Results 1 to 10 of 10
  1. #1
    fairytalesx's Avatar
    Join Date
    Aug 2015
    Gender
    female
    Posts
    52
    Reputation
    10
    Thanks
    29
    My Mood
    Angelic

    Finding number of inventory slots without loop

    I highly doubt this is going to be useful in the foreseeable future but anyway here it is :D
    Code:
    //For dll only
    #define INVENTORY_BASE 0x88F584
    size_t GetInventorySize()
    {
        DWORD gb = (DWORD)GetModuleHandle("trove.exe"); //game base
        DWORD *pStart = *(DWORD *)(*(DWORD *)(gb+INVENTORY_BASE)+0x17C)+0x78;
        DWORD *pEnd = *(DWORD *)(*(DWORD *)(gb+INVENTORY_BASE)+0x17C)+0x7C;
        return (size_t)( (*pEnd - *pStart) / sizeof(DWORD) );
    }
    If you do not use dll inject, you have to replace the DWORD pointers with ReadProcessMemory functions. :( :( :(
    If you need help with the code feel free to ask me, I'll try to reply where possible.

  2. The Following User Says Thank You to fairytalesx For This Useful Post:

    taejim (08-07-2015)

  3. #2
    sizzlorox's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    Hello, On this line : return (size_t)( (*pEnd - *pStart) / sizeof(DWORD) );
    What is the DWORD inside of sizeof() if I were to replace the dll with reading memory?

  4. #3
    taejim's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Location
    Trove
    Posts
    301
    Reputation
    10
    Thanks
    892
    My Mood
    Devilish
    Quote Originally Posted by fairytalesx View Post
    I highly doubt this is going to be useful in the foreseeable future but anyway here it is
    Code:
    //For dll only
    #define INVENTORY_BASE 0x88F584
    size_t GetInventorySize()
    {
        DWORD gb = (DWORD)GetModuleHandle("trove.exe"); //game base
        DWORD *pStart = *(DWORD *)(*(DWORD *)(gb+INVENTORY_BASE)+0x17C)+0x78;
        DWORD *pEnd = *(DWORD *)(*(DWORD *)(gb+INVENTORY_BASE)+0x17C)+0x7C;
        return (size_t)( (*pEnd - *pStart) / sizeof(DWORD) );
    }
    If you do not use dll inject, you have to replace the DWORD pointers with ReadProcessMemory functions.
    If you need help with the code feel free to ask me, I'll try to reply where possible.
    hi can i have your skype i want to ask you a few things and what is sizeof(DWORD)?
    Last edited by taejim; 08-07-2015 at 07:17 AM.

    Code:
    My Trove Bot (OUTDATED) LazyFishing v1.9
    If you appreciate what i have done:

    1. Press the Thanks button above and give me reputation <3

    2. You can donate me if you feel like it, any amount is much appreciate.


  5. #4
    fairytalesx's Avatar
    Join Date
    Aug 2015
    Gender
    female
    Posts
    52
    Reputation
    10
    Thanks
    29
    My Mood
    Angelic
    Quote Originally Posted by sizzlorox View Post
    Hello, On this line : return (size_t)( (*pEnd - *pStart) / sizeof(DWORD) );
    What is the DWORD inside of sizeof() if I were to replace the dll with reading memory?
    sizeof(type) is C standard which returns size in bytes of the object representation of type.
    Therefore, sizeof(DWORD) is 4. Surely you can write 4 in place of sizeof(DWORD) but that way it is not so descriptive.

    P.S. I only know C++/MASM so unfortunately I am not able to answer questions with other macro programs like AutoHotKey script
    Last edited by fairytalesx; 08-07-2015 at 09:29 AM.

  6. #5
    taejim's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Location
    Trove
    Posts
    301
    Reputation
    10
    Thanks
    892
    My Mood
    Devilish
    Quote Originally Posted by fairytalesx View Post
    sizeof(type) is C standard which returns size in bytes of the object representation of type.
    Therefore, sizeof(DWORD) is 4. Surely you can write 4 in place of sizeof(DWORD) but that way it is not so descriptive.

    P.S. I only know C++/MASM so unfortunately I am not able to answer questions with other macro programs like AutoHotKey script
    thank you for the offset why 0x17c, 0x78 is the start and 0x17c, 0x7c is the end? i mean i know the 1st offset of inventory is 0x17c but i thought the 2nd offset is 0x78 and the 3rd offset is the slot number which is 0,4,8,C,10...

    Code:
    My Trove Bot (OUTDATED) LazyFishing v1.9
    If you appreciate what i have done:

    1. Press the Thanks button above and give me reputation <3

    2. You can donate me if you feel like it, any amount is much appreciate.


  7. #6
    fairytalesx's Avatar
    Join Date
    Aug 2015
    Gender
    female
    Posts
    52
    Reputation
    10
    Thanks
    29
    My Mood
    Angelic
    Quote Originally Posted by taejim View Post
    thank you for the offset why 0x17c, 0x78 is the start and 0x17c, 0x7c is the end? i mean i know the 1st offset of inventory is 0x17c but i thought the 2nd offset is 0x78 and the 3rd offset is the slot number which is 0,4,8,C,10...
    Memory allocation is usually compiler generated for performance optimization. Even Trove devs can't explain that lol

  8. #7
    taejim's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Location
    Trove
    Posts
    301
    Reputation
    10
    Thanks
    892
    My Mood
    Devilish
    Quote Originally Posted by fairytalesx View Post
    Memory allocation is usually compiler generated for performance optimization. Even Trove devs can't explain that lol
    i mean there must be some reason that u choose 0x7c for end right? and 0x78 for start

    Code:
    My Trove Bot (OUTDATED) LazyFishing v1.9
    If you appreciate what i have done:

    1. Press the Thanks button above and give me reputation <3

    2. You can donate me if you feel like it, any amount is much appreciate.


  9. #8
    fairytalesx's Avatar
    Join Date
    Aug 2015
    Gender
    female
    Posts
    52
    Reputation
    10
    Thanks
    29
    My Mood
    Angelic
    Quote Originally Posted by taejim View Post
    i mean there must be some reason that u choose 0x7c for end right? and 0x78 for start
    This is where I found it.
    Code:
    .text:0086F9D7                 mov     eax, [esi+74h]
    .text:0086F9DA                 inc     edx
    .text:0086F9DB                 sub     eax, [esi+70h]
    .text:0086F9DE                 add     ecx, 2
    .text:0086F9E1                 sar     eax, 1
    .text:0086F9E3                 cmp     edx, eax
    .text:0086F9E5                 jb      short loc_86F9D0

  10. #9
    taejim's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Location
    Trove
    Posts
    301
    Reputation
    10
    Thanks
    892
    My Mood
    Devilish
    Quote Originally Posted by fairytalesx View Post
    This is where I found it.
    Code:
    .text:0086F9D7                 mov     eax, [esi+74h]
    .text:0086F9DA                 inc     edx
    .text:0086F9DB                 sub     eax, [esi+70h]
    .text:0086F9DE                 add     ecx, 2
    .text:0086F9E1                 sar     eax, 1
    .text:0086F9E3                 cmp     edx, eax
    .text:0086F9E5                 jb      short loc_86F9D0
    Is it IDA pro?

    Code:
    My Trove Bot (OUTDATED) LazyFishing v1.9
    If you appreciate what i have done:

    1. Press the Thanks button above and give me reputation <3

    2. You can donate me if you feel like it, any amount is much appreciate.


  11. #10
    Yemiez's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Sweden
    Posts
    2,566
    Reputation
    731
    Thanks
    16,280
    My Mood
    Devilish
    // Moved to "Trove Disussions & Help" as it fits better here!

Similar Threads

  1. How to change Inventory slot color
    By TheReafg1000 in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 3
    Last Post: 02-07-2015, 09:55 PM
  2. How can people get free bag slots and bank slots without buying with AC?
    By Geovane108 in forum Adventure Quest Worlds (AQW) Hacks / Cheats / Trainers
    Replies: 14
    Last Post: 08-10-2013, 11:26 PM
  3. [CODERS] How to find your character number for SF
    By brayton123 in forum Soldier Front Help
    Replies: 0
    Last Post: 09-21-2012, 02:50 PM
  4. she left without leaving a number..
    By Austin in forum General
    Replies: 3
    Last Post: 11-29-2011, 02:05 PM
  5. [Release] [source]D3D9: Finding the VirtualTable without signatures
    By .::SCHiM::. in forum C++/C Programming
    Replies: 11
    Last Post: 05-20-2011, 06:53 PM