everytime i use a kernel or user eboot under UPDATE it doesnt work (shows currupt), i know im going wrong somewere, just dunno (im using 1.50 kernel btw)
all im doing is reading from flash0, not flashing or anything. the other things im doing is like putting a eboot on the ms & making directiories on it aswell.
i've searched around, google and http://forums.ps2dev.org/search.php lolol
can anyone help me get this to run under UPDATE please??
Code: Select all
PSP_MODULE_INFO("write", 0x1000, 1, 0);
PSP_MAIN_THREAD_ATTR(0);
#define FILE_SIZE 0000
char file_buffer[FILE_SIZE];
u8 file_md5[16] =
{
/*md5*/
};
void ErrorExit(int milisecs, char *fmt, ...)
{
va_list list;
char msg[256];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
printf(msg);
sceKernelDelayThread(milisecs*1000);
sceKernelExitGame();
}
void read_file(char *file, u8 *md5, char *buf, int size)
{
SceUID fd;
int read;
u8 digest[16];
fd= sceIoOpen(file, PSP_O_RDONLY, 0777);
if (fd < 0)
{
ErrorExit(4000, "blah blah\n", file);
}
read = sceIoRead(fd, buf, size);
if (read != size)
{
ErrorExit(4000, "blah blah\n", file);
}
if (sceKernelUtilsMd5Digest((u8 *)buf, size, digest) < 0)
{
ErrorExit(4000, "blah blah\n");
}
if (memcmp(digest, md5, 16) != 0)
{
ErrorExit(4000, "blah blah\n", file);
}
}
/*i know this involves the use of the buffers lol, might be my problem in user??*/
int check_file()
{
read_file("flash0:/blah", filemd5, file_buffer, FILE_SIZE);
return 0;
}
int menu()
{
pspDebugScreenClear();
printf("blahblah\n");
return 0;
}
int Eboots()
{
sceIoMkdir("ms0:/blah", 0777);
SceUID fd = sceIoOpen("ms0:/blah.PBP", PSP_O_WRONLY | PSP_O_CREAT, 0777);
if(fd < 0)
{
TextColor(RED);
ErrorExit(5000, "\n\nCannot open file for writing.\n");
}
int written = sceIoWrite(fd, EBOOTS, size_EBOOTS);
if(written != size_EBOOTS)
{
sceIoClose(fd);
TextColor(RED);
ErrorExit(5000, "\n\nCannot write file.\n");
}
sceIoClose(fd);
return 0;
}
int main()
{
pspDebugScreenClear();
check_file();
menu();
while (1)
{
SceCtrlData pad;
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_RTRIGGER)
{
sceKernelExitGame();
}
else if (pad.Buttons & PSP_CTRL_CROSS)
{
break;
}
sceKernelDelayThread(10000);
}
Eboots();
printf("\n\n\nDone");
sceKernelExitGame();
return 0;
}