salumor Advanced Cheater Reputation: 0
Joined: 14 Jan 2019 Posts: 84
|
Posted: Sun Dec 26, 2021 5:15 pm Post subject: Append DB entry to player [(Lua),System.Collections,(mono)] |
|
|
Ok, so I have a working code living up to the point providing the address to the DB entry I want to copy and of the player's list of owned entries like f.e. (and see attached):
Code: | local wantedDBentry = readPointer([[vars and offsets to addr in above code]])
local addrofplayerownedentries = readPointer([[vars and offsets to addr in above code]]) |
And I do know the functions adding them do make use of System.Collections.Generic.List<T>.Add
Code: | public void Add(T item)
{
if (this._size == this._items.Length)
{
this.EnsureCapacity(this._size + 1);
}
T[] items = this._items;
int size = this._size;
this._size = size + 1;
items[size] = item;
this._version++;
} |
Now I know that- and how I could do that using ASM Hooks and calling conventions. But I'd need to be independent and thus know what's the best way to manually append to the list using lua or other code blocks?
Up till now I thought about a structure (thanks to mono auto created, else manually), recursive copy as a table and write the table addr. to wanted offset-addr.
But I don't know if that could be problematic (f.e. if I add ce allocated space). Further I don't know how to ensure enough List/Array space so I guess the easiest way after copying the List would be to call the function above, but dunno how to do that. Prob. ccode, but, yeah ....
Also for that way I don't know how the List has to look like (if I do think about Array.GetLength() f.e.).
Description: |
|
Filesize: |
130.64 KB |
Viewed: |
668 Time(s) |
|
|
|