From: bobdole on 5 Feb 2010 22:03 DWORD GameBase = 0x400000; DWORD* SomePointer = (DWORD*)(GameBase+0x4C62FC); DWORD SomeValue = *(DWORD*)(*SomePointer+0xC); // Change the variable (SomeValue) type accordingly to what the value type is that you're reading at 0xC could anyone please explain what this code is doing..... btw DWORD = unsigned int -thx for the help!!! (explain as simply as possible)
From: ScottMcP [MVP] on 5 Feb 2010 23:41 On Feb 5, 10:03 pm, bobdole <innerfirenucl...(a)gmail.com> wrote: > DWORD GameBase = 0x400000; > DWORD* SomePointer = (DWORD*)(GameBase+0x4C62FC); > DWORD SomeValue = *(DWORD*)(*SomePointer+0xC); // Change the variable > (SomeValue) type accordingly to what the value type is that you're > reading at 0xC > > could anyone please explain what this code is doing..... btw DWORD = > unsigned int -thx for the help!!! (explain as simply as possible) It is reading a pointer from a known address... DWORD* SomeOtherPointer = *SomePointer+0xC Then reading the value at SomeOtherPointer DWORD SomeValue = *SomeOtherPointer
From: Richard Heathfield on 6 Feb 2010 19:14 bobdole wrote: > DWORD GameBase = 0x400000; > DWORD* SomePointer = (DWORD*)(GameBase+0x4C62FC); > DWORD SomeValue = *(DWORD*)(*SomePointer+0xC); // Change the variable > (SomeValue) type accordingly to what the value type is that you're > reading at 0xC > > could anyone please explain what this code is doing..... btw DWORD = > unsigned int -thx for the help!!! (explain as simply as possible) The first statement assigns the value 0x400000 to GameBase. The second statement is best explained in parts: (GameBase + 0x4C62FC) results in the value 0x8C62FC. The cast converts this value to a pointer type (DWORD *). That converted value is assigned to SomePointer. The third statement finds the DWORD value at that address (0x8C62FC) and adds 0xC (decimal 12) to it. It then converts the value to a DWORD pointer, and reads the DWORD at that address into SomeValue. Basically, the code is looking for a pointer value at a certain offset into an array. That pointer value points to a DWORD, and the code is looking up that DWORD value and assigning it to SomeValue. -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ "Usenet is a strange place" - dmr 29 July 1999 Sig line vacant - apply within
|
Pages: 1 Prev: Code needed for Parsing PE for Exports Next: Flip screen application |