|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Hanamichi How do I cheat? Reputation: 0
Joined: 14 Apr 2007 Posts: 2
|
Posted: Sat Apr 14, 2007 11:24 am Post subject: [VB] ReadProcessMemory |
|
|
I'm use ReadProcessMemory to read Pointer in Step 8 Cheat Engine Tutorial
Code: | Private Sub cmdTest_Click()
Dim Game As Long, ProcessID As Long, Handle As Long
Dim lngTest1 As Long
Handle = FindWindow("TForm9", "Step 8")
If Handle <> 0 Then
GetWindowThreadProcessId Handle, ProcessID
hProc = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
If hProc <> 0 Then
Dim lngAddress As Long
lngAddress = &H45CC18 + &HC
ReadProcessMemory hProc, lngAddress, VarPtr(lngTest1), 4, 0&
MsgBox lngTest1
End If
End If
End Sub
|
But it's return 0.
If i change
Code: | ReadProcessMemory hProc, lngAddress, lngTest1, 4, 0& |
to
Code: | ReadProcessMemory hProc, lngAddress, lngTest1, 3, 0& |
It's return FFFFFF.
So how can i read 4 byte value from an address.
----------------------
I'm not good at English.So.....
|
|
Back to top |
|
|
stealthy17 Expert Cheater Reputation: 0
Joined: 10 Apr 2007 Posts: 144 Location: The Netherlands
|
Posted: Sat Apr 14, 2007 4:08 pm Post subject: |
|
|
Code: | Private Sub cmdTest_Click()
Dim Game As Long, ProcessID As Long, Handle As Long
Dim lngTest1 As Long
Handle = FindWindow("TForm9", "Step 8")
If Handle <> 0 Then
GetWindowThreadProcessId Handle, ProcessID
hProc = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
If hProc <> 0 Then
Dim lngAddress As Long
lngAddress = &H45CC18 + &HC
ReadProcessMemory hProc, lngAddress, lngTest1, 4, 0&
MsgBox lngTest1
End If
End If
End Sub |
This should work just fine by the looks of it ...
It reads 4 bytes from &H45CC18 + &HC which is &H45CC24 and stores the value in lngTest1.
I don't know why you used VarPtr =/
|
|
Back to top |
|
|
Hanamichi How do I cheat? Reputation: 0
Joined: 14 Apr 2007 Posts: 2
|
Posted: Tue Apr 17, 2007 10:18 am Post subject: |
|
|
Quote: | This should work just fine by the looks of it ... |
But it give me bad result when i run.
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|