well translate it now to delphi or vb cuz i dont understand ANY thing of that code...
well translate it now to delphi or vb cuz i dont understand ANY thing of that code...
Gee man, I'd translate it but... I'd let someone else do it for me... xD
gee man, just say what to doo...
Well after researching for a while i think the data is stored in a very dynamic way, something like this:
So first you need to get the pointer to the structure, i think its 0x768C9C, with this pointer you can read the other pointer (item list)Code:struct TibiaDAT { int start_item; //i guess since it equals to 100 ?? int item_count; //number of items TibiaItem *Items; //pointer to the items }; TibiaDat *tdat;
Some pseudo code:
This sounds confusing but i've obtained correct data, i'll post some code later.Code://Read the struct first str_addr = ReadInt(0x768C9C); start_item = ReadInt(str_addr); item_count = ReadInt(str_addr+4); items = ReadInt(str_addr + 8); //then, to read items: i_addr = ReadInt(items); first_item = read_whole_item(i_addr) //read x item: x_item = read_whole_item(i_addr + (x*0x4C))
Awesome. Thanks, now there's no need to trouble yourself using HeapWalk and everything I did, your method is way faster, and cheaper in all ways.
The above code, thanks to zionz, removes the need to use HeapWalk() to find the heap entry. Now with just two lines of code you can get it :PCode:const unsigned int* TibiaDat = (const unsigned int*)0x768C9C; const unsigned int* HeapStartAddress = (const unsigned int*)(*TibiaDat + 0x8); char output[125]; sprintf(output,"%x",*HeapStartAddress); MessageBoxA(0,output,"entry",0);
this is just simple like:
???Code:const TibiaDat = $768C9C; HeapStartAddress = TibiaDat + $08; var output : integer; output := HeapStartAddress; MessageBox(0,inttostr(output),'entry',mb_ok);
i think its like
Code:const TibiaDat = $768C9C; var output : integer; output := memreadint(TibiaDat + $08); MessageBox(0,inttostr(output),'entry',mb_ok);
More like:Originally Posted by Xyllo
Code:const TibiaDat = $768C9C; var output: integer; heapstart: integer; begin output := memreadint(TibiaDat) + $08; heapstart := memreadint(output); MessageBox(0,inttostr(heapstart),'entry',mb_ok);
ahhh now i understand
Errr. I updated the flags, IsStackable was switched with IsCorpse, and renamed IsCorpse to IsContainer.