What exactly are Offsets? few other questions...
What exactly are Offsets? few other questions...
I noticed that in your Rom Bot scripts you have a main address then a bunch of offsets for like hp and stuff. Is it normal for all the character information to be stored close together or something?
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: What exactly are Offsets? few other questions...
An offset is simply a number of bytes that an address is 'off' from it's base. Typically, data will be stored in structs/classes, so yes, these pieces of data will be close to each other.
Here's an example:
The PLAYERINFO struct is what you would have a base address to (lets pretend it's 0x00123400). Each of the pieces of the data would be 'offset' from it. health is at +0 bytes (0x0), maxhealth is at +4 bytes (0x4), lives is at +8 (0x8), and type is at +10 (0xA; but *may* be moved to 0xC due to compilers padding a short to 4 bytes).
Here's an example:
Code: Select all
struct PLAYERINFO
{
int health; // 4 bytes
int maxhealth; // 4 bytes
short lives; // 2 bytes
char type; // 1 byte
} *PPLAYERINFO;
Re: What exactly are Offsets? few other questions...
Thats good to know then. When you were searching for the main player address in rom how exactly did you come up with an address? I can find health and stuff but I have no idea how I'd search for a character address.
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: What exactly are Offsets? few other questions...
When you find a health pointer, it'll show up as 0x12345600 + 0x1C or something like that. 0x12345600 would be the character base address, 0x1C the offset to get to health.
Re: What exactly are Offsets? few other questions...
I see, appearently Xenimus was made sloppy because there is no pointers for stuff like hp/mp/position/mouse coord...It's all the first address I find.
Who is online
Users browsing this forum: No registered users and 0 guests