Example #1
0
int main(int argc, char* argv[])
{
    // Qt5
    QApplication app(argc, argv);

    // Initialize file logger
    InitializeEasyLogging(argc, argv);
    LOG(INFO) << "========== Missing HUD 2 " << MHUD2_VERSION << " ==========";

    // Initialize BoI DLL Injector
    BoIInjector injector;

    // Load preferences
    MHUD::Prefs mhud_prefs = MHUD::Options::ReadCfgFile(CFG_FILENAME);

    // Show GUI
    LoaderGUI gui;
    gui.ConnectSlots(injector);
    gui.UpdatePrefs(mhud_prefs);
    gui.show();

    // Start the DLL monitoring thread
    injector.Start();

    int ret_code = app.exec();
    LOG(INFO) << "Missing HUD 2 exiting with exit code " << ret_code << ".";
    return ret_code;
}
Example #2
0
int main(int argc, char* argv[])
{
    // Qt5
    QApplication app(argc, argv);

    // Initialize file logger
    InitializeEasyLogging(argc, argv);
    LOG(INFO) << "MissingHUD2 starting.";

    // Initialize BoI DLL Injector
    BoIInjector injector;

    // Show GUI
    LoaderGUI gui;
    gui.ConnectSlots(injector);
    gui.show();

    // Start the DLL monitoring thread
    injector.Start();

    int ret_code = app.exec();
    LOG(INFO) << "MissingHUD2 exiting with exit code " << ret_code << ".";

    return ret_code;
}
Example #3
0
extern "C" DLL_PUBLIC void MHUD2_Start()
{
    InitializeEasyLogging();
    LOG(INFO) << "MissingHUD2 injected and starting.";

    try
    {
        // Initialize any static objects we require that don't involve an OpenGL context
        ResourceLoader::Initialize(dll_handle);
        RebirthMemReader::GetMemoryReader();

        // Hook the OpenGL SwapBuffers function via IAT redirection
        GDISwapBuffers *gdi_swapbuffers = GDISwapBuffers::GetInstance();
        IATHook::InitIATHook(GetModuleHandle(ISAAC_MODULE_NAME), "gdi32.dll", "SwapBuffers", (LPVOID)&gdiSwapBuffersDetour);

        // Enable the IAT hooks
        IATHook::EnableIATHook("SwapBuffers", (LPVOID*)gdi_swapbuffers->GetEndpointAddr());
    }
    catch (std::runtime_error &e)
    {
        LOG(ERROR) << "Error occured during MHUD2 initilization: " << e.what();
        FreeLibraryAndExitThread(dll_handle, EXIT_FAILURE);
    }
}