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 

mcSetFileInfo help please!

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



Joined: 24 Sep 2008
Posts: 2

PostPosted: Tue Apr 20, 2010 5:52 am    Post subject: mcSetFileInfo help please! Reply with quote

Hi!
Greetings to all i'm new here...

First thing first: i'm not a programmer nor do i have any experience with programming,
so please be understanding and don't take for granted that i know stuff :)

So the question is:
I am playing around with some old fmcb sources to make an installer that installs
a single file to "mc1:/BEEXEC-SYSTEM" and after the installation i would like it to
protect "BEEXEC-SYSTEM" using mcSetFileInfo... thus my kids can't erase it +
i have an easy way to update their Memorycards.

Tried lots of different stuff but i cant get it to work :(

Note: the code is heavily modified by trial and error method,
and i went with the embeded file method for ease of use.

Regards.

Code:
int Install_Hack(void)
{

   int ret; //, i;
//    u8 *OSDname;
//    char OSD_Path[MAX_PATH];
//    char path[MAX_PATH];
//    char launch_path[MAX_PATH];
//   u8 *cnf_file, *boot_file;
//   int cnf_filesize, boot_filesize;
//   int custom_cnf = 0;
//   int fd, fd2, r, r2;
//   char *p;



   mcMkDir(1,0, "BEEXEC-SYSTEM");
   mcSync(0, NULL, &ret);

//-->   test_mcTable = mcDir[i];
//-->   test_mcTable.attrFile = 0x8497;
//-->   mcSetFileInfo(1, 0, "BEEXEC-SYSTEM", (char *) &test_mcTable, 0x0008)


   Print_XY("Updating .....", pos_x, pos_y, MainTextColor, 0.5f, 0.7f);
   Draw_Screen();
    if (!(Create_File(install_tab[BOOT_ELF], &boot_elf, size_boot_elf)))
   {
      scr_printf("error creating %s\n", install_tab[BOOT_ELF]);
      Print_XY("Klart !", pos_x + 250, pos_y, MainTextColor, 0.5f, 0.7f);
      pos_y += FONT_HEIGHT;
      Draw_Screen();
      return 0;
   }
   Print_XY("Klart !", pos_x + 250, pos_y, TextGreen, 0.5f, 0.7f);
   pos_y += FONT_HEIGHT;
   Draw_Screen();
   
//   mcSync(0, NULL, &ret);

   return 1;
}
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 -> PS2 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