0

Hello all,
I want to check in a external process if an address X, that i'll call here $00000001 is "NOPPED", i know that an address with NOP its byte is x90, so my question is:
Can i use ReadProcessMemory putting the value x90 as the IpBuffer or do you have a better idea,
EX:

if ReadProcessMemory(hProcess, Ptr($00000001), ptr(90), 4, Written) then
ShowMessage('He is nopped');
2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by AceStryker
0

No, you misused the ReadProcessMemory function.

This is how it should be used:

procedure NotifyAboutNOP(ProcessHandle:THandle; Address:Longword);
var
  B : Byte;

begin
  if LongBool( ReadProcessMemory(ProcessHandle, Pointer(Address), @B, 1, NIL) ) then begin
  // reading succeeded:
  if B = $90
    then ShowMessage('the byte at Address of the process ProcessHandle contains a NOP instruction.')
    else ShowMessage('the byte at Address of the process ProcessHandle contains hexadecimal value ' + IntToHex(B,2));
end else begin
  ShowMessage('Failure trying to read memory from another process.');
end;

end;

procedure TForm1.Button1Click(Sender:TObject);
begin
  NotifyAboutNOP(hProcess, $00000001);
end;
0

Thanks a lot bro.I think it can work.
Can it be called with WriteProcessMemory() too?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.