diff --git a/src/common/Settings.cpp b/src/common/Settings.cpp index ea1732275..338fb1c7e 100644 --- a/src/common/Settings.cpp +++ b/src/common/Settings.cpp @@ -78,6 +78,7 @@ static struct { const char* RecentXbeFiles = "RecentXbeFiles"; const char* DataStorageToggle = "DataStorageToggle"; const char* DataCustomLocation = "DataCustomLocation"; + const char* IgnoreInvalidXbeSig = "IgnoreInvalidXbeSig"; } sect_gui_keys; static const char* section_core = "core"; @@ -309,6 +310,8 @@ bool Settings::LoadConfig() index++; } + m_gui.bIgnoreInvalidXbeSig = m_si.GetBoolValue(section_gui, sect_gui_keys.IgnoreInvalidXbeSig, /*Default=*/false); + // ==== GUI End ============= // ==== Core Begin ========== @@ -508,6 +511,8 @@ bool Settings::Save(std::string file_path) m_si.SetValue(section_gui, sect_gui_keys.RecentXbeFiles, m_gui.szRecentXbeFiles[i].c_str(), nullptr, false); } + m_si.SetBoolValue(section_gui, sect_gui_keys.IgnoreInvalidXbeSig, m_gui.bIgnoreInvalidXbeSig, nullptr, true); + // ==== GUI End ============= // ==== Core Begin ========== diff --git a/src/common/Settings.hpp b/src/common/Settings.hpp index 515d066cf..4c1b682ae 100644 --- a/src/common/Settings.hpp +++ b/src/common/Settings.hpp @@ -85,6 +85,7 @@ public: std::string szRecentXbeFiles[10]; unsigned int DataStorageToggle; std::string szCustomLocation = ""; + bool bIgnoreInvalidXbeSig; } m_gui; // Core settings diff --git a/src/gui/WndMain.cpp b/src/gui/WndMain.cpp index 6a967ae65..2a9d39169 100644 --- a/src/gui/WndMain.cpp +++ b/src/gui/WndMain.cpp @@ -1289,6 +1289,11 @@ Please do not report issues with games while this hack is active. Are you sure y RefreshMenus(); break; + case ID_SETTINGS_IGNOREINVALIDXBESIG: + g_Settings->m_gui.bIgnoreInvalidXbeSig = !g_Settings->m_gui.bIgnoreInvalidXbeSig; + RefreshMenus(); + break; + case ID_SETTINGS_ALLOWADMINPRIVILEGE: g_Settings->m_core.allowAdminPrivilege = !g_Settings->m_core.allowAdminPrivilege; RefreshMenus(); @@ -1757,6 +1762,9 @@ void WndMain::RefreshMenus() break; } + chk_flag = (g_Settings->m_gui.bIgnoreInvalidXbeSig) ? MF_CHECKED : MF_UNCHECKED; + CheckMenuItem(settings_menu, ID_SETTINGS_IGNOREINVALIDXBESIG, chk_flag); + chk_flag = (g_Settings->m_core.allowAdminPrivilege) ? MF_CHECKED : MF_UNCHECKED; CheckMenuItem(settings_menu, ID_SETTINGS_ALLOWADMINPRIVILEGE, chk_flag); } @@ -1997,7 +2005,7 @@ void WndMain::OpenXbe(const char *x_filename) return; } - if (!g_Settings->m_core.allowAdminPrivilege && !m_Xbe->CheckXbeSignature()) + if (!g_Settings->m_gui.bIgnoreInvalidXbeSig && !m_Xbe->CheckXbeSignature()) { int ret = MessageBox(m_hwnd, "XBE signature check failed!\n" "\nThis is dangerous, as maliciously modified Xbox titles could take control of your system.\n" diff --git a/src/gui/resource/Cxbx.rc b/src/gui/resource/Cxbx.rc index aeda426ac..0de867c74 100644 --- a/src/gui/resource/Cxbx.rc +++ b/src/gui/resource/Cxbx.rc @@ -677,6 +677,7 @@ BEGIN MENUITEM "Skip rdtsc patching", ID_HACKS_SKIPRDTSCPATCHING,MFT_STRING,MFS_ENABLED END MENUITEM "Use Loader Executable", ID_USELOADEREXEC,MFT_STRING,MFS_ENABLED + MENUITEM "Ignore Invalid Xbe Signature", ID_SETTINGS_IGNOREINVALIDXBESIG,MFT_STRING,MFS_ENABLED MENUITEM "Allow Admin Privilege", ID_SETTINGS_ALLOWADMINPRIVILEGE,MFT_STRING,MFS_ENABLED MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Reset To Defaults", ID_SETTINGS_INITIALIZE,MFT_STRING,MFS_ENABLED diff --git a/src/gui/resource/ResCxbx.h b/src/gui/resource/ResCxbx.h index bdcb4b96c..944333217 100644 --- a/src/gui/resource/ResCxbx.h +++ b/src/gui/resource/ResCxbx.h @@ -363,6 +363,7 @@ #define ID_SYNC_CONFIG_INPUT 40112 #define ID_SETTINGS_EXPERIMENTAL 40113 #define ID_USELOADEREXEC 40114 +#define ID_SETTINGS_IGNOREINVALIDXBESIG 40115 #define IDC_STATIC -1 // Next default values for new objects @@ -370,7 +371,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 136 -#define _APS_NEXT_COMMAND_VALUE 40115 +#define _APS_NEXT_COMMAND_VALUE 40116 #define _APS_NEXT_CONTROL_VALUE 1304 #define _APS_NEXT_SYMED_VALUE 109 #endif