 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
Posted: Sun Feb 24, 2008 3:21 am Post subject: Function to grep an homebrew name from eboot? |
|
|
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. |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sun Feb 24, 2008 4:33 am Post subject: |
|
|
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.
| Code: | 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); |
I read all the file into a buffer because I do further processing.
Last edited by Insert_witty_name on Sun Feb 24, 2008 4:37 am; edited 1 time in total |
|
| Back to top |
|
 |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
Posted: Sun Feb 24, 2008 4:36 am Post subject: |
|
|
| Many thanks Insert_witty_name, i will take a look and post the code here if successfull. |
|
| 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
|