Greetings.
Please note this is a beta release.
I am not sure if some COD4 versions have different offsets, I only have this one (german) version of COD4 to work with.
Some feedback would be nice.
v0.01 can only do godmode so far.
However I'll post it along with the source code, so you can learn a bit from it.
It's written in Delphi 7, so make sure you have the corresponding runtimes installed.
Code:
unit GZPCOD4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uallProcess, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
CheckBox1: TCheckBox;
Label1: TLabel;
Timer1: TTimer;
Timer2: TTimer;
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
codpid: integer;
codhandle: integer;
implementation
{$R *.dfm}
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const
SC_DRAGMOVE = $F012;
begin
if Button = mbleft then
begin
ReleaseCapture;
Form1.Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0);
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
codpid := findprocess('iw3sp');
if (codpid > 0) then
begin
Label1.Caption := Format('COD4 PID: %d', [codpid]);
codhandle := OpenProcess(PROCESS_ALL_ACCESS,False,codpid);
CheckBox1.Enabled := true;
end
else
begin
Label1.Caption := 'COD4 PID: 0 (searching...)';
codhandle := 0;
CheckBox1.Checked := false;
CheckBox1.Enabled := false;
end;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
var
health: pcardinal;
write: cardinal;
begin
if (CheckBox1.Checked) then
begin
Getmem(health,4);
health^ := 1000;
WriteProcessMemory(codhandle,ptr($C8155C),health,4,write);
FreeMem(health);
end;
end;
end.
Smacked together in 20 minutes of work.
If you want to compile it on your own, you gotta download the uallCollection (google it).
Regards,
EvilKing