Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //MiLk Approved
- //Bl4Ck.KiD...'s Knife Example
- //Includes
- #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 <psppower.h>
- #include <pspnet.h>
- #include <pspwlan.h>
- #include <psprtc.h>
- #include <psphprm.h>
- #include <pspctrl_kernel.h>
- PSP_MODULE_INFO("Knife PRX", 0x3008, 1, 2);
- PSP_MAIN_THREAD_ATTR(0);
- PSP_HEAP_SIZE_KB(-128);
- #define MAX_THREAD 64
- SceUID thid;
- unsigned char GAMEID[10];
- unsigned char BUFFER[64];
- unsigned int RUNNING=0;
- //Activate Knife Off Code
- unsigned int *PRXOFF=(unsigned int*) (0x007D0000+0x08800000);
- //Knife
- unsigned int *KNIFE=(unsigned int*) (0x005044D8+0x08800000);
- int module_start(SceSize args, void *argp) __attribute__((alias
- ("_start")));
- int module_stop(SceSize args, void *argp) __attribute__((alias
- ("_stop")));
- int mainThread(){
- SceCtrlData pad;
- sceCtrlSetSamplingCycle(0);
- sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
- signed int fd;
- unsigned int counter=0;
- RUNNING=1;
- sceKernelDelayThread(15000000);
- while(!sceKernelFindModuleByName("sceKernelLibrary"))
- sceKernelDelayThread(100000);
- sceKernelDelayThread(100000);
- do{
- fd=sceIoOpen("disc0:/UMD_DATA.BIN", PSP_O_RDONLY,
- 0777);
- sceKernelDelayThread(10000);
- } while(fd<=0);
- sceIoRead(fd, GAMEID, 10);
- sceIoClose(fd);
- if(strncmp(GAMEID, "UCUS-98645", 10)){
- RUNNING=0;
- }
- while(RUNNING){
- sceCtrlReadBufferPositive(&pad, 1);
- //If The Activation Code Value Is 0x00000000 Prx Goes Off
- if(*PRXOFF==0x00000000){
- //L+R+[] To Knife
- if((pad.Buttons & PSP_CTRL_LTRIGGER) && (pad.Buttons & PSP_CTRL_RTRIGGER) && (pad.Buttons & PSP_CTRL_SQUARE){
- *KNIFE=0x00000000;//Put Modded Hex Here
- }
- else {
- *KNIFE=0x00000100;//Orignal Hex Here
- }
- sceKernelDelayThread(10000);
- }
- }
- int _start(SceSize args, void *argp){
- thid=sceKernelCreateThread("KnifePRX", &mainThread, 0x18,
- 0x1000, 0, NULL);
- if(thid >= 0) sceKernelStartThread(thid, 0, NULL);
- return 0;
- }
- int _stop(SceSize args, void *argp){
- RUNNING=0;
- sceKernelTerminateThread(thid);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement