Nostafaru
Moderating the Crunch Bunch.
Retired Staff
Community Elite
Community Veteran
Determined Poster
Active Member
Console ID Poster
public static class HElems {
public static uint //0xb8 4 = icon, 1 = text
//Updated 1.12 - By iTnDM
ELEM = 0xD87808, //patched FIX_ELEM = 0x335C7, FPS = 0x36BC58, G_LocalizedString = 0x33580,
type = 0x00, xOffset = 0x04, yOffset = 0x08, zOffset = 0x0C, targetEntNum = 0x10, fontScale = 0x14, fromFontScale = 0x18, fontScaleStartTime = 0x1C, fontScaleTime = 0x20, font = 0x24, alignOrg = 0x28, alignScreen = 0x2C, color = 0x30, fromColor = 0x34, fadeStartTime = 0x38, fadeTime = 0x3C, label = 0x40, text = 0x42, width = 0x44, height = 0x48, materialIndex = 0x4C, fromWidth = 0x50, fromHeight = 0x54, scaleStartTime = 0x58, scaleTime = 0x5C, fromX = 0x60, fromY = 0x64, fromAlignOrg = 0x68, fromAlignScreen = 0x6C, moveStartTime = 0x70, moveTime = 0x74, time = 0x78, duration = 0x7C, value = 0x80, sort = 0x88, glowColor = 0x8C, fxBirthTime = 0x90, fxLetterTime = 0x94, fxDecayStartTime = 0x98, fxDecayDuration = 0x9C, soundID = 0xA0, flags = 0xA4, clientOffset = 0xA8;
}
public static int getLevelTime()
{
return PS3.Extension.ReadInt32(0xdb5a44);
}
public static void SetGlow(uint elemIndex, int r, int g, int b, int a)
{ uint num = HElems.ELEM + (elemIndex * 0xb8); PS3.SetMemory(num + HElems.glowColor, RGBA(r, g, b, a));
}
public static void Enable_Cacher()
{ PS3.SetMemory(0x2100000, new byte[32]); PS3.SetMemory(0x2105000, new byte[32]); PS3.SetMemory(0x36BC58, new byte[] { 0x3C, 0x60, 0x02, 0x10, 0x80, 0x83, 0x00, 0x00, 0x2C, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x8C, 0x4B, 0xCC, 0x79, 0x19, 0x3C, 0x80, 0x02, 0x10, 0x90, 0x64, 0x50, 0x00, 0x38, 0x60, 0x00, 0x00, 0x90, 0x64, 0x00, 0x00, 0x48, 0x00, 0x00, 0x74, 0x3B, 0xE4, 0xBB, 0xBC, 0x38, 0x80, 0x00, 0x00 }); PS3.SetMemory(0x335C7, new byte[] { 0x01 });
}
public static void ActivateIndex(int index, int type)
{
byte[] Typ = BitConverter.GetBytes(type);
Array.Reverse(Typ); PS3.SetMemory(Hud.HElems.ELEM + 0xb8 * (uint)index, Typ);
}
public static byte[] ToHexFloat(float Axis)
{
byte[] bytes = BitConverter.GetBytes(Axis);
Array.Reverse(bytes);
return bytes;
}
public static byte[] RGBA(decimal R, decimal G, decimal B, decimal A)
{ byte[] RGBA = new byte[4]; byte[] RVal = BitConverter.GetBytes(Convert.ToInt32(R)); byte[] GVal = BitConverter.GetBytes(Convert.ToInt32(G)); byte[] BVal = BitConverter.GetBytes(Convert.ToInt32(B)); byte[] AVal = BitConverter.GetBytes(Convert.ToInt32(A)); RGBA[0] = RVal[0]; RGBA[1] = GVal[0]; RGBA[2] = BVal[0]; RGBA[3] = AVal[0];
return RGBA;
}
//StoreIcon
public static void StoreIcon(int elemIndex, uint client, int shader, int width, int height, float x, float y, uint align, float sort, int r, int g, int b, int a)
{ uint offset = (uint) (0xD87808 + (elemIndex * 0xb8)); PS3.SetMemory(offset, new byte[0xb8]); byte[] buffer = new byte[4]; buffer[3] = 4; PS3.SetMemory(offset, buffer); PS3.Extension.WriteInt32(offset + HElems.materialIndex, shader); PS3.Extension.WriteInt32(offset + HElems.clientOffset, (int) client); PS3.Extension.WriteInt32(offset + HElems.width, width); PS3.Extension.WriteInt32(offset + HElems.height, height); PS3.Extension.WriteInt32(offset + HElems.alignScreen, 0); PS3.Extension.WriteInt32(offset + HElems.alignOrg, 0); PS3.Extension.WriteFloat(offset + HElems.xOffset, x); PS3.Extension.WriteFloat(offset + HElems.yOffset, y); PS3.SetMemory(offset + HElems.color, RGBA(r, g, b, a));
}
private byte[] CacheString(string Text)
{ PS3.SetMemory(0x2100000, Encoding.ASCII.GetBytes(Text + "\0")); byte[] result = new byte[4]; Thread.Sleep(50); PS3.GetMemory(0x2105000, result);
return result;
}
//StoreTextElem
public static void StoreTextElem(int elemIndex, int client, string Text, short font, float fontSize, float x, float y, uint align, float sort, int r, int g, int b, int a)
{ uint offset = HElems.ELEM + (Convert.ToUInt32(elemIndex) * 0xb8); PS3.SetMemory(offset, new byte[0xb8]); byte[] buffer = new byte[4]; buffer[3] = 1; PS3.SetMemory(offset, buffer); PS3.Extension.WriteInt16(offset + HElems.text, G_LocalizedStringIndex(Text)); PS3.Extension.WriteInt32(offset + HElems.font, font); PS3.Extension.WriteInt32(offset + HElems.clientOffset, client); PS3.Extension.WriteFloat(offset + HElems.fontScale, fontSize); PS3.Extension.WriteFloat(offset + HElems.xOffset, x); PS3.Extension.WriteFloat(offset + HElems.yOffset, y); PS3.SetMemory(offset + HElems.color, RGBA(r, g, b, a));
}
//doTypewriter
public static void doTypeWriter(uint ElemIndex, int client, string text, double fontScale, short font, float X, float Y, int fxLetterTime, int fxDecayStartTime, int fxDecayDuration, int r, int g, int b, int a, int r1, int b1, int g1, int a1)
{ uint offset = HElems.ELEM + (Convert.ToUInt32(ElemIndex) * 0xb8); PS3.SetMemory(offset, new byte[0xb8]); byte[] buffer = new byte[4]; buffer[3] = 1; PS3.SetMemory(offset, buffer); PS3.Extension.WriteInt16(offset + HElems.text, G_LocalizedStringIndex(text)); PS3.Extension.WriteInt16(offset + HElems.font, font); PS3.Extension.WriteInt32(offset + HElems.clientOffset, client); PS3.Extension.WriteInt16(offset + HElems.alignScreen, 0); PS3.Extension.WriteInt16(offset + HElems.alignOrg, 0); PS3.Extension.WriteFloat(offset + HElems.fontScale, (float) fontScale); PS3.Extension.WriteFloat(offset + HElems.xOffset, X); PS3.Extension.WriteFloat(offset + HElems.yOffset, Y); PS3.SetMemory(offset + HElems.color, RGBA(r, g, b, a)); PS3.SetMemory(offset + HElems.glowColor, RGBA(r1, g1, b1, a1)); PS3.Extension.WriteInt32(offset + HElems.fxBirthTime, getLevelTime()); PS3.Extension.WriteInt32(offset + HElems.fxLetterTime, fxLetterTime); PS3.Extension.WriteInt32(offset + HElems.fxDecayStartTime, fxDecayStartTime); PS3.Extension.WriteInt32(offset + HElems.fxDecayDuration, fxDecayDuration);
}
public static uint MoveOverTime(uint elemIndex, short Time, float X, float Y)
{ uint Elem = 0xD87808 + (elemIndex) * 0xB8; PS3.Extension.WriteFloat(Elem + Hud.HElems.fromX, PS3.Extension.ReadFloat(Elem + Hud.HElems.xOffset)); PS3.Extension.WriteFloat(Elem + Hud.HElems.fromY, PS3.Extension.ReadFloat(Elem + Hud.HElems.yOffset)); PS3.Extension.WriteInt32(Elem + Hud.HElems.moveTime, Time); PS3.Extension.WriteInt32(Elem + Hud.HElems.moveStartTime, getLevelTime()); PS3.Extension.WriteFloat(Elem + Hud.HElems.xOffset, X); PS3.Extension.WriteFloat(Elem + Hud.HElems.yOffset, Y);
return Elem;
}
public static void ChangeFontScaleOverTime(uint elemIndex, short Time, double OldFont, double NewFont)
{ uint Elem = 0xD87808 + (elemIndex) * 0xB8; PS3.Extension.WriteFloat(Elem + HElems.fromFontScale, (float)OldFont);//fromFontScale PS3.Extension.WriteUInt32(Elem + HElems.fontScaleStartTime, (UInt32)getLevelTime());//fontScaleStartTime PS3.Extension.WriteInt32(Elem + HElems.fontScaleTime, Time);//fontScaleTime PS3.Extension.WriteFloat(Elem + HElems.fontScale, (float)NewFont);
}
public static void ScaleOverTime(uint elemIndex, short Time, short Width, short Height)
{ uint Elem = 0xD87808 + (elemIndex) * 0xB8; PS3.Extension.WriteInt32(Elem + HElems.fromHeight, PS3.Extension.ReadInt16(Elem + HElems.height));//From Height PS3.Extension.WriteInt32(Elem + HElems.fromWidth, PS3.Extension.ReadInt16(Elem + HElems.width));//from Width PS3.Extension.WriteInt32(Elem + HElems.scaleTime, Time); PS3.Extension.WriteInt32(Elem + HElems.scaleStartTime, getLevelTime());//MoveStartTime PS3.Extension.WriteInt16(Elem + HElems.height, Height); PS3.Extension.WriteInt16(Elem + HElems.width, Width);
}
public static void FadeOverTime(uint elem, short Time, int R, int G, int B, int A)
{ uint Elem = 0xD87808 + (elem) * 0xB8; byte[] RVal = PS3.GetMemory(Elem + HElems.color, 1);//Gets Current RVal byte[] GVal = PS3.GetMemory(Elem + HElems.color + 0x01, 1);//Gets Current GVal byte[] BVal = PS3.GetMemory(Elem + HElems.color + 0x02, 1);//Gets Current BVal byte[] AVal = PS3.GetMemory(Elem + HElems.color + 0x03, 1);//Gets Current AVal PS3.SetMemory(Elem + HElems.fromColor, RVal);//Sets Current RVal PS3.SetMemory(Elem + HElems.fromColor + 0x01, GVal);//Sets Current GVal PS3.SetMemory(Elem + HElems.fromColor + 0x02, BVal);//Sets Current BVal PS3.SetMemory(Elem + HElems.fromColor + 0x03, AVal);//Sets Current AVal PS3.Extension.WriteUInt32(Elem + HElems.fadeStartTime, (UInt32)getLevelTime()); PS3.Extension.WriteInt32(Elem + HElems.fadeTime, Time);//Fade Time PS3.SetMemory(Elem + HElems.color, RGBA(R, G, B, A));//Set New Colors }
public static byte[] UInt32ToBytes(uint input)
{ byte[] bytes = BitConverter.GetBytes(input);
Array.Reverse(bytes);
return bytes;
}
public static byte[] ReverseBytes(byte[] inArray)
{
Array.Reverse(inArray);
return inArray;
}
public static byte[] uintBytes(uint input)
{ byte[] data = BitConverter.GetBytes(input);
Array.Reverse(data);
return data;
}
}
Credits:
īTnDM- Update Huds Elements To 1.11 + 1.12
Bad Luck Brain - Huds + Help
public static uint //0xb8 4 = icon, 1 = text
//Updated 1.12 - By iTnDM
ELEM = 0xD87808, //patched FIX_ELEM = 0x335C7, FPS = 0x36BC58, G_LocalizedString = 0x33580,
type = 0x00, xOffset = 0x04, yOffset = 0x08, zOffset = 0x0C, targetEntNum = 0x10, fontScale = 0x14, fromFontScale = 0x18, fontScaleStartTime = 0x1C, fontScaleTime = 0x20, font = 0x24, alignOrg = 0x28, alignScreen = 0x2C, color = 0x30, fromColor = 0x34, fadeStartTime = 0x38, fadeTime = 0x3C, label = 0x40, text = 0x42, width = 0x44, height = 0x48, materialIndex = 0x4C, fromWidth = 0x50, fromHeight = 0x54, scaleStartTime = 0x58, scaleTime = 0x5C, fromX = 0x60, fromY = 0x64, fromAlignOrg = 0x68, fromAlignScreen = 0x6C, moveStartTime = 0x70, moveTime = 0x74, time = 0x78, duration = 0x7C, value = 0x80, sort = 0x88, glowColor = 0x8C, fxBirthTime = 0x90, fxLetterTime = 0x94, fxDecayStartTime = 0x98, fxDecayDuration = 0x9C, soundID = 0xA0, flags = 0xA4, clientOffset = 0xA8;
}
public static int getLevelTime()
{
return PS3.Extension.ReadInt32(0xdb5a44);
}
public static void SetGlow(uint elemIndex, int r, int g, int b, int a)
{ uint num = HElems.ELEM + (elemIndex * 0xb8); PS3.SetMemory(num + HElems.glowColor, RGBA(r, g, b, a));
}
public static void Enable_Cacher()
{ PS3.SetMemory(0x2100000, new byte[32]); PS3.SetMemory(0x2105000, new byte[32]); PS3.SetMemory(0x36BC58, new byte[] { 0x3C, 0x60, 0x02, 0x10, 0x80, 0x83, 0x00, 0x00, 0x2C, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x8C, 0x4B, 0xCC, 0x79, 0x19, 0x3C, 0x80, 0x02, 0x10, 0x90, 0x64, 0x50, 0x00, 0x38, 0x60, 0x00, 0x00, 0x90, 0x64, 0x00, 0x00, 0x48, 0x00, 0x00, 0x74, 0x3B, 0xE4, 0xBB, 0xBC, 0x38, 0x80, 0x00, 0x00 }); PS3.SetMemory(0x335C7, new byte[] { 0x01 });
}
public static void ActivateIndex(int index, int type)
{
byte[] Typ = BitConverter.GetBytes(type);
Array.Reverse(Typ); PS3.SetMemory(Hud.HElems.ELEM + 0xb8 * (uint)index, Typ);
}
public static byte[] ToHexFloat(float Axis)
{
byte[] bytes = BitConverter.GetBytes(Axis);
Array.Reverse(bytes);
return bytes;
}
public static byte[] RGBA(decimal R, decimal G, decimal B, decimal A)
{ byte[] RGBA = new byte[4]; byte[] RVal = BitConverter.GetBytes(Convert.ToInt32(R)); byte[] GVal = BitConverter.GetBytes(Convert.ToInt32(G)); byte[] BVal = BitConverter.GetBytes(Convert.ToInt32(B)); byte[] AVal = BitConverter.GetBytes(Convert.ToInt32(A)); RGBA[0] = RVal[0]; RGBA[1] = GVal[0]; RGBA[2] = BVal[0]; RGBA[3] = AVal[0];
return RGBA;
}
//StoreIcon
public static void StoreIcon(int elemIndex, uint client, int shader, int width, int height, float x, float y, uint align, float sort, int r, int g, int b, int a)
{ uint offset = (uint) (0xD87808 + (elemIndex * 0xb8)); PS3.SetMemory(offset, new byte[0xb8]); byte[] buffer = new byte[4]; buffer[3] = 4; PS3.SetMemory(offset, buffer); PS3.Extension.WriteInt32(offset + HElems.materialIndex, shader); PS3.Extension.WriteInt32(offset + HElems.clientOffset, (int) client); PS3.Extension.WriteInt32(offset + HElems.width, width); PS3.Extension.WriteInt32(offset + HElems.height, height); PS3.Extension.WriteInt32(offset + HElems.alignScreen, 0); PS3.Extension.WriteInt32(offset + HElems.alignOrg, 0); PS3.Extension.WriteFloat(offset + HElems.xOffset, x); PS3.Extension.WriteFloat(offset + HElems.yOffset, y); PS3.SetMemory(offset + HElems.color, RGBA(r, g, b, a));
}
private byte[] CacheString(string Text)
{ PS3.SetMemory(0x2100000, Encoding.ASCII.GetBytes(Text + "\0")); byte[] result = new byte[4]; Thread.Sleep(50); PS3.GetMemory(0x2105000, result);
return result;
}
//StoreTextElem
public static void StoreTextElem(int elemIndex, int client, string Text, short font, float fontSize, float x, float y, uint align, float sort, int r, int g, int b, int a)
{ uint offset = HElems.ELEM + (Convert.ToUInt32(elemIndex) * 0xb8); PS3.SetMemory(offset, new byte[0xb8]); byte[] buffer = new byte[4]; buffer[3] = 1; PS3.SetMemory(offset, buffer); PS3.Extension.WriteInt16(offset + HElems.text, G_LocalizedStringIndex(Text)); PS3.Extension.WriteInt32(offset + HElems.font, font); PS3.Extension.WriteInt32(offset + HElems.clientOffset, client); PS3.Extension.WriteFloat(offset + HElems.fontScale, fontSize); PS3.Extension.WriteFloat(offset + HElems.xOffset, x); PS3.Extension.WriteFloat(offset + HElems.yOffset, y); PS3.SetMemory(offset + HElems.color, RGBA(r, g, b, a));
}
//doTypewriter
public static void doTypeWriter(uint ElemIndex, int client, string text, double fontScale, short font, float X, float Y, int fxLetterTime, int fxDecayStartTime, int fxDecayDuration, int r, int g, int b, int a, int r1, int b1, int g1, int a1)
{ uint offset = HElems.ELEM + (Convert.ToUInt32(ElemIndex) * 0xb8); PS3.SetMemory(offset, new byte[0xb8]); byte[] buffer = new byte[4]; buffer[3] = 1; PS3.SetMemory(offset, buffer); PS3.Extension.WriteInt16(offset + HElems.text, G_LocalizedStringIndex(text)); PS3.Extension.WriteInt16(offset + HElems.font, font); PS3.Extension.WriteInt32(offset + HElems.clientOffset, client); PS3.Extension.WriteInt16(offset + HElems.alignScreen, 0); PS3.Extension.WriteInt16(offset + HElems.alignOrg, 0); PS3.Extension.WriteFloat(offset + HElems.fontScale, (float) fontScale); PS3.Extension.WriteFloat(offset + HElems.xOffset, X); PS3.Extension.WriteFloat(offset + HElems.yOffset, Y); PS3.SetMemory(offset + HElems.color, RGBA(r, g, b, a)); PS3.SetMemory(offset + HElems.glowColor, RGBA(r1, g1, b1, a1)); PS3.Extension.WriteInt32(offset + HElems.fxBirthTime, getLevelTime()); PS3.Extension.WriteInt32(offset + HElems.fxLetterTime, fxLetterTime); PS3.Extension.WriteInt32(offset + HElems.fxDecayStartTime, fxDecayStartTime); PS3.Extension.WriteInt32(offset + HElems.fxDecayDuration, fxDecayDuration);
}
public static uint MoveOverTime(uint elemIndex, short Time, float X, float Y)
{ uint Elem = 0xD87808 + (elemIndex) * 0xB8; PS3.Extension.WriteFloat(Elem + Hud.HElems.fromX, PS3.Extension.ReadFloat(Elem + Hud.HElems.xOffset)); PS3.Extension.WriteFloat(Elem + Hud.HElems.fromY, PS3.Extension.ReadFloat(Elem + Hud.HElems.yOffset)); PS3.Extension.WriteInt32(Elem + Hud.HElems.moveTime, Time); PS3.Extension.WriteInt32(Elem + Hud.HElems.moveStartTime, getLevelTime()); PS3.Extension.WriteFloat(Elem + Hud.HElems.xOffset, X); PS3.Extension.WriteFloat(Elem + Hud.HElems.yOffset, Y);
return Elem;
}
public static void ChangeFontScaleOverTime(uint elemIndex, short Time, double OldFont, double NewFont)
{ uint Elem = 0xD87808 + (elemIndex) * 0xB8; PS3.Extension.WriteFloat(Elem + HElems.fromFontScale, (float)OldFont);//fromFontScale PS3.Extension.WriteUInt32(Elem + HElems.fontScaleStartTime, (UInt32)getLevelTime());//fontScaleStartTime PS3.Extension.WriteInt32(Elem + HElems.fontScaleTime, Time);//fontScaleTime PS3.Extension.WriteFloat(Elem + HElems.fontScale, (float)NewFont);
}
public static void ScaleOverTime(uint elemIndex, short Time, short Width, short Height)
{ uint Elem = 0xD87808 + (elemIndex) * 0xB8; PS3.Extension.WriteInt32(Elem + HElems.fromHeight, PS3.Extension.ReadInt16(Elem + HElems.height));//From Height PS3.Extension.WriteInt32(Elem + HElems.fromWidth, PS3.Extension.ReadInt16(Elem + HElems.width));//from Width PS3.Extension.WriteInt32(Elem + HElems.scaleTime, Time); PS3.Extension.WriteInt32(Elem + HElems.scaleStartTime, getLevelTime());//MoveStartTime PS3.Extension.WriteInt16(Elem + HElems.height, Height); PS3.Extension.WriteInt16(Elem + HElems.width, Width);
}
public static void FadeOverTime(uint elem, short Time, int R, int G, int B, int A)
{ uint Elem = 0xD87808 + (elem) * 0xB8; byte[] RVal = PS3.GetMemory(Elem + HElems.color, 1);//Gets Current RVal byte[] GVal = PS3.GetMemory(Elem + HElems.color + 0x01, 1);//Gets Current GVal byte[] BVal = PS3.GetMemory(Elem + HElems.color + 0x02, 1);//Gets Current BVal byte[] AVal = PS3.GetMemory(Elem + HElems.color + 0x03, 1);//Gets Current AVal PS3.SetMemory(Elem + HElems.fromColor, RVal);//Sets Current RVal PS3.SetMemory(Elem + HElems.fromColor + 0x01, GVal);//Sets Current GVal PS3.SetMemory(Elem + HElems.fromColor + 0x02, BVal);//Sets Current BVal PS3.SetMemory(Elem + HElems.fromColor + 0x03, AVal);//Sets Current AVal PS3.Extension.WriteUInt32(Elem + HElems.fadeStartTime, (UInt32)getLevelTime()); PS3.Extension.WriteInt32(Elem + HElems.fadeTime, Time);//Fade Time PS3.SetMemory(Elem + HElems.color, RGBA(R, G, B, A));//Set New Colors }
public static byte[] UInt32ToBytes(uint input)
{ byte[] bytes = BitConverter.GetBytes(input);
Array.Reverse(bytes);
return bytes;
}
public static byte[] ReverseBytes(byte[] inArray)
{
Array.Reverse(inArray);
return inArray;
}
public static byte[] uintBytes(uint input)
{ byte[] data = BitConverter.GetBytes(input);
Array.Reverse(data);
return data;
}
}
Credits:
īTnDM- Update Huds Elements To 1.11 + 1.12
Bad Luck Brain - Huds + Help