Merge pull request #1523 from GXTX/sigchk

Check XBE signature on Open
This commit is contained in:
Luke Usher 2019-01-08 20:34:26 +00:00 committed by GitHub
commit c24f83f9b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 1 deletions

View File

@ -1990,7 +1990,24 @@ void WndMain::OpenXbe(const char *x_filename)
return;
}
if (!g_Settings->m_core.allowAdminPrivilege && !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"
"\nAre you sure you want to continue?", "Cxbx-Reloaded", MB_ICONEXCLAMATION | MB_YESNO);
if (ret != IDYES)
{
delete m_Xbe; m_Xbe = nullptr;
RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE);
UpdateCaption();
return;
}
}
// save this xbe to the list of recent xbe files
if(m_XbeFilename[0] != '\0') {
bool found = false;