Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //System Patch PRX
- //Credit to vosman
- //Build: Dark987
- #define _PSP_FW_VERSION 150
- #include <pspkernel.h>
- #include <pspkerneltypes.h>
- #include <pspmoduleinfo.h>
- #include <pspiofilemgr.h>
- #include <pspmodulemgr.h>
- #include <pspthreadman.h>
- #include <stdlib.h>
- #include <pspchnnlsv.h>
- #include <pspctrl.h>
- #include <string.h>
- #include <pspctrl_kernel.h>
- #include <pspthreadman_kernel.h>
- #include <pspumd.h>
- #include <crt0_prx.h>
- #include <pspnet.h>
- #include <pspwlan.h>
- #include <psprtc.h>
- #include <psphprm.h>
- //Defines
- PSP_MODULE_INFO("SystemPatch", 0x3008, 1, 2); //0x3007
- PSP_MAIN_THREAD_ATTR(0); //0 for kernel mode too
- PSP_HEAP_SIZE_KB(-128);
- #define MAX_THREAD 64
- //Globals
- SceUID thid;
- //set up storage points for buffers
- unsigned char GAMEID[10];
- unsigned char BUFFER[64];
- //Functions
- int module_start(SceSize args, void *argp) __attribute__((alias("_start")));
- int module_stop(SceSize args, void *argp) __attribute__((alias("_stop")));
- unsigned int RUNNING=0;
- //main thread obviously look how its named are you STUPID?
- int mainThread(){
- SceCtrlData pad;
- sceCtrlSetSamplingCycle(0);
- sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
- signed int fd;
- unsigned int counter=0;
- RUNNING=1;
- //Wait for the kernel to boot up (if we don't, the PRX will crash since some functions may be missing)
- sceKernelDelayThread(51000000);
- while(!sceKernelFindModuleByName("sceKernelLibrary"))
- sceKernelDelayThread(100000);
- sceKernelDelayThread(100000);
- //Find the GAME ID (by reading the UMD_DATA file on the UMD)
- do{
- fd=sceIoOpen("disc0:/UMD_DATA.BIN", PSP_O_RDONLY, 0777);
- sceKernelDelayThread(10000);
- } while(fd<=0);
- //grab the game id from umd_data.bin and and store it into GAMEID buffer
- sceIoRead(fd, GAMEID, 10);
- //close the buffer
- sceIoClose(fd);
- //Compare the GAMEID buffer to the string "UCUS-98716" to see if the game is SOCOM RUNNING
- if(strncmp(GAMEID, "UCUS-98716", 10)){
- //Game isn't SOCOM RUNNING tell running to stop, this will also stop our while loop below.
- RUNNING=0;
- }
- //while running is not equal to zero then run this loop
- while(RUNNING){
- sceCtrlReadBufferPositive(&pad, 1);
- unsigned int *Value=(unsigned int*) (0x01739B80+0x08800000);
- if (*Value >=0x00000001)
- {
- _sw(0x0a200400, (0x01739b80+0x08800000));
- _sw(0x3c02322e, (0x00001000+0x08800000));
- _sw(0x24423630, (0x00001004+0x08800000));
- _sw(0x03e00008, (0x00001008+0x08800000));
- _sw(0xae020000, (0x0000100c+0x08800000));
- }
- }
- //time out to keep thinks smooooth
- sceKernelDelayThread(0001000);
- }
- int _start(SceSize args, void *argp){
- //Create thread
- thid=sceKernelCreateThread("SystemPatch", &mainThread, 0x18, 0x1000, 0, NULL);
- //Start thread
- if(thid >= 0) sceKernelStartThread(thid, 0, NULL);
- return 0;
- }
- int _stop(SceSize args, void *argp){
- //shut down all our functions depending on RUNNING
- RUNNING=0;
- sceKernelTerminateThread(thid);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement