Function to grep an homebrew name from eboot?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Function to grep an homebrew name from eboot?

Post by Cpasjuste »

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.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

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: Select all

char name[] = "NewName";

int lSize;

int fd = sceIoOpen(filepath, PSP_O_RDONLY, 0777);

if&#40;fd < 0&#41;
	return -1;

lSize = sceIoLseek32&#40;fd, 0, PSP_SEEK_END&#41;;
	
unsigned char *fileBuffer = malloc&#40;lSize&#41;;
	
if&#40;fileBuffer == NULL&#41;
&#123;
	sceIoClose&#40;fd&#41;;
	return -1;
&#125;

sceIoLseek32&#40;fd, 0, SEEK_SET&#41;;

sceIoRead&#40;fd, fileBuffer, lSize&#41;;

sceIoClose&#40;fd&#41;;

strncpy&#40;&#40;char *&#41; &fileBuffer&#91;320&#93;, name, 127&#41;;
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.
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Many thanks Insert_witty_name, i will take a look and post the code here if successfull.
Post Reply