Ne nur den von cheatproject.
Um direkt 5 Bytes zu schreiben sollte es so gehen:
Delphi-Quellcode:
type
TJumpRec = packed record
Jmp: Byte;
Distance: Cardinal;
end;
procedure Hook(ToAddress, FromAddress: pointer);
var
jmpRec: TJmprec;
begin
jmprec.jmp := $E9;
jmprec.Distance := Cardinal(ToAddress) - Cardinal(FromAddress) - 5;
WriteProcessMemory(..., @jmprec, SizeOf(jmprec), ...)