- Joined
- Sep 8, 2007
- Messages
- 1,381
- Reaction score
- 39
here is my attempt at writeprocessmemory after following an example from Torry Delphi pages
What im trying to do is trying to NOP at the given address, but it doesnt work :S
Code:
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,GunZLib;
const
Address = $777042EB;
Value = $90; //NOP
type
TForm4 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Strings : TbountyGunZ;
Form4: TForm4;
ProcessID : Integer;
ThreadID : Integer;
WindowName : Integer;
HandleWindow : Integer;
Data : Pchar;
Written : Cardinal;
implementation
{$R *.dfm}
procedure ByPassSerial();
begin
WindowName := FindWindow(nil,'EpicGunZ Launcher'); // Find our GunZClient
ThreadId := GetWindowThreadProcessId(WindowName, @ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId);
GetMem(Data,1);
Data^ := chr(Value);
WriteProcessMemory(HandleWindow, ptr(Address),Data,2, Written); // Nop the serial Key
freemem(Data);
CloseHandle(HandleWindow);
end;
procedure TForm4.Button1Click(Sender: TObject);
begin
try
begin
ByPassSerial;
end;
except
begin
showmessage('epic phail');
end;
end;
end;
end.
What im trying to do is trying to NOP at the given address, but it doesnt work :S