- UnityPlayer.dll imports VERSION.dll + WINHTTP.dll (objdump -p) — version.dll beside DEVOUR.exe is auto-loaded on Windows, installer now silently auto-sets WINEDLLOVERRIDES=version=n,b in Steam localconfig.vdf for Proton so user just presses Play - src/main_version.cpp: now full HookThread (wait GameAssembly.dll + installPatches) linking devour_core (was minimal no-hooks 103K, now 14M full like winhttp) — unlocks all categories: robes/characters/perks/pets/flashlights/emotes/outfits via IsRobe/IsCharacter/HasPerk/HasOutfit + UpdateLocked* hooks - CMakeLists.txt: version target links devour_core + winpthread static, primary = version.dll less flagged than winhttp; winhttp retained only as optional compat - scripts/install.sh: copy version.dll primary (all categories), auto-set LaunchOptions silent, message no manual step; scripts/launch.sh: now uses version=n,b auto, checks version.dll - standalone/injector.py: find_built_dlls prefers version.dll, ensure_mod_deployed deploys version primary; standalone/devour_unlocker.py: diagnose hints updated to version.dll - .github/workflows/build.yml: runs-on docker (Forgejo runner media-server labels docker v6.4.0), package version.dll primary zip, linux job also docker
112 lines
3.9 KiB
CMake
112 lines
3.9 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 + version.dll proxies (Windows) — version.dll is less flagged by anti-cheat, preferred
|
|
# winhttp still built for compatibility, but version.dll is primary for new installs
|
|
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)
|
|
if(MINGW)
|
|
target_link_options(winhttp PRIVATE -static-libgcc -static-libstdc++ -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic)
|
|
endif()
|
|
|
|
# version.dll is primary unlocker — full hooks (all categories) + proxy, no WINEDLLOVERRIDES needed for user (installer handles it silently)
|
|
add_library(version SHARED
|
|
src/platform/version_proxy.cpp
|
|
src/main_version.cpp
|
|
)
|
|
target_link_libraries(version PRIVATE devour_core kernel32)
|
|
set_target_properties(version PROPERTIES OUTPUT_NAME "version" PREFIX "" SUFFIX ".dll")
|
|
target_compile_definitions(version PRIVATE VERSION_PROXY=1)
|
|
if(MINGW)
|
|
target_link_options(version PRIVATE -static-libgcc -static-libstdc++ -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic)
|
|
endif()
|
|
|
|
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")
|
|
if(MINGW)
|
|
target_link_options(DevourUnlocker PRIVATE -static-libgcc -static-libstdc++)
|
|
endif()
|
|
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()
|