Jump to content
Tuts 4 You

x32dbg question - absolute / relative addresses


REAP

Recommended Posts

Posted

Hello,

I'm writing a code cave in the .text section

I want to use a counter / variable and am using a location at the end of the .data section (which is writable)

However when the code re-runs, while all the addresses in .text section are updating to take account of ASLR.

The instruction that references the location in the .data section doesn't update the address location.

Here is an example

mov eax,dword ptr ds:[1E7EFF0]

While the underlying relative address is unchanged, I need the absolute address to update each time the program is loaded.

Is there a way that I can do this or do I need to use something like VirtualProtect and allocate my own working space?

Thanks

Posted

Hi

do something like this :

call next instruction (E8 00000000)

pop eax (getting current address)

add eax, 0x12345678 (distance from here to destination address)

 

 

BR,

h4sh3m

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...