Advertisement
intent

Black Ops 2 1.19 RPC

Feb 20th, 2015
1,085
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. Black Ops 2 1.19 RPC
  2.  
  3. Credit for RPC goes to JeWeLs. Credit for putting in pastebin goes to Angry
  4.  
  5. using PS3Lib;
  6. using System;
  7. using System.Threading;
  8. namespace BO2
  9. {
  10. public class RPC
  11. {
  12. private static uint function_address;
  13.  
  14. public static int Call(uint func_address, params object[] parameters)
  15. {
  16. int length = parameters.Length;
  17. int index = 0;
  18. uint num3 = 0;
  19. uint num4 = 0;
  20. uint num5 = 0;
  21. uint num6 = 0;
  22. while (index < length)
  23. {
  24. if (parameters[index] is int)
  25. {
  26. PS3.Extension.WriteInt32(0x10020000 + (num3 * 4), (int)parameters[index]);
  27. num3++;
  28. }
  29. else if (parameters[index] is uint)
  30. {
  31. PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), (uint)parameters[index]);
  32. num3++;
  33. }
  34. else
  35. {
  36. uint num7;
  37. if (parameters[index] is string)
  38. {
  39. num7 = 0x10022000 + (num4 * 0x400);
  40. PS3.Extension.WriteString(num7, Convert.ToString(parameters[index]));
  41. PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
  42. num3++;
  43. num4++;
  44. }
  45. else if (parameters[index] is float)
  46. {
  47. PS3.Extension.WriteFloat(0x10020024 + (num5 * 4), (float)parameters[index]);
  48. num5++;
  49. }
  50. else if (parameters[index] is float[])
  51. {
  52. float[] input = (float[])parameters[index];
  53. num7 = 0x10021000 + (num6 * 4);
  54. Lib.WriteSingle(num7, input);
  55. PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
  56. num3++;
  57. num6 += (uint)input.Length;
  58. }
  59. }
  60. index++;
  61. }
  62. PS3.Extension.WriteUInt32(0x1002004C, func_address);
  63. Thread.Sleep(20);
  64. return PS3.Extension.ReadInt32(0x10020050);
  65. }
  66.  
  67. public static void Enable()
  68. {
  69. PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
  70. Thread.Sleep(20);
  71. byte[] memory = new byte[]
  72. { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x02, 0x81, 0x83, 0x00, 0x4C,
  73. 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08,
  74. 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18,
  75. 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xc0, 0x43, 0x00, 0x28,
  76. 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xc0, 0xC3, 0x00, 0x38,
  77. 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00,
  78. 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x02, 0x38, 0xA0, 0x00, 0x00,
  79. 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6,
  80. 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
  81. PS3.SetMemory(function_address + 4, memory);
  82. PS3.SetMemory(0x10020000, new byte[0x2854]);
  83. PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
  84. }
  85.  
  86. public static int Init()
  87. {
  88. function_address = 0x007AA050;
  89. Enable();
  90. return 0;
  91. }
  92.  
  93. public static void Cbuf_AddText(int client, string text)
  94. {
  95. RPC.Call(0x313E88, client, text);
  96. }
  97. public static void iPrintln(int Client, string Text)
  98. {
  99. SV_GameSendServerCommand(Client, "O \"" + Text + "\"");
  100. }
  101.  
  102. public static void iPrintlnBold(int Client, string Text)
  103. {
  104. SV_GameSendServerCommand(Client, "< \"" + Text + "\"");
  105. }
  106. public static void CBuf_Addtext(string Command)
  107. {
  108. RPC.Call(00315938, 0, Command);
  109. }
  110.  
  111. public static void SV_GameSendServerCommand(int Client, string Command)
  112. {
  113. RPC.Call(0x34A1DC, Client, 1, Command);
  114. }
  115. }
  116. }
  117.  
  118. //Enable with "RPC.Init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement