Розыгрыш Premium и Уникальной юзергруппы на форуме! Перейти

Unload для индиги

Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
@TryToOwnMe @Nevermind а если способ без краша игры?Я пытался так сделать, но все равно вылет

Код:
Expand Collapse Copy
#include "Main.h"
#include "../RL/ReflectiveLoader.h"
#include <thread>

//[enc_string_enable /]
//[junk_enable /]
DWORD WINAPI CheatEntry(LPVOID lpThreadParameter)
{
    HMODULE hModule = (HMODULE)lpThreadParameter;

    if (Engine::Initialize())
    {
        return 0;
    }
    while (!Settings::Misc::Unload) {
        using namespace std::literals::chrono_literals;
        std::this_thread::sleep_for(1s);
    }

    Engine::Shutdown();
    std::this_thread::sleep_for(std::chrono::milliseconds(100));

    fclose((FILE*)stdin);
    fclose((FILE*)stdout);
    FreeConsole();

    FreeLibraryAndExitThread(static_cast<HMODULE>(hModule), 1);
    return 0;
}

bool threadLoop;
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
    if (fdwReason == DLL_PROCESS_ATTACH)
    {
        DisableThreadLibraryCalls(hinstDLL);

        Client::BaseDir = CSX::Utils::GetHackWorkingDirectory().c_str();


        if (Client::BaseDir.size() < 1)
        {
            Client::BaseDir = CSX::Utils::GetModuleBaseDir(hinstDLL);
        }

#if ENABLE_DEBUG_FILE == 1
        AllocConsole();
        AttachConsole(GetCurrentProcessId());
        freopen("CONIN$", "r", stdin);
        freopen("CONOUT$", "w", stdout);
        freopen("CONOUT$", "w", stderr);

        Client::LogFile = Client::BaseDir + "\\debug.log";
        DeleteFileA(Client::LogFile.c_str());
        CSX::Log::LogFile = Client::LogFile;
        printf("Client::BaseDir = %s\nClient::LogFile = %s\n", Client::BaseDir.c_str(), Client::LogFile.c_str());
        CSX::Log::Add("::Init::");

#endif

        CreateThread(0, 0, CheatEntry, hinstDLL, 0, 0);

    
            

    }
    else if (fdwReason == DLL_PROCESS_DETACH)
    {
        
        Engine::Shutdown();
        
    }

    return TRUE;
}
 
Назад
Сверху Снизу