Astekk

GHOSTS 1.16 RPC

Dec 18th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. //CoD Ghosts RPC CEX/DEX - 1.16
  2. //Add using System.Threading And using System And using PS3Lib
  3. //You need to define the PS3API To static
  4. //private PS3API PS3 = new PS3API();
  5. // credits to CHOCO original RPC
  6. #region RPC
  7. private static uint function_address = 0x4A0700;
  8. public static int CallFunction(uint func_address, params object[] parameters)
  9. {
  10. int length = parameters.Length;
  11. uint num2 = 0;
  12. for (uint i = 0; i < length; i++)
  13. {
  14. if (parameters[i] is int)
  15. {
  16. byte[] array = BitConverter.GetBytes((int)parameters[i]);
  17. Array.Reverse(array);
  18. PS3.SetMemory(0x10050000 + ((i + num2) * 4), array);
  19. }
  20. else if (parameters[i] is uint)
  21. {
  22. byte[] buffer2 = BitConverter.GetBytes((uint)parameters[i]);
  23. Array.Reverse(buffer2);
  24. PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer2);
  25. }
  26. else if (parameters[i] is string)
  27. {
  28. byte[] buffer3 = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
  29. PS3.SetMemory(0x10050054 + (i * 0x400), buffer3);
  30. uint num4 = 0x10050054 + (i * 0x400);
  31. byte[] buffer4 = BitConverter.GetBytes(num4);
  32. Array.Reverse(buffer4);
  33. PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer4);
  34. }
  35. else if (parameters[i] is float)
  36. {
  37. num2++;
  38. byte[] buffer5 = BitConverter.GetBytes((float)parameters[i]);
  39. Array.Reverse(buffer5);
  40. PS3.SetMemory(0x10050024 + ((num2 - 1) * 4), buffer5);
  41. }
  42. }
  43. byte[] bytes = BitConverter.GetBytes(func_address);
  44. Array.Reverse(bytes);
  45. PS3.SetMemory(0x1005004c, bytes);
  46. Thread.Sleep(20);
  47. byte[] memory = new byte[4];
  48. PS3.GetMemory(0x10050050, memory);
  49. Array.Reverse(memory);
  50. return BitConverter.ToInt32(memory, 0);
  51. }
  52.  
  53. public static void WritePPC()
  54. {
  55. if (PS3.Extension.ReadByte(function_address + 3) == 0x11)
  56. {
  57. PS3.SetMemory(function_address, new byte[] { 0x4e, 0x80, 0, 0x20 });
  58. Thread.Sleep(20);
  59. byte[] memory = new byte[] {
  60. 0x7c, 8, 2, 0xa6, 0xf8, 1, 0, 0x80, 60, 0x60, 0x10, 5, 0x81, 0x83, 0, 0x4c,
  61. 0x2c, 12, 0, 0, 0x41, 130, 0, 100, 0x80, 0x83, 0, 4, 0x80, 0xa3, 0, 8,
  62. 0x80, 0xc3, 0, 12, 0x80, 0xe3, 0, 0x10, 0x81, 3, 0, 20, 0x81, 0x23, 0, 0x18,
  63. 0x81, 0x43, 0, 0x1c, 0x81, 0x63, 0, 0x20, 0xc0, 0x23, 0, 0x24, 0xc0, 0x43, 0, 40,
  64. 0xc0, 0x63, 0, 0x2c, 0xc0, 0x83, 0, 0x30, 0xc0, 0xa3, 0, 0x34, 0xc0, 0xc3, 0, 0x38,
  65. 0xc0, 0xe3, 0, 60, 0xc1, 3, 0, 0x40, 0xc1, 0x23, 0, 0x48, 0x80, 0x63, 0, 0,
  66. 0x7d, 0x89, 3, 0xa6, 0x4e, 0x80, 4, 0x21, 60, 0x80, 0x10, 5, 0x38, 160, 0, 0,
  67. 0x90, 0xa4, 0, 0x4c, 0x90, 100, 0, 80, 0xe8, 1, 0, 0x80, 0x7c, 8, 3, 0xa6,
  68. 0x38, 0x21, 0, 0x70, 0x4e, 0x80, 0, 0x20
  69. };
  70. PS3.SetMemory(function_address + 4, memory);
  71. PS3.SetMemory(0x10050000, new byte[0x2854]);
  72. PS3.SetMemory(function_address, new byte[] { 0xf8, 0x21, 0xff, 0x91 });
  73. }
  74. else
  75. {
  76. }
  77. }
  78. #endregion
Add Comment
Please, Sign In to add comment