Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -705,3 +705,9 @@ healthchecksdb
MigrationBackup/

# End of https://www.gitignore.io/api/c,qt,vim,qml,c++,linux,macos,cmake,clion,windows,kdevelop4,qtcreator,visualstudio,visualstudiocode

# Allow vendor files
!cslol-tools/vendor/**

# Validated local build
/cslol-tools/build/
23 changes: 5 additions & 18 deletions cslol-tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,12 @@ if (WIN32)
endif()

if (WIN32)
FetchContent_Declare(
cslol-patcher
URL https://github.com/LeagueToolkit/cslol-patcher/releases/download/7/cslol-patcher.zip
URL_HASH SHA256=46b6dba49b1e1b79a93f4864110aa0ef8996cef09bf6e561d83ce1a89d88a734
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
DOWNLOAD_EXTRACT_TIMESTAMP True
add_library(cslol-patcher SHARED IMPORTED GLOBAL)
set_target_properties(cslol-patcher PROPERTIES
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/vendor/cslol-patcher/cslol-dll.lib"
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/vendor/cslol-patcher/cslol-dll.dll"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/vendor/cslol-patcher"
)
FetchContent_GetProperties(cslol-patcher)
if(NOT cslol-patcher_POPULATED)
FetchContent_Populate(cslol-patcher)

add_library(cslol-patcher SHARED IMPORTED)
set_target_properties(cslol-patcher PROPERTIES
IMPORTED_IMPLIB "${cslol-patcher_SOURCE_DIR}/cslol-dll.lib"
IMPORTED_LOCATION "${cslol-patcher_SOURCE_DIR}/cslol-dll.dll"
INTERFACE_INCLUDE_DIRECTORIES "${cslol-patcher_SOURCE_DIR}"
)
endif()

target_link_libraries(cslol-lib PUBLIC cslol-patcher)
add_custom_command(TARGET mod-tools POST_BUILD
Expand Down
9 changes: 8 additions & 1 deletion cslol-tools/dep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,14 @@ FetchContent_Declare(
FetchContent_GetProperties(miniz)
if(NOT miniz_POPULATED)
FetchContent_Populate(miniz)
add_subdirectory(${miniz_SOURCE_DIR} ${miniz_BINARY_DIR})
# add_subdirectory(${miniz_SOURCE_DIR} ${miniz_BINARY_DIR})
add_library(miniz STATIC
${miniz_SOURCE_DIR}/miniz.c
${miniz_SOURCE_DIR}/miniz_zip.c
${miniz_SOURCE_DIR}/miniz_tinfl.c
${miniz_SOURCE_DIR}/miniz_tdef.c
)
target_include_directories(miniz PUBLIC ${miniz_SOURCE_DIR})
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change to the miniz library setup appears unrelated to introducing the local patcher dll. The modification from using add_subdirectory to manually creating the library should either be explained in the PR description or moved to a separate commit/PR for better change tracking and easier review.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed by bumping the commit at

GIT_TAG d9d197c92606da7be59cee2be2fbc6830b73c480 # 3.0.2

Newer versions have cmake version bumped, see https://github.com/richgel999/miniz/commits/master/

Should also fix:

  The BUILD_COMMAND keyword was followed by an empty string or no value at
  all.  Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
  ARG_BUILD_COMMAND variable rather than setting it to an empty string.

While at it. All of it in a new PR problem.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target_compile_definitions(miniz PRIVATE -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS=1)
endif()

Expand Down
67 changes: 67 additions & 0 deletions cslol-tools/vendor/cslol-patcher/cslol-api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#ifndef CSLOL_API_H
#define CSLOL_API_H

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

#include <stdbool.h>
#include <uchar.h>

#ifdef CSLOL_IMPL
# ifdef _MSC_VER
# define CSLOL_API __declspec(dllexport)
# else
# define CSLOL_API
# endif
#else
# ifdef _MSC_VER
# define CSLOL_API __declspec(dllimport)
# else
# define CSLOL_API extern
# endif
#endif

typedef enum cslol_hook_flags {
CSLOL_HOOK_DISALBE_NONE = 0u,
CSLOL_HOOK_DISABLE_VERIFY = 1u,
CSLOL_HOOK_DISABLE_FILE = 2u,
CSLOL_HOOK_DISABLE_ALL = (unsigned)(-1),
} cslol_hook_flags;

typedef enum cslol_log_level {
CSLOL_LOG_ERROR = 0,
CSLOL_LOG_INFO = 0x10,
CSLOL_LOG_DEBUG = 0x20,
CSLOL_LOG_ALL = 0x1000,
} cslol_log_level;

// Msg proc used for injection.
CSLOL_API intptr_t cslol_msg_hookproc(int code, uintptr_t wParam, intptr_t lParam);

// Initialize IPC, returns error if any.
CSLOL_API const char* cslol_init();

// Sets prefix folder, returns error if any.
CSLOL_API const char* cslol_set_config(const char16_t* prefix);

// Sets flags, return error if any.
CSLOL_API const char* cslol_set_flags(cslol_hook_flags flags);

// Set log level, return error if any.
CSLOL_API const char* cslol_set_log_level(cslol_log_level level);

// Pull log message if any.
CSLOL_API const char* cslol_log_pull();

// Find thread id of running lol instance.
CSLOL_API unsigned cslol_find();

// Hook, return error if any.
CSLOL_API const char* cslol_hook(unsigned tid, unsigned post_iters, unsigned event_iters);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // CSLOL_API_H
Binary file added cslol-tools/vendor/cslol-patcher/cslol-dll.dll
Binary file not shown.
Binary file added cslol-tools/vendor/cslol-patcher/cslol-dll.lib
Binary file not shown.