Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IXboxManager Manager;
- IXboxConsole Hooker;
- uint Hookernection;
- int isconnected = 0;
- uint offset;
- XboxDebugCommunicator xHooker;
- public void Connect()
- {
- string Hooker1;
- string Hooker2;
- try
- {
- if (isconnected == 0)
- {
- Manager = new XboxManager();
- Hooker = Manager.OpenConsole(Manager.DefaultConsole);
- try
- {
- Hookernection = Hooker.OpenConnection(null);
- xHooker = new XboxDebugCommunicator(Manager.DefaultConsole.ToString());
- }
- catch (Exception)
- {
- Form1.ActiveForm.Text = "No";
- MessageBox.Show("Connected Un-Successfully!");
- return;
- }
- if (Hooker.DebugTarget.IsDebuggerConnected(out Hooker1, out Hooker2) == true)
- {
- isconnected = 1;
- Form1.ActiveForm.Text = "yea";
- MessageBox.Show("Connected Successfully!");
- Hooker.DebugTarget.MemoryCacheEnabled = false;
- }
- else
- {
- isconnected = 1;
- Form1.ActiveForm.Text = "Yea";
- MessageBox.Show("Connected Successfully!");
- Hooker.DebugTarget.MemoryCacheEnabled = false;
- }
- }
- Hooker.DebugTarget.MemoryCacheEnabled = false;
- }
- catch (Exception asd)
- {
- MessageBox.Show(asd.ToString());
- }
- }
- public static float swap(float input)
- {
- byte[] tmpIn = BitConverter.GetBytes(input);
- byte[] tmpOut = new byte[4];
- tmpOut[0] = tmpIn[3];
- tmpOut[1] = tmpIn[2];
- tmpOut[2] = tmpIn[1];
- tmpOut[3] = tmpIn[0];
- return BitConverter.ToSingle(tmpOut, 0);
- }
- public uint getPlayerState(int clientIndex)
- {
- byte[] bytess = new byte[4];
- uint num;
- Hooker.DebugTarget.GetMemory(0x82F03600 + ((uint)clientIndex * 0x280) + 0x158, 4, bytess, out num);
- Array.Reverse(bytess);
- uint asd = BitConverter.ToUInt32(bytess, 0);
- return asd;
- }
- public uint gct(int client)
- {
- return (getPlayerState(client)+0x2D68);
- }
- byte[] button= new byte[8];
- byte[] xA = new byte[4];
- public uint GB(int clientID)
- {
- uint asd;
- Hooker.DebugTarget.GetMemory(gct(clientID) + 0x6C5, 4, xA, out asd);
- Hooker.DebugTarget.InvalidateMemoryCache(true, gct(clientID) + 0x6C5, 4);
- return System.BitConverter.ToUInt32(xA, 0);
- }
- decimal jetcount=(decimal)0.0;
- private void timer1_Tick(object sender, EventArgs e)
- {
- try
- {
- uint LB = GB(0);
- if (LB == 32768)
- {
- if (jetcount < 100)
- {
- decimal count = (decimal)2.5;
- jetcount+=count;
- byte[] datab; uint outnum;
- float a = (float)jetcount; datab = BitConverter.GetBytes(swap(a));
- Hooker.DebugTarget.SetMemory(getPlayerState(0) + 0x30, 4, datab, out outnum);
- }
- else
- {
- decimal count = (decimal)1.5;
- jetcount += count;
- byte[] datab; uint outnum;
- float a = (float)jetcount; datab = BitConverter.GetBytes(swap(a));
- Hooker.DebugTarget.SetMemory(getPlayerState(0) + 0x30, 4, datab, out outnum);
- }
- }
- else
- {
- if (jetcount > 0)
- jetcount = jetcount - 1;
- }
- }
- catch (Exception asd)
- {timer1.Stop(); MessageBox.Show(asd.ToString()); }
- }
Add Comment
Please, Sign In to add comment