BS2: check the hash of the loaded ipl.bin file
remove some extra + chars from a few ini files (copypasta from a patch?)
This commit is contained in:
parent
70dffdc3e1
commit
5c15292fd8
|
@ -5,66 +5,66 @@ EmulationStateId = 5
|
||||||
EmulationIssues =
|
EmulationIssues =
|
||||||
[OnFrame] Add memory patches to be applied every frame here.
|
[OnFrame] Add memory patches to be applied every frame here.
|
||||||
[ActionReplay] Add action replay cheats here.
|
[ActionReplay] Add action replay cheats here.
|
||||||
+$Can always save
|
$Can always save
|
||||||
+04153E00 38000037
|
04153E00 38000037
|
||||||
+04153A50 60000000
|
04153A50 60000000
|
||||||
+$Zero saves
|
$Zero saves
|
||||||
+0233B832 00000000
|
0233B832 00000000
|
||||||
+$Have all maps
|
$Have all maps
|
||||||
+022961C2 0000FFFF
|
022961C2 0000FFFF
|
||||||
+$Have all files
|
$Have all files
|
||||||
+022961C0 0000FFFB
|
022961C0 0000FFFB
|
||||||
+022961C6 0000FFFF
|
022961C6 0000FFFF
|
||||||
+$Timers don't decrease
|
$Timers don't decrease
|
||||||
+043835C0 00015F91
|
043835C0 00015F91
|
||||||
+$Infinite Ammo (All slots)
|
$Infinite Ammo (All slots)
|
||||||
+04152D34 3BC00063
|
04152D34 3BC00063
|
||||||
+04152D60 60000000
|
04152D60 60000000
|
||||||
+$Infinite health (REBECCA)
|
$Infinite health (REBECCA)
|
||||||
+0431CA4C 00000100
|
0431CA4C 00000100
|
||||||
+$Infinite Ammo [All Slots] (R)
|
$Infinite Ammo [All Slots] (R)
|
||||||
+023272EA 00000063
|
023272EA 00000063
|
||||||
+023272EE 00000063
|
023272EE 00000063
|
||||||
+023272F2 00000063
|
023272F2 00000063
|
||||||
+023272F6 00000063
|
023272F6 00000063
|
||||||
+023272FA 00000063
|
023272FA 00000063
|
||||||
+023272FE 00000063
|
023272FE 00000063
|
||||||
+$Slot 1/2: Hunting gun (R)
|
$Slot 1/2: Hunting gun (R)
|
||||||
+023272E8 00000005
|
023272E8 00000005
|
||||||
+$Slot 1/2: Shotgun (R)
|
$Slot 1/2: Shotgun (R)
|
||||||
+023272E8 00000006
|
023272E8 00000006
|
||||||
+$Slot 1/2: Grenade Launcher (R)
|
$Slot 1/2: Grenade Launcher (R)
|
||||||
+023272E8 00000007
|
023272E8 00000007
|
||||||
+$Slot 1/2: Sub-machine gun (R)
|
$Slot 1/2: Sub-machine gun (R)
|
||||||
+023272E8 0000000B
|
023272E8 0000000B
|
||||||
+$Slot 1/2: Rocket Launcher (R)
|
$Slot 1/2: Rocket Launcher (R)
|
||||||
+023272E8 00000017
|
023272E8 00000017
|
||||||
+$Slot 3: Magnum Revolver (R)
|
$Slot 3: Magnum Revolver (R)
|
||||||
+023272F0 00000016
|
023272F0 00000016
|
||||||
+$Slot 4: Moltov cocktails (R)
|
$Slot 4: Moltov cocktails (R)
|
||||||
+023272F4 0000000E
|
023272F4 0000000E
|
||||||
+$Infinite health (BILLY)
|
$Infinite health (BILLY)
|
||||||
+0231CC76 00000100
|
0231CC76 00000100
|
||||||
+$Slot 1/2: Hunting gun (B)
|
$Slot 1/2: Hunting gun (B)
|
||||||
+02327308 00000005
|
02327308 00000005
|
||||||
+$Slot 1/2: Shotgun (B)
|
$Slot 1/2: Shotgun (B)
|
||||||
+02327308 00000006
|
02327308 00000006
|
||||||
+$Slot 1/2: Grenade Launcher (B)
|
$Slot 1/2: Grenade Launcher (B)
|
||||||
+02327308 00000007
|
02327308 00000007
|
||||||
+$Slot 1/2: Sub-machine gun (B)
|
$Slot 1/2: Sub-machine gun (B)
|
||||||
+02327308 0000000B
|
02327308 0000000B
|
||||||
+$Slot 1/2: Rocket Launcher (B)
|
$Slot 1/2: Rocket Launcher (B)
|
||||||
+02327308 00000017
|
02327308 00000017
|
||||||
+$Slot 3: Magnum Revolver (B)
|
$Slot 3: Magnum Revolver (B)
|
||||||
+02327310 00000016
|
02327310 00000016
|
||||||
+$Infinite Ammo [All Slots] (B)
|
$Infinite Ammo [All Slots] (B)
|
||||||
+0232730A 00000063
|
0232730A 00000063
|
||||||
+0232730E 00000063
|
0232730E 00000063
|
||||||
+02327312 00000063
|
02327312 00000063
|
||||||
+02327316 00000063
|
02327316 00000063
|
||||||
+0232731A 00000063
|
0232731A 00000063
|
||||||
+0232731E 00000063
|
0232731E 00000063
|
||||||
+$Slot 4: Moltov cocktails (B)
|
$Slot 4: Moltov cocktails (B)
|
||||||
+02327214 0000000E
|
02327214 0000000E
|
||||||
[Video]
|
[Video]
|
||||||
ProjectionHack = 0
|
ProjectionHack = 0
|
||||||
|
|
|
@ -8,111 +8,111 @@ EmulationStateId = 4
|
||||||
EmulationIssues =
|
EmulationIssues =
|
||||||
[OnFrame]
|
[OnFrame]
|
||||||
[ActionReplay]
|
[ActionReplay]
|
||||||
+$Infinite Health
|
$Infinite Health
|
||||||
+425577DC 02D90064
|
425577DC 02D90064
|
||||||
+6C5577DC 81000000
|
6C5577DC 81000000
|
||||||
+425577DC 015C0064
|
425577DC 015C0064
|
||||||
+425577DC 02310064
|
425577DC 02310064
|
||||||
+$Infinite Oxygen
|
$Infinite Oxygen
|
||||||
+025666B6 00000DAC
|
025666B6 00000DAC
|
||||||
+$No Reload
|
$No Reload
|
||||||
+325B08F6 0000000F
|
325B08F6 0000000F
|
||||||
+025B08FA 00000019
|
025B08FA 00000019
|
||||||
+2A5B08F6 00000010
|
2A5B08F6 00000010
|
||||||
+025B08FA 0000000F
|
025B08FA 0000000F
|
||||||
+$Max Grip Level
|
$Max Grip Level
|
||||||
+025666E8 0000012C
|
025666E8 0000012C
|
||||||
+$Have Infinite Rations
|
$Have Infinite Rations
|
||||||
+025668FA 00000005
|
025668FA 00000005
|
||||||
+$Have Infinite Medicine
|
$Have Infinite Medicine
|
||||||
+025668FE 00000001
|
025668FE 00000001
|
||||||
+$Have Infinite Bandages
|
$Have Infinite Bandages
|
||||||
+02566900 0000000A
|
02566900 0000000A
|
||||||
+$Have Infinite Pentazem
|
$Have Infinite Pentazem
|
||||||
+02566902 0000000A
|
02566902 0000000A
|
||||||
+$Have Body Armor
|
$Have Body Armor
|
||||||
+02566906 00000001
|
02566906 00000001
|
||||||
+$Have Mine Detector
|
$Have Mine Detector
|
||||||
+0256690A 00000001
|
0256690A 00000001
|
||||||
+$Have RP Sensor
|
$Have RP Sensor
|
||||||
+0256692A 00000001
|
0256692A 00000001
|
||||||
+$Have Gas Mask
|
$Have Gas Mask
|
||||||
+0256690E 00000001
|
0256690E 00000001
|
||||||
+$Have Night Vision Goggles
|
$Have Night Vision Goggles
|
||||||
+02566910 00000001
|
02566910 00000001
|
||||||
+$Have Thermal Goggles
|
$Have Thermal Goggles
|
||||||
+02566912 00000001
|
02566912 00000001
|
||||||
+$Have Scope
|
$Have Scope
|
||||||
+02566914 00000001
|
02566914 00000001
|
||||||
+$Have Digital Camera
|
$Have Digital Camera
|
||||||
+02566916 00000001
|
02566916 00000001
|
||||||
+$Have Rope
|
$Have Rope
|
||||||
+02566920 00000001
|
02566920 00000001
|
||||||
+$Have Handkerchief
|
$Have Handkerchief
|
||||||
+0256694A 00000001
|
0256694A 00000001
|
||||||
+$Have Box 1
|
$Have Box 1
|
||||||
+02566918 00000001
|
02566918 00000001
|
||||||
+$Have Box 2
|
$Have Box 2
|
||||||
+02566924 00000001
|
02566924 00000001
|
||||||
+$Have Box 3
|
$Have Box 3
|
||||||
+02566926 00000001
|
02566926 00000001
|
||||||
+$Have Ketchup
|
$Have Ketchup
|
||||||
+02566928 00000001
|
02566928 00000001
|
||||||
+$Have SOCOM Suppressor
|
$Have SOCOM Suppressor
|
||||||
+02566932 00000001
|
02566932 00000001
|
||||||
+$Have MO Disc
|
$Have MO Disc
|
||||||
+0256693C 00000001
|
0256693C 00000001
|
||||||
+$Have Level 99 Keycard
|
$Have Level 99 Keycard
|
||||||
+0256691C 00000063
|
0256691C 00000063
|
||||||
+$Have Bandana
|
$Have Bandana
|
||||||
+02566938 00000001
|
02566938 00000001
|
||||||
+$Have Stealth Suit
|
$Have Stealth Suit
|
||||||
+02566908 00000001
|
02566908 00000001
|
||||||
+$Have M9 (Infinite Ammo)
|
$Have M9 (Infinite Ammo)
|
||||||
+0256686A 0000002E
|
0256686A 0000002E
|
||||||
+$Have SOCOM (Infinite Ammo)
|
$Have SOCOM (Infinite Ammo)
|
||||||
+0256686E 0000003D
|
0256686E 0000003D
|
||||||
+$Have PSG1 (Infinite Ammo)
|
$Have PSG1 (Infinite Ammo)
|
||||||
+02566870 0000003D
|
02566870 0000003D
|
||||||
+$Have Nikita (Infinite Ammo)
|
$Have Nikita (Infinite Ammo)
|
||||||
+02566874 00000028
|
02566874 00000028
|
||||||
+$Have Stinger (Infinite Ammo)
|
$Have Stinger (Infinite Ammo)
|
||||||
+02566876 00000028
|
02566876 00000028
|
||||||
+$Have Claymore (Infinite Ammo)
|
$Have Claymore (Infinite Ammo)
|
||||||
+02566878 00000010
|
02566878 00000010
|
||||||
+$Have C4 (Infinite Ammo)
|
$Have C4 (Infinite Ammo)
|
||||||
+0256687A 00000010
|
0256687A 00000010
|
||||||
+$Have Chaff Grenade (Infinite Ammo)
|
$Have Chaff Grenade (Infinite Ammo)
|
||||||
+0256687C 00000014
|
0256687C 00000014
|
||||||
+$Have Stun Grenade (Infinite Ammo)
|
$Have Stun Grenade (Infinite Ammo)
|
||||||
+0256687E 00000014
|
0256687E 00000014
|
||||||
+$Have Grenade (Infinite Ammo)
|
$Have Grenade (Infinite Ammo)
|
||||||
+0256688A 00000014
|
0256688A 00000014
|
||||||
+$Have FAMAS (Infinite Ammo)
|
$Have FAMAS (Infinite Ammo)
|
||||||
+0256688C 000000D3
|
0256688C 000000D3
|
||||||
+$Have PSG1-T (Infinite Ammo)
|
$Have PSG1-T (Infinite Ammo)
|
||||||
+0256688E 0000003D
|
0256688E 0000003D
|
||||||
+$Have Book (Infinite Ammo)
|
$Have Book (Infinite Ammo)
|
||||||
+02566892 00000005
|
02566892 00000005
|
||||||
+$Have Magazine (Infinite Ammo)
|
$Have Magazine (Infinite Ammo)
|
||||||
+02566888 00000064
|
02566888 00000064
|
||||||
+$Have No PAL Key
|
$Have No PAL Key
|
||||||
+0256694C 00000000
|
0256694C 00000000
|
||||||
+$Have Warm (Yellow) PAL Key
|
$Have Warm (Yellow) PAL Key
|
||||||
+0256694C 00000001
|
0256694C 00000001
|
||||||
+$Have Cold (Blue) PAL Key
|
$Have Cold (Blue) PAL Key
|
||||||
+0256694C 00000002
|
0256694C 00000002
|
||||||
+$Have Hot (Red) PAL Key
|
$Have Hot (Red) PAL Key
|
||||||
+0256694C 00000003
|
0256694C 00000003
|
||||||
+$Low Total Game Time
|
$Low Total Game Time
|
||||||
+045666F4 000000A0
|
045666F4 000000A0
|
||||||
+$Saved 0 Times
|
$Saved 0 Times
|
||||||
+025666F2 00000000
|
025666F2 00000000
|
||||||
+$Continued 0 Times
|
$Continued 0 Times
|
||||||
+025666EC 00000000
|
025666EC 00000000
|
||||||
+$999 Kills
|
$999 Kills
|
||||||
+02566700 000003E7
|
02566700 000003E7
|
||||||
+$0 Rations Used
|
$0 Rations Used
|
||||||
+02567B4C 00000000
|
02567B4C 00000000
|
||||||
[Video]
|
[Video]
|
||||||
ProjectionHack = 0
|
ProjectionHack = 0
|
||||||
|
|
|
@ -5,42 +5,42 @@ EmulationStateId = 5
|
||||||
EmulationIssues =
|
EmulationIssues =
|
||||||
[OnFrame] Add memory patches to be applied every frame here.
|
[OnFrame] Add memory patches to be applied every frame here.
|
||||||
[ActionReplay] Add action replay cheats here.
|
[ActionReplay] Add action replay cheats here.
|
||||||
+$Infinite/max health
|
$Infinite/max health
|
||||||
+04114244 3800000E
|
04114244 3800000E
|
||||||
+$Lots of coins
|
$Lots of coins
|
||||||
+04030764 38007FFF
|
04030764 38007FFF
|
||||||
+$All levels open
|
$All levels open
|
||||||
+041D8BEC FFFFFFFF
|
041D8BEC FFFFFFFF
|
||||||
+$Moon Jump (Hold A)
|
$Moon Jump (Hold A)
|
||||||
+04111B74 3D803E00
|
04111B74 3D803E00
|
||||||
+04111B78 618C01CE
|
04111B78 618C01CE
|
||||||
+0A439104 00000100
|
0A439104 00000100
|
||||||
+04111B7C 919E0208
|
04111B7C 919E0208
|
||||||
+0A439104 00000000
|
0A439104 00000000
|
||||||
+04111B7C 60000000
|
04111B7C 60000000
|
||||||
+$All levels open and complete + GBA games
|
$All levels open and complete GBA games
|
||||||
+041D8BEC FFFFFFFF
|
041D8BEC FFFFFFFF
|
||||||
+041D8BF4 FFFFFFFF
|
041D8BF4 FFFFFFFF
|
||||||
+041D8BF8 FFFFFFFF
|
041D8BF8 FFFFFFFF
|
||||||
+021D8BFC 0000FFFF
|
021D8BFC 0000FFFF
|
||||||
+041D8C04 FFFFFFFF
|
041D8C04 FFFFFFFF
|
||||||
+041D8C08 FFFFFFFF
|
041D8C08 FFFFFFFF
|
||||||
+021D8C0C 0000FFFF
|
021D8C0C 0000FFFF
|
||||||
+041D8C24 FFFFFFFF
|
041D8C24 FFFFFFFF
|
||||||
+041D8C28 FFFFFFFF
|
041D8C28 FFFFFFFF
|
||||||
+021D8C2C 0000FFFF
|
021D8C2C 0000FFFF
|
||||||
+041D8C34 FFFFFFFF
|
041D8C34 FFFFFFFF
|
||||||
+041D8C38 FFFFFFFF
|
041D8C38 FFFFFFFF
|
||||||
+021D8C3C 0000FFFF
|
021D8C3C 0000FFFF
|
||||||
+041D8C54 FFFFFFFF
|
041D8C54 FFFFFFFF
|
||||||
+041D8C58 FFFFFFFF
|
041D8C58 FFFFFFFF
|
||||||
+021D8C5C 0000FFFF
|
021D8C5C 0000FFFF
|
||||||
+041D8C64 FFFFFFFF
|
041D8C64 FFFFFFFF
|
||||||
+041D8C68 FFFFFFFF
|
041D8C68 FFFFFFFF
|
||||||
+021D8C6C 0000FFFF
|
021D8C6C 0000FFFF
|
||||||
+041D8C84 FFFFFFFF
|
041D8C84 FFFFFFFF
|
||||||
+041D8C88 FFFFFFFF
|
041D8C88 FFFFFFFF
|
||||||
+021D8C8C 0000FFFF
|
021D8C8C 0000FFFF
|
||||||
+041D8C94 FFFFFFFF
|
041D8C94 FFFFFFFF
|
||||||
+041D8C98 FFFFFFFF
|
041D8C98 FFFFFFFF
|
||||||
+021D8C9C 0000FFFF
|
021D8C9C 0000FFFF
|
|
@ -47,6 +47,8 @@
|
||||||
#include "../ConfigManager.h"
|
#include "../ConfigManager.h"
|
||||||
#include "VolumeCreator.h" // DiscIO
|
#include "VolumeCreator.h" // DiscIO
|
||||||
#include "NANDContentLoader.h"
|
#include "NANDContentLoader.h"
|
||||||
|
#include "Hash.h"
|
||||||
|
#include "CommonPaths.h"
|
||||||
|
|
||||||
void CBoot::Load_FST(bool _bIsWii)
|
void CBoot::Load_FST(bool _bIsWii)
|
||||||
{
|
{
|
||||||
|
@ -140,11 +142,41 @@ bool CBoot::LoadMapFromFilename(const std::string &_rFilename, const char *_game
|
||||||
// It does not initialize the hardware or anything else like BS1 does.
|
// It does not initialize the hardware or anything else like BS1 does.
|
||||||
bool CBoot::Load_BS2(const std::string& _rBootROMFilename)
|
bool CBoot::Load_BS2(const std::string& _rBootROMFilename)
|
||||||
{
|
{
|
||||||
|
const u32 USA = 0x1FCE3FD6;
|
||||||
|
const u32 USA_v1_1 = 0x4D5935D1;
|
||||||
|
const u32 JAP = 0x87424396;
|
||||||
|
const u32 PAL = 0xA0EA7341;
|
||||||
|
//const u32 PanasonicQJ = 0xAEA8265C;
|
||||||
|
//const u32 PanasonicQU = 0x94015753;
|
||||||
|
|
||||||
// Load the whole ROM dump
|
// Load the whole ROM dump
|
||||||
std::string data;
|
std::string data;
|
||||||
if (!File::ReadFileToString(false, _rBootROMFilename.c_str(), data))
|
if (!File::ReadFileToString(false, _rBootROMFilename.c_str(), data))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
u32 ipl_hash = HashAdler32((const u8*)data.data(), data.size());
|
||||||
|
std::string ipl_region;
|
||||||
|
switch (ipl_hash)
|
||||||
|
{
|
||||||
|
case USA:
|
||||||
|
case USA_v1_1:
|
||||||
|
ipl_region = USA_DIR;
|
||||||
|
break;
|
||||||
|
case JAP:
|
||||||
|
ipl_region = JAP_DIR;
|
||||||
|
break;
|
||||||
|
case PAL:
|
||||||
|
ipl_region = EUR_DIR;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
PanicAlert("IPL with unknown hash %x", ipl_hash);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string BootRegion = _rBootROMFilename.substr(_rBootROMFilename.find_last_of(DIR_SEP) - 3, 3);
|
||||||
|
if (BootRegion != ipl_region)
|
||||||
|
PanicAlert("%s ipl found in %s directory, the disc may not be recognized", ipl_region.c_str(), BootRegion.c_str());
|
||||||
|
|
||||||
// Run the descrambler over the encrypted section containing BS1/BS2
|
// Run the descrambler over the encrypted section containing BS1/BS2
|
||||||
CEXIIPL::Descrambler((u8*)data.data()+0x100, 0x1AFE00);
|
CEXIIPL::Descrambler((u8*)data.data()+0x100, 0x1AFE00);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue