Valhalla Legends Forums Archive | Visual Basic Programming | Having some trouble

AuthorMessageTime
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?
December 22, 2003, 4:31 PM
Skywing
[quote author=zeronx link=board=31;threadid=4395;start=0#msg36749 date=1072110663]
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?
[/quote]MSDN Online can help you find the answers to these kinds of things: ReadProcessMemory.
December 22, 2003, 4:49 PM
zeronx
can i get a example of how to use this i really dont get it and would really appreciate it
December 22, 2003, 4:54 PM
Grok
[quote author=zeronx link=board=31;threadid=4395;start=0#msg36752 date=1072112055]
can i get a example of how to use this i really dont get it and would really appreciate it
[/quote]

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
December 22, 2003, 5:16 PM
zeronx
thanks alot my methods for searching are shit compared to yours !
December 22, 2003, 5:36 PM
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

December 22, 2003, 5:49 PM
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).
December 22, 2003, 6:19 PM
Grok
[quote author=Skywing link=board=31;threadid=4395;start=0#msg36777 date=1072117163]
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).
[/quote]

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

[code]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[/code]
December 22, 2003, 6:23 PM
zeronx
no its just i thought the handle was game.exe
December 22, 2003, 7:37 PM

Search