[Tutorial] Inventory stack

05/02/2013 20:04 iktov2#1
First thing you need to do is find the pointers to the inventory struct that are located in the player class. You can find them by putting a stack of pills in your first slot of your inventory and scanning for the amount of pills in the stack. Once the scan completes remove some pills from the stack and search the new value. This should give you an address to the "count" of the first slot in the first row of your inventory.

Once you have that address add it in cheat engine and "Browse this memory region". Scroll up a bit and find the ItemID(I recommend putting an item in the first slot that you know the ItemID of so you can recognize it easily...Godsend lucky ticket maybe?). This address is the start of the inventory array.

Look through the block of memory here and you will see it starts with the itemid and contains the inventory Row and Slot as well as the "count" of the items if its a stackable item. Then right after is an entry for the next Slot that is currently filled in your inventory.

If you look at the screenshot below you can see outlined in the black is the Entry for Row0 Slot0 of the inventory(ie the first slot in the inventory). It starts with 0x0D 0x04(1037) the ItemID of Godsend lucky tickets.

[Only registered and activated users can see links. Click Here To Register...]

Now in the screenshot above if you look directly after the part outlined in black you will see 0x0D 0x04 again. This is the start of the next inventory slot in that row! You will notice that it now looks like this:

[Only registered and activated users can see links. Click Here To Register...]

Notice the part highlighted in blue and compare it to the data highlighted in black for the first slot. It is now a value of 2(the second slot!).

If you look a little farther down in the first screenshot you will see 0x1F, that is the ItemID for the for the chi pills. Look right after the ItemID and you now see the value is 2(and the chi pills in are in the second row)... aha! So that value represents the row. We already know that the next value represents the Slot in the row(so the chi pills are in Row2 Slot2).

Now you'll notice the next value after the ItemID, Row, and Slot is 0x62. Look again in the first screenshot, you see I have 98 chi pills in Row2 Slot2. What is 98 in hex? 0x62! There we have the item count of stackable items!

Ok now that we have figured out how the inventory works, we want to make all items stack onto 1 single slot right? So we need to make a for loop through all rows/slots in the inventory and set them all to 1 single Row/Slot!

From the screenshots above we determined the following:

Code:
struct Inventory{
         int ItemID;
         int Row;
         int Slot;
         int Count;
         char Unknown[8]; //Unsure what the last 8 bytes do and don't really care
};
Inventory *Inventory1 = (Inventory *)0x11C12FC; //this is the address of the first slot where it stores ItemID.  This is the first entry in the array of inventory slots
Inventory *Inventory2 = (Inventory *)0x11C18FC; //Address for the first row/slot of Hermit vault,  find it the same way as the inventory
Now with the above we have declared a struct for our inventory and casted the address of the first entry in the array to it.

Below we will make a for loop through all slots(64) and set all of their Row/Slots to slot 1.

Code:
void InventoryStack()
{
	for(int i = 0; i < 64; i++)
	{
		Inventory[i].Row = 0; //First row
		Inventory[i].Slot = 0; //First slot in the first row
                Inventory2[i].Row = 0; //Hermit vault
		Inventory2[i].Slot = 0; 
	}
}
Simple as that. Within your main loop of your .dll call it like this:
Code:
InventoryStack();
You can also filter specific items and move them to different slots based on what they are like this:



Code:
if(Inventory1[i].ItemID == 1108)
{
         Inventory1[i].Row = 2; // Second row
	 Inventory1[i].Slot = 0; // First slot of second row
}
05/02/2013 20:13 Mastershouter#2
Nice Tutorial! Keep up the good work.
05/02/2013 20:21 Agresive3#3
good tutorial and thanks for posting it.
05/02/2013 20:49 softuserz#4
damn all I need now is an intel pc :P or some other way to get around xtrap for CE ;)
05/02/2013 20:56 seidlud#5
bad tutorial
05/02/2013 21:15 almar12#6
Quote:
Originally Posted by seidlud View Post
bad tutorial
Lol if you don't understand this tutorial you should go back to kindergarten. Seriously even a kid would know what to do.
05/02/2013 21:21 seidlud#7
no comment, super mario
05/02/2013 21:29 iktov2#8
Quote:
Originally Posted by almar12 View Post
Lol if you don't understand this tutorial you should go back to kindergarten. Seriously even a kid would know what to do.
I am not sure weather to be thankful or offended... ha ha.
05/02/2013 22:49 softuserz#9
Quote:
Originally Posted by almar12 View Post
Lol if you don't understand this tutorial you should go back to kindergarten. Seriously even a kid would know what to do.
hey now....
I had to read it 3 times :P
and I finished kindergarden 3 times as well ;)

nah but serriously thanks Ikov you are very useful to these forums bro.
05/02/2013 22:53 Rumil12#10
Good job iktov! Looks much nicer than my barbaric code :D
05/02/2013 23:20 almar12#11
Quote:
Originally Posted by iktov2 View Post
I am not sure weather to be thankful or offended... ha ha.
If you can explain something in kindergarden you made a good tutorial.
05/03/2013 01:58 leondr#12
i think deco hack works like this, i just changed a wlc to deco 4 item, and try to wear and it dced me...ofcourse...i ll find it
05/03/2013 22:01 Rumil12#13
Quote:
Originally Posted by leondr View Post
i think deco hack works like this, i just changed a wlc to deco 4 item, and try to wear and it dced me...ofcourse...i ll find it
Ya might as well make ur lvl 1 commons into d12 elites while ur at it :D
05/04/2013 04:17 softuserz#14
Quote:
Originally Posted by leondr View Post
i think deco hack works like this, i just changed a wlc to deco 4 item, and try to wear and it dced me...ofcourse...i ll find it
Your only touching visual client side ;) and are very far from the real deal :P
05/26/2013 21:59 seid096#15
how to make this cheat with cheat engine adresses?