Remove crash file

This commit is contained in:
momo5502 2022-09-18 08:48:12 +02:00
parent ff59d3efa9
commit 45ec89f98d

View File

@ -74,6 +74,16 @@ namespace
utils::hook::set(utils::nt::library{}.get_iat_entry("kernel32.dll", "ExitProcess"), exit_hook); utils::hook::set(utils::nt::library{}.get_iat_entry("kernel32.dll", "ExitProcess"), exit_hook);
} }
void remove_crash_file()
{
const utils::nt::library game{};
const auto game_file = game.get_path();
auto game_path = std::filesystem::path(game_file);
game_path.replace_extension(".start");
utils::io::remove_file(game_path.generic_string());
}
bool run() bool run()
{ {
srand(uint32_t(time(nullptr)) ^ ~(GetTickCount() * GetCurrentProcessId())); srand(uint32_t(time(nullptr)) ^ ~(GetTickCount() * GetCurrentProcessId()));
@ -91,6 +101,7 @@ namespace
try try
{ {
patch_imports(); patch_imports();
remove_crash_file();
if (!component_loader::pre_start()) if (!component_loader::pre_start())
{ {