Skip to content

Commit

Permalink
Merge pull request #1267 from lioncash/statics
Browse files Browse the repository at this point in the history
VolumeCreator: Make master key arrays static
  • Loading branch information
skidau committed Oct 14, 2014
2 parents 01359a4 + 00b3cc3 commit a069183
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Source/Core/DiscIO/VolumeCreator.cpp
Expand Up @@ -59,8 +59,15 @@ class CBlobBigEndianReader
IBlobReader& m_rReader;
};

const unsigned char g_MasterKey[16] = {0xeb,0xe4,0x2a,0x22,0x5e,0x85,0x93,0xe4,0x48,0xd9,0xc5,0x45,0x73,0x81,0xaa,0xf7};
const unsigned char g_MasterKeyK[16] = {0x63,0xb8,0x2b,0xb4,0xf4,0x61,0x4e,0x2e,0x13,0xf2,0xfe,0xfb,0xba,0x4c,0x9b,0x7e};
static const unsigned char s_master_key[16] = {
0xeb,0xe4,0x2a,0x22,0x5e,0x85,0x93,0xe4,
0x48,0xd9,0xc5,0x45,0x73,0x81,0xaa,0xf7
};

static const unsigned char s_master_key_korean[16] = {
0x63,0xb8,0x2b,0xb4,0xf4,0x61,0x4e,0x2e,
0x13,0xf2,0xfe,0xfb,0xba,0x4c,0x9b,0x7e
};

static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _PartitionGroup, u32 _VolumeType, u32 _VolumeNum, bool Korean);
EDiscType GetDiscType(IBlobReader& _rReader);
Expand Down Expand Up @@ -195,7 +202,7 @@ static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _Part
usingKoreanKey = true;

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

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

0 comments on commit a069183

Please sign in to comment.