memory offsets, possible to do negative?

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

memory offsets, possible to do negative?

#1 Post by lisa » Sun May 20, 2012 10:02 pm

Is it possible to do a negative offset, so instead of offsetting to a greater memory address offset to an earlier address?

Issue I am having at the moment is I have a section of memory and I have an address with a set of offsets which are reliable but I am struggling to find a reliable address+offsets for an address which is always 0x60 before the address I can get reliably.

Offsets that are reliable are

Code: Select all

{0x18,0xC8,0xC,0x34,0x264,0x8},
As an example the reliable offsets point to
13454DE0
but I also want the value at
13454D80

Any thoughts?

--=== Edit ===--

Turns out it isn't always 0x60 before the address, so that won't work.
I'd still like to know if it's possible though just for curiosities sake.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

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

Re: memory offsets, possible to do negative?

#2 Post by Administrator » Sun May 20, 2012 10:52 pm

Well, I don't really think that would be possible normally because an unsigned int is needed. You can, however, just subtract 0x60 from the address and use a memory reading function on that new address; that would accomplish the same thing and be easier to read.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: memory offsets, possible to do negative?

#3 Post by lisa » Mon May 21, 2012 4:04 am

Since I couldn't find a set of offsets that was 100% reliable I did a lot more testing, turned out when 1 set of offsets failed another worked so I came up with this as a solution, testing it now and seems good so far.

Code: Select all

		playermaxhp = memoryReadFloatPtr(getProc(), addresses.playerbase, addresses.playermaxhpoffset) or 0
		if playermaxhp == 0 then
			playermaxhp = memoryReadFloatPtr(getProc(), addresses.playerbase, addresses.playermaxhp2offset) or 0
		end
So if the first set fails it uses the second set.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests