#include "stdafx.h"
#include <cellstatus.h>
#include <sys/prx.h>
#include <sys/timer.h>
#include <sys/syscall.h>
#include <sys/ppu_thread.h>
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include <wchar.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/memory.h>
#include <typeinfo>
)
int console_write(const char * s)
{
uint32_t len;
system_call_4(403, 0, (uint64_t) s, 32, (uint64_t) &len);
return_to_user_prog(int);
}
void sleep(usecond_t time)
{
sys_timer_usleep(time * 1000);
}
sys_ppu_thread_t create_thread(void (*entry)(uint64_t), int priority, size_t stacksize, const char* threadname,sys_ppu_thread_t id)
{
if(sys_ppu_thread_create(&id, entry, 0, priority , stacksize, 0, threadname) == CELL_OK)
{
console_write("\n\nINJECTED !\n\n");
}
return id;
}
void writeString(const char* str, int len, unsigned int addr)
{
for(int i = 0; i < len; i++)
{
if(*str == 0x00) {break;}
*(char*)(addr+i) = *(str+i);
}
}
sys_ppu_thread_t thrd_mainstart;
sys_ppu_thread_t thrd_Calls;
void StartThreads()
{
create_thread(StartMenu, 0x4AA, 0x6000, "blb_Main", thrd_mainstart);
create_thread(Calls_thread, 0x4AB, 0x6000, "blb_Calls", thrd_Calls);
}
! THE TOC IS IN THE ASM INLINE STUFF !!!!!!!!!
int CALL(int numOfArgs, int addr, ...)
{
int i,val;
va_list vl;
va_start(vl,numOfArgs);
va_arg(vl,int);//skip one
for (i=1;i<(numOfArgs+1);i++)
{
val=va_arg(vl,int);
*(int*)(0x2100000+i*4) = val;
}
va_end(vl);
sleep(50);
*(int*)0x2100000 = addr;
return *(int*)(0x210004C);
}
void Calls_thread(std::uint64_t nothing)
{
for(;
{
__asm(
"lis 3, 0x210;"
"lwz 3, 0(3);"
"cmpwi 3, 0x00;"
"beq end;"
/*save the general registers !*/
"mflr 0;"
"std 0, -0x520-0x10(1);"
"std 31, -0x520-0x18(1);"
"std 30, -0x520-0x20(1);"
"std 29, -0x520-0x28(1);"
"std 28, -0x520-0x30(1);"
"std 27, -0x520-0x38(1);"
"std 26, -0x520-0x40(1);"
"std 2, -0x520-0x48(1);"
/*emulate the Ghosts POC registers*/
"lis 2, 0xA7;"
"ori 2, 2, 0xF3F8;"
"lis 26, 0;"
"lis 27, 0;"
"li 28, 0x0C800;"
"lis 29, 0;"
"lis 30, 0xD00D;"
"addic 30,30, 0x9DF0;"
"lis 31, 0x157;"
"addic 31,31, 0x059C;"
/*Loading args*/
"lis 12, 0x210;"
"lwz 3, 0x4(12);"
"lwz 4, 0x8(12);"
"lwz 5, 0xC(12);"
"lwz 6, 0x10(12);"
"lwz 7, 0x14(12);"
"lwz 8, 0x18(12);"
"lwz 9, 0x1C(12);"
"lwz 10, 0x20(12);"
"lwz 11, 0x24(12);"
"lfs 1, 0x28(12);"
"lfs 2, 0x2C(12);"
"lfs 3, 0x30(12);"
"lfs 4, 0x34(12);"
"lfs 5, 0x38(12);"
"lfs 6, 0x3C(12);"
"lfs 7, 0x40(12);"
"lfs 8, 0x44(12);"
"lfs 9, 0x48(12);"
/*Calling*/
"lwz 12, 0(12);"
"mtctr 12;"
"bctrl;"
/*returns*/
"lis 4, 0x210;"
"stw 3, 0x4C(4);"
"stfs 1, 0x50(4);"
"li 3, 0;"
"stw 3, 0(4);"
"ld 0, -0x520-0x10(1);"
"mtlr 0;"
"ld 26, -0x520-0x40(1);"
"ld 27, -0x520-0x38(1);"
"ld 28, -0x520-0x30(1);"
"ld 29, -0x520-0x28(1);"
"ld 30, -0x520-0x20(1);"
"ld 31, -0x520-0x18(1);"
"ld 2, -0x520-0x48(1);"
);
__asm("end:;");
sleep(5);
}
}
if(*(int*)0x00cbcce4 == 1) //button monitoring for square
{
CALL(3, 0x5720C0, 0, 0, "c test" ); //number of args in the function, address of the function and the args..
*(int*)0x00cbcce4 = 0; //avoid calling it 42836423946 times.. 
}
int CALL(int numOfArgs, int addr, ...)
{
int i,val;
va_list vl;
va_start(vl,numOfArgs);
va_arg(vl,int);//skip one
for (i=1;i<(numOfArgs+1);i++)
{
val=va_arg(vl,int);
*(int*)(0x2200000+i*4) = val;
}
va_end(vl);
sleep(50);
*(int*)0x2200000 = addr;
return *(int*)(0x220004C);
}
void Calls_thread(std::uint64_t nothing)
{
for(;
{
__asm(
"lis 3, 0x220;"
"lwz 3, 0(3);"
"cmpwi 3, 0x00;"
"beq end;"
/*save the general registers !*/
"mflr 0;"
"std 0, -0x520-0x10(1);"
"std 31, -0x520-0x18(1);"
"std 30, -0x520-0x20(1);"
"std 29, -0x520-0x28(1);"
"std 28, -0x520-0x30(1);"
"std 27, -0x520-0x38(1);"
"std 26, -0x520-0x40(1);"
"std 2, -0x520-0x48(1);"
/*emulate the registers*/
"lis 2, 0xD6;"
"ori 2, 2, 0x7E98;"
"li 26, 0;"
"li 27, 0;"
"li 28, 0;"
"lis 29, 0xD5;"
"ori 29, 29, 0x3D88;"
"lis 30, 0xD014;"
"addic 30, 30, 0x7080;"
"li 31, 0;"
/*Loading args*/
"lis 12, 0x220;"
"lwz 3, 0x4(12);"
"lwz 4, 0x8(12);"
"lwz 5, 0xC(12);"
"lwz 6, 0x10(12);"
"lwz 7, 0x14(12);"
"lwz 8, 0x18(12);"
"lwz 9, 0x1C(12);"
"lwz 10, 0x20(12);"
"lwz 11, 0x24(12);"
"lfs 1, 0x28(12);"
"lfs 2, 0x2C(12);"
"lfs 3, 0x30(12);"
"lfs 4, 0x34(12);"
"lfs 5, 0x38(12);"
"lfs 6, 0x3C(12);"
"lfs 7, 0x40(12);"
"lfs 8, 0x44(12);"
"lfs 9, 0x48(12);"
/*Calling*/
"lwz 12, 0(12);"
"mtctr 12;"
"bctrl;"
/*returns*/
"lis 4, 0x220;"
"stw 3, 0x4C(4);"
"stfs 1, 0x50(4);"
"li 3, 0;"
"stw 3, 0(4);"
"ld 0, -0x520-0x10(1);"
"mtlr 0;"
"ld 26, -0x520-0x40(1);"
"ld 27, -0x520-0x38(1);"
"ld 28, -0x520-0x30(1);"
"ld 29, -0x520-0x28(1);"
"ld 30, -0x520-0x20(1);"
"ld 31, -0x520-0x18(1);"
"ld 2, -0x520-0x48(1);"
);
__asm("end:;");
sleep(5);
}
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.