Advertisement
IndieDeveloper

RPC ZOMBIE

Apr 12th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. // Remote Procedure Call Zombie Black Ops 3
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using PS3Lib;
  9. using System.Threading;
  10. using Demonware_v3_Zombie;
  11.  
  12.  
  13. namespace Demonware_v3_Zombie
  14. {
  15. class RPC
  16. {
  17. public static PS3API PS3 = new PS3API();
  18. public static uint function_address = 0x3D00E8; // 1.07
  19.  
  20. public static int Init()
  21. {
  22. if (function_address == 0) return -1;
  23. Enable_RPC();
  24. return 0;
  25. }
  26.  
  27. public static void Enable_RPC()
  28. {
  29. PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
  30. System.Threading.Thread.Sleep(20);
  31. byte[] func = new byte[] { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x05, 0x81, 0x83, 0x00, 0x4C, 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08, 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18, 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xC0, 0x43, 0x00, 0x28, 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xC0, 0xC3, 0x00, 0x38, 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00, 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x05, 0x38, 0xA0, 0x00, 0x00, 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6, 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
  32. PS3.SetMemory(function_address + 0x4, func);
  33. PS3.SetMemory(0x10050000, new byte[0x2854]);
  34. PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
  35. }
  36.  
  37. public static int Call(uint func_address, params object[] parameters)
  38. {
  39. int num_params = parameters.Length;
  40. uint num_floats = 0;
  41. for (uint i = 0; i < num_params; i++)
  42. {
  43. if (parameters[i] is int)
  44. {
  45. byte[] val = BitConverter.GetBytes((int)parameters[i]);
  46. Array.Reverse(val);
  47. PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
  48. }
  49. else if (parameters[i] is uint)
  50. {
  51. byte[] val = BitConverter.GetBytes((uint)parameters[i]);
  52. Array.Reverse(val);
  53. PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
  54. }
  55. else if (parameters[i] is string)
  56. {
  57. byte[] str = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
  58. PS3.SetMemory(0x10050054 + i * 0x400, str);
  59. uint addr = 0x10050054 + i * 0x400;
  60. byte[] address = BitConverter.GetBytes(addr);
  61. Array.Reverse(address);
  62. PS3.SetMemory(0x10050000 + (i + num_floats) * 4, address);
  63. }
  64. else if (parameters[i] is float)
  65. {
  66. num_floats++;
  67. byte[] val = BitConverter.GetBytes((float)parameters[i]);
  68. Array.Reverse(val);
  69. PS3.SetMemory(0x10050024 + ((num_floats - 1) * 0x4), val);
  70. }
  71. }
  72. byte[] fadd = BitConverter.GetBytes(func_address);
  73. Array.Reverse(fadd);
  74. PS3.SetMemory(0x1005004C, fadd);
  75. System.Threading.Thread.Sleep(20);
  76. byte[] ret = PS3.Extension.ReadBytes(0x10050050, 4);
  77. Array.Reverse(ret);
  78. return BitConverter.ToInt32(ret, 0);
  79.  
  80. }
  81.  
  82. public static void Cbuf_AddText(String Command)
  83. {
  84. Call(0x5A657C, 0, Command);
  85.  
  86. }
  87.  
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement