Advertisement
Mango_Knife

Black Ops 2 RPC CEX/DEX 1.18

Mar 11th, 2014
3,437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.53 KB | None | 0 0
  1.        //Credits
  2.        //Choco - Original RPC
  3.        //Sharks - FIX RPC
  4.        //Unknauwn - 1.17 Fog Address
  5.        //Mango_Knife - 1.18 Fog Address
  6.        //iMCSx & Enstone - PS3Lib.
  7.  
  8.                 //If the RPC Dosent Work, try this: http://pastebin.com/vzk4HApW
  9.                 #region Call Function
  10.                 public static class RPC
  11.                 {
  12.                 //Notifications:
  13.                 private static void WriteSingle(uint address, float[] input)
  14.                 {
  15.                     int length = input.Length;
  16.                     byte[] array = new byte[length * 4];
  17.                     for (int i = 0; i < length; i++)
  18.                     {
  19.                         ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int)(i * 4));
  20.                     }
  21.                     PS3.SetMemory(address, array);
  22.                 }
  23.                 private static byte[] ReverseBytes(byte[] inArray)
  24.                 {
  25.                     Array.Reverse(inArray);
  26.                     return inArray;
  27.                 }
  28.                 private static uint function_address = 0x7AA1E0;
  29.                 public static int Call(uint func_address, params object[] parameters)
  30.                 {
  31.                     int length = parameters.Length;
  32.                     int index = 0;
  33.                     uint num3 = 0;
  34.                     uint num4 = 0;
  35.                     uint num5 = 0;
  36.                     uint num6 = 0;
  37.                     while (index < length)
  38.                     {
  39.                         if (parameters[index] is int)
  40.                         {
  41.                             PS3.Extension.WriteInt32(0x10020000 + (num3 * 4), (int)parameters[index]);
  42.                             num3++;
  43.                         }
  44.                         else if (parameters[index] is uint)
  45.                         {
  46.                             PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), (uint)parameters[index]);
  47.                             num3++;
  48.                         }
  49.                         else
  50.                         {
  51.                             uint num7;
  52.                             if (parameters[index] is string)
  53.                             {
  54.                                 num7 = 0x10022000 + (num4 * 0x400);
  55.                                 PS3.Extension.WriteString(num7, Convert.ToString(parameters[index]));
  56.                                 PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
  57.                                 num3++;
  58.                                 num4++;
  59.                             }
  60.                             else if (parameters[index] is float)
  61.                             {
  62.                                 PS3.Extension.WriteFloat(0x10020024 + (num5 * 4), (float)parameters[index]);
  63.                                 num5++;
  64.                             }
  65.                             else if (parameters[index] is float[])
  66.                             {
  67.                                 float[] input = (float[])parameters[index];
  68.                                 num7 = 0x10021000 + (num6 * 4);
  69.                                 WriteSingle(num7, input);
  70.                                 PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
  71.                                 num3++;
  72.                                 num6 += (uint)input.Length;
  73.                             }
  74.                         }
  75.                         index++;
  76.                     }
  77.                     PS3.Extension.WriteUInt32(0x1002004C, func_address);
  78.                     Thread.Sleep(20);
  79.                     return PS3.Extension.ReadInt32(0x10020050);
  80.                 }
  81.  
  82.                 public static void Enable_RPC()
  83.                 {
  84.                     if (PS3.Extension.ReadByte(function_address + 0xB) == 0xD0)
  85.                     {
  86.                         PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
  87.                         Thread.Sleep(20);
  88.                         byte[] memory = new byte[]
  89.                     { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x02, 0x81, 0x83, 0x00, 0x4C,
  90.             0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08,
  91.             0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18,
  92.             0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xc0, 0x43, 0x00, 0x28,
  93.             0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xc0, 0xC3, 0x00, 0x38,
  94.             0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00,
  95.             0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x02, 0x38, 0xA0, 0x00, 0x00,
  96.             0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6,
  97.             0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
  98.                         PS3.SetMemory(function_address + 4, memory);
  99.                         PS3.SetMemory(0x10020000, new byte[0x2854]);
  100.                         PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
  101.                     }
  102.                     else
  103.                     {
  104.  
  105.                     }
  106.                 }
  107.                 public static int Init()
  108.                 {
  109.                     function_address = 0x7AA1E0;
  110.                     Enable_RPC();
  111.                     return 0;
  112.                 }
  113.                 public static void Exmple(Int32 Client, String text)
  114.                 {
  115.                     UInt32 Cbuf_AddText = 0x313E88;
  116.                     Call(Multiplayer.Offsets.Addresses.Cbuf_AddText, text);
  117.                 }
  118.                 #region SV_GameSendServerCommand
  119.                 public static void SV_GameSendServerCommand(int client, string text, int type = 0)
  120.                 {
  121.                     RPC.Call(0x34A1DC, client, 0, (text));
  122.                 }
  123.                 #endregion
  124.                 #region iPrintln
  125.                 public static void iPrintln(int client, string input)
  126.                 {
  127.                     SV_GameSendServerCommand(client, "< \"" + input + "\"");
  128.                 }
  129.                 #endregion
  130.                 #region iPrintlnBold
  131.                 public static void iPrintlnBold(int clientNumber, string input)
  132.                 {
  133.                     SV_GameSendServerCommand(clientNumber, "O \"" + input + "\"");
  134.                 }
  135.                 #endregion
  136.                 }
  137.                 #endregion
  138.         //How to Enable?
  139.         //Enable_RPC();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement