Skip to content

Instantly share code, notes, and snippets.

@saveroo
Created February 4, 2014 00:29
Show Gist options
  • Save saveroo/223f37d4ce1717572cb8 to your computer and use it in GitHub Desktop.
Save saveroo/223f37d4ce1717572cb8 to your computer and use it in GitHub Desktop.
Poking Multilevel Pointer
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