Advertisement
PrimeNotorious

rpc

Jun 29th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. public int call(uint address, params object[] parameters)
  2. {
  3. int length = parameters.Length;
  4. uint num2 = 0;
  5. for (int i = 0; i < length; i++)
  6. {
  7. if(parameters[i] is int)
  8. {
  9. DEX.Extension.WriteInt32(0x10050000 + ((uint)i + num2) * 4, (int)parameters[i]);
  10. }
  11. else if(parameters[i] is float)
  12. {
  13. DEX.Extension.WriteFloat(address + ((uint)i + num2) * 4, (float)parameters[i]);
  14. }
  15. else if(parameters[i] is string)
  16. {
  17. DEX.Extension.WriteString(address, (string)parameters[i]);
  18. }
  19. else if(parameters[i] is uint)
  20. {
  21. DEX.Extension.WriteUInt32(0x10050000 + ((uint)i + num2) * 4, (uint)parameters[i]);
  22. }
  23. else if(parameters[i] is bool)
  24. {
  25. DEX.Extension.WriteBool(0x10050000 + ((uint)i + num2) * 4, (bool)parameters[i]);
  26. }
  27. else if(parameters[i] is byte)
  28. {
  29. DEX.Extension.WriteByte(0x10050000 + ((uint)i + num2) * 4, (byte)parameters[i]);
  30. }
  31. else
  32. {
  33. Console.WriteLine("This RPC Does Not Support that type of value!");
  34. }
  35. }
  36. DEX.Extension.WriteUInt32(0x1002004C, address);
  37. System.Threading.Thread.Sleep(20);
  38. return DEX.Extension.ReadInt32(0x10020050);
  39. }
  40. public void writePowerPC()
  41. {
  42. PS3.SetMemory(0x00, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
  43. System.Threading.Thread.Sleep(20);
  44. byte[] ppc = new byte[] { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00,
  45. 0x80, 0x3D, 0x60, 0x02, 0x10, 0x80, 0x6B, 0x00, 0x04, 0x80, 0x8B, 0x00, 0x08, 0x80, 0xAB,
  46. 0x00, 0x0C, 0x80, 0xCB, 0x00, 0x10, 0x80, 0xEB, 0x00, 0x14, 0x81, 0x0B, 0x00, 0x18, 0x81,
  47. 0x2B, 0x00, 0x1C, 0x81, 0x6B, 0x00, 0x00, 0x7D, 0x69, 0x03, 0xA6, 0x39, 0x60, 0x00, 0x00,
  48. 0x4E, 0x80, 0x04, 0x21, 0x3D, 0x60, 0x02, 0x10, 0x90, 0x6B, 0x00, 0x20, 0x38, 0x60, 0x00,
  49. 0x00, 0x90, 0x6B, 0x00, 0x00, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6, 0x38, 0x21,
  50. 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
  51. PS3.SetMemory(0x00 + 4, ppc);
  52. PS3.SetMemory(0x10020000, new byte[0x2854]);
  53. PS3.SetMemory(0x00, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
  54. }
  55. public int init()
  56. {
  57. uint address = 0x00;
  58. writePowerPC();
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement