How do i add up the pointer? base addy + offset..

Posts 1–3 of 3 · Page 1 of 1
How do i add up the pointer? base addy + offset..
What is the proper way for getting the addy where pointer is pointing to?

DWORD base = (DWORD)GetModuleHandleA("module.dll");

DWORD addy = base + 0xoffset1 + 0xoffset2 + 0xoffset3; ?

*(int*)addy = newvalue;

is it same with multilevel pointer?

Could somebody explain me multilevel pointers? as i understand, the multilevel pointer is with multiple offsets right?

OrX
Multilevel pointer simply means that you must dereference and add multiple offsets to a "base" value to find the address of the pointer.
Think about this:
0x12345 points to an integer type variable.
0x123456 points to 0x12345
0x1234567 points to 0x123456
the base would be 0x1234567
http://www.mpgh.net/forum/31-c-c-pro...ml#post4647733

The first offset is read differently than in a normal situation since it is used to rebase the first address to avoid problems with the relocation of modules (ASLR).

As you can see from my code, I immediately add the first offset to the module base in order to find the correct virtual address, and from there start casting/dereferencing.
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us