Fixed BigBase v2 crashing if injected too early.

This commit is contained in:
gir489 2020-03-28 02:00:19 -04:00
parent b6a6961ad8
commit f4f2f41093
4 changed files with 7 additions and 18 deletions

View File

@ -13,11 +13,15 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID)
using namespace big;
if (reason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hmod);
g_hmodule = hmod;
g_main_thread = CreateThread(nullptr, 0, [](PVOID) -> DWORD
{
while (!FindWindow(L"grcWindow", L"Grand Theft Auto V"))
std::this_thread::sleep_for(1s);
auto logger_instance = std::make_unique<logger>();
try
{
@ -32,21 +36,6 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID)
auto pointers_instance = std::make_unique<pointers>();
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.");
//}
auto renderer_instance = std::make_unique<renderer>();
LOG(INFO) << "Renderer initialized.";

2
vendor/ImGui vendored

@ -1 +1 @@
Subproject commit 03453246464cdd414c2f76d4a2569d2d5511870b
Subproject commit ec2a24a5f13fe8724acda7fc77c3328db6bf076a

2
vendor/fmtlib vendored

@ -1 +1 @@
Subproject commit e00997b004713a8de4ea480d7dfb3abb11d07852
Subproject commit 770a94edefd7589f7fbd410346f68f503d988bfe

2
vendor/g3log vendored

@ -1 +1 @@
Subproject commit 3ffc36a3a2d07e2c1e51acfe5e04856f87639488
Subproject commit 4000c5c899c0ae58b8b851f9b66e1a2ac0fe2bff