mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
Add Read16/Read8 to the CBlobBigEndianReader so the key check is reading 8bit from the correct location to determin which key to use. Also change check to == 1 as suggested in the IRC channel on first implementation. Potentially fixes 6852.
This commit is contained in:
parent
14d9802ea4
commit
4867937355
@ -45,9 +45,20 @@ public:
|
||||
{
|
||||
u32 Temp;
|
||||
m_rReader.Read(_Offset, 4, (u8*)&Temp);
|
||||
return(Common::swap32(Temp));
|
||||
return Common::swap32(Temp);
|
||||
}
|
||||
u16 Read16(u64 _Offset)
|
||||
{
|
||||
u16 Temp;
|
||||
m_rReader.Read(_Offset, 2, (u8*)&Temp);
|
||||
return Common::swap16(Temp);
|
||||
}
|
||||
u8 Read8(u64 _Offset)
|
||||
{
|
||||
u8 Temp;
|
||||
m_rReader.Read(_Offset, 1, &Temp);
|
||||
return Temp;
|
||||
}
|
||||
|
||||
private:
|
||||
IBlobReader& m_rReader;
|
||||
};
|
||||
@ -188,10 +199,8 @@ static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _Part
|
||||
// Magic value is at 0x501f1 (1byte)
|
||||
// If encrypted with the Korean key, the magic value would be 1
|
||||
// Otherwise it is zero
|
||||
if (Korean && Reader.Read32(0x501ee) != 0)
|
||||
{
|
||||
if (Korean && Reader.Read8(0x501f1) == 1)
|
||||
usingKoreanKey = true;
|
||||
}
|
||||
|
||||
aes_context AES_ctx;
|
||||
aes_setkey_dec(&AES_ctx, (usingKoreanKey ? g_MasterKeyK : g_MasterKey), 128);
|
||||
|
Loading…
x
Reference in New Issue
Block a user