Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -705,3 +705,10 @@ 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/
/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
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.