Over the course of a few weeks, I have reversed some of the Halo 2 Vista data structures. When I speak of data structures, I'm talking about the live game data that the game is using during play. It is organized in memory so that it can be accessed fairly easily. These structures were written in C structure format.
Structures and address were last updated 09/02/2008 and are for version 1.0.4.129 of Halo 2 Vista.
Code:
//------------------------------------------------------------------------------
struct Local_Index
{
unsigned short Num;
};
extern Local_Index *LocalIndex;
//------------------------------------------------------------------------------
struct ARotator
{
float Yaw;
float Pitch;
};
extern ARotator *Rotator;
//------------------------------------------------------------------------------
struct ALocal
{
float x;
float y;
float z;
unsigned char Unknown[24];
float fov;
};
extern ALocal *Local;
//------------------------------------------------------------------------------
struct Player_Masterchief
{
unsigned char Unknown00[16];
unsigned short CurrentHeldObjectIndex;
unsigned short CurrentHeldObjectID;
unsigned short VehicleIndex;
unsigned short VehicleID;
unsigned char Unknown01[16];
unsigned long LocationID_0;
unsigned long LocationID_1;
float Unknown02[3][4];
unsigned short IsEnteringNewLocation; // 0x7800 if no, 0x9600 if on the line
unsigned short TotalMovementDistance;
float xWorld_0; // world coordinate
float yWorld_0; // world coordinate
float zWorld_0; // world coordinate
float LegsPitch;
float LegsYaw;
float LegsRoll;
unsigned char Unknown03[8]; // Zero's
float Modifier; // 1
float xMovement_0; // movement vector
float yMovement_0; // movement vector
float zMovement_0; // movement vector
unsigned char Unknown04[12]; // Zero's
float ModelScale; // 1
unsigned char Unknown05[76];
float Shield; // 1 = normal
unsigned char Unknown06[92];
unsigned char IsCrouching; // 0 = standing 1 = crouching
unsigned char Unknown07[131];
unsigned short VisibleObjectIndex;
unsigned short VisibleObjectID;
unsigned long Unknown08;
unsigned short VisiblePlayerIndex;
unsigned short VisiblePlayerID;
unsigned char Unknown09[16];
float CrosshairVisDistance; // 1.0f if red
unsigned char Unknown10[48];
unsigned short ACount_0; // Increases everytime you change weapons etc
unsigned char CurWeapSlot_0; // 0 = Primary, 1 = Secondary
unsigned char IsDualWielding_0; // 0xFF = No, 0x02 = Yes
unsigned short ACount_1;
unsigned char CurWeapSlot_1;
unsigned char IsDualWielding_1;
unsigned short PrimaryWeaponIndex;
unsigned short PrimaryWeaponID;
unsigned short SecondaryWeaponIndex;
unsigned short SecondaryWeaponID;
unsigned short TertiaryWeaponIndex; // Dual wield weapon
unsigned short TertiaryWeaponID; // Dual wield weapon
unsigned short QuaternaryWeaponIndex; // Extra weapon slot?
unsigned short QuaternaryWeaponID;
unsigned long PriTotalTimeEquiped;
unsigned long SecTotalTimeEquiped;
unsigned long TriTotalTimeEquiped;
unsigned long QuaTotalTimeEquiped;
unsigned long Unknown11; // 0xFFFFFFFF
unsigned char GrenadeTypeEquiped_0; // 0 = Frag, 1 = Plasma
unsigned char GrenadeTypeEquiped_1; // 0 = Frag, 1 = Plasma
unsigned char FragCount; // # of frag grenades
unsigned char PlasmaCount; // # of plasma grenades
unsigned char ZoomLevel_0; // 0xFF = Not Zoomed, 0x00 = 1st Zoom
unsigned char ZoomLevel_1; // 0xFF = Not Zoomed, 0x00 = 1st Zoom
unsigned short Unknown12;
unsigned long SomeTimer;
unsigned char Unknown13[40];
float xWorld_1; // world coordinate
float yWorld_1; // world coordinate
float zWorld_1; // world coordinate
float xMovement_1; // movement vector
float yMovement_1; // movement vector
float zMovement_1; // movement vector
unsigned char Unknown14[620];
float MidHipBone[13];
float LeftHipBone[13];
float RightHipBone[13];
float UpperHipBone[13];
float LeftKneeBone[13];
float RightKneeBone[13];
float MidChestBone[13];
float LeftAnkleBone[13];
float RightAnkleBone[13];
float LeftChestBone[13];
float LowerNeckBone[13];
float RightChestBone[13];
float LeftFootBone[13];
float RightFootBone[13];
float LeftShoulderBone[13];
float UpperNeckBone[13];
float RightShoulderBone[13];
float LeftElbowBone[13];
float RightElbowBone[13];
float LeftWristBone[13];
float RightWristBone[13];
float LeftKnuckle_00[13];
float LeftKnuckle_01[13];
float LeftKnuckle_02[13];
float RightKnuckle_00[13];
float RightKnuckle_01[13];
float RightKnuckle_02[13];
float LeftKnuckle_03[13];
float LeftKnuckle_04[13];
float LeftKnuckle_05[13];
float RightKnuckle_03[13];
float RightKnuckle_04[13];
float RightKnuckle_05[13];
};
extern Player_Masterchief *Masterchief;
//------------------------------------------------------------------------------
struct Player_Elite
{
unsigned char Unknown00[16];
unsigned short CurrentHeldObjectIndex;
unsigned short CurrentHeldObjectID;
unsigned short VehicleIndex;
unsigned short VehicleID;
unsigned char Unknown01[16];
unsigned long LocationID_0;
unsigned long LocationID_1;
float Unknown02[3][4];
unsigned short IsEnteringNewLocation; // 0x7800 if no, 0x9600 if on the line
unsigned short TotalMovementDistance;
float xWorld_0; // world coordinate
float yWorld_0; // world coordinate
float zWorld_0; // world coordinate
float LegsPitch;
float LegsYaw;
float LegsRoll;
unsigned char Unknown03[8]; // Zero's
float Modifier; // 1
float xMovement_0; // movement vector
float yMovement_0; // movement vector
float zMovement_0; // movement vector
unsigned char Unknown04[12]; // Zero's
float ModelScale; // 1
unsigned char Unknown05[76];
float Shield; // 1 = normal
unsigned char Unknown06[92];
unsigned char IsCrouching; // 0 = standing 1 = crouching
unsigned char Unknown07[131];
unsigned short VisibleObjectIndex;
unsigned short VisibleObjectID;
unsigned long Unknown08;
unsigned short VisiblePlayerIndex;
unsigned short VisiblePlayerID;
unsigned char Unknown09[16];
float CrosshairVisDistance; // 1.0f if red
unsigned char Unknown10[48];
unsigned short ACount_0; // Increases everytime you change weapons etc
unsigned char CurWeapSlot_0; // 0 = Primary, 1 = Secondary
unsigned char IsDualWielding_0; // 0xFF = No, 0x02 = Yes
unsigned short ACount_1;
unsigned char CurWeapSlot_1;
unsigned char IsDualWielding_1;
unsigned short PrimaryWeaponIndex;
unsigned short PrimaryWeaponID;
unsigned short SecondaryWeaponIndex;
unsigned short SecondaryWeaponID;
unsigned short TertiaryWeaponIndex; // Dual wield weapon
unsigned short TertiaryWeaponID; // Dual wield weapon
unsigned short QuaternaryWeaponIndex; // Extra weapon slot?
unsigned short QuaternaryWeaponID;
unsigned long PriTotalTimeEquiped;
unsigned long SecTotalTimeEquiped;
unsigned long TriTotalTimeEquiped;
unsigned long QuaTotalTimeEquiped;
unsigned long Unknown11; // 0xFFFFFFFF
unsigned char GrenadeTypeEquiped_0; // 0 = Frag, 1 = Plasma
unsigned char GrenadeTypeEquiped_1; // 0 = Frag, 1 = Plasma
unsigned char FragCount; // # of frag grenades
unsigned char PlasmaCount; // # of plasma grenades
unsigned char ZoomLevel_0; // 0xFF = Not Zoomed, 0x00 = 1st Zoom
unsigned char ZoomLevel_1; // 0xFF = Not Zoomed, 0x00 = 1st Zoom
unsigned short Unknown12;
unsigned long SomeTimer;
unsigned char Unknown13[40];
float xWorld_1; // world coordinate
float yWorld_1; // world coordinate
float zWorld_1; // world coordinate
float xMovement_1; // movement vector
float yMovement_1; // movement vector
float zMovement_1; // movement vector
unsigned char Unknown14[604];
float MidHipBone[13];
float LeftHipBone[13];
float GroundMiddle[13];
float RightHipBone[13];
float UpperHipBone[13];
float LeftKneeBone_00[13];
float RightKneeBone_00[13];
float MidChestBone[13];
float LeftKneeBone_01[13];
float RightKneeBone_01[13];
float LowerNeckBone_00[13];
float LowerNeckBone_01[13];
float LowerNeckBone_02[13];
float LeftAnkleBone[13];
float RightAnkleBone[13];
float LeftShoulderBone[13];
float UpperNeckBone_00[13];
float RightShoulderBone[13];
float LeftElbowBone[13];
float UpperNeckBone_01[13];
float RightElbowBone[13];
float LeftWristBone[13];
float LeftEyeBone[13];
float RightEyeBone[13];
float LeftBrowBone_00[13];
float LeftBrowBone_01[13];
float LeftNoseBone[13];
float LeftCheekBone[13];
float NoseBone[13];
float RightBrowBone_00[13];
float RightBrowBone_01[13];
float RightNoseBone[13];
float RightCheekBone[13];
float JawBone_00[13];
float JawBone_01[13];
float RightWristBone[13];
float LeftKnuckle_00[13];
float LeftKnuckle_01[13];
float LeftKnuckle_02[13];
float LeftKnuckle_03[13];
float RightKnuckle_00[13];
float RightKnuckle_01[13];
float RightKnuckle_02[13];
float RightKnuckle_03[13];
float LeftKnuckle_04[13];
float LeftKnuckle_05[13];
float LeftKnuckle_06[13];
float LeftKnuckle_07[13];
float RightKnuckle_04[13];
float RightKnuckle_05[13];
float RightKnuckle_06[13];
float RightKnuckle_07[13];
};
extern Player_Elite *Elite;
//------------------------------------------------------------------------------
struct AWeapon
{
unsigned char Unk1[20];
unsigned short PlayerIndex; // Current player holding the weapon
unsigned short PlayerID;
unsigned char Unknown00[442];
unsigned short TotalBulletsFired;
unsigned char Unknown01[60];
unsigned char IsFiring; // 0 = Yes, 1 = No
unsigned char Unknown02[19];
unsigned short IsReloading; // 0 = No, 1 = Yes
unsigned short ReloadTimer_0;
unsigned short Unknown03;
unsigned short RoundsLeft;
unsigned short BulletsLeft; // In current round
unsigned short Unknown04;
unsigned short ReloadTimer_1;
unsigned short ReloadTimerMax; // Time it takes to reload
};
extern AWeapon *Weapon;
//------------------------------------------------------------------------------
struct Object_Table_Header
{
unsigned char TName[32]; // 'object'
unsigned long Max; // Max # of Objects
unsigned long Size; // Object Array Size
unsigned long Unknown00; // ???
unsigned char Data[4]; // '@t@d'
unsigned long Unknown01; // ??
unsigned long Unknown02;
unsigned long Unknown03;
unsigned long Unknown04;
unsigned long Unknown05;
unsigned long FirstObject; // Pointer to first object in table
unsigned long Unknown06; // Pointer to something
};
extern Object_Table_Header *ObjectTableHeader;
//------------------------------------------------------------------------------
struct Object_Table_Array
{
unsigned short ObjectID; // Matches up to Object ID in static player table ( for players )
unsigned short Unknown00;
unsigned short Unknown01;
unsigned short Size; // Structure size
unsigned long Offset; // Pointer to the object data structure
};
extern Object_Table_Array *ObjectTableArray;
//------------------------------------------------------------------------------
struct Static_Player_Header
{
unsigned char TName[32]; // 'players'
unsigned long MaxSlots; // Max number of slots/players possible
unsigned long SlotSize; // Size of each Static_Player struct
unsigned long Unknown00; // ??
unsigned char Data[4]; // '@t@d' - translated as 'data'?
unsigned long Unknown01; // Pointer to something
unsigned long Unknown02; // zero's?
unsigned long Max; // Max player's reached?
unsigned long Num; // Current # of players / slots taken
unsigned short NextPlayerID; // ID of next player to join
unsigned short Unknown03; // index #?
unsigned long FirstPlayer; // Pointer to first player struct
unsigned long Unknown04; // Pointer to something
};
extern Static_Player_Header *StaticPlayerHeader;
//------------------------------------------------------------------------------
struct Static_Player
{
unsigned short PlayerID;
unsigned short IsLocal; //???
unsigned char Unknown00[34];
unsigned short LocationID;
unsigned short ObjectIndexNum;
unsigned short ObjectID; // Matches against object table
unsigned short OldObjectIndexNum; // When dead or spectating
unsigned short OldObjectID;
unsigned char Unknown01[4];
unsigned char IsMelee; // 0xC0
unsigned char IsShooting; // 0x01
unsigned char Unknown02;
unsigned char IsNading; // 0x10
unsigned char IsWeapon; // 0x01 = Reloading 0x10 = Switching
unsigned char Unknown03[3];
unsigned long MeleeTimer; //
wchar_t PlayerName_0[32]; // Unicode / Max - 11 Chars + EOS (12 total)
unsigned char Unknown04[60];
unsigned short Team_0;
unsigned short Unknown05; // 0xFF?
unsigned long Unknown06;
wchar_t PlayerName_1[32];
unsigned char Unknown07[60];
unsigned short Team_1;
unsigned short Unknown08; // 0xFF?
unsigned long Unknown09;
unsigned long RespawnTimer_0; // Miliseconds?
unsigned char Unknown10[8];
unsigned long RespawnTimer_1; // Seconds
unsigned char Unknown11[32];
unsigned long SomeTimer;
unsigned long Unknown12;
float SpeedModifier; // for walking 1.0f = normal 0.75 = holding flag
unsigned char Unknown13[24];
unsigned long HillTime; // Not total, just current time in hill
unsigned long Unknown14[2];
unsigned long Deaths;
unsigned char Unknown15[16];
float LastBulletLocation[2][8];
unsigned long SpawnCount; // Number of times spawned
unsigned long IsTyping; // 0 = Normal, 2 = Chat is open
};
extern Static_Player *StaticPlayer;
//------------------------------------------------------------------------------
Code:
Addresses
-----------
Rotation = 0x30004CD0
Location = halo2.exe + 0x004A8504
LocalIndex = 0x30004B6C
ObjectTableHeader = 0x3003CEF0
StaticPlayerHeader = 0x30002AD0