Created
February 4, 2014 00:29
-
-
Save saveroo/223f37d4ce1717572cb8 to your computer and use it in GitHub Desktop.
Poking Multilevel Pointer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure Poke2Pointer_NoEdit(Address: DWORD; offset1: integer; | |
offset2: integer; isi: extended)stdcall; | |
var | |
BaseAddress: integer; | |
AddressBuffer: DWORD; | |
PokingValue: single; | |
HW: HWND; | |
op: THandle; | |
pcID: integer; | |
begin | |
HW := FindWindow(nil, GameNAME); | |
if HW <> 0 then | |
begin | |
GetWindowThreadProcessId(HW, @pcID); | |
op := OpenProcess(PROCESS_ALL_ACCESS, False, pcID); | |
BaseAddress := integer(GetModuleBaseAddress(pcID, GameEXE)) + | |
integer(Address); | |
ReadMem := readprocessmemory(op, Pointer(BaseAddress), | |
Addr(AddressBuffer), 4, Read); | |
AddressBuffer := AddressBuffer + offset1; | |
ReadMem := readprocessmemory(op, Pointer(AddressBuffer), | |
Addr(AddressBuffer), 4, Read); | |
AddressBuffer := AddressBuffer + offset2; | |
// ReadMem := readprocessmemory(op, Pointer(AddressBuffer), @AddressBuffer, 4, Read); | |
PokingValue := isi; | |
if ReadMem = true then | |
writeprocessmemory(op, Pointer(AddressBuffer), @PokingValue, 4, Read); | |
CloseHandle(op); | |
end; | |
End; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment