Merge pull request #220 from h1-mod/valid-steam
Warn if steam registry doesn't exists
This commit is contained in:
commit
fd7d136bf3
@ -162,7 +162,6 @@ namespace auth
|
|||||||
|
|
||||||
if (xuid != key.get_hash())
|
if (xuid != key.get_hash())
|
||||||
{
|
{
|
||||||
//MessageBoxA(nullptr, steam_id.data(), std::to_string(key.get_hash()).data(), 0);
|
|
||||||
network::send(*from, "error",
|
network::send(*from, "error",
|
||||||
utils::string::va("XUID doesn't match the certificate: %llX != %llX", xuid, key.get_hash()), '\n');
|
utils::string::va("XUID doesn't match the certificate: %llX != %llX", xuid, key.get_hash()), '\n');
|
||||||
return;
|
return;
|
||||||
|
@ -101,7 +101,7 @@ namespace exception
|
|||||||
utils::thread::suspend_other_threads();
|
utils::thread::suspend_other_threads();
|
||||||
show_mouse_cursor();
|
show_mouse_cursor();
|
||||||
|
|
||||||
MessageBoxA(nullptr, error_str.data(), "H1-Mod ERROR", MB_ICONERROR);
|
MSG_BOX_ERROR(error_str.data());
|
||||||
TerminateProcess(GetCurrentProcess(), exception_data.code);
|
TerminateProcess(GetCurrentProcess(), exception_data.code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,9 +90,8 @@ namespace system_check
|
|||||||
|
|
||||||
if (!is_valid())
|
if (!is_valid())
|
||||||
{
|
{
|
||||||
MessageBoxA(nullptr, "Your game files are outdated or unsupported.\n"
|
MSG_BOX_INFO("Your game files are outdated or unsupported.\n"
|
||||||
"Please get the latest officially supported Call of Duty: Modern Warfare Remastered files, or you will get random crashes and issues.",
|
"Please get the latest officially supported Call of Duty: Modern Warfare Remastered files, or you will get random crashes and issues.");
|
||||||
"Invalid game files!", MB_ICONINFORMATION);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -152,7 +152,7 @@ void loader::load_exception_table(const utils::nt::library& target, const utils:
|
|||||||
|
|
||||||
if (!RtlAddFunctionTable(function_list, entry_count, DWORD64(target.get_ptr())))
|
if (!RtlAddFunctionTable(function_list, entry_count, DWORD64(target.get_ptr())))
|
||||||
{
|
{
|
||||||
MessageBoxA(nullptr, "Setting exception handlers failed.", "Error", MB_OK | MB_ICONERROR);
|
MSG_BOX_ERROR("Setting exception handlers failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -91,6 +91,22 @@ FARPROC load_binary(const launcher::mode mode, uint64_t* base_address)
|
|||||||
if (library == "steam_api64.dll"
|
if (library == "steam_api64.dll"
|
||||||
&& function != "SteamAPI_GetSteamInstallPath") // Arxan requires one valid steam api import - maybe SteamAPI_Shutdown is better?
|
&& function != "SteamAPI_GetSteamInstallPath") // Arxan requires one valid steam api import - maybe SteamAPI_Shutdown is better?
|
||||||
{
|
{
|
||||||
|
static bool check_for_steam_install = false;
|
||||||
|
if (!check_for_steam_install)
|
||||||
|
{
|
||||||
|
HKEY key;
|
||||||
|
if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Valve\\Steam", 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
RegCloseKey(key);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MSG_BOX_WARN("Could not find Steam in the registry. If Steam is not installed, you must install it for H1-Mod to work.");
|
||||||
|
}
|
||||||
|
|
||||||
|
check_for_steam_install = true;
|
||||||
|
}
|
||||||
|
|
||||||
return self.get_proc<FARPROC>(function);
|
return self.get_proc<FARPROC>(function);
|
||||||
}
|
}
|
||||||
else if (function == "ExitProcess")
|
else if (function == "ExitProcess")
|
||||||
@ -234,7 +250,7 @@ int main()
|
|||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
MessageBoxA(nullptr, e.what(), "ERROR", MB_ICONERROR);
|
MSG_BOX_ERROR(e.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,10 @@
|
|||||||
#undef min
|
#undef min
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MSG_BOX_INFO(message) MessageBoxA(nullptr, message, "H1-Mod: INFORMATION", MB_ICONINFORMATION);
|
||||||
|
#define MSG_BOX_WARN(message) MessageBoxA(nullptr, message, "H1-Mod: WARNING", MB_ICONWARNING);
|
||||||
|
#define MSG_BOX_ERROR(message) MessageBoxA(nullptr, message, "H1-Mod: ERROR", MB_ICONERROR);
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
Loading…
Reference in New Issue
Block a user