 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
reavenz Newbie cheater
Reputation: 0
Joined: 24 Apr 2012 Posts: 11
|
Posted: Sat May 19, 2012 12:05 am Post subject: Help VB.Net pointer Read |
|
|
my read pointer module is
| Code: | Public Function PointerRead(ByVal MemoryAddress As IntPtr, ByVal bytesToRead As UInteger, ByVal Offset As Integer(), ByRef bytesRead As Integer) As Byte()
Dim iPointerCount As Integer = Offset.Length - 1
Dim ptrBytesRead As IntPtr
bytesRead = 0
Dim buffer As Byte() = New Byte(3) {}
'DWORD to hold an Address
Dim tempAddress As Integer = 0
If iPointerCount = 0 Then
ReadProcessMemory(m_hProcess, MemoryAddress, buffer, 4, ptrBytesRead)
tempAddress = ToDec(Make(buffer)) + Offset(0)
'Final Address
buffer = New Byte(bytesToRead - 1) {}
ReadProcessMemory(m_hProcess, CType(tempAddress, IntPtr), buffer, bytesToRead, ptrBytesRead)
bytesRead = ptrBytesRead.ToInt32()
'MessageBox.Show(bytesRead.ToString());
Return buffer
End If
For i As Integer = 0 To iPointerCount
If i = iPointerCount Then
ReadProcessMemory(m_hProcess, CType(tempAddress, IntPtr), buffer, 4, ptrBytesRead)
tempAddress = ToDec(Make(buffer)) + Offset(i)
'Final Address
buffer = New Byte(bytesToRead - 1) {}
ReadProcessMemory(m_hProcess, CType(tempAddress, IntPtr), buffer, bytesToRead, ptrBytesRead)
bytesRead = ptrBytesRead.ToInt32()
Return buffer
ElseIf i = 0 Then
ReadProcessMemory(m_hProcess, MemoryAddress, buffer, 4, ptrBytesRead)
tempAddress = ToDec(Make(buffer)) + Offset(1)
Else
ReadProcessMemory(m_hProcess, CType(tempAddress, IntPtr), buffer, 4, ptrBytesRead)
tempAddress = ToDec(Make(buffer)) + Offset(i)
End If
Next
Return buffer
End Function |
if i write like this
| Code: | | Label1.Text = myMemory.PointerRead(CType(HexToDec("2239EFD"), IntPtr), 4, {&H328F4, &H6EDC0}, bytesRead).ToString |
my label1.text = System.Byte[]
thats are my value is unkown??
|
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Sat May 19, 2012 3:41 am Post subject: |
|
|
Thats because your function returns a byte array.
Use BitConverter to convert the array to an integer.
| Code: | Dim _Array As Byte() = myMemory.PointerRead(CType(HexToDec("2239EFD"), IntPtr), 4, {&H328F4, &H6EDC0}, bytesRead)
Label1.Text = BitConverter.ToInt32(_Array, 0).ToString("X") |
_________________
|
|
| Back to top |
|
 |
reavenz Newbie cheater
Reputation: 0
Joined: 24 Apr 2012 Posts: 11
|
Posted: Sat May 19, 2012 7:29 pm Post subject: |
|
|
if i use this
| Code: | Dim _Array As Byte() = myMemory.PointerRead(CType(HexToDec("2239EFD"), IntPtr), 4, {&H328F4, &H6EDC0}, bytesRead)
Label1.Text = BitConverter.ToInt32(_Array, 0).ToString("X") |
my label1.text still 0
thats not read pointer
|
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Sun May 20, 2012 3:04 am Post subject: |
|
|
Your pointer function is wrong if it returns the wrong address, keep trying.
Iv looked at your code, i cant really understand it.
_________________
|
|
| 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
|
|