forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Function to grep an homebrew name from eboot?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Sun Feb 24, 2008 3:21 am    Post subject: Function to grep an homebrew name from eboot? Reply with quote

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
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sun Feb 24, 2008 4:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Sun Feb 24, 2008 4:36 am    Post subject: Reply with quote

Many thanks Insert_witty_name, i will take a look and post the code here if successfull.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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