 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
FaderX
Joined: 01 Mar 2008 Posts: 28
|
Posted: Sat Mar 15, 2008 11:36 am Post subject: Cannot Allocate Memory?? 3.XX Sha1 fails aswell |
|
|
Ok i've created a 3.XX game that loads, but.....Im trying to check to make sure the files are correct size etc. e.g 390.PBP
| Code: |
SceUID fd;
int size;
dataPSAR = (u8 *)memalign(0x40, 0x0100a830+256);
if (!dataPSAR)
{
ErrorExit(6000, "Cannot allocate memory (1).\n");
}
dataOut = (u8 *)memalign(0x40, 2000000);
if (!dataOut)
{
ErrorExit(6000, "Cannot allocate memory (2).\n");
}
printf("Opening and checking 390.PBP..... ");
fd = sceIoOpen("ms0:/390.PBP", PSP_O_RDONLY, 0777);
if (fd < 0)
{
ErrorExit(6000, "Cannot open file.\n");
}
size = sceIoLseek(fd, 0, SEEK_END);
sceIoLseek(fd, 0, PSP_SEEK_SET);
sceIoRead(fd, dataOut, 200);
if (memcmp(dataOut, "\0PBP", 4) != 0)
{
sceIoClose(fd);
ErrorExit(6000, "Invalid PBP file.\n");
}
size = size - *(u32 *)&dataOut[0x24];
sceIoLseek(fd, *(u32 *)&dataOut[0x24], PSP_SEEK_SET);
if (size != 20314528)
{
ErrorExit(6000, "Invalid 3.80 update file.\n");
sceIoClose(fd);
}
if (sceIoRead(fd, dataPSAR, 20314528) != 20314528)
{
ErrorExit(6000, "Invalid 3.80 update file (2).\n");
sceIoClose(fd);
}
sceIoClose(fd);
printf("OK\n");
|
That one can't allocate the memory.
Now this one doesn't get the sha1 right, i also removed the previous code.
| Code: |
u8 sha1_390[20] =
{
0x19, 0xAF, 0xAC, 0x87, 0x8B, 0xD3, 0x9E, 0x7A,
0x37, 0x4F, 0xF1, 0xCB, 0xF1, 0x0B, 0x9A, 0x1E,
0x59, 0x08, 0x28, 0x89,
};
SceUID fd6;
int readx, ix;
printf("390.PBP...");
fd6 = sceIoOpen("ms0:/390.PBP", PSP_O_RDONLY, 0777);
if (fd6 < 0)
{
printf("390.PBP Isn't There, Continuing\n");
}
sceKernelUtilsSha1BlockInit(&ctx);
while ((readx = sceIoRead(fd6, dataOut, 2000000)) > 0)
{
sceKernelUtilsSha1BlockUpdate(&ctx, dataOut, readx);
}
sceIoClose(fd6);
sceKernelUtilsSha1BlockResult(&ctx, sha1);
printf("\nSHA1: ");
for (ix = 0; ix < 20; ix++)
printf("%02X", sha1[i]);
if (memcmp(sha1, sha1_390, 20) != 0)
{
TextColor(RED);
printf("Error\n");
//ErrorExit(10000, "\nERROR: Invalid SHA-1. Try again.\nAuto-exiting in 10 seconds.\n");
}
TextColor(WHITE);
printf("\n3.90.PBP is Correct\n"); |
Is it something to do with Dark_AleX's code, my codes? or 3.XX |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Sat Mar 15, 2008 4:19 pm Post subject: |
|
|
| did you set correctly the heap? |
|
| Back to top |
|
 |
FaderX
Joined: 01 Mar 2008 Posts: 28
|
Posted: Sat Mar 15, 2008 4:54 pm Post subject: |
|
|
| Code: | PSP_MODULE_INFO("Check", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
PSP_HEAP_SIZE_MAX(); |
Heap is there |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sat Mar 15, 2008 6:08 pm Post subject: |
|
|
Are you sure that's the sha1 of the 3.90 update?
Because mine gives me 5957951D3F7B8A4D715C36D9135E65693F6DA334
EDIT: but the psar gives me the same sha1 than yours 19AFAC878BD39E7A374FF1CBF10B9A1E59082889, but you are reading the full file, not just the psar. |
|
| Back to top |
|
 |
FaderX
Joined: 01 Mar 2008 Posts: 28
|
Posted: Sun Mar 16, 2008 11:16 am Post subject: |
|
|
Yea i think i've also tried the 3.90 psar, it also failed, but ill give another try later.
Edit:
Tried again, still didnt work?? wtf |
|
| Back to top |
|
 |
FaderX
Joined: 01 Mar 2008 Posts: 28
|
Posted: Tue Mar 18, 2008 6:02 pm Post subject: |
|
|
| Oh does this have to bee in a separate kernel or vsh prx?? |
|
| Back to top |
|
 |
|
|
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
|