Beispiel #1
0
        public static bool Install()
        {
            try {
                if (PS3.Ext.ReadUInt64(INSTALL_ADDR) == 0x3C60000160630084)
                {
                    return(true);
                }

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

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

                PS3.Ext.WriteString(RPC_THREAD_NAME_ADDR, RPC_THREAD_NAME);
                PS3.SetMemory(INSTALL_ADDR, RPC_INSTRUCTIONS);

                PS3.MainThreadStop();

                for (uint i = 0; i < 0x49; i++)
                {
                    Registers[i] = PS3.GetSingleRegister(i);
                }

                PC = PS3.GetSingleRegister((uint)TMAPI.SPRegisters.SNPS3_pc);
                PS3.SetSingleRegister((uint)TMAPI.SPRegisters.SNPS3_pc, INSTALL_ADDR);

                PS3.MainThreadContinue();

                while (PS3.Ext.ReadUInt64(INSTALL_ADDR) == 0)
                {
                    Thread.Sleep(1);
                }

                PS3.MainThreadStop();

                for (uint i = 0; i < 0x49; i++)
                {
                    PS3.SetSingleRegister(i, Registers[i]);
                }

                PS3.SetSingleRegister((uint)TMAPI.SPRegisters.SNPS3_pc, PC);
                PS3.MainThreadContinue();

                PS3TMAPI.PPUThreadInfo ThreadInfo = new PS3TMAPI.PPUThreadInfo();

                if (PS3.GetThreadByName("RPC", ref ThreadInfo))
                {
                    PS3.StopThreadyID(ThreadInfo.ThreadID);
                    PS3.SetSingleRegisterByThreadID(ThreadInfo.ThreadID, (uint)TMAPI.GPRegisters.SNPS3_gpr_13, Registers[13]);
                    PS3.ContinueThreadByID(ThreadInfo.ThreadID);
                }

                while (PS3.Ext.ReadUInt32(RPC_STACK_ADDR_PTR) == 0)
                {
                    Thread.Sleep(1);
                }

                RPC_STACK_ADDR = PS3.Ext.ReadUInt32(RPC_STACK_ADDR_PTR);

                return(true);
            }
            catch {
                return(false);
            }
        }
Beispiel #2
0
 private void SetBytes(uint offset, byte[] bytes)
 {
     Target.SetMemory(offset, bytes);
 }