Home > Back-end >  File VCLFixPack. Call Windows system function in the pas ReadProcessMemory compile prompt parameters
File VCLFixPack. Call Windows system function in the pas ReadProcessMemory compile prompt parameters

Time:11-04

Below red font hints to compile time parameters and arguments, excuse me, how should solve?
Compile-time error: Types of actual and formal var parameters must be identical

Procedure HookProc (Proc, Dest: Pointer; Var BackupCode: TXRedirCode);
Var
N: nativeuint;
Code: TXRedirCode;
The begin
Proc=GetActualAddr (Proc);
Assert (Proc & lt;> Nil);
If ReadProcessMemory (GetCurrentProcess, Proc. @ BackupCode, SizeOf (BackupCode), n) then
The begin
Code. Jump:=$E9.
Code. Offset:=PAnsiChar (Dest) - PAnsiChar (Proc) - SizeOf (Code);
WriteProcessMemory (GetCurrentProcess, Proc. @ Code, SizeOf (Code), n);
end;
end;
  • Related