Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed a bug that incorrectly recognized as 'GameCube'. when you open …
…the Korean Wii Disc, which is re-encrypted with a common-key(g_MasterKey).
  • Loading branch information
kexplo committed Nov 11, 2013
1 parent d1de336 commit 22fef0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Core/DiscIO/Src/VolumeCreator.cpp
Expand Up @@ -183,8 +183,14 @@ static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _Part
memset(IV, 0, 16);
_rReader.Read(rPartition.Offset + 0x44c, 8, IV);

bool usingKoreanKey = false;
if (Korean && Reader.Read32(0x501ee) != 0)
{
usingKoreanKey = true;
}

aes_context AES_ctx;
aes_setkey_dec(&AES_ctx, (Korean ? g_MasterKeyK : g_MasterKey), 128);
aes_setkey_dec(&AES_ctx, (usingKoreanKey ? g_MasterKeyK : g_MasterKey), 128);

u8 VolumeKey[16];
aes_crypt_cbc(&AES_ctx, AES_DECRYPT, 16, IV, SubKey, VolumeKey);
Expand Down

0 comments on commit 22fef0d

Please sign in to comment.