Results 1 to 3 of 3
  1. #1
    Stuped's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0

    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...

  2. #2
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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];

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  3. The Following 2 Users Say Thank You to Jason For This Useful Post:

    Hassan (02-21-2012),Stuped (02-26-2012)

  4. #3
    Stuped's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    Sorry for the late response, it works perfectly, thanks a lot man

Similar Threads

  1. [Request] Read to find out!
    By iVivviD in forum Combat Arms Mod Request
    Replies: 5
    Last Post: 09-11-2011, 12:42 PM
  2. Read it and find out
    By The Supersonic in forum General
    Replies: 27
    Last Post: 07-14-2011, 01:22 PM
  3. Replies: 3
    Last Post: 07-08-2011, 01:19 PM
  4. [Tutorial][C#] Reading struct from game
    By hooch in forum Programming Tutorials
    Replies: 4
    Last Post: 03-03-2011, 12:09 AM
  5. ROLF THIS KID FREAKED OUT! READ THIS!
    By ZZ-FX in forum General
    Replies: 18
    Last Post: 09-06-2009, 05:08 PM