making a trainer - proc-id & writememory ?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by plopzz.

Hi all

I have made a trainer with delphi ... But delphi make big .EXE ...
So i want to try with purebasic (who are amazing!)

for open the game and take the procid (not window handle!) i use that :

New(lpExecInfo);
lpExecInfo^.cbSize:= Sizeof(lpExecInfo^);
lpExecInfo^.fMask:= SEE_MASK_DOENVSUBST or SEE_MASK_NOCLOSEPROCESS;
lpExecInfo^.Wnd:= 0; //Handle; //Application.Handle;
lpExecInfo^.lpVerb:= 'open'#0;
lpExecInfo^.lpFile:= PChar(Edit1.Text);
lpExecInfo^.lpParameters:= #0;
lpExecInfo^.lpDirectory:= #0;
lpExecInfo^.nShow:= SW_SHOWNORMAL;
lpExecInfo^.hInstApp:= 0; //HInstance;
ProcID:= OpenProcess(PROCESS_ALL_ACCESS, False, lpExecInfo^.hProcess);

How i can translate that for purebasic ??

2nd question for memory writing :
i use :
WriteProcessMemory(ProcID, Pointer($0042919C), lpAllType, Sizeof(lpAllType^.Bit8), ReadNum);

(note the var ProcID! :p)

i hope purebasic are most fast for writing address than delphi :)

thanks
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> How i can translate that for purebasic ??

It'd be much easier and quicker to translate this Visual Basic example:

http://www.gamehacking.com/tutorials/prgvb2.php

I'll get round to translating it myself one day, as I need such a program too.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by plopzz.

Hi PB

The problem with this example : like others trainers he need a window for taking the handle and the procid...

For a full working trainer (without problem of window displayed or not, with a name or not), i take the procid when i run the game ... So i'm sure i can patch the memory even if the game change window title or other..

Thats why i said "for open the game and take the procid (not window handle!) i use that :"

btw, thanks, i try to start with this example
+++
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> i take the procid when i run the game ... So i'm sure i can patch the memory
> even if the game change window title or other..

Ah yes, of course -- I forgot about that. I will convert an old routine that I
had for Visual Basic and hopefully post it here in a few days. I had the exact
same issue for one of my older VB apps (ie. window title changing).

UPDATE: I'm having trouble converting my old VB example, so I did another web
search for VB trainers and found the following URL, which opens the calc and
changes the text on one of the buttons. However, I can't convert this to
PureBasic either... can somebody please have a look and give us some tips?

http://www.freevbcode.com/ShowCode.asp? ... NoBox=True


PB - Registered PureBasic Coder

Edited by - PB on 07 August 2002 00:44:58
Post Reply