0

Hey, Im using readprocessmemory to get information on a game, but for some reason it skips two bytes..

part of my structure is similar to

WORD a;
DWORD b;
DWORD c;
DWORD d;

and i read the following memory into it:
00 00 FF FF FF FF 02 00 00 00 FF FF FF FF

i get the result

a=00 00
b= FF FF 02 00 // should be  FF FF FF FF 
c= 00 00 FF FF
d= FF FF ?? ??

does anyone know why it would skip 4 bytes??

i read everything at once, and i have everything in the rest of the struct working, and just happen to notice this issue...

thanks
M

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by nschessnerd
2

Just a guess, but if you are trying to read the contents of a structure perhaps there are holes in the structure, such as the packing factor is something other than 1.

#pragma pack(1)
struct mystuff
{
   WORD a;
    DWORD b;
   // etc
};
#pragma pack()
Votes + Comments
*nods*
Expert analysis
0

thanks! that worked great...

you just know the answer to everything dont you?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.