- Replace hard offsets (0x74B0B0) with il2cpp resolver + string-xref sigscan - winhttp.dll proxy (zero BepInEx, forwards WinHttp* exports) for Windows + Proton (WINEDLLOVERRIDES=winhttp=n,b) - Selective ImGui GUI (F6) per-robe/character overrides, persisted to DevourUnlocker.json - CMake cross-platform build, Linux .so verified - Standalone Python CLI+Tkinter (CachyOS/Proton paths, compatdata/1274570) - Install scripts pulling from git releases (install.sh/ps1), BepInEx Harmony fallback, CI build.yml - Legacy DirectX11 Edition kept as reference, x64/Release artifacts removed
95 lines
3 KiB
CMake
95 lines
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)
|
|
if(WIN32)
|
|
FetchContent_Declare(minhook
|
|
GIT_REPOSITORY https://github.com/TsudaKagecha/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)
|
|
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) ---
|
|
if(BUILD_WINHTTP_PROXY AND WIN32)
|
|
add_library(winhttp SHARED
|
|
src/platform/winhttp_proxy.cpp
|
|
src/main.cpp
|
|
src/platform/winhttp_exports.def
|
|
)
|
|
target_link_libraries(winhttp PRIVATE devour_core)
|
|
set_target_properties(winhttp PROPERTIES OUTPUT_NAME "winhttp" PREFIX "" SUFFIX ".dll")
|
|
# Ensure exports forwarding — actual winhttp forwarded at runtime via LoadLibrary
|
|
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()
|