procedure Poke(BaseAddress:longword;PokeValue:byte);
var
ProcessId : integer;
buf : Char;
HandleWindow : Integer;
write : cardinal;
begin
if IsTrainerSpyActive then
begin
exit;
end;
GetWindowThreadProcessId(FindWindow(nil,wincap),@ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS,False,ProcessId);
buf := Chr(PokeValue);
WriteProcessMemory(HandleWindow,ptr(BaseAddress),@buf,1,write);
closehandle(HandleWindow);
end;
----------------------
procedure Pokedword(BaseAddress:longword;PokeValue:dword);
var
buf : array[1..4] of byte;
begin
move(pokevalue,buf,4);
poke(baseaddress,buf[1]);
poke(baseaddress+1,buf[2]);
poke(baseaddress+2,buf[3]);
poke(baseaddress+3,buf[4]);
end;
[Redigeret d. 27/11-03 13:24:09 af Mark Jensen]