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 

PSAR Dumper 2.0 (PRX 2.0 format decrypted)
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Anissian



Joined: 26 Jan 2007
Posts: 16

PostPosted: Mon Feb 19, 2007 9:55 pm    Post subject: Reply with quote

I thought this could be an appropriate thread for requesting clarification about psardumper (as of v03). Apologies if this are answered elsewhere, I have not been able to find them:

Until now, I thought that when requesting a demangle or a decrypt by using the "g_mangleProc" or the "semaphore2" proc
FindProc("sceMemlmd", "semaphore", 0x4c537c72) the actual "data" needs to be prepended by a header that contains the "code" (initial seed), the size of the data and, as first u32, the lenght of this header in 32-bit words, as in:
Code:

int Scramble(u32 *buf, u32 size, u32 code)
{
   buf[0] = 5;
   buf[1] = buf[2] = 0;
   buf[3] = code;
   buf[4] = size;

   if (g_mangleProc(buf, size+0x14, buf, size+0x14, 7) < 0)
   {
      return -1;
   }

   return 0;
}


but in Encrypt, 4 is used:

Code:

int Encrypt(u32 *buf, int size)
{
   buf[0] = 4;
   buf[1] = buf[2] = 0;
   buf[3] = 0x100;
   buf[4] = size;

   /* Note: this encryption returns different data in each psp,
      But it always returns the same in a specific psp (even if it has two nands) */
   if (g_mangleProc(buf, size+0x14, buf, size+0x14, 5) < 0)
      return -1;

   return 0;
}


I can't figure out why. What am I missing. Is the OP 5 different from OP 1, 7, 11? I am unsure of the format of the header (specifically giving the size may mean this header can be larger, and that psardump is using the "strict minimum". Is this header discussed elsewhere?.

On a side note, I also saw:
Code:

int ReadFile(const char* file, u32 offset, void *buf, u32 size)
{
   SceUID fd = sceIoOpen(file, PSP_O_RDONLY, 0777);
   int read;

   if (fd < 0)
      return fd;

   if (offset != 0)
   {
      sceIoLseek32(fd, 0, PSP_SEEK_SET);
   }

   read = sceIoRead(fd, buf, size);
   sceIoClose(fd);

   return read;
}


there seems to be a weird use of the offset argument (should change the IoLseek call?). This does not seem to have an impact (not used).


Thanks in advance
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
Goto page Previous  1, 2, 3
Page 3 of 3

 
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