Advertisement
Guest User

Untitled

a guest
Jul 31st, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. //System Patch PRX
  2. //Credit to vosman
  3. //Build: Dark987
  4. #define _PSP_FW_VERSION 150
  5. #include <pspkernel.h>
  6. #include <pspkerneltypes.h>
  7. #include <pspmoduleinfo.h>
  8. #include <pspiofilemgr.h>
  9. #include <pspmodulemgr.h>
  10. #include <pspthreadman.h>
  11. #include <stdlib.h>
  12. #include <pspchnnlsv.h>
  13. #include <pspctrl.h>
  14. #include <string.h>
  15. #include <pspctrl_kernel.h>
  16. #include <pspthreadman_kernel.h>
  17. #include <pspumd.h>
  18. #include <crt0_prx.h>
  19. #include <pspnet.h>
  20. #include <pspwlan.h>
  21. #include <psprtc.h>
  22. #include <psphprm.h>
  23.  
  24. //Defines
  25. PSP_MODULE_INFO("SystemPatch", 0x3008, 1, 2); //0x3007
  26. PSP_MAIN_THREAD_ATTR(0); //0 for kernel mode too
  27. PSP_HEAP_SIZE_KB(-128);
  28. #define MAX_THREAD 64
  29.  
  30. //Globals
  31. SceUID thid;
  32.  
  33. //set up storage points for buffers
  34. unsigned char GAMEID[10];
  35. unsigned char BUFFER[64];
  36.  
  37. //Functions
  38. int module_start(SceSize args, void *argp) __attribute__((alias("_start")));
  39. int module_stop(SceSize args, void *argp) __attribute__((alias("_stop")));
  40.  
  41. unsigned int RUNNING=0;
  42.  
  43. //main thread obviously look how its named are you STUPID?
  44. int mainThread(){
  45. SceCtrlData pad;
  46. sceCtrlSetSamplingCycle(0);
  47. sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
  48. signed int fd;
  49. unsigned int counter=0;
  50.  
  51. RUNNING=1;
  52.  
  53. //Wait for the kernel to boot up (if we don't, the PRX will crash since some functions may be missing)
  54. sceKernelDelayThread(51000000);
  55. while(!sceKernelFindModuleByName("sceKernelLibrary"))
  56. sceKernelDelayThread(100000);
  57. sceKernelDelayThread(100000);
  58.  
  59. //Find the GAME ID (by reading the UMD_DATA file on the UMD)
  60. do{
  61. fd=sceIoOpen("disc0:/UMD_DATA.BIN", PSP_O_RDONLY, 0777);
  62. sceKernelDelayThread(10000);
  63. } while(fd<=0);
  64.  
  65. //grab the game id from umd_data.bin and and store it into GAMEID buffer
  66. sceIoRead(fd, GAMEID, 10);
  67. //close the buffer
  68. sceIoClose(fd);
  69.  
  70. //Compare the GAMEID buffer to the string "UCUS-98716" to see if the game is SOCOM RUNNING
  71. if(strncmp(GAMEID, "UCUS-98716", 10)){
  72. //Game isn't SOCOM RUNNING tell running to stop, this will also stop our while loop below.
  73. RUNNING=0;
  74. }
  75.  
  76. //while running is not equal to zero then run this loop
  77. while(RUNNING){
  78. sceCtrlReadBufferPositive(&pad, 1);
  79.  
  80. unsigned int *Value=(unsigned int*) (0x01739B80+0x08800000);
  81.  
  82. if (*Value >=0x00000001)
  83. {
  84. _sw(0x0a200400, (0x01739b80+0x08800000));
  85. _sw(0x3c02322e, (0x00001000+0x08800000));
  86. _sw(0x24423630, (0x00001004+0x08800000));
  87. _sw(0x03e00008, (0x00001008+0x08800000));
  88. _sw(0xae020000, (0x0000100c+0x08800000));
  89. }
  90. }
  91. //time out to keep thinks smooooth
  92. sceKernelDelayThread(0001000);
  93.  
  94. }
  95.  
  96.  
  97. int _start(SceSize args, void *argp){
  98.  
  99. //Create thread
  100. thid=sceKernelCreateThread("SystemPatch", &mainThread, 0x18, 0x1000, 0, NULL);
  101.  
  102. //Start thread
  103. if(thid >= 0) sceKernelStartThread(thid, 0, NULL);
  104.  
  105. return 0;
  106.  
  107. }
  108.  
  109. int _stop(SceSize args, void *argp){
  110.  
  111. //shut down all our functions depending on RUNNING
  112. RUNNING=0;
  113. sceKernelTerminateThread(thid);
  114. return 0;
  115.  
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement