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.Threading.Tasks;
- using System.Windows.Forms;
- using XDevkit;
- using Microsoft.Test.Xbox.XDRPC;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- private bool activeConnection;
- private NumericUpDown redboxclientid;
- private int redboxint;
- private uint ServerCommand = 0x822548c8;
- IXboxConsole XboxCon;
- private uint asd;
- public uint getPlayerState(int clientIndex)
- {
- if (this.activeConnection)
- {
- uint num;
- byte[] data = new byte[4];
- this.xbCon.DebugTarget.GetMemory((uint)((-2098186752 + (clientIndex * 640)) + 0x158), 4, data, out num);
- Array.Reverse(data);
- return BitConverter.ToUInt32(data, 0);
- }
- return 0;
- }
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- public class Form2 : Form
- {
- private NumericUpDown redboxclientid;
- private int redboxint;
- private Button button1;
- private Button button2;
- private Button button3;
- private Button button4;
- private Button button5;
- private Button button6;
- private Button button7;
- private Button button8;
- private Button button9;
- private Button button10;
- private Button button11;
- private Button button12;
- private Button button13;
- private Button button14;
- private int clientID;
- private int int1;
- private int int2;
- private int int3;
- }
- bool AC = false;
- IXboxManager xboxMgr;
- IXboxConsole xbCon;
- private uint xbConnection;
- int clientNum = 0;
- uint FunctionOffset = 0x822548C8;
- public void ConnectToDev()
- {
- string str;
- string str2;
- if (!this.activeConnection)
- {
- this.xboxMgr = (XboxManager)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("A5EB45D8-F3B6-49B9-984A-0D313AB60342")));
- this.xbCon = this.xboxMgr.OpenConsole(this.xboxMgr.DefaultConsole);
- try
- {
- this.xbConnection = this.xbCon.OpenConnection(null);
- }
- catch (Exception)
- {
- rtb("Could not connect to devkit" + xboxMgr.DefaultConsole);
- return;
- }
- if (this.xbCon.DebugTarget.IsDebuggerConnected(out str, out str2))
- {
- this.activeConnection = true;
- rtb("Connected to " + xboxMgr.DefaultConsole);
- this.xbCon.ConsoleType.GetHashCode();
- }
- else
- {
- this.xbCon.DebugTarget.ConnectAsDebugger("niggerjew", XboxDebugConnectFlags.Force);
- if (!this.xbCon.DebugTarget.IsDebuggerConnected(out str, out str2))
- {
- rtb("tried to connect to " + xboxMgr.DefaultConsole);
- }
- else
- {
- this.activeConnection = true;
- rtb("app: connected to " + xboxMgr.DefaultConsole);
- }
- }
- }
- else if (this.xbCon.DebugTarget.IsDebuggerConnected(out str, out str2))
- {
- rtb("Connection Already Active, no need to start a new one!" + xboxMgr.DefaultConsole);
- }
- else
- {
- this.activeConnection = false;
- this.ConnectToDev();
- }
- }
- public uint gct(int client)
- {
- return (this.getPlayerState(client) + 0x2d68);
- }
- public void rtb(string message)
- {
- richTextBox1.Text += message + "\n";
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- if (checkBox1.Checked == true)
- {
- axWindowsMediaPlayer1.Ctlcontrols.stop();
- }
- else if (checkBox1.Checked == false)
- {
- }
- }
- private void button8_Click(object sender, EventArgs e)
- {
- ConnectToDev();
- }
- private void button13_Click(object sender, EventArgs e)
- {
- int clientid = 0;
- this.redbox(clientid);
- this.SV_GameSendServerCommand(clientid, "c \"^2Given Red Box Wallhack!\"");
- }
- public void redbox(int clientid)
- {
- byte[] data = new byte[] { Convert.ToByte(0x10) };
- this.XboxCon.DebugTarget.SetMemory(this.getPlayerState(clientid) + 0x13, 1, data, out asd);
- }
- public void SV_GameSendServerCommand(int clientID, string command)
- {
- XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, this.ServerCommand);
- XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>((uint)clientID);
- XDRPCArgumentInfo<uint> info2 = new XDRPCArgumentInfo<uint>(1);
- XDRPCArrayArgumentInfo<byte[]> info3 = new XDRPCArrayArgumentInfo<byte[]>(Encoding.ASCII.GetBytes(command), ArgumentType.ByRef);
- ((IXboxConsole)this.XboxCon).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2, info3 });
- }
- }
- }
Add Comment
Please, Sign In to add comment