Often inventory items are coded as a list. First step is to find slot one of the list.
Next look for the link in the pointer chain that is incremented.
Here is an example.
This code hack the quantity of item in slot one.
After finding this code with pointer searcher look around the pointer chain to see if there is a list somewhere.
[Inventory slot1 Qty 144]
580F0000 05E9A528
580F1000 00000030
580F1000 000001F0
580F1000 000000B8
580F1000 00000020 <= list found here, next slot is +0x8
580F1000 00000030
780F0000 00000020
640F0000 00000000 00000090
[Inventory all slots Qty 144]
580F0000 05E9A528
580F1000 00000030
580F1000 000001F0
580F1000 000000B8
30000000 00000014 <= loop for 20 times, this is size of your inventory list
9893F000 <= R3 = R15
58031000 00000020 <= Continue with R3
58031000 00000030
78030000 00000020
64030000 00000000 00000090
780F0000 00000008 <= R15 = R15+0x8
31000000
If the list is at the very end of the pointer chain. This code will also work but it can be simplified. There is no need to introduce R3.
30000000 00000014 <= loop for 20 times, this is size of your inventory list
640F0000 00000000 00000090 <= can use R15 as it is the last in the chain
780F0000 00000008 <= R15 = R15+0x8
31000000
Next look for the link in the pointer chain that is incremented.
Here is an example.
This code hack the quantity of item in slot one.
After finding this code with pointer searcher look around the pointer chain to see if there is a list somewhere.
[Inventory slot1 Qty 144]
580F0000 05E9A528
580F1000 00000030
580F1000 000001F0
580F1000 000000B8
580F1000 00000020 <= list found here, next slot is +0x8
580F1000 00000030
780F0000 00000020
640F0000 00000000 00000090
[Inventory all slots Qty 144]
580F0000 05E9A528
580F1000 00000030
580F1000 000001F0
580F1000 000000B8
30000000 00000014 <= loop for 20 times, this is size of your inventory list
9893F000 <= R3 = R15
58031000 00000020 <= Continue with R3
58031000 00000030
78030000 00000020
64030000 00000000 00000090
780F0000 00000008 <= R15 = R15+0x8
31000000
If the list is at the very end of the pointer chain. This code will also work but it can be simplified. There is no need to introduce R3.
30000000 00000014 <= loop for 20 times, this is size of your inventory list
640F0000 00000000 00000090 <= can use R15 as it is the last in the chain
780F0000 00000008 <= R15 = R15+0x8
31000000
Last edited by TomSwitch,