summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorChanwoong Kim <devk0817@gmail.com>2013-11-12 01:05:30 +0900
committerChanwoong Kim <devk0817@gmail.com>2013-11-12 01:05:30 +0900
commit22fef0da9bdda47dba0b83ba2ea89de1b28a75ab (patch)
tree06dcaa092552f6fcaf6a9533f4158b64dea4de29 /Source/Core/DiscIO
parentd1de3368797e137a9b953356775271918c116e57 (diff)
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).
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/Src/VolumeCreator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/Src/VolumeCreator.cpp b/Source/Core/DiscIO/Src/VolumeCreator.cpp
index 7cf26f826a..4863a17949 100644
--- a/Source/Core/DiscIO/Src/VolumeCreator.cpp
+++ b/Source/Core/DiscIO/Src/VolumeCreator.cpp
@@ -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);