Advertisement
Jo-Milk

Cod5 FPS RPC

Jan 5th, 2021
1,448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.31 KB | None | 0 0
  1. W@W FPS RPC
  2.  
  3. 3F 80 10 05 81 9C 00 48 2C 0C 00 00 41 82 00 64 80 7C 00 00 80 9C 00 04 80 BC 00 08 80 DC 00 0C 80 FC 00 10 81 1C 00 14 81 3C 00 18 81 5C 00 1C 81 7C 00 20 C0 3C 00 24 C0 5C 00 28 C0 7C 00 2C C0 9C 00 30 C0 BC 00 34 C0 DC 00 38 C0 FC 00 3C C1 1C 00 40 C1 3C 00 44 7D 89 03 A6 4E 80 04 21 38 80 00 00 90 9C 00 48 90 7C 00 4C D0 3C 00 50 48 00 01 64
  4.  
  5. PPC
  6. lis %r28, 0x1005
  7. lwz %r12, 0x48(%r28)
  8. cmpwi %r12, 0
  9. beq 0x64
  10. lwz %r3, 0x00(%r28)
  11. lwz %r4, 0x04(%r28)
  12. lwz %r5, 0x08(%r28)
  13. lwz %r6, 0x0C(%r28)
  14. lwz %r7, 0x10(%r28)
  15. lwz %r8, 0x14(%r28)
  16. lwz %r9, 0x18(%r28)
  17. lwz %r10, 0x1C(%r28)
  18. lwz %r11, 0x20(%r28)
  19. lfs %f1, 0x24(%r28)
  20. lfs %f2, 0x28(%r28)
  21. lfs %f3, 0x2C(%r28)
  22. lfs %f4, 0x30(%r28)
  23. lfs %f5, 0x34(%r28)
  24. lfs %f6, 0x38(%r28)
  25. lfs %f7, 0x3C(%r28)
  26. lfs %f8, 0x40(%r28)
  27. lfs %f9, 0x44(%r28)
  28. mtctr %r12
  29. bctrl
  30. li %r4, 0
  31. stw %r4, 0x48(%r28)
  32. stw %r3, 0x4C(%r28)
  33. stfs %f1, 0x50(%r28)
  34. b 0x164
  35.  
  36.  
  37. C# part
  38. public static void Enable()
  39.                 {
  40. PS3.SetMemory(0x274DEC0, new byte[] { 0x00 });//FPS OFF
  41.                     byte[] WritePPC = new byte[] {0x3F, 0x80, 0x10, 0x05, 0x81, 0x9C, 0x00, 0x48, 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x7C, 0x00, 0x00, 0x80, 0x9C, 0x00, 0x04, 0x80, 0xBC, 0x00, 0x08, 0x80, 0xDC, 0x00, 0x0C, 0x80, 0xFC, 0x00, 0x10, 0x81, 0x1C, 0x00, 0x14, 0x81, 0x3C, 0x00, 0x18, 0x81, 0x5C, 0x00, 0x1C, 0x81, 0x7C, 0x00, 0x20, 0xC0, 0x3C, 0x00, 0x24, 0xC0, 0x5C, 0x00, 0x28, 0xC0, 0x7C, 0x00, 0x2C, 0xC0, 0x9C, 0x00, 0x30, 0xC0, 0xBC, 0x00, 0x34, 0xC0, 0xDC, 0x00, 0x38, 0xC0, 0xFC, 0x00, 0x3C, 0xC1, 0x1C, 0x00, 0x40, 0xC1, 0x3C, 0x00, 0x44, 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x38, 0x80, 0x00, 0x00, 0x90, 0x9C, 0x00, 0x48, 0x90, 0x7C, 0x00, 0x4C, 0xD0, 0x3C, 0x00, 0x50, 0x48, 0x00, 0x01, 0x64 };
  42.                     PS3.SetMemory(0x1D8BB8, WritePPC);/*Write PPC at FPS Function aka offset 0x1D8B88 I use 0x1D8BB8 to use the fps stack*/
  43.                     PS3.SetMemory(0x274DEC0, new byte[] { 0x01 });//FPS ON
  44.                 }
  45. public static Int32 Call(UInt32 address, params Object[] parameters)
  46.                 {
  47.                     Int32 length = parameters.Length;
  48.                     Int32 index = 0;
  49.                     UInt32 count = 0;
  50.                     UInt32 Strings = 0;
  51.                     UInt32 Single = 0;
  52.                     UInt32 Array = 0;
  53.                     while (index < length)
  54.                     {
  55.                         if (parameters[index] is Int32)
  56.                         {
  57.                             PS3.Extension.WriteInt32(0x10050000 + (count * 4), (Int32)parameters[index]);
  58.                             count++;
  59.                         }
  60.                         else if (parameters[index] is UInt32)
  61.                         {
  62.                             PS3.Extension.WriteUInt32(0x10050000 + (count * 4), (UInt32)parameters[index]);
  63.                             count++;
  64.                         }
  65.                         else if (parameters[index] is Int16)
  66.                         {
  67.                             PS3.Extension.WriteInt16(0x10050000 + (count * 4), (Int16)parameters[index]);
  68.                             count++;
  69.                         }
  70.                         else if (parameters[index] is UInt16)
  71.                         {
  72.                             PS3.Extension.WriteUInt16(0x10050000 + (count * 4), (UInt16)parameters[index]);
  73.                             count++;
  74.                         }
  75.                         else if (parameters[index] is Byte)
  76.                         {
  77.                             PS3.Extension.WriteByte(0x10050000 + (count * 4), (Byte)parameters[index]);
  78.                             count++;
  79.                         } //Should work now :D let me try
  80.                         else
  81.                         {
  82.                             UInt32 pointer;
  83.                             if (parameters[index] is String)
  84.                             {
  85.                                 pointer = 0x10052000 + (Strings * 0x400);
  86.                                 PS3.Extension.WriteString(pointer, Convert.ToString(parameters[index]));
  87.                                 PS3.Extension.WriteUInt32(0x10050000 + (count * 4), pointer);
  88.                                 count++;
  89.                                 Strings++;
  90.                             }
  91.                             else if (parameters[index] is Single)
  92.                             {
  93.                                 WriteSingle(0x10050024 + (Single * 4), (Single)parameters[index]);
  94.                                 Single++;
  95.                             }
  96.                             else if (parameters[index] is Single[])
  97.                             {
  98.                                 Single[] Args = (Single[])parameters[index];
  99.                                 pointer = 0x10051000 + Array * 4;
  100.                                 WriteSingle(pointer, Args);
  101.                                 PS3.Extension.WriteUInt32(0x10050000 + count * 4, pointer);
  102.                                 count++;
  103.                                 Array += (UInt32)Args.Length;
  104.                             }
  105.  
  106.                         }
  107.                         index++;
  108.                     }
  109.                     PS3.Extension.WriteUInt32(0x10050048, address);
  110.                     Thread.Sleep(20);
  111.                     return PS3.Extension.ReadInt32(0x1005004c);
  112.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement