Is there a way to change a kernel threads stack pointer? Iv tried using assembly and it just crashes the psp every time. I need about 2MB of stack.
Or would expanding the kernel partition work? iv tried using sctrlHENSetMemory to allocate 6MB to partition 8, my prx loaded fine but the stack was still allocated in partition 1 so that defeated the purpose.
thanks.
change threads stack pointer
-
- Posts: 23
- Joined: Fri Sep 18, 2009 3:33 pm
Well, a couple of threads back i started to try and reverse the ipl so i could get the kernel keys for psar dumper. (It isn't going to well =P)
So iv taken to loading the ipl in vram, patching some of the nasty parts that would cause a crash and executing the decryption parts like
sceDecypt1((void*)0xBFC00040, 0x280, (void*)seed1, (void*)seed2, (void*)main_bin, 0x8180);
For this function i believe i need kernel mode and a huge stack because it freezes the psp when i run it. or maybe im just completely wrong and i cant run code from vram.
I have a couple more ideas but this was the easiest on the list. The next one is writing a program to rebase the ipl in user mode and modify sceMtInit etc to run. And after that is to write a program to generate an assembly version of the ipl that i can include in my project. Thats all for now
So iv taken to loading the ipl in vram, patching some of the nasty parts that would cause a crash and executing the decryption parts like
sceDecypt1((void*)0xBFC00040, 0x280, (void*)seed1, (void*)seed2, (void*)main_bin, 0x8180);
Code: Select all
memset((void*)0x44000000, 0, 0x00200000);
SceUID fd = sceIoOpen("host0:/ipl.mem", PSP_O_RDONLY, 0777);
int size = sceIoLseek32(fd, 0, SEEK_END);
sceIoLseek32(fd, 0, SEEK_SET);
sceIoRead(fd, (void*)_VRAM(0x040EC000), size);
sceIoClose(fd);
I have a couple more ideas but this was the easiest on the list. The next one is writing a program to rebase the ipl in user mode and modify sceMtInit etc to run. And after that is to write a program to generate an assembly version of the ipl that i can include in my project. Thats all for now
You cannot change your stack pointer easily because if your thread context gets switched the thread manager will kill you because it thinks you blew your stack.
You might be able to get away with disabling interrupts while running the ipl code, with interrupts off the threads cannot context switch and you would _get away with it_ :)
You might be able to get away with disabling interrupts while running the ipl code, with interrupts off the threads cannot context switch and you would _get away with it_ :)