What exactly are Offsets? few other questions...

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).
Post Reply
Message
Author
Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

What exactly are Offsets? few other questions...

#1 Post by Exempt » Thu Mar 04, 2010 9:42 pm

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?

User avatar
Administrator
Site Admin
Posts: 4861
Joined: Sat Jan 05, 2008 4:21 pm

Re: What exactly are Offsets? few other questions...

#2 Post by Administrator » Sat Mar 06, 2010 12:39 am

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:

Code: Select all

struct PLAYERINFO
{
  int health; // 4 bytes
  int maxhealth; // 4 bytes

  short lives; // 2 bytes
  char type; // 1 byte
} *PPLAYERINFO;
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).

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

Re: What exactly are Offsets? few other questions...

#3 Post by Exempt » Sat Mar 06, 2010 3:00 pm

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.

User avatar
Administrator
Site Admin
Posts: 4861
Joined: Sat Jan 05, 2008 4:21 pm

Re: What exactly are Offsets? few other questions...

#4 Post by Administrator » Sat Mar 06, 2010 9:03 pm

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.

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

Re: What exactly are Offsets? few other questions...

#5 Post by Exempt » Sun Mar 07, 2010 12:33 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest