Post: [1.02/RELEASE] SPRX Hud Elems
11-01-2015, 08:03 PM #1
Swaqq
Professional Thanker
(adsbygoogle = window.adsbygoogle || []).push({}); You must login or register to view this content.

Hello Everyone!

I know Black Ops 3 hasn't been released and all but I reversed these hud elements, and realized that they were the same as black ops 2. I haven't tested them, but they should work. So here they are. I'd show a screenshot, but I don't actually have the game. So have fun! Update: The text is confirmed working, but not the shaders. Please give me some time to verify. Thanks.



    

#pragma region Hud Elements
struct color_t
{
char r;
char g;
char b;
char a;
};
union hudelem_color_t
{
color_t color;
int rgba;
};




struct hudelem_s
{
float x;//0x00
float y;//0x04
float z;//0x08;
float fontScale;//0xC
float fromFontScale;//0x10
int fontScaleStartTime;//0x14
hudelem_color_t color;//0x18
hudelem_color_t fromColor;//0x1C
int fadeStartTime;//0x20
int scaleStartTime;//0x24
float fromX;//0x28
float fromY;//0x2C
int moveStartTime;//0x30
int time;//0x34
int duration;//0x38
float value;//0x3C
float sort;//0x40
hudelem_color_t glowColor;//0x44
int fxBirthTime;//0x48
int flags;//0x4C
short targetEntNum;//0x50
short fontScaleTime;//0x52
short fadeTime;//0x54
short label;//0x56
short width;//0x58
short height; //0x5A
short fromWidth;//0x5C
short fromHeight;//0x5E
short scaleTime;//0x60
short moveTime;//0x62
short text;//0x64
short fxLetterTime;//0x66
short fxDecayStartTime;//0x68
short fxDecayDuration;//0x6A
short fxRedactDecayStartTime;//0x6C
short fxRedactDecayDuration;//0x6E
unsigned char type;//0x70
unsigned char font;//0x71
unsigned char alignOrg;//0x72
unsigned char alignScreen;//0x73
short materialIndex;//0x74
short offscreenMaterialIndex;//0x76
unsigned char fromAlignOrg;//0x78
unsigned char fromAlignScreen;//0x79
unsigned char soundID;//0x7A
};
typedef struct game_hudelem_s
{
hudelem_s elem;//0x00 - 0x7B
int clientNum;//0x7C
int team;//0x80
int abilityFlag;//0x84
};


game_hudelem_s* HudElem_Alloc()
{
for (int i = 120; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(0x176F348 + (i * 0x8Cool Man (aka Tustin));
if (elem->elem.type == 0)
{
printf("\nHud: %i\n", i);
return elem;
}
}
return (game_hudelem_s*)0;
}


#define G_LocalizedStringIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388C14))(Text)
#define G_MaterialIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388CFCool Man (aka Tustin))(Text)

int GetLevelTime(){
return *(int*)(0x1780B00 + 0x98C);//BO3 1.01
}
void ChangeText(game_hudelem_s* elem, const char* text){
elem->elem.text = G_LocalizedStringIndex(text);
}

game_hudelem_s* SetShader(int client, const char* shader, float x, float y, short width, short height, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = 8;
elem->elem.materialIndex = G_MaterialIndex(shader);
elem->elem.width = width;
elem->elem.height = height;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.alignOrg = 0;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}

game_hudelem_s* SetText(int client, const char* Text, int font, float fontSize, float x, float y, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = 1;
elem->elem.text = G_LocalizedStringIndex(Text);
elem->elem.font = font;
elem->elem.fontScale = fontSize;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}

void fadeOverTime(game_hudelem_s * Elem, int Time, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.color.r = R;
Elem->elem.color.color.g = G;
Elem->elem.color.color.b = B;
Elem->elem.color.color.a = A;
Elem->elem.fadeTime = Time;
Elem->elem.fadeStartTime = GetLevelTime();
}

void moveOverTime(game_hudelem_s * elem, int time, float X, float Y)
{
elem->elem.fromX = elem->elem.x;
elem->elem.fromY = elem->elem.y;
elem->elem.moveStartTime = GetLevelTime();
elem->elem.moveTime = time;
elem->elem.x = X;
elem->elem.y = Y;
}
void scaleOverTime(game_hudelem_s* elem, int time, short width, short height){
elem->elem.fromWidth = elem->elem.width;
elem->elem.fromHeight = elem->elem.height;
elem->elem.scaleStartTime = GetLevelTime();
elem->elem.scaleTime = time;
elem->elem.width = width;
elem->elem.height = height;
}
#pragma endregion


Credits:
    
Sabotage & John - Some addresses
Last edited by Swaqq ; 11-09-2015 at 12:41 AM. Reason: fixed em

The following 27 users say thank you to Swaqq for this useful post:

anxify, mason, Bigmoneyhustlin, Red-EyeX32, Cmd-X, Sabotage, dom_m3hdy_xx3, EternalHabit, Father Luckeyy, iDontRte, Im_YouViolateMe, ImPiffHD, Joren, LaughTracks, Loz, Nana, Next To Nothing, NickBeHaxing, John, oStankyModz, Pianist Prodigy, RoRoH_AR, Specter, basshead4ever, Laser, xexDELL
11-06-2015, 10:32 PM #20
Swaqq
Professional Thanker
Originally posted by Bitwise View Post
In the comments you stated that the size of hudelem_s is 0x7B - when from your declaration it's 0x7C. The hud element field only goes to 0x7A - which only specifies soundID as a byte...why do you keep copy and pasting?

EDIT:

Might aswell add in structure-form what the field is telling you.

    
typedef struct _hudelem_s
{
float x;
float y;
float z;
float fontScale;
float fromFontScale;
int fontScaleStartTime;
hudelem_color_s color;
hudelem_color_s fromColor;
int fadeStartTime;
int scaleStartTime;
float fromX;
float fromY;
int moveStartTime;
int time;
int duration;
float value;
float sort;
hudelem_color_s glowColor;
int fxBirthTime;
int flags;
short targetEntNum;
short fontScaleTime;
short fadeTime;
short label;
short width;
short height;
short fromWidth;
short fromHeight;
short scaleTime;
short moveTime;
short text;
short fxLetterTime;
short fxDecayStartTime;
short fxDecayDuration;
short fxRedactDecayStartTime;
short fxRedactDecayDuration;
unsigned char type;
unsigned char font;
unsigned char alignOrg;
unsigned char alignScreen;
short materialIndex;
short offscreenMaterialIdx;
unsigned char fromAlignOrg;
unsigned char fromAlignScreen;
unsigned char soundID;
};


I was using my aw project... I didnt change everything ffs
11-07-2015, 08:55 AM #21
primetime43
Knowledge is power Tiphat
Funny how staff jump on this like flies on shit because it's the first for this game, so they sticky it, and half of it doesn't even work.
11-08-2015, 11:52 AM #22
mrtn
Little One
Originally posted by Swaqq View Post
You must login or register to view this content.

Hello Everyone!

I know Black Ops 3 hasn't been released and all but I reversed these hud elements, and realized that they were the same as black ops 2. I haven't tested them, but they should work. So here they are. I'd show a screenshot, but I don't actually have the game. So have fun! Update: The text is confirmed working, but not the shaders. Please give me some time to verify. Thanks.



    

#pragma region Hud Elements
struct color_t
{
char r;
char g;
char b;
char a;
};
union hudelem_color_t
{
color_t color;
int rgba;
};
enum he_type_t
{
HE_TYPE_NONE,
HE_TYPE_TEXT,
HE_TYPE_VALUE,
HE_TYPE_PLAYERNAME,
HE_TYPE_MATERIAL,
HE_TYPE_TIMER_UP,
HE_TYPE_TIMER_DOWN,
HE_TYPE_TIMER_STATIC,
HE_TYPE_TIMER_TENTHS_UP,
HE_TYPE_TIMER_TENTHS_DOWN,
HE_TYPE_TIMER_TENTHS_STATIC,
HE_TYPE_CLOCK_UP,
HE_TYPE_CLOCK_DOWN,
HE_TYPE_WAYPOINT,
HE_TYPE_UNKNOWN1,
HE_TYPE_UNKNOWN2,
HE_TYPE_UNKNOWN3,
HE_TYPE_MOVER,
};



struct hudelem_s
{
float x;//0x00
float y;//0x04
float z;//0x08;
float fontScale;//0xC
float fromFontScale;//0x10
int fontScaleStartTime;//0x14
hudelem_color_t color;//0x18
hudelem_color_t fromColor;//0x1C
int fadeStartTime;//0x20
int scaleStartTime;//0x24
float fromX;//0x28
float fromY;//0x2C
int moveStartTime;//0x30
int time;//0x34
int duration;//0x38
float value;//0x3C
float sort;//0x40
hudelem_color_t glowColor;//0x44
int fxBirthTime;//0x48
int flags;//0x4C
short targetEntNum;//0x50
short fontScaleTime;//0x52
short fadeTime;//0x54
short label;//0x56
short width;//0x58
short height; //0x5A
short fromWidth;//0x5C
short fromHeight;//0x5E
short scaleTime;//0x60
short moveTime;//0x62
short text;//0x64
short fxLetterTime;//0x66
short fxDecayStartTime;//0x68
short fxDecayDuration;//0x6A
short fxRedactDecayStartTime;//0x6C
short fxRedactDecayDuration;//0x6E
unsigned char type;//0x70
unsigned char font;//0x71
unsigned char alignOrg;//0x72
unsigned char alignScreen;//0x73
unsigned char materialIndex;//0x74
unsigned char offscreenMaterialIndex;//0x75
unsigned char fromAlignOrg;//0x76
unsigned char fromAlignScreen;//0x77
unsigned char soundID;//0x78
unsigned char ui3dWindow;//0x79;
short flag2;//0x7A
};
typedef struct game_hudelem_s
{
hudelem_s elem;//0x00 - 0x7B
int clientNum;//0x7C
int team;//0x80
int abilityFlag;//0x84
};


opd_s ha = { 0x32D3C4, TOC }; //Wrong... Use the HudElem_Alloc function.

game_hudelem_s*(*HudElem_Alloc)(int client, int team) = (game_hudelem_s*(*)(int, int))&ha;

#define G_LocalizedStringIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388C14))(Text)
#define G_MaterialIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388CFCool Man (aka Tustin))(Text)

int GetLevelTime(){
return *(int*)(0x1780B00 + 0x98C);//BO3 1.01
}
void ChangeText(game_hudelem_s* elem, const char* text){
elem->elem.text = G_LocalizedStringIndex(text);
}

game_hudelem_s* SetShader(int client, const char* shader, float x, float y, short width, short height, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = HE_TYPE_MATERIAL;
elem->elem.materialIndex = G_MaterialIndex(shader);
elem->elem.width = width;
elem->elem.height = height;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.alignOrg = 0;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}

game_hudelem_s* SetText(int client, const char* Text, int font, float fontSize, float x, float y, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = HE_TYPE_TEXT;
elem->elem.text = G_LocalizedStringIndex(Text);
elem->elem.font = font;
elem->elem.fontScale = fontSize;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}

void fadeOverTime(game_hudelem_s * Elem, int Time, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.color.r = R;
Elem->elem.color.color.g = G;
Elem->elem.color.color.b = B;
Elem->elem.color.color.a = A;
Elem->elem.fadeTime = Time;
Elem->elem.fadeStartTime = GetLevelTime();
}

void moveOverTime(game_hudelem_s * elem, int time, float X, float Y)
{
elem->elem.fromX = elem->elem.x;
elem->elem.fromY = elem->elem.y;
elem->elem.moveStartTime = GetLevelTime();
elem->elem.moveTime = time;
elem->elem.x = X;
elem->elem.y = Y;
}
void scaleOverTime(game_hudelem_s* elem, int time, short width, short height){
elem->elem.fromWidth = elem->elem.width;
elem->elem.fromHeight = elem->elem.height;
elem->elem.scaleStartTime = GetLevelTime();
elem->elem.scaleTime = time;
elem->elem.width = width;
elem->elem.height = height;
}
#pragma endregion


Credits:
    
Sabotage & John - Some addresses


The reason your shaders doesn't work is because you set the type to 4 (HE_TYPE_MATERIAL) when it's actually 8, like on BO2 tears
11-08-2015, 02:51 PM #23
Swaqq
Professional Thanker
Originally posted by 0x0000000 View Post
The reason your shaders doesn't work is because you set the type to 4 (HE_TYPE_MATERIAL) when it's actually 8, like on BO2 tears


yeah and my struct is a little off
11-08-2015, 11:22 PM #24
Originally posted by Swaqq View Post
I was using my aw project... I didnt change everything ffs


Your AW project? Lol this is a copy and pasted BO2 structure - please you're obviously beyond too basic to be reverse engineering structures.

Originally posted by 0x0000000 View Post
The reason your shaders doesn't work is because you set the type to 4 (HE_TYPE_MATERIAL) when it's actually 8, like on BO2 tears


Type enumeration is copy and pasted from my AW enum, like the structure he also copy and pasted and took credit for lmao.
11-09-2015, 12:32 AM #25
SC58
Former Staff
Mods/Admin should unsticky this if this isn't going to get fixed already lol
11-09-2015, 12:32 AM #26
Swaqq
Professional Thanker
Originally posted by Bitwise View Post
Your AW project? Lol this is a copy and pasted BO2 structure - please you're obviously beyond too basic to be reverse engineering structures.



Type enumeration is copy and pasted from my AW enum, like the structure he also copy and pasted and took credit for lmao.


You are an idiot aren't you. I actually do know how to reverse structures and functions. I also didn't take credits for the structures/enums I gave credits to shark because he sent them to me. I don't understand why you think I would copy and paste a bo2 struct. But if you need some proof that I did reverse the struct, here.

This is my 1.01 elf.
You must login or register to view this content.
And all those functions took me hours to find. So don't come on my thread, start flaming on how I'm a leecher, and try to be a tough guy because you want reputation. Now please get the fuck off my thread.

EDIT: I took out your shitty enum so you get no credit.
Last edited by Swaqq ; 11-09-2015 at 12:35 AM.

The following user thanked Swaqq for this useful post:

x_com
11-09-2015, 12:40 AM #27
Swaqq
Professional Thanker
Originally posted by SC58 View Post
Mods/Admin should unsticky this if this isn't going to get fixed already lol


forgot about the thread, but i fixed em they should work.
11-09-2015, 12:48 AM #28
SC58
Former Staff
Originally posted by Swaqq View Post
You are an idiot aren't you. I actually do know how to reverse structures and functions. I also didn't take credits for the structures/enums I gave credits to shark because he sent them to me. I don't understand why you think I would copy and paste a bo2 struct. But if you need some proof that I did reverse the struct, here.

This is my 1.01 elf.
You must login or register to view this content.
And all those functions took me hours to find. So don't come on my thread, start flaming on how I'm a leecher, and try to be a tough guy because you want reputation. Now please get the fuck off my thread.

EDIT: I took out your shitty enum so you get no credit.


You must login or register to view this content.

That is the struct, u mapped it out in the functions

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo