The error tells you that one of the variables you pass as a parameter does not have the required type. The error is in the var parameter. The last parameter for both of these functions is the only var parameter, so it is clear that Bytes not the required type.
The solution is to make Bytes match the type specified in the ReadProcessMemory and WriteProcessMemory . In XE2, this type is SIZE_T . So you just need to change your Bytes definition to type SIZE_T .
Here are the XE2 announcements:
function ReadProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer; nSize: SIZE_T; var lpNumberOfBytesRead: SIZE_T): BOOL; stdcall; function WriteProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer; nSize: SIZE_T; var lpNumberOfBytesWritten: SIZE_T): BOOL; stdcall;
source share