mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 12:35:27 +00:00
Added some ugly shitty code which will let ppl paste the masterkey in hex into a masterkey.txt file and let the emu convert it to binary.
Feel free to make it nicer if you want to. Requested by ector. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1300 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
5c49095069
commit
3f52c69513
@ -59,6 +59,7 @@
|
|||||||
#define GC_MEMCARDB "MemoryCardB.raw"
|
#define GC_MEMCARDB "MemoryCardB.raw"
|
||||||
|
|
||||||
#define WII_MASTERKEY "masterkey.bin"
|
#define WII_MASTERKEY "masterkey.bin"
|
||||||
|
#define WII_MASTERKEY_HEX "masterkey.txt"
|
||||||
#define WII_EUR_SETTING "setting-eur.txt"
|
#define WII_EUR_SETTING "setting-eur.txt"
|
||||||
#define WII_USA_SETTING "setting-usa.txt"
|
#define WII_USA_SETTING "setting-usa.txt"
|
||||||
#define WII_JAP_SETTING "setting-jpn.txt"
|
#define WII_JAP_SETTING "setting-jpn.txt"
|
||||||
@ -109,6 +110,7 @@
|
|||||||
#define DSP_COEF_FILE FULL_GC_SYS_DIR DSP_COEF
|
#define DSP_COEF_FILE FULL_GC_SYS_DIR DSP_COEF
|
||||||
|
|
||||||
#define WII_MASTERKEY_FILE FULL_WII_SYS_DIR WII_MASTERKEY
|
#define WII_MASTERKEY_FILE FULL_WII_SYS_DIR WII_MASTERKEY
|
||||||
|
#define WII_MASTERKEY_FILE_HEX FULL_WII_SYS_DIR WII_MASTERKEY_HEX
|
||||||
#define WII_EUR_SETTING_FILE FULL_WII_SYS_DIR WII_EUR_SETTING
|
#define WII_EUR_SETTING_FILE FULL_WII_SYS_DIR WII_EUR_SETTING
|
||||||
#define WII_USA_SETTING_FILE FULL_WII_SYS_DIR WII_USA_SETTING
|
#define WII_USA_SETTING_FILE FULL_WII_SYS_DIR WII_USA_SETTING
|
||||||
#define WII_JAP_SETTING_FILE FULL_WII_SYS_DIR WII_JAP_SETTING
|
#define WII_JAP_SETTING_FILE FULL_WII_SYS_DIR WII_JAP_SETTING
|
||||||
|
@ -127,8 +127,38 @@ IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _VolumeType)
|
|||||||
FILE* pT = fopen(WII_MASTERKEY_FILE, "rb");
|
FILE* pT = fopen(WII_MASTERKEY_FILE, "rb");
|
||||||
if (pT == NULL)
|
if (pT == NULL)
|
||||||
{
|
{
|
||||||
PanicAlert("Can't open " WII_MASTERKEY_FILE);
|
PanicAlert("Can't open '" WII_MASTERKEY_FILE "'.\n If you know the key, now it's the time to paste it into '" WII_MASTERKEY_FILE_HEX "' before pressing [OK].");
|
||||||
return NULL;
|
|
||||||
|
pT = fopen(WII_MASTERKEY_FILE_HEX, "r");
|
||||||
|
if(pT==NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
static char hexkey[32];
|
||||||
|
if(fread(hexkey,1,32,pT)<32)
|
||||||
|
{
|
||||||
|
fclose(pT);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
fclose(pT);
|
||||||
|
|
||||||
|
static char binkey[16];
|
||||||
|
char *t=hexkey;
|
||||||
|
for(int i=0;i<16;i++)
|
||||||
|
{
|
||||||
|
char h[3]={*(t++),*(t++),0};
|
||||||
|
binkey[i] = strtol(h,NULL,16);
|
||||||
|
}
|
||||||
|
|
||||||
|
pT = fopen(WII_MASTERKEY_FILE, "wb");
|
||||||
|
if(pT==NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
fwrite(binkey,16,1,pT);
|
||||||
|
fclose(pT);
|
||||||
|
|
||||||
|
pT = fopen(WII_MASTERKEY_FILE, "rb");
|
||||||
|
if(pT==NULL)
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(g_MasterKey, 16, 1, pT);
|
fread(g_MasterKey, 16, 1, pT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user