DevourUnlocker/CMakeLists.txt
MiTHRAL 77f86c00ac
Some checks are pending
Build DevourUnlocker / windows-cross (push) Waiting to run
Build DevourUnlocker / linux (push) Waiting to run
Build DevourUnlocker / standalone (push) Waiting to run
v2.0.3: fix winhttp proxy forwarding + MH already init + standalone auto-deploy
- winhttp_proxy: runtime forwarding via GetProcAddress to C:\Windows\System32\winhttp.dll (fixes unimplemented WinHttpGetIEProxyConfigForCurrentUser crash, was forwarding to winhttp_real.dll which doesn't exist)
- patches: handle MH_ERROR_ALREADY_INITIALIZED, log to DevourUnlocker.log, background retry for UpdateLocked* (fixes pets not found when IL2CPP not ready)
- config: all 7 categories (pets/perks etc) global toggles, standalone now auto-deploys DLLs via injector.ensure_mod_deployed on unlock --all
- injector: find_built_dlls includes /tmp/devour_win_build, auto mingw cross-build + fallback to install.sh fetch
- scripts/launch.sh: sets WINEDLLOVERRIDES="winhttp=n,b" and launches via Proton
- diagnose: checks winhttp.dll presence, DevourUnlocker.log, WINEDLLOVERRIDES hint
- Verified: winhttp.dll 1.5M exports WinHttpGetIEProxyConfigForCurrentUser correctly forwarded, no longer crashes, Present hooked, but UpdateLockedPets still not found — needs IL2CPP enumeration fix
2026-08-21 22:46:42 -04:00

95 lines
3.3 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(DevourUnlocker VERSION 2.0.0 LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(BUILD_WINHTTP_PROXY "Build winhttp.dll proxy (Windows/Proton)" ON)
option(BUILD_TESTS "Build tests" OFF)
# --- Dependencies ---
include(FetchContent)
# MinHook (Windows hooking) — correct owner is TsudaKageyu
if(WIN32)
FetchContent_Declare(minhook
GIT_REPOSITORY https://github.com/TsudaKageyu/minhook.git
GIT_TAG master
)
FetchContent_MakeAvailable(minhook)
endif()
# Dear ImGui
FetchContent_Declare(imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG v1.90.4
)
FetchContent_MakeAvailable(imgui)
add_library(imgui STATIC
${imgui_SOURCE_DIR}/imgui.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
${imgui_SOURCE_DIR}/imgui_demo.cpp
)
target_include_directories(imgui PUBLIC ${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}/backends)
# ImGui backends (platform-specific sources added per-target)
# --- Core static lib: resolver + patches + gui + config ---
add_library(devour_core STATIC
src/il2cpp_resolver.cpp
src/patches.cpp
src/config.cpp
src/gui/overlay.cpp
src/platform/common.cpp
)
target_include_directories(devour_core PUBLIC src ${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}/backends)
target_link_libraries(devour_core PUBLIC imgui)
if(WIN32)
target_sources(devour_core PRIVATE
src/platform/win32.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_win32.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_dx11.cpp
)
target_link_libraries(devour_core PUBLIC d3d11 dxgi minhook dwmapi d3dcompiler)
target_compile_definitions(devour_core PUBLIC DEVOUR_WINDOWS=1)
else()
# Linux build (for testing + .so plugin). Under Proton the Windows DLL is used.
# Keep Linux build dependency-free (no SDL required) — native .so is not primary.
target_sources(devour_core PRIVATE src/platform/linux.cpp)
target_compile_definitions(devour_core PUBLIC DEVOUR_LINUX=1)
endif()
# --- winhttp.dll proxy (Windows) — no static forwarding to winhttp_real (that DLL doesn't exist, caused load fail).
# We ship a minimal winhttp.dll that only exports DllMain for hooking; WinHttp APIs are not needed for Devour's unlock.
# If you need full WinHttp proxy, install winhttp_orig.dll alongside and use runtime forwarding in winhttp_proxy.cpp.
if(BUILD_WINHTTP_PROXY AND WIN32)
add_library(winhttp SHARED
src/platform/winhttp_proxy.cpp
src/main.cpp
)
target_link_libraries(winhttp PRIVATE devour_core)
set_target_properties(winhttp PROPERTIES OUTPUT_NAME "winhttp" PREFIX "" SUFFIX ".dll")
target_compile_definitions(winhttp PRIVATE WINHTTP_PROXY=1)
add_library(DevourUnlocker SHARED src/main.cpp)
target_link_libraries(DevourUnlocker PRIVATE devour_core)
set_target_properties(DevourUnlocker PROPERTIES OUTPUT_NAME "DevourUnlocker" PREFIX "" SUFFIX ".dll")
endif()
# Linux .so (LD_PRELOAD / Plugins/x86_64)
if(UNIX)
add_library(DevourUnlocker_Linux SHARED src/main.cpp)
target_link_libraries(DevourUnlocker_Linux PRIVATE devour_core)
set_target_properties(DevourUnlocker_Linux PROPERTIES OUTPUT_NAME "DevourUnlocker" PREFIX "" SUFFIX ".so")
endif()
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()