Log in

View Full Version : need help in delphi


Šlil_Jimmy_Live
07-08-2004, 11:26
my game trainer

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls, ActnList, StdCtrls;

const
Addr11 = $007EB834;
Poke11 = $00;
Addr12 = $007EB834;
Poke12 = $01;
Addr13 = $007EB834;
Poke13 = $02;
Bytes = 1;
WindowTitle = 'gunbound';
type
TGbHacked = class(TForm)
Image11: TImage;
Image12: TImage;
Image19: TImage;
Image20: TImage;
ActionList1: TActionList;
Image24: TImage;
Image21: TImage;
A: TAction;
B: TAction;
C: TAction;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure AExecute(Sender: TObject);
procedure BExecute(Sender: TObject);
procedure CExecute(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
GbHacked: TGbHacked;
WIN : integer;
PID : integer;
TID : integer;
HND : integer;
WRT : cardinal;
BUF : pchar;

implementation

{$R *.dfm}
procedure TGbHacked.AExecute(Sender: TObject);
begin
begin
WIN := FindWindow(nil,WindowTitle);
TID := GetWindowThreadProcessId(WIN,@PID);
HND := OpenProcess(PROCESS_ALL_ACCESS,False,PID);
GetMem(BUF,1);
BUF^ := Chr(Poke11);
WriteProcessMemory(HND,ptr(Addr11),BUF,Bytes,WRT);
FreeMem(BUF);
closehandle(HND);

end;
end;
procedure TGbHacked.BExecute(Sender: TObject);
begin
WIN := FindWindow(nil,WindowTitle);
TID := GetWindowThreadProcessId(WIN,@PID);
HND := OpenProcess(PROCESS_ALL_ACCESS,False,PID);
GetMem(BUF,1);
BUF^ := Chr(Poke12);
WriteProcessMemory(HND,ptr(Addr12),BUF,Bytes,WRT);
FreeMem(BUF);
closehandle(HND);

end;

procedure TGbHacked.CExecute(Sender: TObject);
begin
WIN := FindWindow(nil,WindowTitle);
TID := GetWindowThreadProcessId(WIN,@PID);
HND := OpenProcess(PROCESS_ALL_ACCESS,False,PID);
GetMem(BUF,1);
BUF^ := Chr(Poke13);
WriteProcessMemory(HND,ptr(Addr13),BUF,Bytes,WRT);
FreeMem(BUF);
closehandle(HND);

end;

end.




this code works nicely but the thing is it finds the window, i need some windows api comands that find the process instead of the window title, any help would be greatly appreciated :D

Max Lobovsky
07-08-2004, 12:26
This site is dedicated to the FIRST robotics competition (www.usfirst.org). ChiefDelphi is just the name of the team that hosts this site.

Regardless, there are definitley some people knowledgable in Delphi here, and you may find help. (You aren't the first person to make this mistake)

By the way, this is some memory-based hack the game Gunbound, correct? You might have wanted to hide that fact if you are looking for help.

Šlil_Jimmy_Live
07-08-2004, 14:24
This site is dedicated to the FIRST robotics competition
Sry for the misunderstanding, but help would greatly be apreciated.

By the way, this is some memory-based hack the game Gunbound, correct? You might have wanted to hide that fact if you are looking for help.
yeah,but well i would think that programmers such as your self would be glad to help,and you are a programmer,which means you program...not waste your time on playing games
~anyways beyond that point HELP :ahh:

Astronouth7303
07-08-2004, 19:08
There are plenty of API for window/thread/process handling. Spy++ is a very good tool (comes with Microsoft Visual Studio). The Microsoft Developer Network (http://msdn.microsoft.com/) is the ultimate Windows resource.

Beyond that is going to require some digging, and I do not know Delphi. And I won't get specific due to the questionable purposes.

Šlil_Jimmy_Live
07-08-2004, 22:51
thx for the info,and now let's continue the research, i really appreciate your help

Max Lobovsky
07-08-2004, 23:45
Huh, I thought that this thread seemed very familiar, the last person looking for Delphi help was also looking for a similar game hack, maybe he can help you: http://www.chiefdelphi.com/forums/showthread.php?t=28745&highlight=delphi

Anyway, this isn't a major issue or anything, but the mods might consider putting a sticky in Technical/Programming briefly explaining what we do and what our name means.