 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
SlowPoke69 How do I cheat?
Reputation: 0
Joined: 18 Feb 2011 Posts: 7
|
Posted: Fri Feb 18, 2011 6:27 am Post subject: VB 2010 Readopenprocess Converting Strings |
|
|
Hello, Im looking for a little help. I have an address that im reading a string from and trying to convert the string. Now I can manage to get only the first couple letters of the string and not the rest. Not exactly sure how to widen up the buffer a bit. Below is my code. and thanks for any help!
Public Function Readmem2(ByVal Address As Integer)
Dim myProcesses As Process() = Process.GetProcessesByName("elementclient")
If myProcesses.Length = 0 Then
Status2.Text = "Process is not opened."
End
End If
Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, myProcesses(0).Id)
If myProcesses.Length = 0 Then
Status2.Text = "Can not open Process."
End
End If
ReadProcessMemory(processHandle, Address, rBuff, 4, Nothing)
CloseHandle(processHandle)
Return rBuff
End Function
Readmem2(&H63FC830)
ret = BitConverter.GetBytes(rBuff)
CharName = System.Text.Encoding.ASCII.GetString(ret).Replace("RAW", "")
Status2.Text = CharName
|
|
Back to top |
|
 |
Jesper Grandmaster Cheater Supreme
Reputation: 9
Joined: 21 Feb 2007 Posts: 1156
|
Posted: Fri Feb 18, 2011 7:06 am Post subject: |
|
|
You're reading 4 bytes of memory, which is 4 characters.
Code: |
Public Function Readmem2(ByVal Address As Integer, ByVal len as Integer)
Dim myProcesses As Process() = Process.GetProcessesByName("elementclient")
If myProcesses.Length = 0 Then
Status2.Text = "Process is not opened."
End
End If
Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, myProcesses(0).Id)
If myProcesses.Length = 0 Then
Status2.Text = "Can not open Process."
End
End If
ReadProcessMemory(processHandle, Address, rBuff, len, Nothing)
CloseHandle(processHandle)
Return rBuff
End Function
|
Try using that instead, and pass the length of the string you want to read.
|
|
Back to top |
|
 |
SlowPoke69 How do I cheat?
Reputation: 0
Joined: 18 Feb 2011 Posts: 7
|
Posted: Fri Feb 18, 2011 7:30 am Post subject: |
|
|
Okay, so I made the changes. I know my string is 6 bytes, 6 characters, and it still came back with the first 4. So for shits and giggles I put len value to 25 and the program crashed.
Here's my declare, check to see if thats defined correctly.
Private Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
|
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
|
|