SolvedReading Out A Struct

Posts 1–3 of 3 · Page 1 of 1
Reading Out A Struct
Hey guys,

I'm new in this "scene" and have a question which is:

I'm reading out the Radarstruct of Counter-strike, so first i declare the struct in C++, then i read out the radarbase and use memcpy to copie the memory. All goes good in general, my only problem is:

The pitch, yaw and roll memory are lieng directly in a row, in the beginning zhe pitch
I've got the offset of the pitch and want to read the three things only with this one, i know thats possible i have to read out the pitch with 12 bytes(for the three things). But i dont even know how to come to the single results, cause when i read out the pitch with 12 bytes, i just have one result, not three(pitch, yaw, roll). How should i go about that, mabye someone of you can help me with an example

Would be very nice, so thanks in advance and sorry for my bad english, i'm a german...
If you have the 12 bytes for Pitch/Yaw/Roll just cast the byte pointer to a float pointer and index into the array.

For example:
Code:
PBYTE yawPitchRoll = <somevalue>;
float *fData = (float*)yawPitchRoll;
float yaw = fData[0];
float pitch = fData[1];
float roll = fData[2];
Sorry for the late response, it works perfectly, thanks a lot man
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?