This document provides guidelines for AI coding agents working on the R3nzSkin codebase.
R3nzSkin is a League of Legends skin changer that hooks into the game's DirectX 11 rendering pipeline. The project consists of two components:
- R3nzSkin - A DLL that injects into the game process to modify skins
- R3nzSkin_Injector - An executable that injects the DLL into the game
- Visual Studio 2019 or 2022 with C++ workload
- Windows 10 SDK
- Platform Toolset v143
The solution supports four configurations:
RiotGamesServers|x64- For international servers (64-bit)RiotGamesServers|Win32- For international servers (32-bit)ChinaServer|x64- For Chinese servers (64-bit)ChinaServer|Win32- For Chinese servers (32-bit)
# Build the main DLL (RiotGamesServers, x64)
msbuild R3nzSkin/R3nzSkin.vcxproj /p:Platform=x64 /p:Configuration=RiotGamesServers
# Build the main DLL (ChinaServer, x64)
msbuild R3nzSkin/R3nzSkin.vcxproj /p:Platform=x64 /p:Configuration=ChinaServer
# Build the injector
msbuild R3nzSkin_Injector/R3nzSkin_Injector.vcxproj /p:Platform=x64 /p:Configuration=RiotGamesServers
# Build entire solution
msbuild R3nzSkin.sln /p:Platform=x64 /p:Configuration=RiotGamesServersBuild outputs are placed in Release/<Configuration>/ (e.g., Release/RiotGamesServers/)
This project does not have automated tests. Manual testing requires:
- Building the DLL and injector
- Launching League of Legends
- Running the injector to inject the DLL
- Pressing F7 in-game runs
testFunc()inHooks.cppfor debugging
- C++20 or later (
/std:c++latest) - Conformance mode enabled (
/permissive-) - No precompiled headers
- Header files:
PascalCase.hpp - Source files:
PascalCase.cpp - SDK headers in
SDK/subdirectory
- Standard library headers (
<cstdint>,<string>, etc.) - Windows/DirectX headers (
<Windows.h>,<d3d11.h>) - Third-party libraries (
"json/json.hpp","imgui/imgui.h") - Project headers (
"CheatManager.hpp","SDK/AIBaseCommon.hpp")
Use #pragma once exclusively - no traditional include guards.
- Classes:
PascalCase(e.g.,CheatManager,AIBaseCommon) - Functions/Methods:
camelCasewith descriptive names (e.g.,get_character_data_stack,change_skin) - Member variables:
camelCase(e.g.,localPlayer,heroList) - Constants/Enums:
PascalCaseorSCREAMING_SNAKE_CASEfor macros - Namespaces:
lowercaseorsnake_case(e.g.,offsets,d3d_vtable) - Template parameters:
PascalCase(e.g.,Type,ReturnType)
- Use fixed-width types:
std::int32_t,std::uint64_t,std::uintptr_t - Use
std::size_tfor sizes and indices - Use
autowith brace initialization:auto value{ expression }; - Prefer
const auto&for loop iterables
- Mark non-throwing functions with
noexcept - Use
[[nodiscard]]for getters and pure functions - Use
[[maybe_unused]]for intentionally unused parameters - Prefer trailing return types with
[[nodiscard]]
[[nodiscard]] bool isLaneMinion() const noexcept;
[[nodiscard]] inline returnType name() const noexcept;- Opening brace on same line (K&R style for control structures)
- Member initialization uses brace initialization
if (condition) {
// code
}
class Example {
public:
bool flag{ true };
std::int32_t value{ 0 };
};*and&attach to type:AIBaseCommon* player- Use
this->explicitly for member access in methods - Use
::prefix for global Windows API calls:::GetModuleHandleW()
- Use
std::unique_ptrfor owned resources - Use raw pointers for non-owning references to game objects
- Memory offsets found via pattern scanning at runtime
Use helper macros defined in SDK/Pad.hpp:
CLASS_GETTER(returnType, name, offset) // Value getter
CLASS_GETTER_P(returnType, name, offset) // Pointer getter
PAD(size) // Padding bytesUse FNV hashing for string comparisons:
// Compile-time hash
if (hash == FNV("SRU_Baron"))
// Runtime hash
fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str)- Minimal exception usage (exceptions disabled in RiotGamesServers config)
- Use early returns with null/error checks
- Use
__try/__exceptfor SEH in critical paths
- Avoid excessive comments - code should be self-documenting
- Use
//for inline comments - Document VTable offsets with pattern signatures
_RIOT- Defined for RiotGamesServers builds_CRT_SECURE_NO_WARNINGS- Suppress CRT security warnings__SSE2__- SSE2 instruction set enabled
Central manager accessed via global cheatManager instance:
cheatManager.hooks- DirectX hook managementcheatManager.config- User configurationcheatManager.gui- ImGui interfacecheatManager.memory- Memory/offset managementcheatManager.database- Skin databasecheatManager.logger- Logging system
- Offsets defined in
offsets.hppwith inline variables - Pattern signatures in
Memory.hppfor runtime scanning - Use
offset_signaturestruct for pattern definitions
- VMT hooking via
vmt_smart_hook.hpp - Hooks
IDXGISwapChain::PresentandResizeBuffers - ImGui rendering in hooked Present call
- Add inline variable to appropriate namespace in
offsets.hpp - Add pattern signature to
Memory.hppinsigsvector - Use offset via
offsets::Namespace::OffsetName
- Modify
SkinDatabase.hppfor skin data - Update
GUI.cppfor UI elements - Handle skin changes in
Hooks.cpp
- Define offset in
offsets.hpp - Add getter macro in appropriate SDK header
- Access via
object->getter_name()