| View previous topic :: View next topic |
| Author |
Message |
*CandyShop* Grandmaster Cheater
Reputation: 0
Joined: 03 Apr 2007 Posts: 865 Location: Israel
|
Posted: Mon Dec 17, 2007 7:49 am Post subject: [Delphi] ReadProcessMemory help. |
|
|
I read about it on MSDN but I don't get how its working.
Can anyone give an example how do I read the address's value and then print it (ShowMessage..)?
THANKS!
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Dec 17, 2007 10:17 am Post subject: |
|
|
| Code: | var
hProcess,HandleWindow: THandle;
Struct: TProcessEntry32;
ProcessID,temp:cardinal;
buf:pchar;
begin
HandleWindow :=FindWindow(nil,'Untitled - Notepad');
GetWindowThreadProcessId(HandleWindow,@ProcessID);
hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID);
getmem(buf,4);
readprocessmemory(hProcess,ptr($00830022),buf,4,temp);
showmessage(string(buf));
freemem(buf);
if hProcess <> 0 then
CloseHandle(hProcess);
end; |
|
|
| Back to top |
|
 |
*CandyShop* Grandmaster Cheater
Reputation: 0
Joined: 03 Apr 2007 Posts: 865 Location: Israel
|
Posted: Mon Dec 17, 2007 11:19 am Post subject: |
|
|
| HolyBlah wrote: | | Code: | var
hProcess,HandleWindow: THandle;
Struct: TProcessEntry32;
ProcessID,temp:cardinal;
buf:pchar;
begin
HandleWindow :=FindWindow(nil,'Untitled - Notepad');
GetWindowThreadProcessId(HandleWindow,@ProcessID);
hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID);
getmem(buf,4);
readprocessmemory(hProcess,ptr($00830022),buf,4,temp);
showmessage(string(buf));
freemem(buf);
if hProcess <> 0 then
CloseHandle(hProcess);
end; |
|
Not working.
I think that the reading is working but when you did showmessage it show this message:
Is that a value
nvm.
My friend figure it out. (<33 mOnSoOn)
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Tue Dec 18, 2007 6:40 am Post subject: |
|
|
| *CandyShop* wrote: |
Not working.
I think that the reading is working but when you did showmessage it show this message:
Is that a value
nvm.
My friend figure it out. (<33 mOnSoOn) |
Try use this code:
| Code: |
showmessage(inttostr(integer(buf)));
|
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Tue Dec 18, 2007 7:42 am Post subject: |
|
|
| HolyBlah wrote: | | Code: | var
hProcess,HandleWindow: THandle;
Struct: TProcessEntry32;
ProcessID,temp:cardinal;
buf:pchar;
begin
HandleWindow :=FindWindow(nil,'Untitled - Notepad');
GetWindowThreadProcessId(HandleWindow,@ProcessID);
hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID);
getmem(buf,4);
readprocessmemory(hProcess,ptr($00830022),buf,4,temp);
showmessage(string(buf));
freemem(buf);
if hProcess <> 0 then
CloseHandle(hProcess);
end; |
|
Use the class, not the window title...
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Tue Dec 18, 2007 8:02 am Post subject: |
|
|
| Which is 'notepad' btw.
|
|
| Back to top |
|
 |
|