View Full Version : ReadProcessMemory vs. WinXP
tazmanian
March 17th, 2003, 21:39
Hi guys, i'm trying to do an app that reads DUDATA.DLL from DuMeter to get the current down and up speed...but i'm with problems with WinXP. The ReadProcessMemory returns 0 (fails), while in win98 works fine...
See the code:
.data
ClassName db "TfrmDUGraph",0
BreakPoint dd 1000E150h,0 ;Address from DUDATA.DLL!!!
.code
invoke FindWindow, addr ClassName, NULL
.if EAX!=NULL
mov hWindow, eax
invoke GetWindowThreadProcessId,hWindow,addr Process_ID
invoke OpenProcess,001F0000h,0,Process_ID
mov hProcess, eax
invoke ReadProcessMemory,hProcess,BreakPoint,addr buffer,4,0
..
...
....
What is the problem with WinXP?
Thx for your help!
[NtSC]
March 18th, 2003, 09:59
Problem might be that the Dll could be relocated to a different base Address,wich would make clear why your ReadProcessMemory fails...
If itsd not that, try to change the Page Attributes and try again..
...Just a guess

disavowed
March 18th, 2003, 13:42
also, this might be the kind of thing that only works if you're logged in as admin
i believe there's also a registry setting somewhere that allows/disallows access for readprocessmemory to other process, but i'm not 100% sure
[NtSC]
March 18th, 2003, 15:40
As long as you dont mess with System Files, the Windows File Protection shouldnt get in your Way..
For an ReadProcessMemory you shouldnt need Admin Rights,
as long as you dont wanna do it in R0

squidge
March 18th, 2003, 18:29
By default, XP will only allow you to ReadProcessMemory of your own created processes. That is, you can't read system processes, or the processes of other users (normally, service apps come under "other users" even if your the only users on the system).
Also, you must make sure that the OpenProcess call you used previously to access the process passed with the access value of PROCESS_VM_READ or higher.
tazmanian
March 18th, 2003, 21:43
Quote:
Originally posted by squidge
Also, you must make sure that the OpenProcess call you used previously to access the process passed with the access value of PROCESS_VM_READ or higher. |
That was the problem!
Thank you guys for your help!
I appreciate....
it works now
thx a lot!
Powered by vBulletin® Version 4.2.2 Copyright © 2018 vBulletin Solutions, Inc. All rights reserved.