Reading map ingame
Hey guys,
I'm having a problem reading the mapname from a game.
It's stored as a unicode string, i want to get it as a c-string, in ascii.
The pointer to the string storage is 0x633494. I'm in a dll so u can use pointer stuff.
This is what the memory looks like:

I'm obviously messing up somewhere, but this is my code.
I'm having a problem reading the mapname from a game.
It's stored as a unicode string, i want to get it as a c-string, in ascii.
The pointer to the string storage is 0x633494. I'm in a dll so u can use pointer stuff.
This is what the memory looks like:
| This image has been resized. Click this bar to view the full image. The original image is sized 859x456. |
I'm obviously messing up somewhere, but this is my code.
Code:
char * getMap()
{
DWORD * mapAdd = (DWORD *)0x633494;
DWORD * mapNameLength = (DWORD *)(*mapAdd + 0x8);
char nameArr[50];
for(int i = 0; i < *mapNameLength; i++)
{
nameArr[i] = (char)(*mapAdd + 0xC + i*2);
}
nameArr[*mapNameLength] = 0;
return nameArr;
}


0 comentarios:
Publicar un comentario