Skip to content

Commit

Permalink
change rpc location in header
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Jun 24, 2021
1 parent e27a4c7 commit e521470
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions PS3 Toolbox/PS3RPC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ namespace PS3_SPRX_Loader {
class PS3RPC {
private static TMAPI PS3;

private const uint INSTALL_ADDR = 0x1001C;
private const uint RPC_CREATION = 0x10000;
private const uint RPC_THREAD_NAME_ADDR = 0x10008;
private const uint RPC_STACK_ADDR_PTR = 0x1000C;
private const uint RPC_BASE = 0x10040;
private const uint INSTALL_ADDR = RPC_BASE + 0x1C;
private const uint RPC_THREAD_NAME_ADDR = RPC_BASE + 0x8;
private const uint RPC_STACK_ADDR_PTR = RPC_BASE + 0xC;
private const string RPC_THREAD_NAME = "RPC";
private static uint RPC_STACK_ADDR = 0x0;

Expand Down Expand Up @@ -42,26 +42,27 @@ class PS3RPC {
private static byte[] RPC_INSTRUCTIONS = new byte[] {
//RPC Setup Instructions
0x3C, 0x60, 0x00, 0x01, //lis %r3, 0x1
0x60, 0x63, 0x00, 0x84, //ori %r3, %r3, 0x84
0x60, 0x63, 0x00, 0xC8, //ori %r3, %r3, 0xC8 //RPC Thread Entry Point (0x100C8)
0x3C, 0x80, 0x00, 0x01, //lis %r4, 0x1
0x60, 0x84, 0x00, 0x10, //ori %r4, %r4, 0x10
0x90, 0x64, 0x00, 0x00, //stw %r3, 0x0(%r4)
0x90, 0x44, 0x00, 0x04, //stw %r2, 0x4(%r4)
0x90, 0x84, 0x00, 0x08, //stw %r4, 0x8(%r4)
0x60, 0x84, 0x00, 0x50, //ori %r4, %r4, 0x50 //RPC Thread OPD
0x90, 0x64, 0x00, 0x00, //stw %r3, 0x0(%r4) //Add entry point to OPD
0x90, 0x44, 0x00, 0x04, //stw %r2, 0x4(%r4) //Add TOC to OPD
0x90, 0x84, 0x00, 0x08, //stw %r4, 0x8(%r4) //Write OPD pointer (0x10058)
0x3C, 0x60, 0x00, 0x01, //lis %r3, 0x1
0x60, 0x63, 0x00, 0x40, //ori %r3, %r3, 0x40
0x3C, 0x80, 0x00, 0x01, //lis %r4, 0x1
0x60, 0x84, 0x00, 0x18, //ori %r4, %r4, 0x18
0x60, 0x84, 0x00, 0x58, //ori %r4, %r4, 0x58
0x38, 0xA0, 0x00, 0x00, //li %r5, 0
0x38, 0xC0, 0x00, 0x00, //li %r6, 0
0x38, 0xE0, 0x03, 0x00, //li %r7, 0x300
0x39, 0x00, 0x40, 0x00, //li %r8, 0x4000
0x39, 0x20, 0x00, 0x00, //li %r9, 0
0x3D, 0x40, 0x00, 0x01, //lis %r10, 0x1
0x61, 0x4A, 0x00, 0x08, //ori %r10, %r10, 0x8
0x61, 0x4A, 0x00, 0x48, //ori %r10, %r10, 0x48
0x39, 0x60, 0x00, 0x34, //li %r11, 0x34
0x44, 0x00, 0x00, 0x02, //;sc
0x3C, 0x60, 0x00, 0x01, //lis %r3, 0x1
0xE8, 0x63, 0x00, 0x00, //ld %r3, 0(%r3)
0xE8, 0x63, 0x00, 0x40, //ld %r3, 0x40(%r3)
0x39, 0x60, 0x00, 0x35, //li %r11, 0x35
0x44, 0x00, 0x00, 0x02, //;sc
0x60, 0x00, 0x00, 0x00, //nop
Expand All @@ -72,7 +73,7 @@ class PS3RPC {
0x3C, 0x60, 0x00, 0x01, //lis %r3, 0x1
0x7C, 0x24, 0x0B, 0x78, //mr %r4, %r1
0x38, 0x84, 0xF0, 0x00, //addi %r4, %r4, -0x1000
0x90, 0x83, 0x00, 0x0C, //stw %r4, 0xC(%r3)
0x90, 0x83, 0x00, 0x4C, //stw %r4, 0x4C(%r3)
0xF8, 0x21, 0xF0, 0x01, //stdu %r1, -0x1000(%r1)

//System Calls RPC Instructions
Expand Down Expand Up @@ -145,10 +146,13 @@ public static uint[] GetModules() {

public static bool Install() {
try {
if (PS3.Ext.ReadUInt64(INSTALL_ADDR) == 0x3C60000160630084)
if (PS3.Ext.ReadUInt64(INSTALL_ADDR) == 0x3C600001606300C8)
{
RPC_STACK_ADDR = PS3.Ext.ReadUInt32 (RPC_STACK_ADDR_PTR);
return true;
}

PS3.SetMemory(0x10000, new byte[0x200]);
PS3.SetMemory(RPC_BASE, new byte[0x1B0]);

ulong PC = 0;
ulong[] Registers = new ulong[0x49];
Expand Down

0 comments on commit e521470

Please sign in to comment.