Removed StackWalker and replaced it with g3log exception handling.
Updated natives for 1.50. Added settings JSON implementation. Refactored spawn vehicle bypass to not crash. (removed VMT hook)
This commit is contained in:
@ -21,102 +21,83 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID)
|
||||
auto logger_instance = std::make_unique<logger>();
|
||||
try
|
||||
{
|
||||
|
||||
LOG_RAW(log_color::green | log_color::intensify,
|
||||
u8R"kek( ...
|
||||
;::::;
|
||||
;::::; :;
|
||||
;:::::' :;
|
||||
;:::::; ;.
|
||||
,:::::' ; OOO\
|
||||
::::::; ; OOOOO\
|
||||
;:::::; ; OOOOOOOO
|
||||
,;::::::; ;' / OOOOOOO
|
||||
;:::::::::`. ,,,;. / / DOOOOOO
|
||||
.';:::::::::::::::::;, / / DOOOO
|
||||
,::::::;::::::;;;;::::;, / / DOOO
|
||||
;`::::::`'::::::;;;::::: ,#/ / DOOO
|
||||
:`:::::::`;::::::;;::: ;::# / DOOO
|
||||
::`:::::::`;:::::::: ;::::# / DOO
|
||||
`:`:::::::`;:::::: ;::::::#/ DOO
|
||||
:::`:::::::`;; ;:::::::::## OO
|
||||
::::`:::::::`;::::::::;:::# OO
|
||||
`:::::`::::::::::::;'`:;::# O
|
||||
`:::::`::::::::;' / / `:#
|
||||
::::::`:::::;' / / `#
|
||||
|
||||
)kek");
|
||||
|
||||
LOG(RAW_GREEN_TO_CONSOLE) << u8R"kek(
|
||||
______ _ ______ ______
|
||||
(____ \(_) (____ \ (_____ \
|
||||
____) )_ ____ ____) ) ____ ___ ____ _ _ ____) )
|
||||
| __ (| |/ _ | __ ( / _ |/___)/ _ ) | | /_____/
|
||||
| |__) ) ( ( | | |__) | ( | |___ ( (/ / \ V /_______
|
||||
|______/|_|\_|| |______/ \_||_(___/ \____) \_/(_______)
|
||||
(_____|)kek";
|
||||
auto pointers_instance = std::make_unique<pointers>();
|
||||
LOG_INFO("Pointers initialized.");
|
||||
LOG(INFO) << "Pointers initialized.";
|
||||
|
||||
if (*g_pointers->m_game_state != eGameState::Playing)
|
||||
{
|
||||
LOG_INFO("Waiting for the game to load.");
|
||||
do
|
||||
{
|
||||
std::this_thread::sleep_for(100ms);
|
||||
} while (*g_pointers->m_game_state != eGameState::Playing);
|
||||
|
||||
LOG_INFO("The game has loaded.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_INFO("The game is already loaded.");
|
||||
}
|
||||
//if (*g_pointers->m_game_state != eGameState::Playing)
|
||||
//{
|
||||
// LOG_INFO("Waiting for the game to load.");
|
||||
// do
|
||||
// {
|
||||
// std::this_thread::sleep_for(100ms);
|
||||
// } while (*g_pointers->m_game_state != eGameState::Playing);
|
||||
//
|
||||
// LOG_INFO("The game has loaded.");
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// LOG_INFO("The game is already loaded.");
|
||||
//}
|
||||
|
||||
auto renderer_instance = std::make_unique<renderer>();
|
||||
LOG_INFO("Renderer initialized.");
|
||||
LOG(INFO) << "Renderer initialized.";
|
||||
|
||||
auto fiber_pool_instance = std::make_unique<fiber_pool>(10);
|
||||
LOG_INFO("Fiber pool initialized.");
|
||||
LOG(INFO) << "Fiber pool initialized.";
|
||||
|
||||
auto hooking_instance = std::make_unique<hooking>();
|
||||
LOG_INFO("Hooking initialized.");
|
||||
LOG(INFO) << "Hooking initialized.";
|
||||
|
||||
g_settings.load();
|
||||
LOG(INFO) << "Settings Loaded.";
|
||||
|
||||
g_script_mgr.add_script(std::make_unique<script>(&features::script_func));
|
||||
g_script_mgr.add_script(std::make_unique<script>(&gui::script_func));
|
||||
LOG_INFO("Scripts registered.");
|
||||
LOG(INFO) << "Scripts registered.";
|
||||
|
||||
g_hooking->enable();
|
||||
LOG_INFO("Hooking enabled.");
|
||||
LOG(INFO) << "Hooking enabled.";
|
||||
|
||||
while (g_running)
|
||||
{
|
||||
if (GetAsyncKeyState(VK_END) & 0x8000)
|
||||
g_running = false;
|
||||
|
||||
g_hooking->ensure_dynamic_hooks();
|
||||
std::this_thread::sleep_for(10ms);
|
||||
std::this_thread::sleep_for(500ms);
|
||||
}
|
||||
|
||||
g_hooking->disable();
|
||||
LOG_INFO("Hooking disabled.");
|
||||
LOG(INFO) << "Hooking disabled.";
|
||||
|
||||
std::this_thread::sleep_for(1000ms);
|
||||
|
||||
g_script_mgr.remove_all_scripts();
|
||||
LOG_INFO("Scripts unregistered.");
|
||||
LOG(INFO) << "Scripts unregistered.";
|
||||
|
||||
hooking_instance.reset();
|
||||
LOG_INFO("Hooking uninitialized.");
|
||||
LOG(INFO) << "Hooking uninitialized.";
|
||||
|
||||
fiber_pool_instance.reset();
|
||||
LOG_INFO("Fiber pool uninitialized.");
|
||||
LOG(INFO) << "Fiber pool uninitialized.";
|
||||
|
||||
renderer_instance.reset();
|
||||
LOG_INFO("Renderer uninitialized.");
|
||||
LOG(INFO) << "Renderer uninitialized.";
|
||||
|
||||
pointers_instance.reset();
|
||||
LOG_INFO("Pointers uninitialized.");
|
||||
LOG(INFO) << "Pointers uninitialized.";
|
||||
}
|
||||
catch (std::exception const &ex)
|
||||
{
|
||||
LOG_ERROR("{}", ex.what());
|
||||
LOG(WARNING) << ex.what();
|
||||
MessageBoxA(nullptr, ex.what(), nullptr, MB_OK | MB_ICONEXCLAMATION);
|
||||
}
|
||||
|
||||
LOG_INFO("Farewell!");
|
||||
LOG(INFO) << "Farewell!";
|
||||
logger_instance.reset();
|
||||
|
||||
CloseHandle(g_main_thread);
|
||||
|
Reference in New Issue
Block a user