Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Threading;
- using XRPCLib;
- namespace HudE
- {
- public partial class Form1 : Form
- {
- XRPC Jtag = new XRPC();
- Random rnd = new Random();
- private static byte[] myBuffer = new byte[0x20];
- Thread t;
- public Form1()
- {
- InitializeComponent();
- }
- #region HUD
- public class gameAddresses
- {
- public static uint
- locString = 0x82388668,
- material = 0x82388A88,
- elem = 0x83541618,
- type = 0x6D,
- xOffset = 0x0,
- yOffset = 0x4,
- textOffset = 0x62,
- fontSizeOffset = 12,
- colorOffset = 0x18,
- relativeOffset = 0x72,
- widthOffset = 0x58,
- heightOffset = 90,
- shaderOffset = 0x74,
- alignOffset = 0x72,
- clientOffset = 0x7C,
- sortOffset = 0x20,
- glowOffset = 0x44,
- sort = 0x32;
- public static float
- fromX = 0,
- fromY = 0,
- fromAlignOrg = 0,
- fromAlignScreen = 0;
- }
- /*
- public uint createElem(int client)
- {
- return Jtag.Call(gameAddresses.elem, client, 0);
- }*/
- public uint createElem(int client)
- {
- uint CreateElem = Jtag.Call(gameAddresses.elem, client, 0);
- Jtag.SetMemory(CreateElem + 0x7C, ReverseBytes(BitConverter.GetBytes(client)));
- return CreateElem;
- }
- public uint spawnElem(int client, uint elemAddress)
- {
- Jtag.SetMemory(elemAddress + 0xA8, ReverseBytes(BitConverter.GetBytes(client)));
- return elemAddress;
- }
- public uint createText(string text)
- {
- return Jtag.Call(gameAddresses.locString, text);
- }
- public uint getMaterialIndex(string material)
- {
- return Jtag.Call(gameAddresses.material, material);
- }
- public byte[] uintBytes(uint input)
- {
- byte[] data = BitConverter.GetBytes(input);
- Array.Reverse(data);
- return data;
- }
- public byte[] ReverseBytes(byte[] inArray)
- {
- byte temp;
- int highCtr = inArray.Length - 1;
- for (int ctr = 0; ctr < inArray.Length / 2; ctr++)
- {
- temp = inArray[ctr];
- inArray[ctr] = inArray[highCtr];
- inArray[highCtr] = temp;
- highCtr -= 1;
- }
- return inArray;
- }
- public void setIcon(int client, uint elem, uint shader, int width, int height, float x, float y, uint align, float sort = 0, int r = 84, int g = 84, int b = 84, int a = 215)
- {
- Jtag.SetMemory(elem + gameAddresses.clientOffset, ReverseBytes(BitConverter.GetBytes((byte)client)));
- byte[] myelem = new byte[] {
- 0x42, 0x48, 0x00, 0x00, 0x42, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x29, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0x80, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x46,
- 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x21, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00 };
- Jtag.SetMemory(elem, myelem);
- byte[] sorts = ReverseBytes(BitConverter.GetBytes(sort));
- Jtag.SetMemory(elem + gameAddresses.sort, new byte[] { sorts[0], sorts[1] });
- Jtag.SetMemory(elem + gameAddresses.relativeOffset, new byte[] { (byte)5 });
- Jtag.SetMemory(elem + gameAddresses.relativeOffset + 1, new byte[] { (byte)align });
- byte[] heights = BitConverter.GetBytes(height);
- Jtag.SetMemory(elem + gameAddresses.heightOffset - 2, ReverseBytes(heights));
- byte[] widths = BitConverter.GetBytes(width);
- Jtag.SetMemory(elem + gameAddresses.widthOffset - 2, ReverseBytes(widths));
- Jtag.SetMemory(elem + gameAddresses.shaderOffset, new byte[] { (byte)shader });
- Jtag.SetMemory(elem + gameAddresses.colorOffset, new byte[] { BitConverter.GetBytes(r)[0], BitConverter.GetBytes(g)[0], BitConverter.GetBytes(b)[0], BitConverter.GetBytes(a)[0] });
- Jtag.SetMemory(elem + gameAddresses.xOffset, ReverseBytes(BitConverter.GetBytes(x)));
- Jtag.SetMemory(elem + gameAddresses.yOffset, ReverseBytes(BitConverter.GetBytes(y)));
- }
- public void SetText(int client, uint elem, byte[] text, float fontScale, float x, float y, uint align, int r = 255, int g = 255, int b = 255, int a = 255, int GlowR = 255, int GlowG = 255, int GlowB = 255, int GlowA = 255)
- {
- Jtag.SetMemory(elem + 0x7c, ReverseBytes(BitConverter.GetBytes(client)));
- //byte[] myelem = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x42, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x6B, 0x08, 0x00, 0x01, 0x80, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x64, 0xEA, 0x60, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
- //remote.SetMemory(elem, myelem);
- Jtag.SetMemory(elem + gameAddresses.type, new byte[] { 0x00, 0x00, 0x00, 0x01 });
- Jtag.SetMemory(gameAddresses.sort + elem, new byte[] { (byte)0x0A, (byte)0xFF });
- Jtag.SetMemory(elem + gameAddresses.textOffset, text);
- Jtag.SetMemory(elem + gameAddresses.relativeOffset, new byte[] { (byte)5 });
- Jtag.SetMemory(elem + gameAddresses.relativeOffset + 1, new byte[] { (byte)align });
- Jtag.SetMemory(elem + gameAddresses.textOffset + 4, new byte[] { 0x40, 0x00 });
- Jtag.SetMemory(elem + gameAddresses.fontSizeOffset, ReverseBytes(BitConverter.GetBytes(fontScale)));
- Jtag.SetMemory(elem + gameAddresses.xOffset, ReverseBytes(BitConverter.GetBytes(x)));
- Jtag.SetMemory(elem + gameAddresses.yOffset, ReverseBytes(BitConverter.GetBytes(y)));
- Jtag.SetMemory(elem + gameAddresses.colorOffset, new byte[] { BitConverter.GetBytes(r)[0], BitConverter.GetBytes(g)[0], BitConverter.GetBytes(b)[0], BitConverter.GetBytes(a)[0] });
- //remote.SetMemory(elem + gameAddresses.GlowColor, new byte[] { BitConverter.GetBytes(GlowR)[0], BitConverter.GetBytes(GlowG)[0], BitConverter.GetBytes(GlowB)[0], BitConverter.GetBytes(GlowA)[0] });
- }
- #endregion
- class Offsets
- {
- public static uint
- SENDSERVERCOMMAND = 0x8242F958,
- CBUF_ADDTEXT = 0x82401540;
- }
- class Buttons
- {
- public static uint
- LB = 256,
- RB = 512,
- RT = 128,
- LT = 2147487744,
- LS = 1088,
- RS = 32,
- Y = 134217728,
- X = 4,
- A = 8192,
- B = 32768,
- Allonger = 32768,
- AllongerRS = 32800;
- }
- float move = -40;
- float Fx = 0;
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Jtag.Connect();
- if (Jtag.activeConnection)
- {
- textBox1.Text = ("Connected");
- }
- else
- {
- textBox1.Text = ("Failed");
- }
- }
- uint elemshader = 0;
- uint shader = 0;
- uint elem = 0;
- string elemtext = "";
- void Newsbar()
- {
- for (int j = 0; j <= 17; j++)
- {
- elemshader = createElem(1);
- shader = getMaterialIndex("black");
- setIcon(1, elemshader, shader, 2000, 50, 320, 400, 1, 0, 2);
- spawnElem(1, elemshader);
- elem = createElem(j);
- SetText(j, elem, uintBytes(createText(elemtext)), 10, 10, 435, 0, 255);
- spawnElem(j, elem);
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- Thread n = new Thread(Newsbar);
- elemtext = HUD_0.Text;
- n.Start();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment