## Scanning for arrays

You can find tutorials and ask questions about memory editing here. You may also post any game-specific information you find (ie. cheat tables or addresses).
Message
Author
Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

### Scanning for arrays

Is there any chance of a short array scan tutorial?

Posts: 5312
Joined: Sat Jan 05, 2008 4:21 pm

### Re: Scanning for arrays

You don't scan for arrays. You find one address that resides in an array, then check out nearby memory until you find the bounds of the array. For example, if you have an array that describes the number of each item in your inventory (0 to 99), you could find the number of HP potions you have then check nearby memory for values that do not fit this pattern (ie. a value of 255 would be invalid, so it must not be part of the array). Once you've found the start (or end) you can sometimes apply a bit of math to find the bounds. That is, if you know the array holds 100 values, and it starts at 0x00800000, then it must end by 0x00800099.

More often than not nowadays, games are going to use variable-sized containers such as vectors or lists. Most game companies implement their own code for these, so there is no one-size-fits-all code for navigating these lists. They may or not be sequential in memory, and so may not follow the same rules listed above for arrays.

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

### Re: Scanning for arrays

Ok, so asuming i find every element of my inventory array what would be the best way to accually turn all the memory addresses into a single list in my script?

Posts: 5312
Joined: Sat Jan 05, 2008 4:21 pm

### Re: Scanning for arrays

You only need the address to the first entry. Arrays are sequential, so you can assume the address of the next entry. +0x0 is the first entry (obviously), +4 (or whichever size of data you're working with) would be second, +8 would be 3rd, etc.

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

### Re: Scanning for arrays

Ok, I have my first slot found but how would i go about storing the other 19 values to a table in my script? It's 4 byte.

Posts: 5312
Joined: Sat Jan 05, 2008 4:21 pm

### Re: Scanning for arrays

Iterate through all 20 and copy the values to a table.

Code: Select all

``````for i = 1,20 do
end
``````

### Who is online

Users browsing this forum: No registered users and 1 guest