|
static ssize_t | ccInflateMemory (unsigned char *in, ssize_t inLength, unsigned char **out) |
| Inflates either zlib or gzip deflated memory. More...
|
|
static ssize_t | inflateMemory (unsigned char *in, ssize_t inLength, unsigned char **out) |
static ssize_t | ccInflateMemoryWithHint (unsigned char *in, ssize_t inLength, unsigned char **out, ssize_t outLengthHint) |
| Inflates either zlib or gzip deflated memory. More...
|
|
static ssize_t | inflateMemoryWithHint (unsigned char *in, ssize_t inLength, unsigned char **out, ssize_t outLengthHint) |
static int | ccInflateGZipFile (const char *filename, unsigned char **out) |
| inflates a GZip file into memory More...
|
|
static int | inflateGZipFile (const char *filename, unsigned char **out) |
static bool | ccIsGZipFile (const char *filename) |
| test a file is a GZip format file or not More...
|
|
static bool | isGZipFile (const char *filename) |
static bool | ccIsGZipBuffer (const unsigned char *buffer, ssize_t len) |
| test the buffer is GZip format or not More...
|
|
static bool | isGZipBuffer (const unsigned char *buffer, ssize_t len) |
static int | ccInflateCCZFile (const char *filename, unsigned char **out) |
| inflates a CCZ file into memory More...
|
|
static int | inflateCCZFile (const char *filename, unsigned char **out) |
static int | ccInflateCCZBuffer (const unsigned char *buffer, ssize_t len, unsigned char **out) |
| inflates a buffer with CCZ format into memory More...
|
|
static int | inflateCCZBuffer (const unsigned char *buffer, ssize_t len, unsigned char **out) |
static bool | ccIsCCZFile (const char *filename) |
| test a file is a CCZ format file or not More...
|
|
static bool | isCCZFile (const char *filename) |
static bool | ccIsCCZBuffer (const unsigned char *buffer, ssize_t len) |
| test the buffer is CCZ format or not More...
|
|
static bool | isCCZBuffer (const unsigned char *buffer, ssize_t len) |
static void | ccSetPvrEncryptionKeyPart (int index, unsigned int value) |
| Sets the pvr.ccz encryption key parts separately for added security. More...
|
|
static void | setPvrEncryptionKeyPart (int index, unsigned int value) |
static void | ccSetPvrEncryptionKey (unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4) |
| Sets the pvr.ccz encryption key. More...
|
|
static void | setPvrEncryptionKey (unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4) |
static void ccSetPvrEncryptionKey |
( |
unsigned int |
keyPart1, |
|
|
unsigned int |
keyPart2, |
|
|
unsigned int |
keyPart3, |
|
|
unsigned int |
keyPart4 |
|
) |
| |
|
inlinestatic |
Sets the pvr.ccz encryption key.
Example: If the key used to encrypt the pvr.ccz file is 0xaaaaaaaabbbbbbbbccccccccdddddddd you will call this function with the key split into 4 parts as follows
ZipUtils::setPvrEncryptionKey(0xaaaaaaaa, 0xbbbbbbbb, 0xcccccccc, 0xdddddddd);
Note that using this function makes it easier to reverse engineer and discover the complete key because the key parts are present in one function call.
IMPORTANT: Be sure to call setPvrEncryptionKey or setPvrEncryptionKeyPart with all of the key parts before loading the spritesheet or decryption will fail and the spritesheet will fail to load.
- Parameters
-
keyPart1 | the key value part 1. |
keyPart2 | the key value part 2. |
keyPart3 | the key value part 3. |
keyPart4 | the key value part 4. |
static void
ccSetPvrEncryptionKeyPart |
( |
int |
index, |
|
|
unsigned int |
value |
|
) |
| |
|
inlinestatic |
Sets the pvr.ccz encryption key parts separately for added security.
Example: If the key used to encrypt the pvr.ccz file is 0xaaaaaaaabbbbbbbbccccccccdddddddd you will call this function 4 different times, preferably from 4 different source files, as follows
ZipUtils::setPvrEncryptionKeyPart(0, 0xaaaaaaaa); ZipUtils::setPvrEncryptionKeyPart(1, 0xbbbbbbbb); ZipUtils::setPvrEncryptionKeyPart(2, 0xcccccccc); ZipUtils::setPvrEncryptionKeyPart(3, 0xdddddddd);
Splitting the key into 4 parts and calling the function from 4 different source files increases the difficulty to reverse engineer the encryption key. Be aware that encrpytion is never 100% secure and the key code can be cracked by knowledgable persons.
IMPORTANT: Be sure to call setPvrEncryptionKey or setPvrEncryptionKeyPart with all of the key parts before loading the spritesheet or decryption will fail and the spritesheet will fail to load.
- Parameters
-
index | part of the key [0..3] |
value | value of the key part |