Anissian
Joined: 26 Jan 2007 Posts: 16
|
Posted: Mon Feb 19, 2007 9:55 pm Post subject: |
|
|
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 |
|