Kal C++ Functions

Results 1 to 9 of 9
  1. #1
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    35Posts

    Kal C++ Functions


    RaGEZONE Recommends

    RaGEZONE Recommends

    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?


  2. #2
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    35Posts

    Re: Kal C++ Functions

    Any info helps guys please. I won't hoard my codes after you help me.

  3. #3
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    35Posts

    Re: Kal C++ Functions

    bumperino

  4. #4
    Registered stealthguard is offline
    MemberRank
    Sep 2017 Join Date
    somewhereLocation
    15Posts

    Re: Kal C++ Functions

    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.

  5. #5
    Hardcore Member nonosocr1986 is offline
    MemberRank
    Aug 2006 Join Date
    Planet EarthLocation
    111Posts

    Re: Kal C++ Functions

    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.
    Before Creation, Comes Destruction.

  6. #6
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    35Posts

    Re: Kal C++ Functions

    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?

  7. #7
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    35Posts

    Re: Kal C++ Functions

    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; }
    }

  8. #8
    Hardcore Member nonosocr1986 is offline
    MemberRank
    Aug 2006 Join Date
    Planet EarthLocation
    111Posts

    Re: Kal C++ Functions

    Quote Originally Posted by Itutorial View Post
    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:
    static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))0x0045D1E0;
    to:
    Code:
    static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))0x0045D190;
    Before Creation, Comes Destruction.

  9. #9
    Member Itutorial is offline
    MemberRank
    Jul 2016 Join Date
    35Posts

    Re: Kal C++ Functions

    Anyway you would be willing to go through some of this stuff with me? Maybe in PM.




Advertisement