forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Decrypt 2.6 PRX on 2.6 itself

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
tnt



Joined: 11 Oct 2006
Posts: 9

PostPosted: Thu Oct 19, 2006 4:29 pm    Post subject: Decrypt 2.6 PRX on 2.6 itself Reply with quote

Hello,

I'm trying to decrypt the 2.6 PRX on a PSP running a 2.6 fw.
To do that, I'm using the PSARDump source code (the Dark_AleX's version), eloader 0.98 and
the kernel exploit of 2.6.

The first step to decrypt is to find the address of the functions to use, and I have some problems with that :

* sceKernelFindModuleByName is not available in VSH mode and I didn't find a suitable
vsh.... replacement in the sdk headers. I could just search the module list myself but there
must be a better way ?

* The needed functions are in the following modules : sceMesgLed, sceMemlmd, sceKernelUtils.

The sceMesgLed is loaded in vsh mode but the other two are not. (or maybe they are
the module whose name I can't see even in kernel mode). First do I just need to load them ? or start them as well ? Then, is it "safe" to do so (they won't touch the flash without being asked to ?).

Finally, I've tried to load flash0:/kd/memlmd.prx using vshKernelLoadModuleVSH("flash0:/kd/memlmd.prx", 0, NULL); unfortunaly it doesn't work. Neither in user(vsh) or kernel mode.

The returned error are :

for user(vsh) mode :
SCE_KERNEL_ERROR_UNSUPPORTED_PRX_TYPE = 0x80020148,

for kernel mode :
SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL = 0x80020149,

I would have thought loading encrypted prx from flash would go smoothly ... What's going on here ?


Thanks for any insight ;)
Back to top
View user's profile Send private message
hitchhikr



Joined: 04 Feb 2006
Posts: 83

PostPosted: Thu Oct 19, 2006 10:43 pm    Post subject: Reply with quote

Use pspSdkInstallNoDeviceCheckPatch() in kernel mode then you should be able to load flash0 prxs from an user thread.

It may eventually looks like that:

Code:

void User_Thread(SceSize args, void *argp) {
   SceUID PRxId;
   SceKernelLMOption Options;
   SceUID PrxHandle;
   int Start_Result;

   PrxHandle = sceIoOpen("flash0:/kd/thename.prx", PSP_O_RDONLY, 0);
   if(PrxHandle >= 0) {
      memset(&Options, 0, sizeof(SceKernelLMOption));
      Options.size = sizeof(SceKernelLMOption);
      Options.mpidtext = 1;
      Options.mpiddata = 1;
      Options.access = 1;
      PRxId = sceKernelLoadModuleByID(PrxHandle, 0, &Options);
      if(PRxId >= 0) sceKernelStartModule(PRxId, 0, NULL, &Start_Result, 0);
      sceIoClose(PrxHandle);
   }
}

void Patcher(SceSize args, void *argp) {
   pspSdkInstallNoDeviceCheckPatch();
   sceKernelExitDeleteThread(0);
}

   /* Must run in kernel mode */
   SceUID thid;

   thid = sceKernelCreateThread("Patcher", (void *) (Patcher + 0x80000000), 0x20, 16 * 1024, 0, 0);
   if(thid >= 0) sceKernelStartThread(thid, 0, NULL);

   thid = sceKernelCreateThread("User_Thread", (void *) User_Thread, 0x20, 16 * 1024, PSP_THREAD_ATTR_USER, 0);
   if(thid >= 0) sceKernelStartThread(thid, 0, NULL);


It *may* run.
Back to top
View user's profile Send private message
tnt



Joined: 11 Oct 2006
Posts: 9

PostPosted: Sun Oct 22, 2006 1:48 am    Post subject: Reply with quote

Thanks but I still have to find how to launch a kernel thread from an exploited vsh ... just calling sceCreateThread doesn't do it ;)
Back to top
View user's profile Send private message
0okm0000



Joined: 13 Jan 2006
Posts: 116

PostPosted: Sun Oct 22, 2006 3:41 am    Post subject: Reply with quote

2.7X PRXDecrypter for 2.60 by moonlight
http://forums.maxconsole.net/showthread.php?t=23666
_________________
PSP hardware hack
http://0okm.blogspot.com/
Back to top
View user's profile Send private message Visit poster's website
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Sun Oct 22, 2006 3:48 pm    Post subject: Reply with quote

IF you are in kernel mode, you should get the address of sceKernelFindModuleByName in a kernel dump. Anyways, i tell it to you: 0x8801c36c

Btw, if you plan to decrypt the files directly from the flash, you'll encounter the "sign check" problem. You'll have to "unsign check" them before actually decrypting them.I still didn't reverse how they are "unsign checked", but probably it is a very easy process.

Also notice that if you call vshKernelLoadModuleVSH from kernel mode, you'll have the error 0x80020149.
Use sceKernelLoadModule, but the one from ModuleMgrForKernel:

SceUID (* sceKernelLoadModule_k)(const char *path, int flags, SceKernelLMOption *option);

sceKernelLoadModule_k = (void *)FindProc("sceModuleManager", "ModuleMgrForKernel", 0x977de386);

anyways, you are wrong: memlmd is already loaded in vsh.
Back to top
View user's profile Send private message
tnt



Joined: 11 Oct 2006
Posts: 9

PostPosted: Sun Oct 22, 2006 8:31 pm    Post subject: Reply with quote

Thanks for the link and the explanation.

I decrypted the modules from a previous dump, not from the flash directly so it worked fine. I just had to change the exploit code to the vsh version to use it from eloader (tiff)

For the memlmd, I just didn't see it in the loaded module list, but there are 12 modules I can't get names of so it may be one of them ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group