 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Wed May 20, 2009 2:03 pm Post subject: Getting Handle |
|
|
well i want to get Handle for MS, im using delphi but my result is 0 O.o!!! im using a form to get Module, this is my code:
| Code: |
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
Label1: TLabel;
Txt1: TEdit;
procedure CheckBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
hProcess:Integer;
StringhProcess:String;
implementation
{$R *.dfm}
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
hProcess := GetModuleHandle('');
sleep(200);
StringhProcess:= IntToStr(hProcess);
Txt1.Text := StringhProcess;
end;
end.
|
and this is compiled one O.o ( attached item )
what am i doing wrong O.o!
p.d:
where it says: '' its MS process just that it doesn't let me post it
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed May 20, 2009 2:06 pm Post subject: |
|
|
If you are within a DLL try ImageNtHeader via MapViewOfFile.
If you are using a stand-alone application, then you'll have to use OpenProcess.
_________________
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Wed May 20, 2009 5:27 pm Post subject: Re: Getting Handle |
|
|
| gunminiho wrote: | well i want to get Handle for MS, im using delphi but my result is 0 O.o!!! im using a form to get Module, this is my code:
| Code: |
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
Label1: TLabel;
Txt1: TEdit;
procedure CheckBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
hProcess:Integer;
StringhProcess:String;
implementation
{$R *.dfm}
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
hProcess := GetModuleHandle('');
sleep(200);
StringhProcess:= IntToStr(hProcess);
Txt1.Text := StringhProcess;
end;
end.
|
and this is compiled one O.o ( attached item )
what am i doing wrong O.o!
p.d:
where it says: '' its MS process just that it doesn't let me post it |
Lol... GetModuleHandle Retrieves the handle of a Module in the current process... And besides it doesn't return a hProcess Handle. It returns the base address of the module to get a handle for rvm/wvm you need to use OpenProcess like Lurc Said.
|
|
| Back to top |
|
 |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Wed May 20, 2009 7:01 pm Post subject: Re: Getting Handle |
|
|
| dnsi0 wrote: | | gunminiho wrote: | well i want to get Handle for MS, im using delphi but my result is 0 O.o!!! im using a form to get Module, this is my code:
| Code: |
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
Label1: TLabel;
Txt1: TEdit;
procedure CheckBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
hProcess:Integer;
StringhProcess:String;
implementation
{$R *.dfm}
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
hProcess := GetModuleHandle('');
sleep(200);
StringhProcess:= IntToStr(hProcess);
Txt1.Text := StringhProcess;
end;
end.
|
and this is compiled one O.o ( attached item )
what am i doing wrong O.o!
p.d:
where it says: '' its MS process just that it doesn't let me post it |
Lol... GetModuleHandle Retrieves the handle of a Module in the current process... And besides it doesn't return a hProcess Handle. It returns the base address of the module to get a handle for rvm/wvm you need to use OpenProcess like Lurc Said. |
hmm ^.^, same as i were using WriteProcessMemory isn't it?
| lurc wrote: | If you are within a DLL try ImageNtHeader via MapViewOfFile.
If you are using a stand-alone application, then you'll have to use OpenProcess. |
hmm would you main to explain a bit more about ImageNtHeader via MapViewOfFile, i have knowlegde about OpenProcess but i have no idea about the other, i would like to learn ^.^ that method, when im using a dll i use VirtualProtect ^.^
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Wed May 20, 2009 7:53 pm Post subject: Re: Getting Handle |
|
|
| gunminiho wrote: | | dnsi0 wrote: | | gunminiho wrote: | well i want to get Handle for MS, im using delphi but my result is 0 O.o!!! im using a form to get Module, this is my code:
| Code: |
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
Label1: TLabel;
Txt1: TEdit;
procedure CheckBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
hProcess:Integer;
StringhProcess:String;
implementation
{$R *.dfm}
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
hProcess := GetModuleHandle('');
sleep(200);
StringhProcess:= IntToStr(hProcess);
Txt1.Text := StringhProcess;
end;
end.
|
and this is compiled one O.o ( attached item )
what am i doing wrong O.o!
p.d:
where it says: '' its MS process just that it doesn't let me post it |
Lol... GetModuleHandle Retrieves the handle of a Module in the current process... And besides it doesn't return a hProcess Handle. It returns the base address of the module to get a handle for rvm/wvm you need to use OpenProcess like Lurc Said. |
hmm ^.^, same as i were using WriteProcessMemory isn't it?
| lurc wrote: | If you are within a DLL try ImageNtHeader via MapViewOfFile.
If you are using a stand-alone application, then you'll have to use OpenProcess. |
hmm would you main to explain a bit more about ImageNtHeader via MapViewOfFile, i have knowlegde about OpenProcess but i have no idea about the other, i would like to learn ^.^ that method, when im using a dll i use VirtualProtect ^.^ |
Don't even bother exploring Image Headers and that stuff if you can't even get readprocessmemory/writeprocessmemory working.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|