• Welcome to Valhalla Legends Archive.
 

Having some trouble

Started by zeronx, December 22, 2003, 10:31 AM

Previous topic - Next topic

zeronx

Im trying to make a module to read life, anyways i was wondering how exactly do you read the process memory in vb? I know its the readprocessmemory function but im not sure how to use it.Can someone explain what the parameters mean?

Skywing

Quote from: zeronx on December 22, 2003, 10:31 AM
Im trying to make a module to read life, anyways i was wondering how exactly do you read the process memory in vb? I know its the readprocessmemory function but im not sure how to use it.Can someone explain what the parameters mean?
MSDN Online can help you find the answers to these kinds of things: ReadProcessMemory.

zeronx

can i get a example of how to use this i really dont get it and would really appreciate it

Grok

Quote from: zeronx on December 22, 2003, 10:54 AM
can i get a example of how to use this i really dont get it and would really appreciate it

I'll show you HOW to get an example of this.... I do this about 5 times a day:

Start here:  http://www.google.com/advanced_search?hl=en

In "All Words" put ReadProcessMemory
In "Exact Phrase" put "Visual Basic" and click Search.

Go through the results one-by-one until something looks good.  Here's one:
http://visualbasicforum.com/t124587.html

zeronx

thanks alot my methods for searching are shit compared to yours !

zeronx

i get  error 242 and object required everytime i compile :-S

this is my code
Private Sub Command3_Click()
ReadProcessMemory Game.exe, &H4312B25, B, Len(B), lBytesRead


End Sub


Skywing

You need to get a HANDLE to the process, such as with OpenProcess.  GetWindowThreadProcessId and FindWindow might be useful to get a process id (unless you are using CreateProcess to start the program yourself).

Grok

Quote from: Skywing on December 22, 2003, 12:19 PM
You need to get a HANDLE to the process, such as with OpenProcess.  GetWindowThreadProcessId and FindWindow might be useful to get a process id (unless you are using CreateProcess to start the program yourself).

Hmm, he didn't even look at the example:

Dim hwnd As Long
Dim pid As Long
Dim pHandle As Long
Dim lBytesRead As Long
Const PROCESS_ALL_ACCESS = &H1F0FFF
Dim B As Long

hwnd = FindWindow(vbNullString, "legend of mir2")
 If (hwnd = 0) Then
     MsgBox "Window not found!"
     Exit Sub
 End If
GetWindowThreadProcessId hwnd, pid
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
 If (pHandle = 0) Then
     MsgBox "Couldn't get a process handle!"
     Exit Sub
 End If
ReadProcessMemory pHandle, CLng("&02501BD3"), B, Len(B), lBytesRead
Label2.Caption = B
CloseHandle hProcess

zeronx

no its just i thought the handle was game.exe