diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 7c4093eb..75b7b3b9 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -136,7 +136,7 @@ CPMAddPackage("gh:google/re2#954656f") target_include_directories(${PROJECT_NAME} PRIVATE ${md4c_SOURCE_DIR}/src) # Tulip hook (hooking) -CPMAddPackage("gh:altalk23/TulipHook#2a97005") +CPMAddPackage("gh:altalk23/TulipHook#2347311") target_link_libraries(${PROJECT_NAME} md4c z TulipHook geode-sdk re2) diff --git a/loader/src/hooks/MessageBoxFix.cpp b/loader/src/hooks/MessageBoxFix.cpp index d77f1424..fbe366af 100644 --- a/loader/src/hooks/MessageBoxFix.cpp +++ b/loader/src/hooks/MessageBoxFix.cpp @@ -7,14 +7,11 @@ #include USE_GEODE_NAMESPACE(); -using geode::core::meta::x86::Thiscall; // for some reason RobTop uses MessageBoxW in his GLFW error handler. // no one knows how this is possible (he passes char* to wchar_t*). // so anyway, here's a fix for it -static auto CCEGLVIEW_CON_ADDR = reinterpret_cast(base::getCocos() + 0xc2860); - static void __cdecl fixedErrorHandler(int code, char const* description) { log::error("GLFW Error {}: {}", code, description); MessageBoxA( @@ -28,23 +25,11 @@ static void __cdecl fixedErrorHandler(int code, char const* description) { ); } -static CCEGLView* CCEGLView_CCEGLView(CCEGLView* self) { - // you will never have to make a manual hook with Geode again, they said - // it will be fun, they said - reinterpret_cast(CCEGLVIEW_CON_ADDR)(self); - static auto p = Mod::get()->patch( +$execute { + (void)Mod::get()->patch( reinterpret_cast(geode::base::getCocos() + 0x19feec), toByteArray(&fixedErrorHandler) ); - return self; -} - -$execute { - (void)Mod::get()->addHook( - CCEGLVIEW_CON_ADDR, - &CCEGLView_CCEGLView, - "CCEGLView::CCEGLView", - ); } #endif