• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Kal C++ Functions

Newbie Spellweaver
Joined
Jul 2, 2016
Messages
93
Reaction score
9
I am trying to figure out how these codes are used.

static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))0x0045D1E0;


In this code it has int a2 and int a3

How can I tell what the a2/a3 stand for?

Is a2 the item the code will look for or is a3?
 
Newbie Spellweaver
Joined
Sep 2, 2017
Messages
15
Reaction score
1
you cant tell anything from that. you need to look at the code to see how its used, or debug and check the value, or do both.
 
Upvote 0
Junior Spellweaver
Joined
Aug 19, 2006
Messages
106
Reaction score
162
a2 is item index, a3 is quantity.
how to know? check function calls in IDA.

CPlayer::FindItem(a1, 653, 1)

in this case it's so obvious that a2 is index and a3 is quantity.

Regards.
 
Upvote 0
Newbie Spellweaver
Joined
Jul 2, 2016
Messages
93
Reaction score
9
Yes, I showed that method so it would be easier for everyone to understand what I was trying to say. Is there a list possibly that shows the values for each method?
 
Upvote 0
Newbie Spellweaver
Joined
Jul 2, 2016
Messages
93
Reaction score
9
Can anyone tell me why this doesn't work?

static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))0x0045D1E0;

bool hasPickPet = false;

int pickpets[13] = {2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017};

int count;
for (count = 0; count <= 13; ++count); {
int pet = pickpets[count];
if (CPlayer__FindItem(pPlayer, pet, 1)) { <--- This part isn't working.
hasPickPet = true; }
}
 
Upvote 0
Junior Spellweaver
Joined
Aug 19, 2006
Messages
106
Reaction score
162
Can anyone tell me why this doesn't work?

static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))0x0045D1E0;

bool hasPickPet = false;

int pickpets[13] = {2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017};

int count;
for (count = 0; count <= 13; ++count); {
int pet = pickpets[count];
if (CPlayer__FindItem(pPlayer, pet, 1)) { <--- This part isn't working.
hasPickPet = true; }
}

you are using _FindItem @ 45D1E0 which is stdcall and not thiscall, you should be using FindItem @ 45D190.
change the address
from:
Code:
[COLOR=#666666]static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))[/COLOR][B][COLOR=#ff0000]0x0045D1E0[/COLOR][/B][COLOR=#666666];[/COLOR]

to:
Code:
[COLOR=#666666]static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))[/COLOR][COLOR=#00ff00][B]0x0045D190[/B][/COLOR][COLOR=#666666];[/COLOR]
 
Upvote 0
Newbie Spellweaver
Joined
Jul 2, 2016
Messages
93
Reaction score
9
Anyway you would be willing to go through some of this stuff with me? Maybe in PM.
 
Upvote 0
Back
Top