Computing.Net > Forums > Programming > readprocessmemory in vb help please

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

readprocessmemory in vb help please

Reply to Message Icon

Name: Executoradsfjkl
Date: November 16, 2004 at 14:30:01 Pacific
OS: winxp
CPU/Ram: 1.4 Ghz
Comment:

The api call looks like this

Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long

My code looks like this
dim str as string

ReadProcessMemory pHandle, BaseAddress,str, 1, 0&
Text1.text = str

It is supposed to simply read the address of what is written in a notepad file, all of the declrations are correct to get the handle and the base address, I know this becuase I wrote a similar chunk of code using writememoryprocess and it WORKED. I think the problem exists somewhere in the lbuffer part of the call.



Sponsored Link
Ads by Google

Response Number 1
Name: borelli35
Date: November 19, 2004 at 13:51:01 Pacific
Reply:

==================================================================
The way you have it, it is declared as a statement rather than an assignment/function. Try it this way:

ReadProcessMemory(pHandle, BaseAddress,str, 1, 0 & Text1.text)=str

Also, pHandle is being passed to a variable reference byRef rather than byVal...you may want to check the rest of these and look for similar trouble.

borelli35



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: readprocessmemory in vb help please

VBS help please www.computing.net/answers/programming/vbs-help-please/14315.html

Math.Function in VB - Help! www.computing.net/answers/programming/mathfunction-in-vb-help/11666.html

Please Help me in VB www.computing.net/answers/programming/please-help-me-in-vb/7830.html