Guest User

Untitled

a guest
Jan 16th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using XDevkit;
  11. using Microsoft.Test.Xbox.XDRPC;
  12.  
  13. namespace WindowsFormsApplication1
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         private bool activeConnection;
  18.         private NumericUpDown redboxclientid;
  19.         private int redboxint;
  20.         private uint ServerCommand = 0x822548c8;
  21.         IXboxConsole XboxCon;
  22.         private uint asd;
  23.  
  24.         public uint getPlayerState(int clientIndex)
  25.         {
  26.             if (this.activeConnection)
  27.             {
  28.                 uint num;
  29.                 byte[] data = new byte[4];
  30.                 this.xbCon.DebugTarget.GetMemory((uint)((-2098186752 + (clientIndex * 640)) + 0x158), 4, data, out num);
  31.                 Array.Reverse(data);
  32.                 return BitConverter.ToUInt32(data, 0);
  33.             }
  34.             return 0;
  35.         }
  36.  
  37.         public Form1()
  38.         {
  39.             InitializeComponent();
  40.  
  41.  
  42.         }
  43.  
  44.         private void Form1_Load(object sender, EventArgs e)
  45.         {
  46.            
  47.         }
  48.         public class Form2 : Form
  49.         {
  50.             private NumericUpDown redboxclientid;
  51.             private int redboxint;
  52.             private Button button1;
  53.             private Button button2;
  54.             private Button button3;
  55.             private Button button4;
  56.             private Button button5;
  57.             private Button button6;
  58.             private Button button7;
  59.             private Button button8;
  60.             private Button button9;
  61.             private Button button10;
  62.             private Button button11;
  63.             private Button button12;
  64.             private Button button13;
  65.             private Button button14;
  66.             private int clientID;
  67.             private int int1;
  68.             private int int2;
  69.             private int int3;
  70.         }
  71.  
  72.  
  73.         bool AC = false;
  74.         IXboxManager xboxMgr;
  75.         IXboxConsole xbCon;
  76.         private uint xbConnection;
  77.         int clientNum = 0;
  78.         uint FunctionOffset = 0x822548C8;
  79.  
  80.         public void ConnectToDev()
  81.         {
  82.             string str;
  83.             string str2;
  84.             if (!this.activeConnection)
  85.             {
  86.                 this.xboxMgr = (XboxManager)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("A5EB45D8-F3B6-49B9-984A-0D313AB60342")));
  87.                 this.xbCon = this.xboxMgr.OpenConsole(this.xboxMgr.DefaultConsole);
  88.                 try
  89.                 {
  90.                     this.xbConnection = this.xbCon.OpenConnection(null);
  91.                 }
  92.                 catch (Exception)
  93.                 {
  94.                     rtb("Could not connect to devkit" + xboxMgr.DefaultConsole);
  95.                     return;
  96.                 }
  97.                 if (this.xbCon.DebugTarget.IsDebuggerConnected(out str, out str2))
  98.                 {
  99.                     this.activeConnection = true;
  100.                     rtb("Connected to " + xboxMgr.DefaultConsole);
  101.                     this.xbCon.ConsoleType.GetHashCode();
  102.                 }
  103.                 else
  104.                 {
  105.                     this.xbCon.DebugTarget.ConnectAsDebugger("niggerjew", XboxDebugConnectFlags.Force);
  106.                     if (!this.xbCon.DebugTarget.IsDebuggerConnected(out str, out str2))
  107.                     {
  108.                         rtb("tried to connect to  " + xboxMgr.DefaultConsole);
  109.                     }
  110.                     else
  111.                     {
  112.                         this.activeConnection = true;
  113.                         rtb("app: connected to " + xboxMgr.DefaultConsole);
  114.                     }
  115.                 }
  116.             }
  117.             else if (this.xbCon.DebugTarget.IsDebuggerConnected(out str, out str2))
  118.             {
  119.                 rtb("Connection Already Active, no need to start a new one!" + xboxMgr.DefaultConsole);
  120.             }
  121.             else
  122.             {
  123.                 this.activeConnection = false;
  124.                 this.ConnectToDev();
  125.             }
  126.         }
  127.  
  128.  
  129.         public uint gct(int client)
  130.             {
  131.                 return (this.getPlayerState(client) + 0x2d68);
  132.             }
  133.  
  134.         public void rtb(string message)
  135.         {
  136.             richTextBox1.Text += message + "\n";
  137.         }
  138.  
  139.         private void checkBox1_CheckedChanged(object sender, EventArgs e)
  140.         {
  141.             if (checkBox1.Checked == true)
  142.             {
  143.                 axWindowsMediaPlayer1.Ctlcontrols.stop();
  144.             }
  145.             else if (checkBox1.Checked == false)
  146.             {
  147.  
  148.             }
  149.         }
  150.  
  151.         private void button8_Click(object sender, EventArgs e)
  152.         {
  153.             ConnectToDev();
  154.         }
  155.  
  156.         private void button13_Click(object sender, EventArgs e)
  157.         {
  158.             int clientid = 0;
  159.             this.redbox(clientid);
  160.             this.SV_GameSendServerCommand(clientid, "c \"^2Given Red Box Wallhack!\"");
  161.         }
  162.  
  163.         public void redbox(int clientid)
  164.         {
  165.             byte[] data = new byte[] { Convert.ToByte(0x10) };
  166.             this.XboxCon.DebugTarget.SetMemory(this.getPlayerState(clientid) + 0x13, 1, data, out asd);
  167.         }
  168.         public void SV_GameSendServerCommand(int clientID, string command)
  169.         {
  170.             XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, this.ServerCommand);
  171.             XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>((uint)clientID);
  172.             XDRPCArgumentInfo<uint> info2 = new XDRPCArgumentInfo<uint>(1);
  173.             XDRPCArrayArgumentInfo<byte[]> info3 = new XDRPCArrayArgumentInfo<byte[]>(Encoding.ASCII.GetBytes(command), ArgumentType.ByRef);
  174.             ((IXboxConsole)this.XboxCon).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2, info3 });
  175.         }
  176.  
  177.  
  178.  
  179.  
  180.     }
  181.  
  182. }
Add Comment
Please, Sign In to add comment