iAmHooker

Basic Jetpack source - Hooker

Aug 19th, 2012
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.41 KB | None | 0 0
  1.   IXboxManager Manager;
  2.         IXboxConsole Hooker;
  3.         uint Hookernection;
  4.         int isconnected = 0;
  5.         uint offset;
  6.         XboxDebugCommunicator xHooker;
  7.         public void Connect()
  8.         {
  9.  
  10.             string Hooker1;
  11.             string Hooker2;
  12.             try
  13.             {
  14.                 if (isconnected == 0)
  15.                 {
  16.                     Manager = new XboxManager();
  17.                     Hooker = Manager.OpenConsole(Manager.DefaultConsole);
  18.                     try
  19.                     {
  20.                         Hookernection = Hooker.OpenConnection(null);
  21.                          xHooker = new XboxDebugCommunicator(Manager.DefaultConsole.ToString());
  22.                     }
  23.                     catch (Exception)
  24.                     {
  25.                         Form1.ActiveForm.Text = "No";
  26.                         MessageBox.Show("Connected Un-Successfully!");
  27.                         return;
  28.                     }
  29.  
  30.                     if (Hooker.DebugTarget.IsDebuggerConnected(out Hooker1, out Hooker2) == true)
  31.                     {
  32.                         isconnected = 1;
  33.                         Form1.ActiveForm.Text = "yea";
  34.                         MessageBox.Show("Connected Successfully!");
  35.                         Hooker.DebugTarget.MemoryCacheEnabled = false;
  36.                     }
  37.                     else
  38.                     {
  39.                         isconnected = 1;
  40.                         Form1.ActiveForm.Text = "Yea";
  41.                         MessageBox.Show("Connected Successfully!");
  42.                         Hooker.DebugTarget.MemoryCacheEnabled = false;
  43.                     }
  44.                 }
  45.                 Hooker.DebugTarget.MemoryCacheEnabled = false;
  46.             }
  47.             catch (Exception asd)
  48.             {
  49.                MessageBox.Show(asd.ToString());
  50.             }
  51.  
  52.         }  
  53.  
  54.  
  55.        public static float swap(float input)
  56.         {
  57.             byte[] tmpIn = BitConverter.GetBytes(input);
  58.             byte[] tmpOut = new byte[4];
  59.             tmpOut[0] = tmpIn[3];
  60.             tmpOut[1] = tmpIn[2];
  61.             tmpOut[2] = tmpIn[1];
  62.             tmpOut[3] = tmpIn[0];
  63.             return BitConverter.ToSingle(tmpOut, 0);
  64.         }
  65.  
  66. public uint getPlayerState(int clientIndex)
  67.         {
  68.                 byte[] bytess = new byte[4];
  69.                 uint num;
  70.                 Hooker.DebugTarget.GetMemory(0x82F03600 + ((uint)clientIndex * 0x280) + 0x158, 4, bytess, out num);
  71.                 Array.Reverse(bytess);
  72.                 uint asd = BitConverter.ToUInt32(bytess, 0);
  73.                 return asd;
  74.         }
  75.         public uint gct(int client)
  76.         {
  77.             return (getPlayerState(client)+0x2D68);
  78.         }  
  79.  
  80.  
  81.  byte[] button= new byte[8];
  82.     byte[] xA = new byte[4];
  83.         public uint GB(int clientID)
  84.         {
  85.             uint asd;
  86.             Hooker.DebugTarget.GetMemory(gct(clientID) + 0x6C5, 4, xA, out asd);
  87.             Hooker.DebugTarget.InvalidateMemoryCache(true, gct(clientID) + 0x6C5, 4);
  88.            return System.BitConverter.ToUInt32(xA, 0);
  89.         }
  90.         decimal jetcount=(decimal)0.0;
  91.         private void timer1_Tick(object sender, EventArgs e)
  92.         {
  93.             try
  94.             {
  95.                 uint LB = GB(0);
  96.                 if (LB == 32768)
  97.                 {
  98.                     if (jetcount < 100)
  99.                     {
  100.                         decimal count = (decimal)2.5;
  101.                         jetcount+=count;
  102.                         byte[] datab; uint outnum;
  103.                         float a = (float)jetcount; datab = BitConverter.GetBytes(swap(a));
  104.                         Hooker.DebugTarget.SetMemory(getPlayerState(0) + 0x30, 4, datab, out outnum);
  105.                     }
  106.                     else
  107.                     {
  108.                         decimal count = (decimal)1.5;
  109.                         jetcount += count;
  110.                         byte[] datab; uint outnum;
  111.                         float a = (float)jetcount; datab = BitConverter.GetBytes(swap(a));
  112.                         Hooker.DebugTarget.SetMemory(getPlayerState(0) + 0x30, 4, datab, out outnum);
  113.                     }
  114.                 }
  115.                 else
  116.                 {
  117.                     if (jetcount > 0)
  118.                         jetcount = jetcount - 1;
  119.                 }
  120.             }
  121.             catch (Exception asd)
  122.             {timer1.Stop(); MessageBox.Show(asd.ToString());  }
  123.  
  124.        }
Add Comment
Please, Sign In to add comment