Two types of executables files exist: elf and rar (all lowercase). elf can be executed directly, whereas rar must contain an elf with the SAME name. The version of the RAR compressor used must be 2.X or it will not work.
les elf et les rar ...la doc complète de mcloader est dans le rar dans la section downloads, fichier readme.doc...
Une question c'es quoi ca comme language C... pas reussi à le compiler...
///////////////////////////////////////////////////////////
// this calculates the 3 magic numbers mentioned above
//
// args: discNameLetters: 4 letters from the discname (eg SLES)
// (the letters must be between A and Z, capital letters only)
// discNameNumbers: the disc number (eg 12345)
// (the disc number must be between 0 and 99999)
// magic1: placeholder for magic number 1
// magic2: placeholder for magic number 2
// magic3: placeholder for magic number 3
// returns: true if ok
// false if error
bool calcMagicNums(char discNameLetters[4], int discNameNumbers, unsigned char *magic1, unsigned int *magic2, unsigned char *magic3)
{
unsigned int letters=0;
unsigned int numbers=0;
// check discname letters to make sure they are valid
for(int i=0; i<4; i++)
if(discNameLetters[i] < 'A' || discNameLetters[i] > 'Z')
return false;
// check discname numbers to make sure they are valid
if(discNameNumbers < 0 || discNameNumbers > 99999)
return false;
// make letters fit into a single u_int
letters = (unsigned int)(discNameLetters[3]<< 0) | (unsigned int)(discNameLetters[2]<< 7) |
(unsigned int)(discNameLetters[1]<<14) | (unsigned int)(discNameLetters[0]<<21);
// number already fits into a u_int
numbers = discNameNumbers;
// calculate magic numbers
*magic1 = ((numbers & 0x1F) << 3) | ((0x0FFFFFFF & letters) >> 25);
*magic2 = ( numbers >> 10) | ((0x0FFFFFFF & letters) << 7);
*magic3 = ((numbers & 0x3E0) >> 2) | 0x04;
return true;
}
///////////////////////////////////////////////////////////
// encrypts the raw ps2 logo
//
// args: logo: pointer to raw logo in memory (12*2048bytes)
// discNameLetters: 4 letters from the discname (eg SLES)
// (the letters must be between A and Z, capital letters only)
// discNameNumbers: the disc number (eg 12345)
// (the disc number must be between 0 and 99999)
// returns: true if ok
// false if error
bool EncryptLogo(unsigned char *logo, char discNameLetters[4], int discNameNumbers)
{
unsigned char magicNum=0, magic3=0;
unsigned int magic2=0;
// calculate the magic number needed for XORing
if(!calcMagicNums(discNameLetters, discNameNumbers, &magicNum, &magic2, &magic3))
return false;
// individually encrypt each pixel in the logo
// (even the extra bytes at the end of the pal logo)
for(int i=0; i<12*2048; i++)
{
logo[i] = ((logo[i]<<5)|(logo[i]>>3)) ^ magicNum;
}
return true;
}
|