Hi,
I'm trying to write a simple function to retrieve the "param.sfo" homebrew name from an eboot, but i can't get it.
Does someone have a sample around ?
Thanks in advance,
Cpasjuste.
Function to grep an homebrew name from eboot?
-
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm
Hi.
The quick and dirty way is to open the EBOOT, seek to 320 from the start, then read 128 bytes.
Alternatively you can look at the source of mksfo and unpack-pbp for detailed information.
Here's the code to a function I use to change the name.
I read all the file into a buffer because I do further processing.
The quick and dirty way is to open the EBOOT, seek to 320 from the start, then read 128 bytes.
Alternatively you can look at the source of mksfo and unpack-pbp for detailed information.
Here's the code to a function I use to change the name.
Code: Select all
char name[] = "NewName";
int lSize;
int fd = sceIoOpen(filepath, PSP_O_RDONLY, 0777);
if(fd < 0)
return -1;
lSize = sceIoLseek32(fd, 0, PSP_SEEK_END);
unsigned char *fileBuffer = malloc(lSize);
if(fileBuffer == NULL)
{
sceIoClose(fd);
return -1;
}
sceIoLseek32(fd, 0, SEEK_SET);
sceIoRead(fd, fileBuffer, lSize);
sceIoClose(fd);
strncpy((char *) &fileBuffer[320], name, 127);
Last edited by Insert_witty_name on Sun Feb 24, 2008 4:37 am, edited 1 time in total.