| View previous topic :: View next topic |
| Author |
Message |
mamaorha Newbie cheater
Reputation: 0
Joined: 10 Mar 2012 Posts: 14
|
Posted: Tue Jun 05, 2012 2:13 pm Post subject: c# read text? |
|
|
i managed to read byte, float and byte[4] tho i cant find how to read text?
(i managed to find something in google but it only give me the 4 letters of the text :S)
can somebody help me?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Jun 06, 2012 6:33 am Post subject: |
|
|
Read the memory as bytes then convert them to a string.
_________________
- Retired. |
|
| Back to top |
|
 |
mamaorha Newbie cheater
Reputation: 0
Joined: 10 Mar 2012 Posts: 14
|
Posted: Fri Jun 08, 2012 2:16 am Post subject: |
|
|
well managed to figure it out but the prob is im telling him how many bytes to read (how can i know how much i need to read instead?)
IntPtr NickName = FindAddress(Base + nickPointer, nickOffset);
string nick = ReadAscii(NickName, 15);
nick = nick.Substring(0, nick.IndexOf("\0"));
public string ReadAscii(IntPtr pAddress, int pSize)
{
byte[] buffer = new byte[pSize * 2];
try
{
ReadProcessMemory(GameProcessHandle, pAddress, buffer, pSize * 2, 0);
return System.Text.Encoding.ASCII.GetString(buffer);
}
catch { return ""; }
}
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Jun 12, 2012 9:55 am Post subject: |
|
|
Determining the length is something you will need to look into. If the string is static, then you will know the length already. If it is dynamic, you will need to debug the application to see if there is a buffer limit that is used, or read until you find a null char '0'.
_________________
- Retired. |
|
| Back to top |
|
 |
|