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-02-2015, 03:30 PM #11
ExIIL
AstroCFG
Yeah it's easy to find on google

The following user thanked ExIIL for this useful post:

Bitwise
11-02-2015, 03:31 PM #12
any godmode or inf ammo for zombies please for offline
11-02-2015, 04:15 PM #13
seb5594
Proud Former Admin
Originally posted by Python View Post
Hahahhaha


what's funny?
can't he tell everyone the truth? :seriously:
11-02-2015, 04:33 PM #14
Originally posted by seb5594 View Post
what's funny?
can't he tell everyone the truth? :seriously:


Seb is back!?
11-02-2015, 07:20 PM #15
    
hudelem_s elem;//0x00 - 0x7B
int clientNum;//0x7C


watwatwat
11-02-2015, 07:24 PM #16
work on psn version?
11-05-2015, 10:52 PM #17
Swaqq
Professional Thanker
Originally posted by Bitwise View Post
    
hudelem_s elem;//0x00 - 0x7B
int clientNum;//0x7C


watwatwat


what is wrong? the hud elements are working. Except for an error in setshader.
11-06-2015, 04:21 AM #18
SC58
Former Staff
it seems some of these are wrong by looking at this :p

You must login or register to view this content.
11-06-2015, 05:38 PM #19
Originally posted by Swaqq View Post
what is wrong? the hud elements are working. Except for an error in setshader.


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;
};
Last edited by Bitwise ; 11-06-2015 at 05:41 PM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo