View previous topic :: View next topic |
Author |
Message |
RAIN MAN Cheater
Reputation: 0
Joined: 27 Oct 2009 Posts: 25
|
Posted: Thu Sep 08, 2011 10:02 am Post subject: C# Help Converting int value to ASCII Text. |
|
|
Im making an external ping reader for a friend that shows all the players ingame ping. The problem is i cannot convert the players "Name" to ASCII Text. It stays in 4 Byte value as you can see in the picture.
Thats the players gamertag but i need it to be in the correct format how would i convert it?
Thank you.
This is what i have for the player 1 i just need to convert the output i guess..
Code: | int player1 = Mem.ReadInt(0x402AAFD0);
abel3.Text = player1.ToString(); |
Description: |
|
Filesize: |
4.37 KB |
Viewed: |
7831 Time(s) |

|
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Sep 08, 2011 4:57 pm Post subject: |
|
|
You are only reading the pointer, you need to read the string itself. ToString() doesn't do this automatically for it, it just converts the value of the variable to a string format. You'll need to read the bytes of the players name up to either a specific size or a designated terminator character (usually 0).
_________________
- Retired. |
|
Back to top |
|
 |
RAIN MAN Cheater
Reputation: 0
Joined: 27 Oct 2009 Posts: 25
|
Posted: Thu Sep 08, 2011 6:38 pm Post subject: |
|
|
Ive heard about you O.o your like amazing at coding but i just finished actually i figured it out this was what i needed to do
Code: |
int player1 = Mem.ReadInt(0x402AAFD0);
label3.Text = player1.ToString();
byte[] tmp;
Mem.ReadMem(0x402AAFD0, 32, out tmp);
label3.Text = UnicodeEncoding.Unicode.GetString(tmp); |
but you probably already knew that thanks for your help.
|
|
Back to top |
|
 |
mibiz Cheater
Reputation: 0
Joined: 14 Jun 2009 Posts: 31
|
Posted: Wed Sep 14, 2011 4:27 am Post subject: |
|
|
RAIN MAN wrote: | Ive heard about you O.o your like amazing at coding but i just finished actually i figured it out this was what i needed to do
Code: |
int player1 = Mem.ReadInt(0x402AAFD0);
label3.Text = player1.ToString();
byte[] tmp;
Mem.ReadMem(0x402AAFD0, 32, out tmp);
label3.Text = UnicodeEncoding.Unicode.GetString(tmp); |
but you probably already knew that thanks for your help.  |
Code: | int player1 = Mem.ReadInt(0x402AAFD0); /* also unnecessary since it's not likely to be used in this current code block/segment */
label3.Text = player1.ToString(); /* unnecessary since it will assigned correctly below */
byte[] tmp;
Mem.ReadMem(0x402AAFD0, 32, out tmp);
label3.Text = UnicodeEncoding.Unicode.GetString(tmp); |
|
|
Back to top |
|
 |
empathe How do I cheat?
Reputation: 0
Joined: 21 Sep 2011 Posts: 2
|
Posted: Wed Sep 21, 2011 9:37 pm Post subject: |
|
|
my method:
Code: |
GetPidByName("game.dll");//other function
gameDll = GetDLL("game.dll", dwPID);//other function
//in main
h_Read_Process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwPID);
phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, dwPID);
//thread for nickname
int resultatNom[1];
char temps[25] = "";
int lecture=0x00,espace=0;
int Q=B0; //my offset for nickname
for(cnt = 0; cnt < 50; cnt++) resultatNom[cnt] = 0;
while(lecture<0x25){
ReadProcessMemory(h_Read_Process,(LPCVOID)(gameDll+0x01234567+Q+lecture), &resultatNom[0], sizeof(char), NULL);
if (resultatNom[0]==0){espace++;if(espace>1){break;}}
lecture=lecture+0x01;
sprintf(temps, "%s%c",temps, resultatNom[0]);
}
printf("pseudo=%s\n",temps);
|
_________________
i find dev for new radar DAoC (2012)
already> find other player in memory and x,y,z
add me: [email protected] (je suis fr) |
|
Back to top |
|
 |
|