Post: [Updated/1.10] Hud Elements
03-05-2014, 03:55 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I updated hud elements today aswell. It's everything you need for a mod menu now. Goodluck!

These scripts were originally Bad Luck Brians for 1.05, I don't use my hud elements like this so yeah... here you go.

Thanks to Shark the ppc is fixed :p


Hud Elements 1.10

    
public static class Hud
{
public static class HElems
{
public static uint //0xb8 4 = icon, 1 = text

ELEM = 0xD87888, //patched
FIX_ELEM = 0x335c7,
FPS = 0x36B260,

xOffset = 0x04,
yOffset = 0x08,
textOffset = 0x40,
fontOffset = 0x24,
fontSizeOffset = 0x14, //43 30 ..
colorOffset = 0x30,
relativeOffset = 0x28, //no idea idc.. set it to 0
widthOffset = 0x44,
heightOffset = 0x48,
shaderOffset = 0x4C,
GlowColor = 0x8C,
clientOffset = 0x10,
alignOffset = 0x2C; //set it to 0 also..


}


public static void Enable_Cacher()
{
PS3.SetMemory(0x2100000, new byte[32]);
PS3.SetMemory(0x2106000, new byte[32]);
PS3.SetMemory(0x36B260, new byte[] { 0x3C, 0x60, 0x02, 0x10, 0x80, 0x83, 0x00, 0x00, 0x2C, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x8C, 0x4B, 0xCC, 0x83, 0x11, 0x3C, 0x80, 0x02, 0x10, 0x90, 0x64, 0x60, 0x00, 0x38, 0x60, 0x00, 0x00, 0x90, 0x64, 0x00, 0x00, 0x48, 0x00, 0x00, 0x74 });
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;
}


public static void StoreIcon(uint elemIndex, decimal client, int shader, int width, int height, float x, float y, uint align, float sort, int r, int g, int b, int a)
{
uint elem = HElems.ELEM + ((elemIndex) * 0xbCool Man (aka Tustin);
byte[] ClientID = ReverseBytes(BitConverter.GetBytes(Convert.ToInt32(client)));
PS3.SetMemory(elem, new byte[0xB8]);
PS3.SetMemory(elem, new byte[] { 0x00, 0x00, 0x00, 0x04 });
PS3.SetMemory(elem + HElems.shaderOffset, ReverseBytes(BitConverter.GetBytes(shader)));
PS3.SetMemory(elem + HElems.heightOffset, ReverseBytes(BitConverter.GetBytes(height)));
PS3.SetMemory(elem + HElems.widthOffset, ReverseBytes(BitConverter.GetBytes(width)));
PS3.SetMemory(elem + HElems.alignOffset, ReverseBytes(BitConverter.GetBytes(0)));
PS3.SetMemory(elem + HElems.relativeOffset, ReverseBytes(BitConverter.GetBytes(0)));
PS3.SetMemory(elem + HElems.xOffset, ToHexFloat(x));
PS3.SetMemory(elem + HElems.yOffset, ToHexFloat(y));
PS3.SetMemory(elem + HElems.colorOffset, RGBA(r, g, b, a));
PS3.SetMemory(elem + HElems.clientOffset, ClientID);


}

public static byte[] CacheString(string Text)
{
PS3.SetMemory(HElems.FIX_ELEM, new byte[] { 0x01 }); //must patch this to make it work
PS3.SetMemory(0x2100000, Encoding.ASCII.GetBytes(Text + "\0"));
byte[] result = new byte[6];
Thread.Sleep(10);
PS3.GetMemory(0x2106000, ref result);
return result;
}



public static void StoreTextElem(uint elemIndex, int client, string Text, int font, float fontScale, int x, int y, uint align, float sort, int r, int g, int b, int a, int r1, int g1, int b1, int a1)
{
uint elem = HElems.ELEM + ((elemIndex) * 0xBCool Man (aka Tustin);
byte[] ClientID = ReverseBytes(BitConverter.GetBytes(client));
PS3.SetMemory(elem, new byte[0xB4]);
PS3.SetMemory(elem, new byte[] { 0x00, 0x00, 0x00, 0x01 });
PS3.SetMemory(elem + HElems.textOffset, CacheString(Text));
PS3.SetMemory(elem + HElems.fontOffset, ReverseBytes(BitConverter.GetBytes(Convert.ToInt32(font))));
PS3.SetMemory(elem + HElems.alignOffset, ReverseBytes(BitConverter.GetBytes(Convert.ToInt32(0))));
PS3.SetMemory(elem + HElems.relativeOffset, ReverseBytes(BitConverter.GetBytes(0)));
PS3.SetMemory(elem + HElems.fontSizeOffset, ToHexFloat(fontScale));
PS3.SetMemory(elem + HElems.xOffset, ToHexFloat(x));
PS3.SetMemory(elem + HElems.yOffset, ToHexFloat(y));
PS3.SetMemory(elem + HElems.colorOffset, RGBA(r, g, b, a));
PS3.SetMemory(elem + HElems.GlowColor, RGBA(r1, g1, b1, a1));
PS3.SetMemory(elem + HElems.clientOffset, ClientID);


}

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;
}

}


And before you people flame and say I got this from someone else, I didn't, Bad Luck Brian Taught me how to update them from 1.06. I did this on my own, except the offsets for the hud struct :p

Credits:
    
Bad Luck Brian - Teaching PPC, and how to cache strings
Shark - Fixing PPC Bug :p
SC58
Me - Updating from 1.07 to 1.10


Here is everything for you to make a mod menu

You must login or register to view this content.
You must login or register to view this content.
Last edited by Black Panther ; 04-04-2014 at 11:27 AM. Reason: Updated to 1.10

The following 12 users say thank you to Black Panther for this useful post:

Dannie Fresh, ResistTheJamsha, M-alShammary, Mango_Knife, Notorious, xProvXKiller, RatchetBooty, SnaY, Taylors Bish, Winter, x_action_x, xHostModer
04-04-2014, 09:56 AM #38
Shark
Retired.
Originally posted by AlmightySo View Post
Updated
But kinda of buggy :/


i see what you mean, settext is throwing all sorts of random shit at me, instead of the actual string its throwing strings at me from the game ill try write my own function and see what happens :fa:
04-04-2014, 10:11 AM #39
Originally posted by sharkbait263 View Post
i see what you mean, settext is throwing all sorts of random shit at me, instead of the actual string its throwing strings at me from the game ill try write my own function and see what happens :fa:


Yeah I mean my string that I write eventually shows up but after like a lot of different strings from the game show :/ and I updated because people asked me to
04-04-2014, 10:25 AM #40
Shark
Retired.
Originally posted by AlmightySo View Post
Yeah I mean my string that I write eventually shows up but after like a lot of different strings from the game show :/ and I updated because people asked me to


hm i tried changing the return address same thing happens, only way I can seem to fix it is by using rpc to set it
04-04-2014, 10:36 AM #41
Shark
Retired.
Originally posted by AlmightySo View Post
Maybe during this week.


here m8 i fixed it

    public static void Enable_Huds()
{
PS3.SetMemory(0x2100000, new byte[32]);
PS3.SetMemory(0x2106000, new byte[32]);
PS3.SetMemory(0x36B260, new byte[] { 0x3C, 0x60, 0x02, 0x10, 0x80, 0x83, 0x00, 0x00, 0x2C, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x8C, 0x4B, 0xCC, 0x83, 0x11, 0x3C, 0x80, 0x02, 0x10, 0x90, 0x64, 0x60, 0x00, 0x38, 0x60, 0x00, 0x00, 0x90, 0x64, 0x00, 0x00, 0x48, 0x00, 0x00, 0x74 });
PS3.SetMemory(0x335C7, new byte[] { 0x01 });
}

public static short SetText(string Text)
{
PS3.SetMemory(0x2100000, Encoding.ASCII.GetBytes(Text + "\0"));
System.Threading.Thread.Sleep(100);
return (short)PS3.Extension.ReadInt32(0x2106000);
}


the problem was you were using the wrong offset
You must login or register to view this content.

The following 3 users say thank you to Shark for this useful post:

MegaMister, xHostModer
04-04-2014, 11:15 AM #42
Originally posted by sharkbait263 View Post
here m8 i fixed it

    public static void Enable_Huds()
{
PS3.SetMemory(0x2100000, new byte[32]);
PS3.SetMemory(0x2106000, new byte[32]);
PS3.SetMemory(0x36B260, new byte[] { 0x3C, 0x60, 0x02, 0x10, 0x80, 0x83, 0x00, 0x00, 0x2C, 0x04, 0x00, 0x00, 0x41, 0x82, 0x00, 0x8C, 0x4B, 0xCC, 0x83, 0x11, 0x3C, 0x80, 0x02, 0x10, 0x90, 0x64, 0x60, 0x00, 0x38, 0x60, 0x00, 0x00, 0x90, 0x64, 0x00, 0x00, 0x48, 0x00, 0x00, 0x74 });
PS3.SetMemory(0x335C7, new byte[] { 0x01 });
}

public static short SetText(string Text)
{
PS3.SetMemory(0x2100000, Encoding.ASCII.GetBytes(Text + "\0"));
System.Threading.Thread.Sleep(100);
return (short)PS3.Extension.ReadInt32(0x2106000);
}


the problem was you were using the wrong offset
You must login or register to view this content.


Thanks lol. :p My idc was wrong

The following user thanked Black Panther for this useful post:

xHostModer
04-04-2014, 02:44 PM #43
xHostModer
Little One
Can't Get Text Shit Working
04-04-2014, 03:48 PM #44
xHostModer
Little One
It Gets Me Random Text xD
04-04-2014, 04:10 PM #45
And what's about Button [ Send Typewriter ]
04-05-2014, 05:37 PM #46
Thanks, Welcome to my menu credit's!! Smile

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo