- compiled with PPC r41-2 and libogc 2.4.0 commit a2841dc. Hopefully fixes a time issue.

This commit is contained in:
Fledge68 2023-05-07 17:31:19 -05:00
parent 1239b90751
commit 04cdd3de52
6 changed files with 5 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

@ -53,7 +53,7 @@ void AES_EnableDecrypt(const u8 *key, const u8 *iv)
#define AES_LIMIT 0x1000 #define AES_LIMIT 0x1000
static u8 AES_BUF[AES_LIMIT*16] ATTRIBUTE_ALIGN(16); /* 64KB */ static u8 AES_BUF[AES_LIMIT*16] ATTRIBUTE_ALIGN(16); /* 64KB */
void AES_Decrypt(u8 *inbuf, u8 *outbuf, u16 num_blocks) void AES_Decrypt_(u8 *inbuf, u8 *outbuf, u16 num_blocks)
{ {
/* set mode back to 0 */ /* set mode back to 0 */
aes_mode = 0; aes_mode = 0;

View File

@ -19,6 +19,6 @@
void AES_ResetEngine(void); void AES_ResetEngine(void);
void AES_EnableDecrypt(const u8 *key, const u8 *iv); void AES_EnableDecrypt(const u8 *key, const u8 *iv);
void AES_Decrypt(u8 *inbuf, u8 *outbuf, u16 num_blocks); void AES_Decrypt_(u8 *inbuf, u8 *outbuf, u16 num_blocks);
#endif #endif

View File

@ -42,7 +42,7 @@ void decrypt_title_key(u8 *tik, u8 *title_key)
{ {
AES_ResetEngine(); AES_ResetEngine();
AES_EnableDecrypt((tik[0x01f1] == 1) ? korean_key : common_key, iv); AES_EnableDecrypt((tik[0x01f1] == 1) ? korean_key : common_key, iv);
AES_Decrypt(tik + 0x01bf, title_key, 1); AES_Decrypt_(tik + 0x01bf, title_key, 1);
} }
else else
{ {
@ -106,7 +106,7 @@ static int partition_read_block(wiidisc_t *d, u32 blockno, u8 *block)
{ {
AES_ResetEngine(); AES_ResetEngine();
AES_EnableDecrypt(d->disc_key, iv); AES_EnableDecrypt(d->disc_key, iv);
AES_Decrypt(raw + 0x400, block, 0x7c0); AES_Decrypt_(raw + 0x400, block, 0x7c0);
} }
else else
{ {

View File

@ -208,7 +208,7 @@ int installWad(const char *path)
fread(AES_WAD_Buf, size_enc, 1, wad_file); fread(AES_WAD_Buf, size_enc, 1, wad_file);
AES_EnableDecrypt(tik_key, aes_iv); //ISFS seems to reset it? AES_EnableDecrypt(tik_key, aes_iv); //ISFS seems to reset it?
memcpy(aes_iv, AES_WAD_Buf+(size_enc-16), 16); //last block for cbc memcpy(aes_iv, AES_WAD_Buf+(size_enc-16), 16); //last block for cbc
AES_Decrypt(AES_WAD_Buf, AES_WAD_Buf, num_blocks); AES_Decrypt_(AES_WAD_Buf, AES_WAD_Buf, num_blocks);
u64 size_dec = (content->size - read); u64 size_dec = (content->size - read);
if(size_dec > WAD_BUF) if(size_dec > WAD_BUF)