├── leagueoflegends ├── stdafx.cpp ├── mem │ ├── mem.h │ ├── spoofer.asm │ ├── mem.cpp │ └── spoof_call.h ├── packages.config ├── leagueoflegends.vcxproj.user ├── hooks │ ├── hooks.h │ ├── impl │ │ ├── impl.h │ │ └── impl.cpp │ └── hooks.cpp ├── global │ ├── targetver.h │ ├── colors.h │ ├── utils.h │ ├── globals.cpp │ ├── globals.h │ ├── leagueobfuscation.h │ ├── stringcheck.cpp │ ├── functions.h │ ├── settings.h │ ├── strings.h │ ├── offsets.h │ ├── settings.cpp │ └── structs.h ├── menu │ └── menu.h ├── selfprotection │ ├── utils.h │ ├── pipe │ │ └── namedpipeclient.h │ └── strings │ │ └── obfuscator.h ├── scripts │ ├── championmodule.h │ ├── champions │ │ ├── drmundo.cpp │ │ ├── garen.cpp │ │ ├── jax.cpp │ │ ├── brand.cpp │ │ └── syndra.cpp │ ├── skillshotdatabase.cpp │ ├── skillshotdatabase.h │ ├── scripts.h │ ├── targetselector.cpp │ ├── prediction.cpp │ └── scripts.cpp ├── imgui │ ├── imgui_impl_dx9.h │ ├── imgui_impl_dx10.h │ ├── imgui_impl_dx11.h │ ├── imgui_impl_win32.h │ ├── imgui_impl_opengl3.h │ └── imconfig.h ├── stdafx.h ├── kiero │ ├── kiero.h │ └── minhook │ │ ├── src │ │ ├── hde │ │ │ ├── pstdint.h │ │ │ ├── hde32.h │ │ │ ├── hde64.h │ │ │ ├── table32.h │ │ │ └── table64.h │ │ ├── buffer.h │ │ └── trampoline.h │ │ └── include │ │ └── MinHook.h ├── render │ ├── render.h │ ├── renderfunctions.cpp │ └── render.cpp ├── main │ └── dllmain.cpp └── classes │ └── classes.h ├── start ├── icon1.ico ├── start.aps ├── start.vcxproj.user ├── resource.h ├── start.vcxproj.filters ├── start1.rc ├── start.rc ├── main │ ├── start.cpp │ └── Injection.h ├── RCa16656 └── start.vcxproj ├── NamedPipeConsole ├── NamedPipeConsole.vcxproj.user ├── NamedPipeConsole.vcxproj.filters ├── NamedPipeConsole.cpp └── NamedPipeConsole.vcxproj ├── .gitignore ├── README.md └── leagueoflegends.sln /leagueoflegends/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | -------------------------------------------------------------------------------- /start/icon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matkhl/leagueoflegends/HEAD/start/icon1.ico -------------------------------------------------------------------------------- /start/start.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matkhl/leagueoflegends/HEAD/start/start.aps -------------------------------------------------------------------------------- /leagueoflegends/mem/mem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | namespace mem 6 | { 7 | char* ScanModInternal(char* pattern, char* mask, char* moduleBase); 8 | } -------------------------------------------------------------------------------- /leagueoflegends/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /start/start.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /leagueoflegends/leagueoflegends.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /NamedPipeConsole/NamedPipeConsole.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /leagueoflegends/hooks/hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace hooks 4 | { 5 | extern std::vector renderTypeNames; 6 | 7 | void CheckType(int renderType, const char* typeName); 8 | int Init(int index); 9 | } -------------------------------------------------------------------------------- /leagueoflegends/hooks/impl/impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace hooks 4 | { 5 | namespace impl 6 | { 7 | extern HWND windowDX; 8 | void Init(); 9 | } 10 | } 11 | 12 | IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -------------------------------------------------------------------------------- /leagueoflegends/global/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /leagueoflegends/menu/menu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace menu 4 | { 5 | void Init(); 6 | void SaveSoon(); 7 | void TextCentered(std::string text); 8 | bool CustomCheckbox(const char* label, bool* v); 9 | void DrawMenu(std::pair group, std::pair> groupOrder); 10 | void DynamicSettings(); 11 | void Update(); 12 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /.vs/leagueoflegends 6 | /packages/Microsoft.Windows.CppWinRT.2.0.210806.1 7 | /Win32 8 | /x64/Release 9 | /NamedPipeConsole/x64/Release 10 | /start/Release 11 | /start/x64/Release 12 | -------------------------------------------------------------------------------- /start/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by start.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /leagueoflegends/global/colors.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define COLOR_WHITE 0xffffffff 4 | #define COLOR_BLACK 0xff000000 5 | #define COLOR_RED 0xffff1f1f 6 | #define COLOR_GREEN 0xff0c9d00 7 | #define COLOR_BLUE 0xff7ea6ff 8 | #define COLOR_TURQUOISE 0xff6BFFEE 9 | #define COLOR_PURPLE 0xff9C26FC 10 | 11 | #define COLOR_GRAY 0xff4C4A4C 12 | #define COLOR_DARK 0xff090509 13 | #define COLOR_DARK_TRANSPARENT 0x80090509 14 | #define COLOR_ORANGE 0xffde7642 15 | #define COLOR_LIGHT_GREEN 0xff6BDB63 -------------------------------------------------------------------------------- /leagueoflegends/selfprotection/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "strings/obfuscator.h" 6 | 7 | #define SP_STRING(str) obfs::make_string, xor_<0x50>>(str).decode() 8 | 9 | template 10 | constexpr char xor_(char c) { 11 | return c ^ key; 12 | } 13 | 14 | template 15 | constexpr char add(char c) { 16 | return c + Key; 17 | } 18 | 19 | template 20 | constexpr char comp(char c) { 21 | return f(g(c)); 22 | } -------------------------------------------------------------------------------- /leagueoflegends/global/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef unsigned long long QWORD; 4 | 5 | #define IsValidPtr(addr) ((QWORD)(addr) > 0x100 && (QWORD)(addr) < 0x00007fffffffffff && !IsBadReadPtr(addr, sizeof(PVOID))) 6 | 7 | #define NOP 0x90 8 | 9 | #define PI 3.1415927f 10 | 11 | #define CHAT_COLOR(color, text) std::string(SP_STRING("") + std::string(SP_STRING(text)) + SP_STRING("")) 12 | #define CHAT_COLOR_DT(color, text) std::string(SP_STRING("") + std::string(text) + SP_STRING("")) -------------------------------------------------------------------------------- /leagueoflegends/hooks/hooks.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace hooks 4 | { 5 | std::vector renderTypeNames = { "D3D9", "D3D11" }; 6 | std::vector renderTypesIds = { 1, 3 }; 7 | 8 | void CheckType(int renderType, const char* typeName) 9 | { 10 | if (kiero::init((kiero::RenderType::Enum)renderType) == kiero::Status::Success) globals::renderType = typeName; 11 | } 12 | 13 | int Init(int index) 14 | { 15 | CheckType(renderTypesIds[index], renderTypeNames[index]); 16 | 17 | if (globals::renderType) 18 | { 19 | hooks::impl::Init(); 20 | return 1; 21 | } 22 | 23 | return 0; 24 | } 25 | } -------------------------------------------------------------------------------- /leagueoflegends/global/globals.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace globals 4 | { 5 | QWORD moduleBase; 6 | MODULEINFO moduleInfo; 7 | 8 | bool eject = false; 9 | const char* renderType; 10 | bool hookResponse = false; 11 | ImVec2 menuSize; 12 | bool menuOpen = false; 13 | 14 | float windowWidth = 0.0f; 15 | float windowHeight = 0.0f; 16 | 17 | Object* localPlayer; 18 | ObjectManager* heroManager; 19 | ObjectManager* minionManager; 20 | 21 | namespace scripts 22 | { 23 | namespace orbwalker 24 | { 25 | OrbwalkState orbwalkState; 26 | } 27 | 28 | namespace recalls 29 | { 30 | std::vector recallList = {}; 31 | float timeBuffer = 0.035f; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## leagueoflegends 2 | 3 | Simple source including: 4 | - recall tracker (outdated) 5 | - cooldown tracker (outdated) 6 | - orbwalker 7 | - champion modules 8 | - simple prediction & targetselection 9 | - skinchanger (based on R3nzSkin source) 10 | 11 | *Updated for patch 13.14.522 (minipatch after 13.14 release)* 12 | 13 | ### How to use the Injector 14 | 15 | In order for the injector to work, you need to put two compiled [Guided Hacking injector library](https://github.com/Broihon/GH-Injector-Library) files inside the output directory. 16 | ![Files screenshot](https://i.imgur.com/zVhDSCd.png) 17 | 18 | ### Default hotkeys 19 | - Open menu - Shift 20 | - Attack - Space 21 | - Uninject - Esc 22 | -------------------------------------------------------------------------------- /leagueoflegends/global/globals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | namespace globals 6 | { 7 | extern QWORD moduleBase; 8 | extern MODULEINFO moduleInfo; 9 | 10 | extern bool eject; 11 | extern const char* renderType; 12 | extern bool hookResponse; 13 | extern ImVec2 menuSize; 14 | extern bool menuOpen; 15 | 16 | extern float windowWidth; 17 | extern float windowHeight; 18 | 19 | extern Object* localPlayer; 20 | extern ObjectManager* heroManager; 21 | extern ObjectManager* minionManager; 22 | 23 | namespace scripts 24 | { 25 | namespace orbwalker 26 | { 27 | extern OrbwalkState orbwalkState; 28 | } 29 | 30 | namespace recalls 31 | { 32 | extern std::vector recallList; 33 | extern float timeBuffer; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /leagueoflegends/scripts/championmodule.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | class ChampionModule 6 | { 7 | public: 8 | virtual ~ChampionModule() {} 9 | virtual void Init() = 0; 10 | virtual void Update() = 0; 11 | virtual void Attack() = 0; 12 | virtual void Render() = 0; 13 | }; 14 | 15 | class ChampionModuleManager 16 | { 17 | private: 18 | std::map modules; 19 | 20 | static ChampionModuleManager& GetInstance() { 21 | static ChampionModuleManager instance; 22 | return instance; 23 | } 24 | 25 | ChampionModuleManager() {} 26 | 27 | public: 28 | static void RegisterModule(const std::string& name, ChampionModule* module) { 29 | GetInstance().modules[name] = module; 30 | } 31 | 32 | static ChampionModule* GetModule(const std::string& name) { 33 | auto& instance = GetInstance(); 34 | auto it = instance.modules.find(name); 35 | if (it != instance.modules.end()) { 36 | return it->second; 37 | } 38 | else { 39 | return nullptr; 40 | } 41 | } 42 | }; -------------------------------------------------------------------------------- /NamedPipeConsole/NamedPipeConsole.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /leagueoflegends/mem/spoofer.asm: -------------------------------------------------------------------------------- 1 | 2 | PUBLIC _spoofer_stub 3 | 4 | .code 5 | 6 | _spoofer_stub PROC 7 | pop r11 ; poping without setting up stack frame, r11 is the return address (the one in our code) 8 | add rsp, 8 ; skipping callee reserved space 9 | mov rax, [rsp + 24] ; dereference shell_param 10 | 11 | mov r10, [rax] ; load shell_param.trampoline 12 | mov [rsp], r10 ; store address of trampoline as return address 13 | 14 | mov r10, [rax + 8] ; load shell_param.function 15 | mov [rax + 8], r11 ; store the original return address in shell_param.function 16 | 17 | mov [rax + 16], rbx ; preserve rbx in shell_param.rbx 18 | lea rbx, fixup 19 | mov [rax], rbx ; store address of fixup label in shell_param.trampoline 20 | mov rbx, rax ; preserve address of shell_param in rbx 21 | 22 | jmp r10 ; call shell_param.function 23 | 24 | fixup: 25 | sub rsp, 16 26 | mov rcx, rbx ; restore address of shell_param 27 | mov rbx, [rcx + 16] ; restore rbx from shell_param.rbx 28 | jmp QWORD PTR [rcx + 8] ; jmp to the original return address 29 | _spoofer_stub ENDP 30 | 31 | END -------------------------------------------------------------------------------- /leagueoflegends/scripts/champions/drmundo.cpp: -------------------------------------------------------------------------------- 1 | #include "../../stdafx.h" 2 | 3 | using namespace scripts; 4 | 5 | class DrMundoModule : public ChampionModule 6 | { 7 | private: 8 | std::string name = SP_STRING("DrMundo"); 9 | 10 | Skillshot q = SkillshotManager::RegisterSpell(name, SpellIndex::Q, Skillshot(1000.0f, 70.0f, 2000.0f, 0.25f, SkillshotType::SkillshotLine, { CollidableObjects::Objects })); 11 | 12 | private: 13 | float gameTime = 0.0f; 14 | 15 | public: 16 | DrMundoModule() 17 | { 18 | ChampionModuleManager::RegisterModule(name, this); 19 | } 20 | 21 | void Init() override 22 | { 23 | 24 | } 25 | 26 | void Update() override 27 | { 28 | gameTime = functions::GetGameTime(); 29 | } 30 | 31 | void Attack() override 32 | { 33 | prediction::PredictionOutput qPrediction; 34 | if (q.IsCastable() && prediction::GetPrediction(q, qPrediction)) 35 | { 36 | actions::CastSpell(SpellIndex::Q, qPrediction.position); 37 | return; 38 | } 39 | } 40 | 41 | void Render() override 42 | { 43 | 44 | } 45 | }; 46 | 47 | DrMundoModule module; -------------------------------------------------------------------------------- /leagueoflegends/scripts/skillshotdatabase.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | void Skillshot::SetSlotIndex(int slotId) 4 | { 5 | this->slotIndex = slotId; 6 | } 7 | 8 | float Skillshot::GetRange() 9 | { 10 | return this->range; 11 | } 12 | 13 | float Skillshot::GetRadius() 14 | { 15 | return this->radius; 16 | } 17 | 18 | float Skillshot::GetSpeed() 19 | { 20 | return this->speed; 21 | } 22 | 23 | float Skillshot::GetCastTime() 24 | { 25 | return this->castTime; 26 | } 27 | 28 | int Skillshot::GetType() 29 | { 30 | return this->type; 31 | } 32 | 33 | bool Skillshot::IsCollidableWith(int type) 34 | { 35 | return std::find(this->collidableWith.begin(), this->collidableWith.end(), type) != this->collidableWith.end(); 36 | } 37 | 38 | float Skillshot::GetMaxRange() 39 | { 40 | return (this->type == SkillshotType::SkillshotCircle) ? this->range + (this->radius - min(this->radius, 70.0f)) : this->range; 41 | } 42 | 43 | std::string Skillshot::GetName() 44 | { 45 | return globals::localPlayer->GetSpellBySlotId(this->slotIndex)->GetName(); 46 | } 47 | 48 | bool Skillshot::IsCastable() 49 | { 50 | return globals::localPlayer->CanCastSpell(this->slotIndex); 51 | } 52 | 53 | int Skillshot::GetStacks() 54 | { 55 | return globals::localPlayer->GetSpellBySlotId(this->slotIndex)->GetStacks(); 56 | } -------------------------------------------------------------------------------- /leagueoflegends/global/leagueobfuscation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | template 4 | struct LeagueObfuscation 5 | { 6 | bool isInit; 7 | unsigned char xorCount64; 8 | unsigned char xorCount8; 9 | T xorKey; 10 | unsigned char valueIndex; 11 | T valueTable[4]; 12 | }; 13 | 14 | template 15 | inline T Decrypt(const LeagueObfuscation& data) 16 | { 17 | if (!data.isInit) 18 | throw std::exception(""); 19 | 20 | if (data.xorCount8 != 0) 21 | if (data.xorCount8 > sizeof(T) || data.xorCount8 < 0) 22 | throw std::exception(""); 23 | 24 | if (data.xorCount64 != 0) 25 | if (data.xorCount64 > sizeof(T) || data.xorCount64 < 0) 26 | throw std::exception(""); 27 | 28 | if (data.valueIndex > 4) 29 | throw std::exception(""); 30 | 31 | int xorCount64 = data.xorCount64 >= 1 ? 1 : 0; 32 | 33 | auto tXoredValue = data.valueTable[data.valueIndex]; 34 | auto tXorKeyValue = data.xorKey; 35 | { 36 | auto tXorValuePtr = reinterpret_cast(&tXorKeyValue); 37 | for (auto i = 0; i < xorCount64; i++) 38 | *(reinterpret_cast(&tXoredValue) + i) ^= ~tXorValuePtr[i]; 39 | } 40 | { 41 | auto tXorValuePtr = reinterpret_cast(&tXorKeyValue); 42 | for (auto i = sizeof(T) - data.xorCount8; i < sizeof(T); ++i) 43 | *(reinterpret_cast(&tXoredValue) + i) ^= ~tXorValuePtr[i]; 44 | } 45 | return tXoredValue; 46 | } -------------------------------------------------------------------------------- /leagueoflegends/imgui/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX9 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #pragma once 14 | #include "imgui.h" // IMGUI_IMPL_API 15 | 16 | struct IDirect3DDevice9; 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); 19 | IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); 21 | IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 22 | 23 | // Use if you want to reset your rendering device without losing Dear ImGui state. 24 | IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); 25 | IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 26 | -------------------------------------------------------------------------------- /leagueoflegends/imgui/imgui_impl_dx10.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX10 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture backend. Use 'ID3D10ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #pragma once 14 | #include "imgui.h" // IMGUI_IMPL_API 15 | 16 | struct ID3D10Device; 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device); 19 | IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); 21 | IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); 22 | 23 | // Use if you want to reset your rendering device without losing Dear ImGui state. 24 | IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects(); 25 | IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects(); 26 | -------------------------------------------------------------------------------- /leagueoflegends/imgui/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX11 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #pragma once 14 | #include "imgui.h" // IMGUI_IMPL_API 15 | 16 | struct ID3D11Device; 17 | struct ID3D11DeviceContext; 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 20 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 21 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 22 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 23 | 24 | // Use if you want to reset your rendering device without losing Dear ImGui state. 25 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 26 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 27 | -------------------------------------------------------------------------------- /start/start.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 7 | 8 | 9 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 10 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 11 | 12 | 13 | {6007c53d-7bc5-4caa-9a37-d534188b6c57} 14 | 15 | 16 | 17 | 18 | Header Files 19 | 20 | 21 | main 22 | 23 | 24 | 25 | 26 | Resource Files 27 | 28 | 29 | 30 | 31 | Resource Files 32 | 33 | 34 | 35 | 36 | main 37 | 38 | 39 | -------------------------------------------------------------------------------- /leagueoflegends/global/stringcheck.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace functions::stringcheck 4 | { 5 | static std::vector jungleMonsterObjects = { 6 | JUNGLE_MONSTER_GROMP, 7 | JUNGLE_MONSTER_WOLF, 8 | JUNGLE_MONSTER_WOLF_MINI, 9 | JUNGLE_MONSTER_RAPTOR, 10 | JUNGLE_MONSTER_RAPTOR_MINI, 11 | JUNGLE_MONSTER_KRUG, 12 | JUNGLE_MONSTER_KRUG_MINI, 13 | JUNGLE_MONSTER_KRUG_MINI_MINI, 14 | JUNGLE_MONSTER_CRAB, 15 | JUNGLE_MONSTER_BLUE, 16 | JUNGLE_MONSTER_RED, 17 | JUNGLE_MONSTER_BARON, 18 | JUNGLE_MONSTER_HERALD, 19 | JUNGLE_MONSTER_DRAGON_INFERNAL, 20 | JUNGLE_MONSTER_DRAGON_OCEAN, 21 | JUNGLE_MONSTER_DRAGON_MOUNTAIN, 22 | JUNGLE_MONSTER_DRAGON_CLOUD, 23 | JUNGLE_MONSTER_DRAGON_HEXTECH, 24 | JUNGLE_MONSTER_DRAGON_CHEMTECH, 25 | JUNGLE_MONSTER_DRAGON_ELDER 26 | }; 27 | 28 | static std::vector minionObjects = { 29 | MINION_MELEE_BLUE, 30 | MINION_MELEE_RED, 31 | MINION_RANGED_BLUE, 32 | MINION_RANGED_RED, 33 | MINION_CANNON_BLUE, 34 | MINION_CANNON_RED, 35 | MINION_SUPER_BLUE, 36 | MINION_SUPER_RED 37 | }; 38 | 39 | bool VectorContains(std::vector vector, std::string string) 40 | { 41 | return std::find(vector.begin(), vector.end(), string) != vector.end(); 42 | } 43 | 44 | bool IsJungleMonsterObject(std::string objectName) 45 | { 46 | return VectorContains(jungleMonsterObjects, objectName); 47 | } 48 | 49 | bool IsMinionObject(std::string objectName) 50 | { 51 | return VectorContains(minionObjects, objectName); 52 | } 53 | } -------------------------------------------------------------------------------- /leagueoflegends/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "selfprotection/utils.h" 26 | #include "selfprotection/pipe/namedpipeclient.h" 27 | 28 | #include "kiero/kiero.h" 29 | #include "kiero/minhook/include/MinHook.h" 30 | 31 | #include "imgui/imgui.h" 32 | #include "imgui/imgui_internal.h" 33 | #include "imgui/imgui_impl_dx9.h" 34 | #include "imgui/imgui_impl_dx11.h" 35 | #include "imgui/imgui_impl_win32.h" 36 | 37 | #include "mem/mem.h" 38 | #include "mem/spoof_call.h" 39 | #include "global/strings.h" 40 | #include "global/colors.h" 41 | #include "global/offsets.h" 42 | #include "global/structs.h" 43 | #include "global/utils.h" 44 | #include "global/leagueobfuscation.h" 45 | #include "classes/classes.h" 46 | #include "global/functions.h" 47 | #include "render/render.h" 48 | #include "global/settings.h" 49 | #include "global/globals.h" 50 | #include "global/targetver.h" 51 | #include "scripts/championmodule.h" 52 | #include "scripts/skillshotdatabase.h" 53 | #include "scripts/scripts.h" 54 | 55 | #include "hooks/hooks.h" 56 | #include "hooks/impl/impl.h" 57 | #include "menu/menu.h" -------------------------------------------------------------------------------- /start/start1.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #include "resource1.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // Englisch (Vereinigte Staaten) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE 7, 1 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource1.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // Englisch (Vereinigte Staaten) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | #endif // not APSTUDIO_INVOKED 61 | -------------------------------------------------------------------------------- /leagueoflegends/global/functions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace functions 4 | { 5 | extern void* spoof_trampoline; 6 | 7 | template Function CallVirtual(PVOID base, QWORD index) 8 | { 9 | QWORD** VTablePointer = (QWORD**)base; 10 | QWORD* VTableFunctionBase = *VTablePointer; 11 | QWORD dwAddress = VTableFunctionBase[index]; 12 | return (Function)(dwAddress); 13 | } 14 | 15 | void Init(); 16 | 17 | std::string GetHexString(QWORD hexNumber); 18 | std::string CapitalizeFirstLetter(std::string str); 19 | 20 | Vector3 ReadVector3(QWORD offset); 21 | void WriteVector3(QWORD offset, Vector3 vector); 22 | 23 | void PrintChat(std::string text); 24 | void PrintChat(int number); 25 | void PrintChat(float number); 26 | void PrintChat(void* address); 27 | 28 | float GetGameTime(); 29 | std::string ConvertTime(float seconds); 30 | 31 | bool IsGameFocused(); 32 | bool IsChatOpen(); 33 | 34 | Vector2 GetMousePos(); 35 | Vector3 GetMouseWorldPos(); 36 | 37 | Vector2 WorldToScreen(Vector3 in); 38 | Vector3 GetBaseDrawPosition(Object* obj); 39 | Vector2 GetHpBarPosition(Object* obj); 40 | 41 | Object* GetSelectedObject(); 42 | unsigned int GetCollisionFlags(Vector3 pos); 43 | bool IsBrush(Vector3 pos); 44 | bool IsWall(Vector3 pos); 45 | bool IsAttackWindupSpell(int spellId); 46 | 47 | void TryRightClick(Vector2 pos); 48 | void IssueOrder(Vector2 pos); 49 | void IssueMove(Vector2 pos); 50 | void CastSpell(int spellId, Vector3 pos); 51 | 52 | bool CanSendInput(); 53 | 54 | void AttackObject(Object* obj); 55 | void MoveToMousePos(); 56 | } -------------------------------------------------------------------------------- /start/start.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // Englisch (Vereinigte Staaten) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE 7, 1 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // Englisch (Vereinigte Staaten) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | #endif // not APSTUDIO_INVOKED 61 | 62 | MAINICON ICON "icon1.ico" -------------------------------------------------------------------------------- /leagueoflegends/scripts/champions/garen.cpp: -------------------------------------------------------------------------------- 1 | #include "../../stdafx.h" 2 | 3 | using namespace scripts; 4 | 5 | class GarenModule : public ChampionModule 6 | { 7 | private: 8 | std::string name = SP_STRING("Garen"); 9 | 10 | private: 11 | float gameTime = 0.0f; 12 | 13 | public: 14 | GarenModule() 15 | { 16 | ChampionModuleManager::RegisterModule(name, this); 17 | } 18 | 19 | void Init() override 20 | { 21 | ADD_SETTING("Garen", "auto R", true); 22 | } 23 | 24 | void Update() override 25 | { 26 | gameTime = functions::GetGameTime(); 27 | 28 | if (SETTINGS_BOOL("Garen", "auto R") && globals::localPlayer->CanCastSpell(SpellIndex::R)) 29 | { 30 | if (auto target = targetselector::GetEnemyChampionInRange(400.0f, DamageType::True, Skillshot())) 31 | { 32 | float targetHealth = target->GetHealth(); 33 | 34 | auto rSpell = globals::localPlayer->GetSpellBySlotId(SpellIndex::R); 35 | int rSpellLevel = rSpell->GetLevel(); 36 | float trueDamage = (150.0f * rSpellLevel) + (target->GetMaxHealth() - targetHealth) * (0.20f + 0.05f * rSpellLevel); 37 | 38 | if (targetHealth < trueDamage * 0.95f) 39 | { 40 | actions::CastSpell(SpellIndex::R, target); 41 | return; 42 | } 43 | } 44 | } 45 | } 46 | 47 | void Attack() override 48 | { 49 | 50 | } 51 | 52 | void Render() override 53 | { 54 | 55 | } 56 | }; 57 | 58 | GarenModule module; -------------------------------------------------------------------------------- /leagueoflegends/scripts/champions/jax.cpp: -------------------------------------------------------------------------------- 1 | #include "../../stdafx.h" 2 | 3 | using namespace scripts; 4 | 5 | class JaxModule : public ChampionModule 6 | { 7 | private: 8 | std::string name = SP_STRING("Jax"); 9 | 10 | private: 11 | float gameTime = 0.0f; 12 | 13 | public: 14 | JaxModule() 15 | { 16 | ChampionModuleManager::RegisterModule(name, this); 17 | } 18 | 19 | void Init() override 20 | { 21 | 22 | } 23 | 24 | void Update() override 25 | { 26 | gameTime = functions::GetGameTime(); 27 | 28 | auto wBuff = globals::localPlayer->GetBuffByName("JaxEmpowerTwo"); 29 | if (wBuff && wBuff->GetStacksAlt()) 30 | orbwalker::lastAttackTime = gameTime - globals::localPlayer->GetAttackWindup(); 31 | } 32 | 33 | void Attack() override 34 | { 35 | auto wBuff = globals::localPlayer->GetBuffByName("JaxEmpowerTwo"); 36 | float windup = globals::localPlayer->GetAttackWindup(); 37 | float windupTime = orbwalker::lastAttackTime + windup + SETTINGS_FLOAT("orbwalker", "windupbuffer"); 38 | if ((!wBuff || !wBuff->GetStacksAlt()) && 39 | gameTime > windupTime && 40 | gameTime < windupTime + 0.3f && 41 | globals::localPlayer->CanCastSpell(SpellIndex::W)) 42 | { 43 | if (auto target = targetselector::GetEnemyChampionInRange(globals::localPlayer->GetRealAttackRange())) 44 | { 45 | actions::CastSpell(SpellIndex::W, globals::localPlayer); 46 | return; 47 | } 48 | } 49 | } 50 | 51 | void Render() override 52 | { 53 | 54 | } 55 | }; 56 | 57 | JaxModule module; -------------------------------------------------------------------------------- /leagueoflegends/global/settings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | #define SETTINGS_BOOL(group, key) settings::GetBool(SP_STRING(group), SP_STRING(key)) 6 | #define SETTINGS_INT(group, key) settings::GetInt(SP_STRING(group), SP_STRING(key)) 7 | #define SETTINGS_FLOAT(group, key) settings::GetFloat(SP_STRING(group), SP_STRING(key)) 8 | 9 | namespace settings 10 | { 11 | typedef std::variant SettingValue; 12 | typedef std::map SettingsGroup; 13 | typedef std::map SettingsData; 14 | 15 | typedef std::variant, std::pair> SettingBoundsValue; 16 | typedef std::map SettingsBoundsGroup; 17 | typedef std::map SettingsBounds; 18 | 19 | extern SettingsData data; 20 | 21 | void Load(); 22 | void Save(); 23 | 24 | SettingValue Get(std::string group, std::string key, SettingValue defaultValue); 25 | bool GetBool(std::string group, std::string key); 26 | int GetInt(std::string group, std::string key); 27 | float GetFloat(std::string group, std::string key); 28 | void Set(std::string group, std::string key, SettingValue value); 29 | 30 | SettingBoundsValue GetBounds(std::string group, std::string key, SettingBoundsValue defaultValue); 31 | std::pair GetBoundsInt(std::string group, std::string key, std::pair defaultValue); 32 | std::pair GetBoundsFloat(std::string group, std::string key, std::pair defaultValue); 33 | void AddBounds(std::string group, std::string key, int min, int max); 34 | void AddBounds(std::string group, std::string key, float min, float max); 35 | } -------------------------------------------------------------------------------- /leagueoflegends/mem/mem.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace mem 4 | { 5 | char* ScanBasic(char* pattern, char* mask, char* begin, intptr_t size) 6 | { 7 | intptr_t patternLen = strlen(mask); 8 | 9 | for (int i = 0; i < size; i++) 10 | { 11 | bool found = true; 12 | for (int j = 0; j < patternLen; j++) 13 | { 14 | if (mask[j] != '?' && pattern[j] != *(char*)((intptr_t)begin + i + j)) 15 | { 16 | found = false; 17 | break; 18 | } 19 | } 20 | if (found) 21 | { 22 | return (begin + i); 23 | } 24 | } 25 | return nullptr; 26 | } 27 | 28 | char* ScanInternal(char* pattern, char* mask, char* begin, intptr_t size) 29 | { 30 | char* match{ nullptr }; 31 | MEMORY_BASIC_INFORMATION mbi{}; 32 | 33 | for (char* curr = begin; curr < begin + size; curr += mbi.RegionSize) 34 | { 35 | if (!VirtualQuery(curr, &mbi, sizeof(mbi)) || mbi.State != MEM_COMMIT || mbi.Protect == PAGE_NOACCESS) continue; 36 | 37 | match = ScanBasic(pattern, mask, curr, mbi.RegionSize); 38 | 39 | if (match != nullptr) 40 | { 41 | break; 42 | } 43 | } 44 | return match; 45 | } 46 | 47 | char* TO_CHAR(wchar_t* string) 48 | { 49 | size_t len = wcslen(string) + 1; 50 | char* c_string = new char[len]; 51 | size_t numCharsRead; 52 | wcstombs_s(&numCharsRead, c_string, len, string, _TRUNCATE); 53 | return c_string; 54 | } 55 | 56 | PEB* GetPEB() 57 | { 58 | PEB* peb = (PEB*)__readgsqword(0x60); 59 | 60 | return peb; 61 | } 62 | 63 | char* ScanModInternal(char* pattern, char* mask, char* moduleBase) 64 | { 65 | char* match = ScanInternal(pattern, mask, moduleBase, globals::moduleInfo.SizeOfImage); 66 | 67 | return match; 68 | } 69 | } -------------------------------------------------------------------------------- /leagueoflegends/kiero/kiero.h: -------------------------------------------------------------------------------- 1 | #ifndef __KIERO_H__ 2 | #define __KIERO_H__ 3 | 4 | #include 5 | 6 | #define KIERO_VERSION "1.2.10" 7 | 8 | #define KIERO_INCLUDE_D3D9 1 // 1 if you need D3D9 hook 9 | #define KIERO_INCLUDE_D3D10 0 // 1 if you need D3D10 hook 10 | #define KIERO_INCLUDE_D3D11 1 // 1 if you need D3D11 hook 11 | #define KIERO_INCLUDE_D3D12 0 // 1 if you need D3D12 hook 12 | #define KIERO_INCLUDE_OPENGL 0 // 1 if you need OpenGL hook 13 | #define KIERO_INCLUDE_VULKAN 0 // 1 if you need Vulkan hook 14 | #define KIERO_USE_MINHOOK 1 // 1 if you will use kiero::bind function 15 | 16 | #define KIERO_ARCH_X64 0 17 | #define KIERO_ARCH_X86 0 18 | 19 | #if defined(_M_X64) 20 | # undef KIERO_ARCH_X64 21 | # define KIERO_ARCH_X64 1 22 | #else 23 | # undef KIERO_ARCH_X86 24 | # define KIERO_ARCH_X86 1 25 | #endif 26 | 27 | #if KIERO_ARCH_X64 28 | typedef uint64_t uint150_t; 29 | #else 30 | typedef uint32_t uint150_t; 31 | #endif 32 | 33 | namespace kiero 34 | { 35 | struct Status 36 | { 37 | enum Enum 38 | { 39 | UnknownError = -1, 40 | NotSupportedError = -2, 41 | ModuleNotFoundError = -3, 42 | 43 | AlreadyInitializedError = -4, 44 | NotInitializedError = -5, 45 | 46 | Success = 0, 47 | }; 48 | }; 49 | 50 | struct RenderType 51 | { 52 | enum Enum 53 | { 54 | None, 55 | 56 | D3D9, 57 | D3D10, 58 | D3D11, 59 | D3D12, 60 | 61 | OpenGL, 62 | Vulkan, 63 | 64 | Auto 65 | }; 66 | }; 67 | 68 | Status::Enum init(RenderType::Enum renderType); 69 | void shutdown(); 70 | 71 | Status::Enum bind(uint16_t index, void** original, void* function); 72 | void unbind(uint16_t index); 73 | 74 | RenderType::Enum getRenderType(); 75 | uint150_t* getMethodsTable(); 76 | } 77 | 78 | #endif // __KIERO_H__ -------------------------------------------------------------------------------- /leagueoflegends/scripts/champions/brand.cpp: -------------------------------------------------------------------------------- 1 | #include "../../stdafx.h" 2 | 3 | using namespace scripts; 4 | 5 | class BrandModule : public ChampionModule 6 | { 7 | private: 8 | std::string name = SP_STRING("Brand"); 9 | 10 | Skillshot q = SkillshotManager::RegisterSpell(name, SpellIndex::Q, Skillshot(1040.0f, 60.0f, 1600.0f, 0.25f, SkillshotType::SkillshotLine, { CollidableObjects::Objects })); 11 | Skillshot w = SkillshotManager::RegisterSpell(name, SpellIndex::W, Skillshot(900.0f, 260.0f, 0.0f, 0.9f, SkillshotType::SkillshotCircle)); 12 | 13 | private: 14 | float gameTime = 0.0f; 15 | 16 | public: 17 | BrandModule() 18 | { 19 | ChampionModuleManager::RegisterModule(name, this); 20 | } 21 | 22 | void Init() override 23 | { 24 | 25 | } 26 | 27 | void Update() override 28 | { 29 | gameTime = functions::GetGameTime(); 30 | } 31 | 32 | void Attack() override 33 | { 34 | prediction::PredictionOutput wPrediction; 35 | if (w.IsCastable() && prediction::GetPrediction(w, wPrediction)) 36 | { 37 | actions::CastSpell(SpellIndex::W, wPrediction.position); 38 | return; 39 | } 40 | 41 | auto target = targetselector::GetEnemyChampionInRange(675.0f); 42 | if (target && globals::localPlayer->CanCastSpell(SpellIndex::E)) 43 | { 44 | actions::CastSpell(SpellIndex::E, target); 45 | return; 46 | } 47 | 48 | prediction::PredictionOutput qPrediction; 49 | if (q.IsCastable() && prediction::GetPrediction(q, qPrediction)) 50 | { 51 | actions::CastSpell(SpellIndex::Q, qPrediction.position); 52 | return; 53 | } 54 | } 55 | 56 | void Render() override 57 | { 58 | 59 | } 60 | }; 61 | 62 | BrandModule module; -------------------------------------------------------------------------------- /leagueoflegends/kiero/minhook/src/hde/pstdint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #pragma once 28 | 29 | #include 30 | 31 | // Integer types for HDE. 32 | typedef INT8 int8_t; 33 | typedef INT16 int16_t; 34 | typedef INT32 int32_t; 35 | typedef INT64 int64_t; 36 | typedef UINT8 uint8_t; 37 | typedef UINT16 uint16_t; 38 | typedef UINT32 uint32_t; 39 | typedef UINT64 uint64_t; 40 | -------------------------------------------------------------------------------- /leagueoflegends/global/strings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define JUNGLE_MONSTER_GROMP std::string("SRU_Gromp") 4 | #define JUNGLE_MONSTER_WOLF std::string("SRU_Murkwolf") 5 | #define JUNGLE_MONSTER_WOLF_MINI std::string("SRU_MurkwolfMini") 6 | #define JUNGLE_MONSTER_RAPTOR std::string("SRU_Razorbeak") 7 | #define JUNGLE_MONSTER_RAPTOR_MINI std::string("SRU_RazorbeakMini") 8 | #define JUNGLE_MONSTER_KRUG std::string("SRU_Krug") 9 | #define JUNGLE_MONSTER_KRUG_MINI std::string("SRU_KrugMini") 10 | #define JUNGLE_MONSTER_KRUG_MINI_MINI std::string("SRU_KrugMiniMini") 11 | #define JUNGLE_MONSTER_CRAB std::string("Sru_Crab") 12 | #define JUNGLE_MONSTER_BLUE std::string("SRU_Blue") 13 | #define JUNGLE_MONSTER_RED std::string("SRU_Red") 14 | #define JUNGLE_MONSTER_BARON std::string("SRU_Baron") 15 | #define JUNGLE_MONSTER_HERALD std::string("SRU_RiftHerald") 16 | #define JUNGLE_MONSTER_DRAGON_INFERNAL std::string("SRU_Dragon_Fire") 17 | #define JUNGLE_MONSTER_DRAGON_OCEAN std::string("SRU_Dragon_Water") 18 | #define JUNGLE_MONSTER_DRAGON_MOUNTAIN std::string("SRU_Dragon_Earth") 19 | #define JUNGLE_MONSTER_DRAGON_CLOUD std::string("SRU_Dragon_Air") 20 | #define JUNGLE_MONSTER_DRAGON_HEXTECH std::string("SRU_Dragon_Hextech") 21 | #define JUNGLE_MONSTER_DRAGON_CHEMTECH std::string("SRU_Dragon_Chemtech") 22 | #define JUNGLE_MONSTER_DRAGON_ELDER std::string("SRU_Dragon_Elder") 23 | 24 | #define MINION_MELEE_BLUE std::string("SRU_OrderMinionMelee") 25 | #define MINION_MELEE_RED std::string("SRU_ChaosMinionMelee") 26 | #define MINION_RANGED_BLUE std::string("SRU_OrderMinionRanged") 27 | #define MINION_RANGED_RED std::string("SRU_ChaosMinionRanged") 28 | #define MINION_CANNON_BLUE std::string("SRU_OrderMinionSiege") 29 | #define MINION_CANNON_RED std::string("SRU_ChaosMinionSiege") 30 | #define MINION_SUPER_BLUE std::string("SRU_OrderMinionSuper") 31 | #define MINION_SUPER_RED std::string("SRU_ChaosMinionSuper") 32 | #define MINION_SENNA_SOUL std::string("SennaSoul") -------------------------------------------------------------------------------- /leagueoflegends/scripts/skillshotdatabase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | class Skillshot 6 | { 7 | private: 8 | int slotIndex; 9 | float range; 10 | float radius; 11 | float speed; 12 | float castTime; 13 | int type; 14 | std::vector collidableWith; 15 | 16 | public: 17 | Skillshot() : slotIndex(0), range(0.0f), radius(0.0f), speed(0.0f), castTime(0.0f), type(SkillshotType::SkillshotNone) {} 18 | 19 | Skillshot(float range, float radius, float speed, float castTime, int type, std::vector collidableWith = {}) : 20 | slotIndex(0), 21 | range(range), 22 | radius(radius), 23 | speed(speed), 24 | castTime(castTime), 25 | type(type), 26 | collidableWith(collidableWith) {} 27 | 28 | void SetSlotIndex(int slotIndex); 29 | float GetRange(); 30 | float GetRadius(); 31 | float GetSpeed(); 32 | float GetCastTime(); 33 | int GetType(); 34 | bool IsCollidableWith(int type); 35 | 36 | public: 37 | float GetMaxRange(); 38 | std::string GetName(); 39 | bool IsCastable(); 40 | int GetStacks(); 41 | }; 42 | 43 | class SkillshotManager 44 | { 45 | private: 46 | std::map> spells; 47 | 48 | static SkillshotManager& GetInstance() { 49 | static SkillshotManager instance; 50 | return instance; 51 | } 52 | 53 | SkillshotManager() {} 54 | 55 | public: 56 | static Skillshot RegisterSpell(const std::string& name, const int& slotIndex, Skillshot spell) { 57 | spell.SetSlotIndex(slotIndex); 58 | GetInstance().spells[name][slotIndex] = spell; 59 | return spell; 60 | } 61 | 62 | static bool GetSpell(const std::string& name, const int& slotIndex, Skillshot &out) { 63 | auto& instance = GetInstance(); 64 | auto itName = instance.spells.find(name); 65 | if (itName != instance.spells.end()) { 66 | auto itSpellId = (*itName).second.find(slotIndex); 67 | if (itSpellId != (*itName).second.end()) { 68 | out = itSpellId->second; 69 | return true; 70 | } 71 | } 72 | return false; 73 | } 74 | }; -------------------------------------------------------------------------------- /leagueoflegends/kiero/minhook/src/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | // Size of each memory slot. 32 | #if defined(_M_X64) || defined(__x86_64__) 33 | #define MEMORY_SLOT_SIZE 64 34 | #else 35 | #define MEMORY_SLOT_SIZE 32 36 | #endif 37 | 38 | VOID InitializeBuffer(VOID); 39 | VOID UninitializeBuffer(VOID); 40 | LPVOID AllocateBuffer(LPVOID pOrigin); 41 | VOID FreeBuffer(LPVOID pBuffer); 42 | BOOL IsExecutableAddress(LPVOID pAddress); 43 | -------------------------------------------------------------------------------- /leagueoflegends/selfprotection/pipe/namedpipeclient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../../stdafx.h" 4 | 5 | // %d or % i: Signed integer 6 | // %u : Unsigned integer 7 | // %f : Decimal floating point 8 | // %e : Scientific - notation floating point 9 | // %g : General format floating point 10 | // %x : Unsigned hexadecimal integer 11 | // %o : Unsigned octal integer 12 | // %s : String of characters 13 | // %c : Single character 14 | // %p : Pointer address 15 | // %% : A single % character 16 | 17 | #define LOG(format, ...) PipeClient::WriteFormatted(SP_STRING(format), ##__VA_ARGS__) 18 | 19 | class PipeClient 20 | { 21 | private: 22 | HANDLE pipe; 23 | 24 | static PipeClient& GetInstance() 25 | { 26 | static PipeClient instance; 27 | return instance; 28 | } 29 | 30 | PipeClient() : pipe(INVALID_HANDLE_VALUE) 31 | { 32 | std::string pipePath = SP_STRING("\\\\.\\pipe\\LeagueOfLegends"); 33 | std::wstring wPipePath(pipePath.begin(), pipePath.end()); 34 | 35 | pipe = CreateFile( 36 | wPipePath.c_str(), 37 | GENERIC_WRITE, 38 | 0, 39 | NULL, 40 | OPEN_EXISTING, 41 | 0, 42 | NULL 43 | ); 44 | 45 | if (pipe == INVALID_HANDLE_VALUE) { 46 | std::cerr << SP_STRING("Failed to open named pipe.") << std::endl; 47 | } 48 | } 49 | 50 | public: 51 | static void Write(std::string message) 52 | { 53 | HANDLE pipe = GetInstance().pipe; 54 | if (pipe == INVALID_HANDLE_VALUE) 55 | { 56 | std::cout << message << std::endl; 57 | return; 58 | }; 59 | DWORD bytesWritten; 60 | BOOL result = WriteFile(pipe, message.c_str(), (DWORD)message.size(), &bytesWritten, NULL); 61 | if (!result || bytesWritten != message.size()) { 62 | CloseHandle(pipe); 63 | std::cerr << SP_STRING("Failed to write to named pipe.") << std::endl; 64 | } 65 | } 66 | 67 | static void WriteFormatted(const char* format, ...) 68 | { 69 | char buffer[256]; 70 | va_list args; 71 | va_start(args, format); 72 | vsprintf(buffer, format, args); 73 | const std::string message = buffer; 74 | va_end(args); 75 | 76 | Write(message); 77 | } 78 | 79 | ~PipeClient() { 80 | CloseHandle(pipe); 81 | } 82 | }; -------------------------------------------------------------------------------- /leagueoflegends/mem/spoof_call.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace detail 4 | { 5 | extern "C" void* _spoofer_stub(); 6 | 7 | template 8 | static inline auto shellcode_stub_helper( 9 | const void* shell, 10 | Args... args 11 | ) -> Ret 12 | { 13 | auto fn = (Ret(*)(Args...))(shell); 14 | return fn(args...); 15 | } 16 | 17 | template 18 | struct argument_remapper 19 | { 20 | // At least 5 params 21 | template< 22 | typename Ret, 23 | typename First, 24 | typename Second, 25 | typename Third, 26 | typename Fourth, 27 | typename... Pack 28 | > 29 | static auto do_call( 30 | const void* shell, 31 | void* shell_param, 32 | First first, 33 | Second second, 34 | Third third, 35 | Fourth fourth, 36 | Pack... pack 37 | ) -> Ret 38 | { 39 | return shellcode_stub_helper< 40 | Ret, 41 | First, 42 | Second, 43 | Third, 44 | Fourth, 45 | void*, 46 | void*, 47 | Pack... 48 | >( 49 | shell, 50 | first, 51 | second, 52 | third, 53 | fourth, 54 | shell_param, 55 | nullptr, 56 | pack... 57 | ); 58 | } 59 | }; 60 | 61 | template 62 | struct argument_remapper> 63 | { 64 | // 4 or less params 65 | template< 66 | typename Ret, 67 | typename First = void*, 68 | typename Second = void*, 69 | typename Third = void*, 70 | typename Fourth = void* 71 | > 72 | static auto do_call( 73 | const void* shell, 74 | void* shell_param, 75 | First first = First{}, 76 | Second second = Second{}, 77 | Third third = Third{}, 78 | Fourth fourth = Fourth{} 79 | ) -> Ret 80 | { 81 | return shellcode_stub_helper< 82 | Ret, 83 | First, 84 | Second, 85 | Third, 86 | Fourth, 87 | void*, 88 | void* 89 | >( 90 | shell, 91 | first, 92 | second, 93 | third, 94 | fourth, 95 | shell_param, 96 | nullptr 97 | ); 98 | } 99 | }; 100 | } 101 | 102 | template 103 | static inline auto spoof_call( 104 | void* trampoline, 105 | Ret(*fn)(Args...), 106 | Args... args 107 | ) -> Ret 108 | { 109 | struct shell_params 110 | { 111 | void* trampoline; 112 | void* function; 113 | void* rbx; 114 | }; 115 | 116 | shell_params p{ trampoline, reinterpret_cast(fn) }; 117 | using mapper = detail::argument_remapper; 118 | return mapper::template do_call((void*)&detail::_spoofer_stub, &p, args...); 119 | } -------------------------------------------------------------------------------- /leagueoflegends/render/render.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | namespace render 6 | { 7 | extern ImFont* imFont; 8 | 9 | float Distance(Vector2 vec1, Vector2 vec2); 10 | float Distance(Vector3 vec1, Vector3 vec2); 11 | Vector3 CalcAngle(Vector3 src, Vector3 dst); 12 | Vector3 Add(Vector3 src, Vector3 dst); 13 | Vector3 Subtract(Vector3 src, Vector3 dst); 14 | Vector3 Divide(Vector3 src, float num); 15 | Vector3 Multiply(Vector3 src, float num); 16 | float Magnitude(Vector3 vec); 17 | Vector3 Normalize(Vector3 src); 18 | Vector3 GetLine(Vector2 point1, Vector2 point2); 19 | Vector3 GetVector(Vector3 point1, Vector3 point2); 20 | float GetDistPointToLine(Vector2 point, Vector2 pointLine1, Vector2 pointLine2); 21 | bool IsVectorEqual(Vector3 vec1, Vector3 vec2); 22 | bool IsVector2Null(Vector2 vec); 23 | bool IsVector3Null(Vector3 vec); 24 | bool IsOnScreen(Vector2 pos); 25 | 26 | void RenderText(const std::string& text, const ImVec2& position, float size, uint32_t color, bool center); 27 | void RenderLine(const ImVec2& from, const ImVec2& to, uint32_t color, float thickness); 28 | void RenderCircle(const ImVec2& position, float radius, uint32_t color, float thickness, uint32_t segments); 29 | void RenderCircleFilled(const ImVec2& position, float radius, uint32_t color, uint32_t segments); 30 | void RenderRect(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding, uint32_t roundingCornersFlags, float thickness); 31 | void RenderRectFilled(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding, uint32_t roundingCornersFlags); 32 | void RenderImage(ImTextureID pTexture, const ImVec2& from, const ImVec2& to, uint32_t color); 33 | void RenderImageRounded(ImTextureID pTexture, const ImVec2& from, const ImVec2& to, uint32_t color, float rounding, uint32_t roundingCornersFlags); 34 | void RenderCircleWorld(const Vector3& worldPos, int numPoints, float radius, uintptr_t color, float thickness); 35 | 36 | void Init(); 37 | void Update(); 38 | 39 | namespace scriptsrender 40 | { 41 | void Update(); 42 | 43 | namespace cooldowns 44 | { 45 | void DrawCooldownBar(Object* obj); 46 | void Update(); 47 | } 48 | 49 | namespace recalls 50 | { 51 | void DrawRecallFrame(); 52 | void DrawRecall(float relativePositionOffset, std::string name, uint32_t color, bool teleport); 53 | void Update(); 54 | } 55 | 56 | namespace debug 57 | { 58 | void DrawData(Object* obj, int index); 59 | void DrawObjectData(); 60 | void DrawBoundingRadius(Object* obj); 61 | void DrawObjectBoundingRadius(); 62 | void DrawCursorWorld(); 63 | void DrawPlayerPaths(); 64 | void Update(); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /leagueoflegends/imgui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for Windows (standard windows API for 32 and 64 bits applications) 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | 4 | // Implemented features: 5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui) 6 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 7 | // [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE). 8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | 10 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 11 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 12 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 13 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 14 | 15 | #pragma once 16 | #include "imgui.h" // IMGUI_IMPL_API 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 19 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 21 | 22 | // Win32 message handler your application need to call. 23 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. 24 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. 25 | 26 | #if 0 27 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 28 | #endif 29 | 30 | // DPI-related helpers (optional) 31 | // - Use to enable DPI awareness without having to create an application manifest. 32 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 33 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 34 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 35 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 36 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 37 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 38 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 39 | 40 | // Transparency related helpers (optional) [experimental] 41 | // - Use to enable alpha compositing transparency with the desktop. 42 | // - Use together with e.g. clearing your framebuffer with zero-alpha. 43 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd 44 | -------------------------------------------------------------------------------- /leagueoflegends/kiero/minhook/src/hde/hde32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 32 3 | * Copyright (c) 2006-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | * hde32.h: C/C++ header file 7 | * 8 | */ 9 | 10 | #ifndef _HDE32_H_ 11 | #define _HDE32_H_ 12 | 13 | /* stdint.h - C99 standard header 14 | * http://en.wikipedia.org/wiki/stdint.h 15 | * 16 | * if your compiler doesn't contain "stdint.h" header (for 17 | * example, Microsoft Visual C++), you can download file: 18 | * http://www.azillionmonkeys.com/qed/pstdint.h 19 | * and change next line to: 20 | * #include "pstdint.h" 21 | */ 22 | #include "pstdint.h" 23 | 24 | #define F_MODRM 0x00000001 25 | #define F_SIB 0x00000002 26 | #define F_IMM8 0x00000004 27 | #define F_IMM16 0x00000008 28 | #define F_IMM32 0x00000010 29 | #define F_DISP8 0x00000020 30 | #define F_DISP16 0x00000040 31 | #define F_DISP32 0x00000080 32 | #define F_RELATIVE 0x00000100 33 | #define F_2IMM16 0x00000800 34 | #define F_ERROR 0x00001000 35 | #define F_ERROR_OPCODE 0x00002000 36 | #define F_ERROR_LENGTH 0x00004000 37 | #define F_ERROR_LOCK 0x00008000 38 | #define F_ERROR_OPERAND 0x00010000 39 | #define F_PREFIX_REPNZ 0x01000000 40 | #define F_PREFIX_REPX 0x02000000 41 | #define F_PREFIX_REP 0x03000000 42 | #define F_PREFIX_66 0x04000000 43 | #define F_PREFIX_67 0x08000000 44 | #define F_PREFIX_LOCK 0x10000000 45 | #define F_PREFIX_SEG 0x20000000 46 | #define F_PREFIX_ANY 0x3f000000 47 | 48 | #define PREFIX_SEGMENT_CS 0x2e 49 | #define PREFIX_SEGMENT_SS 0x36 50 | #define PREFIX_SEGMENT_DS 0x3e 51 | #define PREFIX_SEGMENT_ES 0x26 52 | #define PREFIX_SEGMENT_FS 0x64 53 | #define PREFIX_SEGMENT_GS 0x65 54 | #define PREFIX_LOCK 0xf0 55 | #define PREFIX_REPNZ 0xf2 56 | #define PREFIX_REPX 0xf3 57 | #define PREFIX_OPERAND_SIZE 0x66 58 | #define PREFIX_ADDRESS_SIZE 0x67 59 | 60 | #pragma pack(push,1) 61 | 62 | typedef struct { 63 | uint8_t len; 64 | uint8_t p_rep; 65 | uint8_t p_lock; 66 | uint8_t p_seg; 67 | uint8_t p_66; 68 | uint8_t p_67; 69 | uint8_t opcode; 70 | uint8_t opcode2; 71 | uint8_t modrm; 72 | uint8_t modrm_mod; 73 | uint8_t modrm_reg; 74 | uint8_t modrm_rm; 75 | uint8_t sib; 76 | uint8_t sib_scale; 77 | uint8_t sib_index; 78 | uint8_t sib_base; 79 | union { 80 | uint8_t imm8; 81 | uint16_t imm16; 82 | uint32_t imm32; 83 | } imm; 84 | union { 85 | uint8_t disp8; 86 | uint16_t disp16; 87 | uint32_t disp32; 88 | } disp; 89 | uint32_t flags; 90 | } hde32s; 91 | 92 | #pragma pack(pop) 93 | 94 | #ifdef __cplusplus 95 | extern "C" { 96 | #endif 97 | 98 | /* __cdecl */ 99 | unsigned int hde32_disasm(const void *code, hde32s *hs); 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif /* _HDE32_H_ */ 106 | -------------------------------------------------------------------------------- /leagueoflegends/imgui/imgui_impl_opengl3.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for modern OpenGL with shaders / programmatic pipeline 2 | // - Desktop GL: 2.x 3.x 4.x 3 | // - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0) 4 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 5 | 6 | // Implemented features: 7 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 8 | // [x] Renderer: Desktop GL only: Support for large meshes (64k+ vertices) with 16-bit indices. 9 | 10 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 11 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 12 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 13 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 14 | 15 | // About GLSL version: 16 | // The 'glsl_version' initialization parameter should be NULL (default) or a "#version XXX" string. 17 | // On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es" 18 | // Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp. 19 | 20 | #pragma once 21 | #include "imgui.h" // IMGUI_IMPL_API 22 | 23 | // Backend API 24 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL); 25 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame(); 27 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data); 28 | 29 | // (Optional) Called by Init/NewFrame/Shutdown 30 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture(); 31 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture(); 32 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(); 33 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(); 34 | 35 | // Specific OpenGL ES versions 36 | //#define IMGUI_IMPL_OPENGL_ES2 // Auto-detected on Emscripten 37 | //#define IMGUI_IMPL_OPENGL_ES3 // Auto-detected on iOS/Android 38 | 39 | // You can explicitly select GLES2 or GLES3 API by using one of the '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line. 40 | #if !defined(IMGUI_IMPL_OPENGL_ES2) \ 41 | && !defined(IMGUI_IMPL_OPENGL_ES3) 42 | 43 | // Try to detect GLES on matching platforms 44 | #if defined(__APPLE__) 45 | #include 46 | #endif 47 | #if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__)) 48 | #define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es" 49 | #elif defined(__EMSCRIPTEN__) 50 | #define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100" 51 | #else 52 | // Otherwise imgui_impl_opengl3_loader.h will be used. 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /leagueoflegends/main/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #pragma warning(disable : 6387) 2 | 3 | #include "../stdafx.h" 4 | 5 | //#define CONSOLE_ENABLED 6 | 7 | HMODULE hLocalModule; 8 | 9 | bool WINAPI HideThread(const HANDLE hThread) noexcept 10 | { 11 | __try { 12 | using FnSetInformationThread = NTSTATUS(NTAPI*)(HANDLE ThreadHandle, UINT ThreadInformationClass, PVOID ThreadInformation, ULONG ThreadInformationLength); 13 | const auto NtSetInformationThread{ reinterpret_cast(::GetProcAddress(::GetModuleHandle(L"ntdll.dll"), "NtSetInformationThread")) }; 14 | 15 | if (!NtSetInformationThread) 16 | return false; 17 | 18 | if (const auto status{ NtSetInformationThread(hThread, 0x11u, nullptr, 0ul) }; status == 0x00000000) 19 | return true; 20 | } 21 | __except (TRUE) { 22 | return false; 23 | } 24 | } 25 | 26 | DWORD __stdcall EjectThread(LPVOID lpParameter) 27 | { 28 | Sleep(100); 29 | FreeLibraryAndExitThread(hLocalModule, 0); 30 | 31 | return 0; 32 | } 33 | 34 | DWORD __stdcall OnInject(LPVOID lpReserved) 35 | { 36 | #ifdef CONSOLE_ENABLED 37 | FILE* f; 38 | AllocConsole(); 39 | freopen_s(&f, "CONOUT$", "w", stdout); 40 | #endif 41 | 42 | LOG("Injected"); 43 | 44 | Sleep(100); 45 | 46 | if (HideThread(::GetCurrentThread())) 47 | LOG("Thread hidden"); 48 | 49 | globals::moduleBase = (uintptr_t)GetModuleHandle(nullptr); 50 | if (!GetModuleInformation(GetCurrentProcess(), (HMODULE)globals::moduleBase, &globals::moduleInfo, sizeof(MODULEINFO))) 51 | { 52 | Sleep(100); 53 | LOG("Failed to get module information."); 54 | 55 | return 0; 56 | } 57 | 58 | while (true) 59 | { 60 | float* gameTimePtr = (float*)(globals::moduleBase + oGameTime); 61 | if (IsValidPtr(gameTimePtr) && *gameTimePtr > 3.0f) break; 62 | Sleep(300); 63 | } 64 | 65 | int hooked = 2; 66 | for (int i = 0; i < hooks::renderTypeNames.size(); i++) 67 | { 68 | LOG("Testing %s", hooks::renderTypeNames[i]); 69 | if (hooked = hooks::Init(i)) 70 | { 71 | Sleep(400); 72 | if (globals::hookResponse) 73 | break; 74 | kiero::shutdown(); 75 | } 76 | Sleep(100); 77 | } 78 | 79 | Sleep(100); 80 | 81 | if (!globals::hookResponse && hooked == 1) 82 | LOG("Hook function not called by process (press detach key)"); 83 | 84 | while (!globals::eject) 85 | { 86 | Sleep(5); 87 | if (!globals::hookResponse && GetAsyncKeyState(VK_DELETE)) 88 | globals::eject = true; 89 | } 90 | #ifdef CONSOLE_ENABLED 91 | fclose(f); 92 | FreeConsole(); 93 | #endif 94 | 95 | CreateThread(nullptr, 0, EjectThread, nullptr, 0, nullptr); 96 | 97 | return 0; 98 | } 99 | 100 | BOOL APIENTRY DllMain(HMODULE hModule, 101 | DWORD ul_reason_for_call, 102 | LPVOID lpReserved 103 | ) 104 | { 105 | switch (ul_reason_for_call) 106 | { 107 | case DLL_PROCESS_ATTACH: 108 | hLocalModule = hModule; 109 | DisableThreadLibraryCalls(hModule); 110 | CreateThread(nullptr, 0, OnInject, hModule, 0, nullptr); 111 | break; 112 | case DLL_PROCESS_DETACH: 113 | break; 114 | } 115 | return TRUE; 116 | } -------------------------------------------------------------------------------- /leagueoflegends.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.32014.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "leagueoflegends", "leagueoflegends\leagueoflegends.vcxproj", "{DCEC3272-516F-469E-B947-0BD902422763}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "start", "start\start.vcxproj", "{A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NamedPipeConsole", "NamedPipeConsole\NamedPipeConsole.vcxproj", "{17C178A3-9949-4F06-B144-9A2186FE6850}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|x64 = Debug|x64 15 | Debug|x86 = Debug|x86 16 | Release|x64 = Release|x64 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {DCEC3272-516F-469E-B947-0BD902422763}.Debug|x64.ActiveCfg = Debug|x64 21 | {DCEC3272-516F-469E-B947-0BD902422763}.Debug|x64.Build.0 = Debug|x64 22 | {DCEC3272-516F-469E-B947-0BD902422763}.Debug|x86.ActiveCfg = Debug|Win32 23 | {DCEC3272-516F-469E-B947-0BD902422763}.Debug|x86.Build.0 = Debug|Win32 24 | {DCEC3272-516F-469E-B947-0BD902422763}.Release|x64.ActiveCfg = Release|x64 25 | {DCEC3272-516F-469E-B947-0BD902422763}.Release|x64.Build.0 = Release|x64 26 | {DCEC3272-516F-469E-B947-0BD902422763}.Release|x86.ActiveCfg = Release|Win32 27 | {DCEC3272-516F-469E-B947-0BD902422763}.Release|x86.Build.0 = Release|Win32 28 | {A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}.Debug|x64.ActiveCfg = Debug|x64 29 | {A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}.Debug|x64.Build.0 = Debug|x64 30 | {A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}.Debug|x86.ActiveCfg = Debug|Win32 31 | {A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}.Debug|x86.Build.0 = Debug|Win32 32 | {A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}.Release|x64.ActiveCfg = Release|x64 33 | {A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}.Release|x64.Build.0 = Release|x64 34 | {A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}.Release|x86.ActiveCfg = Release|Win32 35 | {A1A7EDFF-43E6-4EC2-9822-7E08B73D07CB}.Release|x86.Build.0 = Release|Win32 36 | {17C178A3-9949-4F06-B144-9A2186FE6850}.Debug|x64.ActiveCfg = Debug|x64 37 | {17C178A3-9949-4F06-B144-9A2186FE6850}.Debug|x64.Build.0 = Debug|x64 38 | {17C178A3-9949-4F06-B144-9A2186FE6850}.Debug|x86.ActiveCfg = Debug|Win32 39 | {17C178A3-9949-4F06-B144-9A2186FE6850}.Debug|x86.Build.0 = Debug|Win32 40 | {17C178A3-9949-4F06-B144-9A2186FE6850}.Release|x64.ActiveCfg = Release|x64 41 | {17C178A3-9949-4F06-B144-9A2186FE6850}.Release|x64.Build.0 = Release|x64 42 | {17C178A3-9949-4F06-B144-9A2186FE6850}.Release|x86.ActiveCfg = Release|Win32 43 | {17C178A3-9949-4F06-B144-9A2186FE6850}.Release|x86.Build.0 = Release|Win32 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {9CFD2868-DA8B-44CA-BF78-FE0EC8C1DF05} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /leagueoflegends/scripts/scripts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | #define ADD_SETTING(group, key, value) AddSetting(SP_STRING(group), SP_STRING(key), value) 6 | #define ADD_SETTING_RANGE(group, key, value, min, max) AddSetting(SP_STRING(group), SP_STRING(key), value, min, max) 7 | 8 | namespace scripts 9 | { 10 | extern float gameTime; 11 | 12 | extern std::vector>> settingsOrder; 13 | 14 | void AddSetting(std::string group, std::string key, settings::SettingValue value, settings::SettingValue min = 0, settings::SettingValue max = 1); 15 | void RefreshBuffer(); 16 | void Init(); 17 | void Update(); 18 | 19 | namespace targetselector 20 | { 21 | bool ChooseSelectedObject(Object* selectedObject, Object* checkObj); 22 | 23 | Object* GetEnemyChampionInRange(float range); 24 | Object* GetEnemyChampionInRange(float range, Skillshot skillshot); 25 | Object* GetEnemyChampionInRange(float range, int damageType, Skillshot skillshot); 26 | Object* GetObjectInRange(float range, std::string name = "", std::vector includefilterTypeHashes = {}, std::vector excludeFilterTypeHashesDetailed = {}, bool isSpecial = false); 27 | 28 | void Init(); 29 | } 30 | 31 | namespace prediction 32 | { 33 | struct PredictionOutput 34 | { 35 | Vector3 position; 36 | float hitChance = 100.0f; 37 | }; 38 | 39 | bool CheckCollision(Vector3 sourcePos, Vector3 targetPos, Object* sourceObject, Object* targetObject, Skillshot& skillshot); 40 | bool IsSpecificObjectInWay(Vector3 sourcePos, Vector3 targetPos, Object* collisionObject, float projectileRadius); 41 | bool IsAnyObjectInWay(Vector3 sourcePos, Vector3 targetPos, Object* sourceObject, Object* targetObject, float projectileRadius); 42 | 43 | Vector3 GetObjectPositionAfterTime(Object* obj, float time, float distanceBuffer = 0.0f); 44 | 45 | bool GetPrediction(Skillshot &spell, PredictionOutput& out); 46 | bool GetPrediction(Object* sourceObj, Object* targetObj, Skillshot &spell, PredictionOutput &out); 47 | } 48 | 49 | namespace actions 50 | { 51 | extern float lastActionTime; 52 | 53 | bool CanDoAction(); 54 | void Idle(); 55 | void AttackObject(Object* obj); 56 | void CastSpell(int spellId, Object* target); 57 | void CastSpell(int spellId, Vector3 pos); 58 | } 59 | 60 | namespace orbwalker 61 | { 62 | 63 | extern float lastAttackTime; 64 | 65 | namespace states 66 | { 67 | void Attack(); 68 | } 69 | 70 | bool StopOrbwalk(); 71 | bool IsReloading(); 72 | void CheckActiveAttack(); 73 | void Init(); 74 | void Update(); 75 | } 76 | 77 | namespace cooldowns 78 | { 79 | void Init(); 80 | } 81 | 82 | namespace recalls 83 | { 84 | void RemoveRecall(int index); 85 | int GetRecallListIndex(Object* obj); 86 | void Init(); 87 | void Update(); 88 | } 89 | 90 | namespace skinchanger 91 | { 92 | void Init(); 93 | void Update(); 94 | } 95 | 96 | namespace debug 97 | { 98 | void Init(); 99 | } 100 | 101 | namespace champions 102 | { 103 | void Init(); 104 | void Update(); 105 | void RenderUpdate(); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /leagueoflegends/kiero/minhook/src/hde/hde64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 64 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | * hde64.h: C/C++ header file 7 | * 8 | */ 9 | 10 | #ifndef _HDE64_H_ 11 | #define _HDE64_H_ 12 | 13 | /* stdint.h - C99 standard header 14 | * http://en.wikipedia.org/wiki/stdint.h 15 | * 16 | * if your compiler doesn't contain "stdint.h" header (for 17 | * example, Microsoft Visual C++), you can download file: 18 | * http://www.azillionmonkeys.com/qed/pstdint.h 19 | * and change next line to: 20 | * #include "pstdint.h" 21 | */ 22 | #include "pstdint.h" 23 | 24 | #define F_MODRM 0x00000001 25 | #define F_SIB 0x00000002 26 | #define F_IMM8 0x00000004 27 | #define F_IMM16 0x00000008 28 | #define F_IMM32 0x00000010 29 | #define F_IMM64 0x00000020 30 | #define F_DISP8 0x00000040 31 | #define F_DISP16 0x00000080 32 | #define F_DISP32 0x00000100 33 | #define F_RELATIVE 0x00000200 34 | #define F_ERROR 0x00001000 35 | #define F_ERROR_OPCODE 0x00002000 36 | #define F_ERROR_LENGTH 0x00004000 37 | #define F_ERROR_LOCK 0x00008000 38 | #define F_ERROR_OPERAND 0x00010000 39 | #define F_PREFIX_REPNZ 0x01000000 40 | #define F_PREFIX_REPX 0x02000000 41 | #define F_PREFIX_REP 0x03000000 42 | #define F_PREFIX_66 0x04000000 43 | #define F_PREFIX_67 0x08000000 44 | #define F_PREFIX_LOCK 0x10000000 45 | #define F_PREFIX_SEG 0x20000000 46 | #define F_PREFIX_REX 0x40000000 47 | #define F_PREFIX_ANY 0x7f000000 48 | 49 | #define PREFIX_SEGMENT_CS 0x2e 50 | #define PREFIX_SEGMENT_SS 0x36 51 | #define PREFIX_SEGMENT_DS 0x3e 52 | #define PREFIX_SEGMENT_ES 0x26 53 | #define PREFIX_SEGMENT_FS 0x64 54 | #define PREFIX_SEGMENT_GS 0x65 55 | #define PREFIX_LOCK 0xf0 56 | #define PREFIX_REPNZ 0xf2 57 | #define PREFIX_REPX 0xf3 58 | #define PREFIX_OPERAND_SIZE 0x66 59 | #define PREFIX_ADDRESS_SIZE 0x67 60 | 61 | #pragma pack(push,1) 62 | 63 | typedef struct { 64 | uint8_t len; 65 | uint8_t p_rep; 66 | uint8_t p_lock; 67 | uint8_t p_seg; 68 | uint8_t p_66; 69 | uint8_t p_67; 70 | uint8_t rex; 71 | uint8_t rex_w; 72 | uint8_t rex_r; 73 | uint8_t rex_x; 74 | uint8_t rex_b; 75 | uint8_t opcode; 76 | uint8_t opcode2; 77 | uint8_t modrm; 78 | uint8_t modrm_mod; 79 | uint8_t modrm_reg; 80 | uint8_t modrm_rm; 81 | uint8_t sib; 82 | uint8_t sib_scale; 83 | uint8_t sib_index; 84 | uint8_t sib_base; 85 | union { 86 | uint8_t imm8; 87 | uint16_t imm16; 88 | uint32_t imm32; 89 | uint64_t imm64; 90 | } imm; 91 | union { 92 | uint8_t disp8; 93 | uint16_t disp16; 94 | uint32_t disp32; 95 | } disp; 96 | uint32_t flags; 97 | } hde64s; 98 | 99 | #pragma pack(pop) 100 | 101 | #ifdef __cplusplus 102 | extern "C" { 103 | #endif 104 | 105 | /* __cdecl */ 106 | unsigned int hde64_disasm(const void *code, hde64s *hs); 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | #endif /* _HDE64_H_ */ 113 | -------------------------------------------------------------------------------- /start/main/start.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include "Injection.h" 16 | 17 | #define NAMED_PIPE 1 18 | 19 | DWORD GetProcId(const wchar_t* procName) 20 | { 21 | DWORD procId = 0; 22 | HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); 23 | if (hSnap != INVALID_HANDLE_VALUE) 24 | { 25 | PROCESSENTRY32 procEntry; 26 | procEntry.dwSize = sizeof(procEntry); 27 | 28 | if (Process32First(hSnap, &procEntry)) 29 | { 30 | do 31 | { 32 | if (!_wcsicmp(procEntry.szExeFile, procName)) 33 | { 34 | procId = procEntry.th32ProcessID; 35 | break; 36 | } 37 | } while (Process32Next(hSnap, &procEntry)); 38 | 39 | } 40 | } 41 | CloseHandle(hSnap); 42 | return procId; 43 | } 44 | 45 | int main() 46 | { 47 | std::cout << "Checking files" << std::endl; 48 | 49 | HINSTANCE hInjectionMod = LoadLibrary(GH_INJ_MOD_NAME); 50 | 51 | auto InjectA = (f_InjectA)GetProcAddress(hInjectionMod, "InjectA"); 52 | auto GetSymbolState = (f_GetSymbolState)GetProcAddress(hInjectionMod, "GetSymbolState"); 53 | auto GetImportState = (f_GetSymbolState)GetProcAddress(hInjectionMod, "GetImportState"); 54 | auto StartDownload = (f_StartDownload)GetProcAddress(hInjectionMod, "StartDownload"); 55 | 56 | StartDownload(); 57 | 58 | while (GetSymbolState() != 0) 59 | { 60 | Sleep(10); 61 | } 62 | 63 | while (GetImportState() != 0) 64 | { 65 | Sleep(10); 66 | } 67 | 68 | DWORD TargetProcessId = 0; 69 | 70 | std::cout << "Waiting for process" << std::endl; 71 | 72 | while (!TargetProcessId) 73 | { 74 | TargetProcessId = GetProcId(L"League of Legends.exe"); 75 | Sleep(500); 76 | } 77 | 78 | std::cout << "Process found" << std::endl; 79 | 80 | Sleep(1000); 81 | 82 | std::vector pathBuf; 83 | DWORD copied = 0; 84 | do { 85 | pathBuf.resize(pathBuf.size() + MAX_PATH); 86 | copied = GetModuleFileName(0, &pathBuf.at(0), pathBuf.size()); 87 | } while (copied >= pathBuf.size()); 88 | 89 | pathBuf.resize(copied); 90 | std::string path(pathBuf.begin(), pathBuf.end() - 0x9); 91 | 92 | #if NAMED_PIPE 93 | setlocale(LC_CTYPE, ".OCP"); 94 | std::wstring wPath(path.begin(), path.end()); 95 | std::cout << "Launching named pipe server" << std::endl; 96 | 97 | try 98 | { 99 | const intptr_t result = reinterpret_cast(ShellExecuteW(NULL, L"open", L"\"NamedPipeConsole.exe\"", NULL, wPath.c_str(), SW_SHOWNORMAL)); 100 | if (result < 33) { 101 | std::cout << "Launching pipe server failed" << std::endl; 102 | } 103 | } 104 | catch (...) {}; 105 | #endif 106 | 107 | INJECTIONDATAA data = 108 | { 109 | "", 110 | TargetProcessId, 111 | INJECTION_MODE::IM_LoadLibraryExW, 112 | LAUNCH_METHOD::LM_FakeVEH, 113 | NULL, 114 | 3000, 115 | NULL, 116 | NULL, 117 | true 118 | }; 119 | 120 | strcpy_s(data.szDllPath, (path + "leagueoflegends.dll").c_str()); 121 | 122 | Sleep(500); 123 | 124 | InjectA(&data); 125 | } -------------------------------------------------------------------------------- /start/RCa16656: -------------------------------------------------------------------------------- 1 | #line 1"D:\\VisualStudio\\League of Legends\\leagueoflegends_23\\start\\start.rc" 2 | #line 1 3 | // Microsoft Visual C++ generated resource script. 4 | // 5 | #line 4 6 | #include "resource.h" 7 | #line 6 8 | #define APSTUDIO_READONLY_SYMBOLS 9 | ///////////////////////////////////////////////////////////////////////////// 10 | // 11 | // Generated from the TEXTINCLUDE 2 resource. 12 | // 13 | #include "winres.h" 14 | #line 13 15 | ///////////////////////////////////////////////////////////////////////////// 16 | #undef APSTUDIO_READONLY_SYMBOLS 17 | #line 16 18 | ///////////////////////////////////////////////////////////////////////////// 19 | // Englisch (Vereinigte Staaten) resources 20 | #line 19 21 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 22 | LANGUAGE 7, 1 23 | #line 22 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | #line 28 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | #line 33 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""winres.h""\r\n" 38 | "\0" 39 | END 40 | #line 39 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | #line 45 47 | #endif // APSTUDIO_INVOKED 48 | #line 47 49 | #endif // Englisch (Vereinigte Staaten) resources 50 | ///////////////////////////////////////////////////////////////////////////// 51 | #line 52 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | #line 59 58 | ///////////////////////////////////////////////////////////////////////////// 59 | #endif // not APSTUDIO_INVOKED 60 | #line 62 61 | MAINICON ICON "icon1.ico" 62 | -------------------------------------------------------------------------------- /leagueoflegends/scripts/targetselector.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace scripts::targetselector 4 | { 5 | bool ChooseSelectedObject(Object* selectedObject, Object* checkObj) 6 | { 7 | return selectedObject == checkObj && SETTINGS_BOOL("targetselector", "always focus selected"); 8 | } 9 | 10 | Object* GetEnemyChampionInRange(float range) 11 | { 12 | return GetEnemyChampionInRange(range, 13 | (globals::localPlayer->GetAttackDamage() > globals::localPlayer->GetAbilityPower()) ? DamageType::Physical : DamageType::Magical, Skillshot()); 14 | } 15 | 16 | Object* GetEnemyChampionInRange(float range, Skillshot skillshot) 17 | { 18 | return GetEnemyChampionInRange(range, 19 | (globals::localPlayer->GetAttackDamage() > globals::localPlayer->GetAbilityPower()) ? DamageType::Physical : DamageType::Magical, skillshot); 20 | } 21 | 22 | Object* GetEnemyChampionInRange(float range, int damageType, Skillshot skillshot) 23 | { 24 | Object* selectedObject = functions::GetSelectedObject(); 25 | Object* best = nullptr; 26 | for (Object* obj : *globals::heroManager) 27 | { 28 | if (!obj->IsValidTarget()) continue; 29 | 30 | if (!obj->IsInRange(globals::localPlayer->GetPosition(), range)) continue; 31 | 32 | prediction::PredictionOutput prediction; 33 | if (skillshot.GetType() != SkillshotType::SkillshotNone && !prediction::GetPrediction(globals::localPlayer, obj, skillshot, prediction)) continue; 34 | 35 | if (ChooseSelectedObject(selectedObject, obj)) return obj; 36 | 37 | if (!best) { 38 | best = obj; 39 | continue; 40 | } 41 | 42 | if (best->GetEffectiveHealth(damageType) > obj->GetEffectiveHealth(damageType)) { 43 | best = obj; 44 | continue; 45 | } 46 | } 47 | 48 | return best; 49 | } 50 | 51 | Object* GetObjectInRange(float range, std::string name, std::vector includeFilterTypeHashes, std::vector excludeFilterTypeHashesDetailed, bool isSpecial) 52 | { 53 | Object* selectedObject = functions::GetSelectedObject(); 54 | Object* best = nullptr; 55 | for (Object* obj : *globals::minionManager) 56 | { 57 | if (!(isSpecial || obj->IsValidTarget())) continue; 58 | 59 | bool excludeHashMatched = false; 60 | for (auto hash : excludeFilterTypeHashesDetailed) 61 | { 62 | if (obj->GetCharacterData()->GetObjectTypeHashDetailed() == hash) 63 | { 64 | excludeHashMatched = true; 65 | break; 66 | } 67 | } 68 | if (excludeHashMatched) continue; 69 | 70 | bool includeHashMatched = false; 71 | for (auto hash : includeFilterTypeHashes) 72 | { 73 | if (obj->GetCharacterData()->GetObjectTypeHash() == hash) 74 | { 75 | includeHashMatched = true; 76 | break; 77 | } 78 | } 79 | if (includeFilterTypeHashes.size() && !includeHashMatched) continue; 80 | 81 | if (name != "" && obj->GetName() != name) continue; 82 | if (!obj->IsInRange(globals::localPlayer->GetPosition(), range)) continue; 83 | 84 | if (ChooseSelectedObject(selectedObject, obj)) return obj; 85 | 86 | if (!best) { 87 | best = obj; 88 | continue; 89 | } 90 | 91 | if (best->GetDistanceTo(globals::localPlayer) > best->GetDistanceTo(globals::localPlayer)) { 92 | best = obj; 93 | continue; 94 | } 95 | } 96 | 97 | return best; 98 | } 99 | 100 | void Init() 101 | { 102 | ADD_SETTING("targetselector", "always focus selected", true); 103 | } 104 | } -------------------------------------------------------------------------------- /NamedPipeConsole/NamedPipeConsole.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class PipeServer 9 | { 10 | private: 11 | HANDLE pipe; 12 | std::array buffer; 13 | 14 | public: 15 | PipeServer() : pipe(INVALID_HANDLE_VALUE) {} 16 | 17 | bool Init(const std::string& pipeName) { 18 | std::wstring wPipeName = std::wstring(pipeName.begin(), pipeName.end()); 19 | pipe = CreateNamedPipe( 20 | (std::wstring(TEXT("\\\\.\\pipe\\")) + wPipeName).c_str(), 21 | PIPE_ACCESS_DUPLEX, 22 | PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 23 | 1, // max instance 24 | 1024 * 16, // out buffer size 25 | 1024 * 16, // in buffer size 26 | NMPWAIT_USE_DEFAULT_WAIT, 27 | NULL 28 | ); 29 | 30 | if (pipe == INVALID_HANDLE_VALUE) { 31 | std::cerr << "Failed to create named pipe." << std::endl; 32 | return false; 33 | } 34 | 35 | std::cout << "Waiting for client to connect to pipe..." << std::endl; 36 | 37 | BOOL result = ConnectNamedPipe(pipe, NULL); 38 | if (!result) { 39 | CloseHandle(pipe); 40 | std::cerr << "Failed to make connection on named pipe." << std::endl; 41 | return false; 42 | } 43 | 44 | std::cout << "Client connected." << std::endl; 45 | return true; 46 | } 47 | 48 | bool WaitConnection() { 49 | DisconnectNamedPipe(pipe); 50 | std::cout << "Waiting for client to connect to pipe..." << std::endl; 51 | BOOL result = ConnectNamedPipe(pipe, NULL); 52 | if (!result) { 53 | CloseHandle(pipe); 54 | std::cerr << "Failed to make connection on named pipe." << std::endl; 55 | return false; 56 | } 57 | 58 | system("cls"); 59 | std::cout << "Client connected." << std::endl; 60 | return true; 61 | } 62 | 63 | std::string Update() { 64 | DWORD bytesRead; 65 | BOOL result = ReadFile(pipe, buffer.data(), buffer.size(), &bytesRead, NULL); 66 | if (!result) { 67 | std::cerr << "Failed to read from named pipe, waiting for new connection..." << std::endl; 68 | return ""; 69 | } 70 | 71 | return std::string(buffer.data(), bytesRead); 72 | } 73 | 74 | ~PipeServer() { 75 | DisconnectNamedPipe(pipe); 76 | CloseHandle(pipe); 77 | } 78 | }; 79 | 80 | inline std::tm localtime_xp(std::time_t timer) 81 | { 82 | std::tm bt {}; 83 | localtime_s(&bt, &timer); 84 | return bt; 85 | } 86 | 87 | inline std::string GetTimestamp() { 88 | auto in_time_t = localtime_xp(std::time(0)); 89 | 90 | char timeBuffer[100]; 91 | return { timeBuffer, std::strftime(timeBuffer, sizeof(timeBuffer), "[%Y-%m-%d %H:%M:%S]", &in_time_t) }; 92 | } 93 | 94 | int main() { 95 | PipeServer server; 96 | 97 | if (server.Init("LeagueOfLegends")) { 98 | while (true) { 99 | std::string message = server.Update(); 100 | if (message.empty()) { 101 | if (!server.WaitConnection()) 102 | break; 103 | } 104 | else { 105 | std::cout << GetTimestamp() << " " << message << std::endl; 106 | } 107 | } 108 | } 109 | 110 | return 0; 111 | } -------------------------------------------------------------------------------- /leagueoflegends/kiero/minhook/src/hde/table32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 32 C 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | */ 7 | 8 | #define C_NONE 0x00 9 | #define C_MODRM 0x01 10 | #define C_IMM8 0x02 11 | #define C_IMM16 0x04 12 | #define C_IMM_P66 0x10 13 | #define C_REL8 0x20 14 | #define C_REL32 0x40 15 | #define C_GROUP 0x80 16 | #define C_ERROR 0xff 17 | 18 | #define PRE_ANY 0x00 19 | #define PRE_NONE 0x01 20 | #define PRE_F2 0x02 21 | #define PRE_F3 0x04 22 | #define PRE_66 0x08 23 | #define PRE_67 0x10 24 | #define PRE_LOCK 0x20 25 | #define PRE_SEG 0x40 26 | #define PRE_ALL 0xff 27 | 28 | #define DELTA_OPCODES 0x4a 29 | #define DELTA_FPU_REG 0xf1 30 | #define DELTA_FPU_MODRM 0xf8 31 | #define DELTA_PREFIXES 0x130 32 | #define DELTA_OP_LOCK_OK 0x1a1 33 | #define DELTA_OP2_LOCK_OK 0x1b9 34 | #define DELTA_OP_ONLY_MEM 0x1cb 35 | #define DELTA_OP2_ONLY_MEM 0x1da 36 | 37 | unsigned char hde32_table[] = { 38 | 0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3, 39 | 0xa8,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xaa,0xb2,0xaa,0x9f,0x9f, 40 | 0x9f,0x9f,0xb5,0xa3,0xa3,0xa4,0xaa,0xaa,0xba,0xaa,0x96,0xaa,0xa8,0xaa,0xc3, 41 | 0xc3,0x96,0x96,0xb7,0xae,0xd6,0xbd,0xa3,0xc5,0xa3,0xa3,0x9f,0xc3,0x9c,0xaa, 42 | 0xaa,0xac,0xaa,0xbf,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0x90, 43 | 0x82,0x7d,0x97,0x59,0x59,0x59,0x59,0x59,0x7f,0x59,0x59,0x60,0x7d,0x7f,0x7f, 44 | 0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x9a,0x88,0x7d, 45 | 0x59,0x50,0x50,0x50,0x50,0x59,0x59,0x59,0x59,0x61,0x94,0x61,0x9e,0x59,0x59, 46 | 0x85,0x59,0x92,0xa3,0x60,0x60,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59, 47 | 0x59,0x59,0x9f,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xcc,0x01,0xbc,0x03,0xf0, 48 | 0x10,0x10,0x10,0x10,0x50,0x50,0x50,0x50,0x14,0x20,0x20,0x20,0x20,0x01,0x01, 49 | 0x01,0x01,0xc4,0x02,0x10,0x00,0x00,0x00,0x00,0x01,0x01,0xc0,0xc2,0x10,0x11, 50 | 0x02,0x03,0x11,0x03,0x03,0x04,0x00,0x00,0x14,0x00,0x02,0x00,0x00,0xc6,0xc8, 51 | 0x02,0x02,0x02,0x02,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xca, 52 | 0x01,0x01,0x01,0x00,0x06,0x00,0x04,0x00,0xc0,0xc2,0x01,0x01,0x03,0x01,0xff, 53 | 0xff,0x01,0x00,0x03,0xc4,0xc4,0xc6,0x03,0x01,0x01,0x01,0xff,0x03,0x03,0x03, 54 | 0xc8,0x40,0x00,0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00, 55 | 0x00,0x00,0x00,0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00, 56 | 0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 57 | 0x00,0xff,0xff,0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 58 | 0x7f,0x00,0x00,0xff,0x4a,0x4a,0x4a,0x4a,0x4b,0x52,0x4a,0x4a,0x4a,0x4a,0x4f, 59 | 0x4c,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x55,0x45,0x40,0x4a,0x4a,0x4a, 60 | 0x45,0x59,0x4d,0x46,0x4a,0x5d,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a, 61 | 0x4a,0x4a,0x4a,0x4a,0x4a,0x61,0x63,0x67,0x4e,0x4a,0x4a,0x6b,0x6d,0x4a,0x4a, 62 | 0x45,0x6d,0x4a,0x4a,0x44,0x45,0x4a,0x4a,0x00,0x00,0x00,0x02,0x0d,0x06,0x06, 63 | 0x06,0x06,0x0e,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x00,0x06,0x06,0x02,0x06, 64 | 0x00,0x0a,0x0a,0x07,0x07,0x06,0x02,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04, 65 | 0x04,0x04,0x00,0x00,0x00,0x0e,0x05,0x06,0x06,0x06,0x01,0x06,0x00,0x00,0x08, 66 | 0x00,0x10,0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01, 67 | 0x86,0x00,0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba, 68 | 0xf8,0xbb,0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00, 69 | 0xc4,0xff,0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00, 70 | 0x13,0x09,0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07, 71 | 0xb2,0xff,0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf, 72 | 0xe7,0x08,0x00,0xf0,0x02,0x00 73 | }; 74 | -------------------------------------------------------------------------------- /leagueoflegends/kiero/minhook/src/hde/table64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Hacker Disassembler Engine 64 C 3 | * Copyright (c) 2008-2009, Vyacheslav Patkov. 4 | * All rights reserved. 5 | * 6 | */ 7 | 8 | #define C_NONE 0x00 9 | #define C_MODRM 0x01 10 | #define C_IMM8 0x02 11 | #define C_IMM16 0x04 12 | #define C_IMM_P66 0x10 13 | #define C_REL8 0x20 14 | #define C_REL32 0x40 15 | #define C_GROUP 0x80 16 | #define C_ERROR 0xff 17 | 18 | #define PRE_ANY 0x00 19 | #define PRE_NONE 0x01 20 | #define PRE_F2 0x02 21 | #define PRE_F3 0x04 22 | #define PRE_66 0x08 23 | #define PRE_67 0x10 24 | #define PRE_LOCK 0x20 25 | #define PRE_SEG 0x40 26 | #define PRE_ALL 0xff 27 | 28 | #define DELTA_OPCODES 0x4a 29 | #define DELTA_FPU_REG 0xfd 30 | #define DELTA_FPU_MODRM 0x104 31 | #define DELTA_PREFIXES 0x13c 32 | #define DELTA_OP_LOCK_OK 0x1ae 33 | #define DELTA_OP2_LOCK_OK 0x1c6 34 | #define DELTA_OP_ONLY_MEM 0x1d8 35 | #define DELTA_OP2_ONLY_MEM 0x1e7 36 | 37 | unsigned char hde64_table[] = { 38 | 0xa5,0xaa,0xa5,0xb8,0xa5,0xaa,0xa5,0xaa,0xa5,0xb8,0xa5,0xb8,0xa5,0xb8,0xa5, 39 | 0xb8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xac,0xc0,0xcc,0xc0,0xa1,0xa1, 40 | 0xa1,0xa1,0xb1,0xa5,0xa5,0xa6,0xc0,0xc0,0xd7,0xda,0xe0,0xc0,0xe4,0xc0,0xea, 41 | 0xea,0xe0,0xe0,0x98,0xc8,0xee,0xf1,0xa5,0xd3,0xa5,0xa5,0xa1,0xea,0x9e,0xc0, 42 | 0xc0,0xc2,0xc0,0xe6,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0xab, 43 | 0x8b,0x90,0x64,0x5b,0x5b,0x5b,0x5b,0x5b,0x92,0x5b,0x5b,0x76,0x90,0x92,0x92, 44 | 0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x6a,0x73,0x90, 45 | 0x5b,0x52,0x52,0x52,0x52,0x5b,0x5b,0x5b,0x5b,0x77,0x7c,0x77,0x85,0x5b,0x5b, 46 | 0x70,0x5b,0x7a,0xaf,0x76,0x76,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b, 47 | 0x5b,0x5b,0x86,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xd5,0x03,0xcc,0x01,0xbc, 48 | 0x03,0xf0,0x03,0x03,0x04,0x00,0x50,0x50,0x50,0x50,0xff,0x20,0x20,0x20,0x20, 49 | 0x01,0x01,0x01,0x01,0xc4,0x02,0x10,0xff,0xff,0xff,0x01,0x00,0x03,0x11,0xff, 50 | 0x03,0xc4,0xc6,0xc8,0x02,0x10,0x00,0xff,0xcc,0x01,0x01,0x01,0x00,0x00,0x00, 51 | 0x00,0x01,0x01,0x03,0x01,0xff,0xff,0xc0,0xc2,0x10,0x11,0x02,0x03,0x01,0x01, 52 | 0x01,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x10, 53 | 0x10,0x10,0x10,0x02,0x10,0x00,0x00,0xc6,0xc8,0x02,0x02,0x02,0x02,0x06,0x00, 54 | 0x04,0x00,0x02,0xff,0x00,0xc0,0xc2,0x01,0x01,0x03,0x03,0x03,0xca,0x40,0x00, 55 | 0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00,0x00,0x00,0x00, 56 | 0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xff,0x00, 57 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, 58 | 0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00, 59 | 0xff,0x40,0x40,0x40,0x40,0x41,0x49,0x40,0x40,0x40,0x40,0x4c,0x42,0x40,0x40, 60 | 0x40,0x40,0x40,0x40,0x40,0x40,0x4f,0x44,0x53,0x40,0x40,0x40,0x44,0x57,0x43, 61 | 0x5c,0x40,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 62 | 0x40,0x40,0x64,0x66,0x6e,0x6b,0x40,0x40,0x6a,0x46,0x40,0x40,0x44,0x46,0x40, 63 | 0x40,0x5b,0x44,0x40,0x40,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x01,0x06, 64 | 0x06,0x02,0x06,0x06,0x00,0x06,0x00,0x0a,0x0a,0x00,0x00,0x00,0x02,0x07,0x07, 65 | 0x06,0x02,0x0d,0x06,0x06,0x06,0x0e,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04, 66 | 0x04,0x04,0x05,0x06,0x06,0x06,0x00,0x00,0x00,0x0e,0x00,0x00,0x08,0x00,0x10, 67 | 0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01,0x86,0x00, 68 | 0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba,0xf8,0xbb, 69 | 0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00,0xc4,0xff, 70 | 0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00,0x13,0x09, 71 | 0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07,0xb2,0xff, 72 | 0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf,0xe7,0x08, 73 | 0x00,0xf0,0x02,0x00 74 | }; 75 | -------------------------------------------------------------------------------- /leagueoflegends/kiero/minhook/src/trampoline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #pragma pack(push, 1) 32 | 33 | // Structs for writing x86/x64 instructions. 34 | 35 | // 8-bit relative jump. 36 | typedef struct _JMP_REL_SHORT 37 | { 38 | UINT8 opcode; // EB xx: JMP +2+xx 39 | UINT8 operand; 40 | } JMP_REL_SHORT, *PJMP_REL_SHORT; 41 | 42 | // 32-bit direct relative jump/call. 43 | typedef struct _JMP_REL 44 | { 45 | UINT8 opcode; // E9/E8 xxxxxxxx: JMP/CALL +5+xxxxxxxx 46 | UINT32 operand; // Relative destination address 47 | } JMP_REL, *PJMP_REL, CALL_REL; 48 | 49 | // 64-bit indirect absolute jump. 50 | typedef struct _JMP_ABS 51 | { 52 | UINT8 opcode0; // FF25 00000000: JMP [+6] 53 | UINT8 opcode1; 54 | UINT32 dummy; 55 | UINT64 address; // Absolute destination address 56 | } JMP_ABS, *PJMP_ABS; 57 | 58 | // 64-bit indirect absolute call. 59 | typedef struct _CALL_ABS 60 | { 61 | UINT8 opcode0; // FF15 00000002: CALL [+6] 62 | UINT8 opcode1; 63 | UINT32 dummy0; 64 | UINT8 dummy1; // EB 08: JMP +10 65 | UINT8 dummy2; 66 | UINT64 address; // Absolute destination address 67 | } CALL_ABS; 68 | 69 | // 32-bit direct relative conditional jumps. 70 | typedef struct _JCC_REL 71 | { 72 | UINT8 opcode0; // 0F8* xxxxxxxx: J** +6+xxxxxxxx 73 | UINT8 opcode1; 74 | UINT32 operand; // Relative destination address 75 | } JCC_REL; 76 | 77 | // 64bit indirect absolute conditional jumps that x64 lacks. 78 | typedef struct _JCC_ABS 79 | { 80 | UINT8 opcode; // 7* 0E: J** +16 81 | UINT8 dummy0; 82 | UINT8 dummy1; // FF25 00000000: JMP [+6] 83 | UINT8 dummy2; 84 | UINT32 dummy3; 85 | UINT64 address; // Absolute destination address 86 | } JCC_ABS; 87 | 88 | #pragma pack(pop) 89 | 90 | typedef struct _TRAMPOLINE 91 | { 92 | LPVOID pTarget; // [In] Address of the target function. 93 | LPVOID pDetour; // [In] Address of the detour function. 94 | LPVOID pTrampoline; // [In] Buffer address for the trampoline and relay function. 95 | 96 | #if defined(_M_X64) || defined(__x86_64__) 97 | LPVOID pRelay; // [Out] Address of the relay function. 98 | #endif 99 | BOOL patchAbove; // [Out] Should use the hot patch area? 100 | UINT nIP; // [Out] Number of the instruction boundaries. 101 | UINT8 oldIPs[8]; // [Out] Instruction boundaries of the target function. 102 | UINT8 newIPs[8]; // [Out] Instruction boundaries of the trampoline function. 103 | } TRAMPOLINE, *PTRAMPOLINE; 104 | 105 | BOOL CreateTrampolineFunction(PTRAMPOLINE ct); 106 | -------------------------------------------------------------------------------- /leagueoflegends/global/offsets.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //functions 4 | #define oGetBaseDrawPosition 0x1F8920 // 5 | #define oWorldToScreen 0xDF0B70 // 6 | #define oTryRightClick 0x882B20 // 7 | #define oIssueOrder 0x898680 // 8 | #define oIssueMove 0x881F00 // 9 | #define oCastSpellWrapper 0x88E990 // 10 | #define oPrintChat 0x841820 // 11 | #define oGetBoundingRadius 0x1F6110 // 12 | #define oGetAttackDelay 0x3AFB90 // 13 | #define oGetAttackWindup 0x3AFA90 // 14 | #define oGetObjectFromNetId 0x38D860 // 15 | #define oGetCollisionFlags 0xD67B50 // 16 | #define oCharacterDataStackUpdate 0x183710 // 17 | 18 | //variables 19 | #define oGameTime 0x4213790 // 20 | #define oLocalPlayer 0x421F8A8 // 21 | #define oHeroManager 0x2171800 // 22 | #define oMinionManager 0x31C4638 // 23 | #define oViewport 0x31C45F8 // 24 | #define oHudInstance 0x21716F0 // 25 | #define oZoomInstance 0x4211B10 // 26 | #define oChatClient 0x4220698 // 27 | #define oChatInstance 0x31C4850 // 28 | #define oGetObjectFromNetIdParam 0x21716E0 // 29 | 30 | #define oManagerList 0x8 31 | #define oManagerListSize 0x10 32 | 33 | #define oViewportW2S 0x270 34 | 35 | #define oHudInstanceCamera 0x18 36 | #define oHudInstanceInput 0x28 37 | #define oHudInstanceUserData 0x60 38 | #define oHudInstanceSpellInfo 0x68 39 | 40 | #define oHudInstanceCameraZoom 0x2B8 41 | 42 | #define oHudInstanceInputMouseWorldPos 0x20 43 | 44 | #define oHudInstanceUserDataSelectedObjectNetId 0x28 45 | 46 | #define oZoomInstanceMaxZoom 0x28 47 | 48 | #define oChatClientChatOpen 0xCC1 49 | 50 | //structs 51 | #define oObjNetId 0x10 52 | #define oObjTeam 0x3C 53 | #define oObjIssueOrderFloatCheck1 0x84 54 | #define oObjIssueOrderFloatCheck2 0x88 55 | #define oObjIssueOrderCheck 0xD4 56 | #define oObjPosition 0x220 57 | #define oObjVisible 0x310 58 | #define oObjAlive 0x328 59 | #define oObjMana 0x340 60 | #define oObjTargetable 0xEB0 61 | #define oObjRecallState 0xF40 62 | #define oObjHealth 0x1058 63 | #define oObjMaxHealth 0x1070 64 | #define oObjActionState 0x13C0 65 | #define oObjBonusAttackDamage 0x15D8 66 | #define oObjAbilityPower 0x15E8 67 | #define oObjBaseAttackDamage 0x1670 68 | #define oObjScale 0x1684 69 | #define oObjArmor 0x1694 70 | #define oObjMagicResist 0x169C 71 | #define oObjMovementSpeed 0x16AC 72 | #define oObjAttackRange 0x16B4 73 | #define oObjBuffManager 0x27C8 74 | #define oObjSpellBook 0x29E8 75 | #define oObjActiveSpellCast 0x2A20 76 | #define oObjCharData 0x3528 77 | #define oObjName 0x35D8 78 | #define oObjCharacterDataStack 0x35C0 79 | #define oObjAiManager 0x36F0 80 | 81 | #define oObjBuffManagerEntriesEnd 0x10 82 | 83 | #define oBuffEntryBuff 0x10 84 | 85 | #define oBuffType 0x8 86 | #define oBuffNamePtr 0x10 87 | #define oBuffStartTime 0x18 88 | #define oBuffEndTime 0x1C 89 | #define oBuffStacksAlt 0x38 90 | #define oBuffStacks 0x8C 91 | 92 | #define oBuffNamePtrName 0x8 93 | 94 | #define oObjSpellBookSpellSlot 0x6D0 95 | 96 | #define oSpellSlotLevel 0x28 97 | #define oSpellSlotCooldown 0x30 98 | #define oSpellSlotStacks 0x5C 99 | #define oSpellSlotTotalCooldown 0x74 100 | #define oSpellSlotSpellInput 0x128 101 | #define oSpellSlotSpellInfo 0x130 102 | 103 | #define oSpellInputTargetNetId 0x14 104 | #define oSpellInputStartPos 0x18 105 | #define oSpellInputEndPos 0x24 106 | 107 | #define oSpellInfoSpellData 0x60 108 | 109 | #define oSpellDataSpellName 0x80 110 | #define oSpellDataManaCost 0x5F4 111 | 112 | #define oActiveSpellCastSpellInfo 0x8 113 | #define oActiveSpellCastSpellType 0x10 114 | #define oActiveSpellCastSpellId 0x124 115 | 116 | #define oObjCharDataData 0x28 117 | 118 | #define oObjCharDataDataSize 0xC4 119 | #define oObjCharDataDataObjType 0x768 120 | 121 | #define oObjCharDataDataObjTypeDetailed 0x20 122 | 123 | #define oObjAiManagerManager 0x10 124 | 125 | #define oObjAiManagerManagerTargetPosition 0x14 126 | #define oObjAiManagerManagerIsMoving 0x2BC 127 | #define oObjAiManagerManagerCurrentSegment 0x2C0 128 | #define oObjAiManagerManagerPathStart 0x2D0 129 | #define oObjAiManagerManagerPathEnd 0x2DC 130 | #define oObjAiManagerManagerSegments 0x2E8 131 | #define oObjAiManagerManagerSegmentsCount 0x2F0 132 | #define oObjAiManagerManagerDashSpeed 0x300 133 | #define oObjAiManagerManagerIsDashing 0x324 134 | #define oObjAiManagerManagerPosition 0x414 -------------------------------------------------------------------------------- /leagueoflegends/global/settings.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace settings 4 | { 5 | inline std::ostream& operator<<(std::ostream& os, const SettingValue& value) { 6 | if (std::holds_alternative(value)) { 7 | os << std::get(value); 8 | } 9 | else if (std::holds_alternative(value)) { 10 | os << std::get(value); 11 | } 12 | else if (std::holds_alternative(value)) { 13 | os << std::boolalpha << std::get(value); 14 | } 15 | return os; 16 | } 17 | 18 | SettingsData data = {}; 19 | SettingsBounds bounds = {}; 20 | 21 | void Save() 22 | { 23 | std::ofstream file("ionia.ini"); 24 | if (file.is_open()) { 25 | for (const auto& group : data) { 26 | file << "[" << group.first << "]\n"; 27 | for (const auto& setting : group.second) { 28 | file << setting.first << "=" << setting.second << "\n"; 29 | } 30 | file << "\n"; 31 | } 32 | file.close(); 33 | } 34 | } 35 | 36 | void Load() 37 | { 38 | std::ifstream file("ionia.ini"); 39 | if (file.is_open()) 40 | { 41 | std::string line; 42 | std::string currentGroup; 43 | while (std::getline(file, line)) { 44 | if (line.empty() || line[0] == '#'){ 45 | continue; 46 | } 47 | if (line[0] == '[' && line.back() == ']') { 48 | currentGroup = line.substr(1, line.size() - 2); 49 | } 50 | else { 51 | auto delimiterPos = line.find('='); 52 | if (delimiterPos != std::string::npos) { 53 | std::string key = line.substr(0, delimiterPos); 54 | std::string valueStr = line.substr(delimiterPos + 1); 55 | 56 | SettingValue value; 57 | if (valueStr == SP_STRING("true")) { 58 | value = true; 59 | } 60 | else if (valueStr == SP_STRING("false")) { 61 | value = false; 62 | } 63 | else if (std::isdigit(valueStr[0])) { 64 | try { 65 | size_t parsedChars; 66 | int intValue = std::stoi(valueStr, &parsedChars); 67 | if (parsedChars == valueStr.size()) { 68 | value = intValue; 69 | } 70 | else { 71 | float floatValue = std::stof(valueStr); 72 | value = floatValue; 73 | } 74 | } 75 | catch (...) {} 76 | } 77 | 78 | auto groupIt = data.find(currentGroup); 79 | if (groupIt != data.end()) { 80 | auto keyIt = groupIt->second.find(key); 81 | if (keyIt != groupIt->second.end()) { 82 | data[currentGroup][key] = value; 83 | } 84 | } 85 | } 86 | } 87 | } 88 | file.close(); 89 | } 90 | } 91 | 92 | SettingValue Get(std::string group, std::string key, SettingValue defaultValue) 93 | { 94 | auto groupIt = data.find(group); 95 | if (groupIt != data.end()) { 96 | auto keyIt = groupIt->second.find(key); 97 | if (keyIt != groupIt->second.end()) { 98 | return keyIt->second; 99 | } 100 | } 101 | Set(group, key, defaultValue); 102 | return defaultValue; 103 | } 104 | 105 | bool GetBool(std::string group, std::string key) 106 | { 107 | return std::get(Get(group, key, false)); 108 | } 109 | 110 | int GetInt(std::string group, std::string key) 111 | { 112 | return std::get(Get(group, key, 0)); 113 | } 114 | 115 | float GetFloat(std::string group, std::string key) 116 | { 117 | return std::get(Get(group, key, 0.0f)); 118 | } 119 | 120 | void Set(std::string group, std::string key, SettingValue value) 121 | { 122 | data[group][key] = value; 123 | } 124 | 125 | SettingBoundsValue GetBounds(std::string group, std::string key, SettingBoundsValue defaultValue) 126 | { 127 | auto groupIt = bounds.find(group); 128 | if (groupIt != bounds.end()) { 129 | auto keyIt = groupIt->second.find(key); 130 | if (keyIt != groupIt->second.end()) { 131 | return keyIt->second; 132 | } 133 | } 134 | return defaultValue; 135 | } 136 | 137 | std::pair GetBoundsInt(std::string group, std::string key, std::pair defaultValue) 138 | { 139 | return std::get>(GetBounds(group, key, defaultValue)); 140 | } 141 | 142 | std::pair GetBoundsFloat(std::string group, std::string key, std::pair defaultValue) 143 | { 144 | return std::get>(GetBounds(group, key, defaultValue)); 145 | } 146 | 147 | void AddBounds(std::string group, std::string key, int min, int max) 148 | { 149 | bounds[group][key] = std::pair(min, max); 150 | } 151 | 152 | void AddBounds(std::string group, std::string key, float min, float max) 153 | { 154 | bounds[group][key] = std::pair(min, max); 155 | } 156 | } -------------------------------------------------------------------------------- /leagueoflegends/classes/classes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | class CharacterStackData 6 | { 7 | public: 8 | const char* model; 9 | char pad1[0x18]; 10 | int skin; 11 | char pad2[0x60]; 12 | char gear; 13 | char pad3[0x7]; 14 | }; 15 | 16 | class CharacterDataStack 17 | { 18 | public: 19 | std::vector stack; 20 | CharacterStackData base_skin; 21 | 22 | void Update(bool change); 23 | }; 24 | 25 | class AiManager 26 | { 27 | public: 28 | Vector3 GetTargetPosition(); 29 | bool IsMoving(); 30 | int GetCurrentSegment(); 31 | Vector3 GetPathStart(); 32 | Vector3 GetPathEnd(); 33 | int GetSegmentsCount(); 34 | float GetDashSpeed(); 35 | bool IsDashing(); 36 | Vector3 GetPosition(); 37 | public: 38 | Vector3 GetSegment(int index); 39 | std::vector GetFutureSegments(); 40 | }; 41 | 42 | class CharacterData 43 | { 44 | public: 45 | float GetSize(); 46 | QWORD GetObjectTypeHash(); 47 | QWORD GetObjectTypeHashDetailed(); 48 | }; 49 | 50 | class SpellData 51 | { 52 | public: 53 | std::string GetName(); 54 | float GetManaCostByLevel(int level); 55 | }; 56 | 57 | class SpellInfo 58 | { 59 | public: 60 | SpellData* GetSpellData(); 61 | }; 62 | 63 | class SpellInput 64 | { 65 | }; 66 | 67 | class Spell 68 | { 69 | public: 70 | int GetLevel(); 71 | float GetCooldownTimer(); 72 | float GetCooldown(); 73 | int GetStacks(); 74 | float GetTotalCooldown(); 75 | float GetRelativeCooldown(); 76 | SpellInput* GetSpellInput(); 77 | SpellInfo* GetSpellInfo(); 78 | public: 79 | bool IsReady(); 80 | std::string GetName(); 81 | float GetManaCost(); 82 | }; 83 | 84 | class SpellCast 85 | { 86 | public: 87 | SpellInfo* GetSpellInfo(); 88 | int GetSpellId(); 89 | public: 90 | bool IsAutoAttack(); 91 | }; 92 | 93 | class Buff 94 | { 95 | public: 96 | std::string GetName(); 97 | float GetStartTime(); 98 | float GetEndTime(); 99 | int GetStacksAlt(); 100 | int GetStacks(); 101 | public: 102 | int GetMaxStacks(); 103 | }; 104 | 105 | class BuffEntry 106 | { 107 | public: 108 | Buff* GetBuff(); 109 | }; 110 | 111 | class BuffManager 112 | { 113 | public: 114 | BuffEntry* GetBuffEntryByIndex(int index); 115 | }; 116 | 117 | class Object 118 | { 119 | public: 120 | unsigned int GetNetId(); 121 | int GetTeam(); 122 | Vector3 GetPosition(); 123 | bool IsVisible(); 124 | bool IsAlive(); 125 | float GetMana(); 126 | bool IsTargetable(); 127 | int GetRecallState(); 128 | float GetHealth(); 129 | float GetMaxHealth(); 130 | unsigned short GetActionState(); 131 | float GetBonusAttackDamage(); 132 | float GetAbilityPower(); 133 | float GetBaseAttackDamage(); 134 | float GetScale(); 135 | float GetMovementSpeed(); 136 | float GetArmor(); 137 | float GetMagicResist(); 138 | float GetAttackRange(); 139 | std::string GetName(); 140 | BuffManager* GetBuffManager(); 141 | QWORD* GetBuffManagerEntriesEnd(); 142 | SpellCast* GetActiveSpellCast(); 143 | Spell* GetSpellBySlotId(int slotId); 144 | CharacterData* GetCharacterData(); 145 | AiManager* GetAiManager(); 146 | public: 147 | float GetBoundingRadius(); 148 | float GetAttackDelay(); 149 | float GetAttackWindup(); 150 | public: 151 | bool CanAttack(); 152 | bool CanCast(); 153 | bool CanMove(); 154 | bool IsEnemy(); 155 | bool IsValidTarget(); 156 | bool IsHero(); 157 | float GetAttackDamage(); 158 | float GetEffectiveHealth(int damageType); 159 | float GetRealAttackRange(); 160 | float GetDistanceTo(Object* obj); 161 | bool IsInRange(Vector3 pos, float radius); 162 | bool CanCastSpell(int slotId); 163 | Vector3 GetServerPosition(); 164 | int GetBuffListSize(); 165 | Buff* GetBuffByName(std::string name); 166 | public: 167 | CharacterDataStack* GetCharacterDataStack(); 168 | void ChangeSkin(int skinId); 169 | }; 170 | 171 | class ObjectManager 172 | { 173 | public: 174 | int GetListSize(); 175 | Object* GetIndex(int index); 176 | public: 177 | class iterator 178 | { 179 | private: 180 | ObjectManager* objectManager; 181 | int index; 182 | 183 | public: 184 | iterator(ObjectManager* _objectManager, int _index) 185 | : objectManager(_objectManager), index(_index) {} 186 | 187 | iterator& operator++() 188 | { 189 | index++; 190 | return *this; 191 | } 192 | 193 | bool operator!=(const iterator& other) const 194 | { 195 | return index != other.index; 196 | } 197 | 198 | Object* operator*() 199 | { 200 | return objectManager->GetIndex(index); 201 | } 202 | }; 203 | 204 | iterator begin() 205 | { 206 | return iterator(this, 0); 207 | } 208 | 209 | iterator end() 210 | { 211 | return iterator(this, GetListSize()); 212 | } 213 | }; -------------------------------------------------------------------------------- /leagueoflegends/scripts/prediction.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace scripts::prediction 4 | { 5 | bool CheckCollision(Vector3 sourcePos, Vector3 targetPos, Object* sourceObject, Object* targetObject, Skillshot &skillshot) 6 | { 7 | if (skillshot.IsCollidableWith(CollidableObjects::Objects) && IsAnyObjectInWay(sourcePos, targetPos, sourceObject, targetObject, skillshot.GetRadius())) 8 | return false; 9 | return true; 10 | } 11 | 12 | bool IsSpecificObjectInWay(Vector3 sourcePos, Vector3 targetPos, Object* collisionObject, float projectileRadius) 13 | { 14 | auto sourceToTarget = targetPos - sourcePos; 15 | sourceToTarget.y = 0.0f; 16 | auto distance = sourceToTarget.Length(); 17 | 18 | auto objPos = collisionObject->GetPosition(); 19 | auto sourceToObj = objPos - sourcePos; 20 | sourceToObj.y = 0.0f; 21 | if (sourceToObj.Length() > distance) return false; 22 | 23 | float dot1 = sourceToObj.DotProduct(sourceToTarget); 24 | float dot2 = sourceToTarget.DotProduct(sourceToTarget); 25 | 26 | if (dot1 < 0.0f) return false; 27 | 28 | float t = dot1 / dot2; 29 | 30 | Vector3 projection = sourcePos + (sourceToTarget * t); 31 | projection.y = 0.0; 32 | 33 | Vector3 distVector = objPos - projection; 34 | distVector.y = 0.0; 35 | 36 | if (distVector.Length() <= projectileRadius + collisionObject->GetBoundingRadius()) 37 | return true; 38 | 39 | return false; 40 | } 41 | 42 | bool IsAnyObjectInWay(Vector3 sourcePos, Vector3 targetPos, Object* sourceObject, Object* targetObject, float projectileRadius) 43 | { 44 | auto objectInWay = [&](auto& objectManager) { 45 | auto sourceToTarget = targetPos - sourcePos; 46 | sourceToTarget.y = 0.0f; 47 | auto distance = sourceToTarget.Length(); 48 | 49 | for (auto obj : objectManager) 50 | { 51 | if (obj == targetObject || obj == sourceObject) continue; 52 | if (!obj->IsValidTarget()) continue; 53 | 54 | if (IsSpecificObjectInWay(sourcePos, targetPos, obj, projectileRadius)) 55 | return true; 56 | } 57 | return false; 58 | }; 59 | 60 | return objectInWay(*globals::minionManager) || objectInWay(*globals::heroManager); 61 | } 62 | 63 | Vector3 GetObjectPositionAfterTime(Object* obj, float time, float distanceBuffer) 64 | { 65 | const auto aiManager = obj->GetAiManager(); 66 | 67 | float speed = obj->GetMovementSpeed(); 68 | if (aiManager->IsDashing()) 69 | { 70 | speed = aiManager->GetDashSpeed(); 71 | } 72 | 73 | std::vector waypoints = { obj->GetServerPosition() }; 74 | auto futureWaypoints = aiManager->GetFutureSegments(); 75 | for (auto waypoint : futureWaypoints) 76 | waypoints.push_back(waypoint); 77 | 78 | const int waypointsSize = (int)waypoints.size(); 79 | 80 | if (!waypointsSize || !time || !aiManager->IsMoving()) 81 | return obj->GetServerPosition(); 82 | 83 | float distance = (speed * time) - distanceBuffer; 84 | 85 | for (int i = 1; i < waypointsSize; i++) 86 | { 87 | const float waydistance = waypoints[i - 1].Distance(waypoints[i]); 88 | if (waydistance >= distance) 89 | { 90 | return waypoints[i - 1].Extend(waypoints[i], distance); 91 | } 92 | if (i == waypointsSize - 1) 93 | return waypoints[i]; 94 | distance = distance - waydistance; 95 | } 96 | 97 | return waypoints.front(); 98 | } 99 | 100 | bool GetPrediction(Skillshot& skillshot, PredictionOutput &out) 101 | { 102 | auto target = targetselector::GetEnemyChampionInRange(skillshot.GetMaxRange(), skillshot); 103 | if (!target) return false; 104 | 105 | return GetPrediction(globals::localPlayer, target, skillshot, out); 106 | } 107 | 108 | bool GetPrediction(Object* sourceObj, Object* targetObj, Skillshot &skillshot, PredictionOutput& out) 109 | { 110 | const auto sourcePos = sourceObj->GetServerPosition(); 111 | const auto targetAiManager = targetObj->GetAiManager(); 112 | const float spellRadius = skillshot.GetRadius(); 113 | 114 | float distance = sourcePos.Distance(targetObj->GetServerPosition()); 115 | float distanceBuffer = skillshot.GetType() == SkillshotType::SkillshotCircle ? max(spellRadius - 20.0f, 0.0f) : 0.0f; 116 | 117 | if (distance > skillshot.GetMaxRange()) 118 | return false; 119 | 120 | if (!skillshot.GetSpeed()) 121 | { 122 | out.position = GetObjectPositionAfterTime(targetObj, skillshot.GetCastTime(), distanceBuffer); 123 | return CheckCollision(sourcePos, out.position, sourceObj, targetObj, skillshot); 124 | } 125 | 126 | auto waypoints = targetAiManager->GetFutureSegments(); 127 | const int waypointsSize = (int)waypoints.size(); 128 | 129 | if (!waypointsSize || !targetAiManager->IsMoving()) 130 | { 131 | out.position = targetObj->GetServerPosition(); 132 | return CheckCollision(sourcePos, out.position, sourceObj, targetObj, skillshot); 133 | } 134 | 135 | float travelTime = (distance / skillshot.GetSpeed()) + skillshot.GetCastTime(); 136 | auto predictedPos = GetObjectPositionAfterTime(targetObj, travelTime, distanceBuffer); 137 | 138 | distance = predictedPos.Distance(sourcePos); 139 | float missileTime = (distance / skillshot.GetSpeed()) + skillshot.GetCastTime(); 140 | 141 | while (std::abs(travelTime - missileTime) > 0.01f) 142 | { 143 | travelTime = missileTime; 144 | predictedPos = GetObjectPositionAfterTime(targetObj, travelTime, distanceBuffer); 145 | 146 | distance = predictedPos.Distance(sourcePos); 147 | if (distance > skillshot.GetMaxRange()) 148 | { 149 | return false; 150 | } 151 | 152 | missileTime = (distance / skillshot.GetSpeed()) + skillshot.GetCastTime(); 153 | } 154 | 155 | out.position = predictedPos; 156 | return CheckCollision(sourcePos, out.position, sourceObj, targetObj, skillshot); 157 | } 158 | } -------------------------------------------------------------------------------- /leagueoflegends/global/structs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../stdafx.h" 4 | 5 | struct Vector3 6 | { 7 | float x, y, z; 8 | 9 | Vector3() : x(0.0f), y(0.0f), z(0.0f) {} 10 | Vector3(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {} 11 | 12 | bool IsValid() const 13 | { 14 | return !(this->x == 0.0f && this->y == 0.0f && this->z == 0.0f) && (this->x > (-1000000)) && (this->y > (-1000000)) && (this->z > (-1000000)) && (this->x < (1000000)) && (this->y < (1000000)) && (this->z < (1000000)); 15 | } 16 | 17 | Vector3 operator+(const Vector3& rhs) const 18 | { 19 | return Vector3(x + rhs.x, y + rhs.y, z + rhs.z); 20 | } 21 | 22 | Vector3 operator-(const Vector3& rhs) const 23 | { 24 | return Vector3(x - rhs.x, y - rhs.y, z - rhs.z); 25 | } 26 | 27 | Vector3 operator*(float scalar) const 28 | { 29 | return Vector3(x * scalar, y * scalar, z * scalar); 30 | } 31 | 32 | Vector3 operator/(float scalar) const 33 | { 34 | return Vector3(x / scalar, y / scalar, z / scalar); 35 | } 36 | 37 | bool operator==(const Vector3& rhs) const 38 | { 39 | return x == rhs.x && y == rhs.y && z == rhs.z; 40 | } 41 | 42 | Vector3 Extend(const Vector3& to, float distance) const 43 | { 44 | const auto from = *this; 45 | const auto result = from + (to - from).Normalized() * distance; 46 | return result; 47 | } 48 | 49 | float Distance(const Vector3& to) const 50 | { 51 | return sqrtf(powf(to.x - x, 2) + powf(to.z - z, 2) + powf(to.y - y, 2)); 52 | } 53 | 54 | float Length() const 55 | { 56 | return sqrtf(this->x * this->x + this->y * this->y + this->z * this->z); 57 | } 58 | 59 | float DotProduct(const Vector3& other) const 60 | { 61 | return this->x * other.x + this->y * other.y + this->z * other.z; 62 | } 63 | 64 | Vector3 Normalized() const 65 | { 66 | auto const length = this->Length(); 67 | if (length != 0) 68 | { 69 | auto const inv = 1.0f / length; 70 | return { this->x * inv, this->y * inv, this->z * inv }; 71 | } 72 | 73 | return *this; 74 | } 75 | }; 76 | 77 | struct Vector2 78 | { 79 | float x, y; 80 | 81 | Vector2() : x(0.0f), y(0.0f) {} 82 | Vector2(float _x, float _y) : x(_x), y(_y) {} 83 | 84 | Vector2 operator+(const Vector2& rhs) const 85 | { 86 | return Vector2(x + rhs.x, y + rhs.y); 87 | } 88 | 89 | Vector2 operator-(const Vector2& rhs) const 90 | { 91 | return Vector2(x - rhs.x, y - rhs.y); 92 | } 93 | 94 | Vector2 operator*(float scalar) const 95 | { 96 | return Vector2(x * scalar, y * scalar); 97 | } 98 | 99 | Vector2 operator/(float scalar) const 100 | { 101 | return Vector2(x / scalar, y / scalar); 102 | } 103 | 104 | bool operator==(const Vector2& rhs) const 105 | { 106 | return x == rhs.x && y == rhs.y; 107 | } 108 | 109 | ImVec2 ToImVec() const 110 | { 111 | return ImVec2(x, y); 112 | } 113 | }; 114 | 115 | enum OrbwalkState 116 | { 117 | Off, 118 | Attack, 119 | Clear, 120 | Harass 121 | }; 122 | 123 | enum RecallState 124 | { 125 | Recalling, 126 | Teleporting, 127 | RecallingFinished, 128 | TeleportingFinished, 129 | }; 130 | 131 | struct RecallInfo 132 | { 133 | int state; 134 | std::string name; 135 | float startTime; 136 | RecallInfo() { state = RecallState::Recalling; name = ""; startTime = 0.0f; } 137 | RecallInfo(int _state, std::string _name, float _startTime) { state = _state; name = _name; startTime = _startTime; } 138 | }; 139 | 140 | enum DamageType 141 | { 142 | Physical, 143 | Magical, 144 | True 145 | }; 146 | 147 | enum SpellIndex 148 | { 149 | Q, 150 | W, 151 | E, 152 | R, 153 | D, 154 | F, 155 | Item1, 156 | Item2, 157 | Item3, 158 | Item4, 159 | Item5, 160 | Item6, 161 | Trinket, 162 | Recall 163 | }; 164 | 165 | enum SpellState 166 | { 167 | Ready = 0, 168 | DoesNotExist = 2, 169 | NotAvailable = 4, 170 | NotLearned = 12, 171 | Processing = 24, 172 | Cooldown = 32, 173 | NoMana = 64 174 | }; 175 | 176 | enum CharacterState : unsigned short 177 | { 178 | CanAttack = 1, 179 | CanCast = 2, 180 | CanMove = 4, 181 | Immovable = 8, 182 | Unknownz = 16, 183 | IsStealth = 32, 184 | Taunted = 64, 185 | Feared = 128, 186 | Fleeing = 256, 187 | Supressed = 512, 188 | Asleep = 1024, 189 | NearSight = 2048, 190 | Ghosted = 4096, 191 | HasGhost = 8192, 192 | Charmed = 16384, 193 | NoRender = 32768 194 | }; 195 | 196 | enum ObjectType : unsigned long long 197 | { 198 | Champion = 7957694998179309635, 199 | Special = 2336349411965497427, 200 | Ward = 5989923982968774999, 201 | Minion_Lane = 8944270284747073869, 202 | Minion_Lane_Siege = 7306920423476651374, 203 | Minion_Lane_Ranged = 7306930284704785774, 204 | Minion_Lane_Melee = 7306365152824092014, 205 | Minion_Lane_Super = 8243118342183806318, 206 | Monster = 2338042707385937741, 207 | Monster_Epic = 2340781521963538015, 208 | Monster_Dragon = 2336927746459059295, 209 | Special_Void = 2340781521963538015, 210 | Structure_Turret = 4294967297, 211 | UNKNOWN = 5980780305148018688, 212 | Less = 126939457912832 213 | }; 214 | 215 | enum CollisionFlags 216 | { 217 | None = 0, 218 | Grass = 1, 219 | Wall = 2, 220 | Building = 64, 221 | Tower = 70, 222 | Prop = 128, 223 | GlobalVision = 256 224 | }; 225 | 226 | enum SkillshotType 227 | { 228 | SkillshotNone, 229 | SkillshotLine, 230 | SkillshotCircle, 231 | SkillshotCone 232 | }; 233 | 234 | enum CollidableObjects 235 | { 236 | Objects, 237 | Walls 238 | }; -------------------------------------------------------------------------------- /leagueoflegends/selfprotection/strings/obfuscator.h: -------------------------------------------------------------------------------- 1 | #ifndef OBFUSCATOR_HPP 2 | #define OBFUSCATOR_HPP 3 | 4 | #include 5 | #include 6 | 7 | #define COMPILE_TIME_SEQUENCE 8 | #define OBFS_FINITE_STATE_MACHINE 9 | #define COMPILE_TIME_RANDOM 10 | #define MAKE_RAND_VAL(MOD) obfs::RAND_VAL<__LINE__, MOD> 11 | #define OBFS_STRING 12 | #define MAKE_STRING(Var, String, ...) constexpr auto Var = obfs::make_string<__VA_ARGS__>(String); 13 | 14 | namespace obfs { 15 | template 16 | struct TypeVal { 17 | using value_type = T; 18 | constexpr static T value = Val; 19 | }; 20 | 21 | struct Nothing {}; 22 | 23 | template 24 | struct Sequence { 25 | using value = TypeVal; 26 | using next = Sequence; 27 | 28 | constexpr static std::size_t size = 1 + sizeof...(Others); 29 | 30 | template 31 | using index = std::conditional_t>; 32 | }; 33 | 34 | template 35 | struct Sequence { 36 | using value = TypeVal; 37 | 38 | constexpr static std::size_t size = 1; 39 | 40 | template 41 | using index = std::conditional_t; 42 | }; 43 | 44 | template 45 | struct TypeSeq { 46 | using type = T; 47 | using next = TypeSeq; 48 | 49 | constexpr static std::size_t size = 1 + sizeof...(Ts); 50 | 51 | template 52 | using index = std::conditional_t>; 53 | }; 54 | 55 | template 56 | struct TypeSeq { 57 | using type = T; 58 | 59 | constexpr static std::size_t size = 1; 60 | 61 | template 62 | using index = std::conditional_t; 63 | }; 64 | 65 | template 66 | struct MinVal { 67 | constexpr static std::size_t value = 68 | Val < MinVal::value ? Val : MinVal::value; 69 | }; 70 | 71 | template 72 | struct MinVal { 73 | constexpr static std::size_t value = Val; 74 | }; 75 | 76 | template 77 | struct SeqPack { 78 | constexpr static std::size_t size = MinVal::value; 79 | 80 | template 81 | using getter = typename U::template index; 82 | 83 | template 84 | using index = TypeSeq...>; 85 | }; 86 | 87 | struct Pass {}; 88 | 89 | template 90 | struct First { 91 | using type = std::conditional_t< 92 | std::is_same_v, 93 | typename First::type, 94 | T>; 95 | }; 96 | 97 | template 98 | struct First { 99 | using type = std::conditional_t< 100 | std::is_same_v, 101 | IfAllPass, 102 | T>; 103 | }; 104 | } 105 | 106 | namespace obfs { 107 | using size_t = decltype(sizeof(void*)); 108 | 109 | constexpr char TIME[] = __TIME__; 110 | constexpr int digit(char c) { 111 | return c - '0'; 112 | } 113 | constexpr size_t SEED = digit(TIME[7]) + 114 | digit(TIME[6]) * 10 + 115 | digit(TIME[4]) * 60 + 116 | digit(TIME[3]) * 600 + 117 | digit(TIME[1]) * 3600 + 118 | digit(TIME[0]) * 36000; 119 | 120 | template 121 | struct Xorshiftplus { 122 | using prev = Xorshiftplus; 123 | 124 | constexpr static size_t update() { 125 | constexpr size_t x = prev::state0 ^ (prev::state0 << 23); 126 | constexpr size_t y = prev::state1; 127 | return x ^ y ^ (x >> 17) ^ (y >> 26); 128 | } 129 | 130 | constexpr static size_t state0 = prev::state1; 131 | constexpr static size_t state1 = update(); 132 | 133 | constexpr static size_t value = state0 + state1; 134 | }; 135 | 136 | template 137 | struct Xorshiftplus { 138 | constexpr static size_t state0 = Seed; 139 | constexpr static size_t state1 = Seed << 1; 140 | constexpr static size_t value = state0 + state1; 141 | }; 142 | 143 | template 144 | constexpr size_t RAND_VAL = Xorshiftplus::value % Mod; 145 | } 146 | 147 | 148 | namespace obfs { 149 | using Encoder = char(*)(char); 150 | using Decoder = char(*)(char); 151 | 152 | template 153 | class String { 154 | public: 155 | template 156 | constexpr String(char const* str, 157 | std::index_sequence): 158 | str{ encoder(str[Idx])... } {} 159 | 160 | inline char const* decode() const { 161 | for (char& chr : str) { 162 | chr = decoder(chr); 163 | } 164 | return str; 165 | } 166 | 167 | private: 168 | mutable char str[size]; 169 | }; 170 | 171 | template 172 | constexpr auto make_string(char const (&str)[size]) { 173 | return String(str, std::make_index_sequence()); 174 | } 175 | 176 | template 177 | using encoder_seq = Sequence; 178 | 179 | template 180 | using decoder_seq = Sequence; 181 | 182 | template 183 | using make_table = SeqPack; 184 | 185 | template 186 | using encoder_pair = Sequence; 187 | 188 | template 189 | using make_pair_table = TypeSeq; 190 | 191 | template 192 | constexpr auto make_string(char const(&str)[size]) { 193 | using pair = typename Table::template index; 194 | constexpr Encoder encoder = pair::template index<0>::value; 195 | constexpr Decoder decoder = pair::template index<1>::value; 196 | 197 | return make_string(str); 198 | } 199 | } 200 | 201 | #endif -------------------------------------------------------------------------------- /NamedPipeConsole/NamedPipeConsole.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {17c178a3-9949-4f06-b144-9a2186fe6850} 25 | NamedPipeConsole 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | true 77 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 78 | true 79 | 80 | 81 | Console 82 | true 83 | 84 | 85 | 86 | 87 | Level3 88 | true 89 | true 90 | true 91 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 92 | true 93 | 94 | 95 | Console 96 | true 97 | true 98 | true 99 | 100 | 101 | 102 | 103 | Level3 104 | true 105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 106 | true 107 | 108 | 109 | Console 110 | true 111 | 112 | 113 | 114 | 115 | Level3 116 | true 117 | true 118 | true 119 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 120 | true 121 | 122 | 123 | Console 124 | true 125 | true 126 | true 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /leagueoflegends/hooks/impl/impl.cpp: -------------------------------------------------------------------------------- 1 | #include "../../stdafx.h" 2 | 3 | namespace hooks 4 | { 5 | namespace impl 6 | { 7 | typedef unsigned int UINT; 8 | 9 | bool _init = false; 10 | 11 | void Inits() 12 | { 13 | globals::localPlayer = *(Object**)(globals::moduleBase + oLocalPlayer); 14 | globals::heroManager = *(ObjectManager**)(globals::moduleBase + oHeroManager); 15 | globals::minionManager = *(ObjectManager**)(globals::moduleBase + oMinionManager); 16 | 17 | functions::Init(); 18 | render::Init(); 19 | scripts::Init(); 20 | settings::Load(); 21 | menu::Init(); 22 | 23 | RECT windowRect; 24 | if (GetWindowRect(windowDX, &windowRect)) 25 | { 26 | globals::windowWidth = (float)abs(windowRect.right - windowRect.left); 27 | globals::windowHeight = (float)abs(windowRect.bottom - windowRect.top); 28 | } 29 | 30 | functions::PrintChat(CHAT_COLOR("#72ff72", "Loaded")); 31 | 32 | globals::hookResponse = true; 33 | 34 | LOG("%s hooked", globals::renderType); 35 | } 36 | 37 | void Updates() 38 | { 39 | scripts::Update(); 40 | render::Update(); 41 | menu::Update(); 42 | } 43 | 44 | bool KeyChecks() 45 | { 46 | if (GetAsyncKeyState(VK_DELETE) & 1) 47 | { 48 | settings::Save(); 49 | globals::eject = true; 50 | 51 | functions::PrintChat(CHAT_COLOR("#ff5b5b", "Ejected")); 52 | 53 | return true; 54 | } 55 | 56 | if (GetAsyncKeyState(VK_SHIFT)) { 57 | globals::menuOpen = true; 58 | } else { 59 | globals::menuOpen = false; 60 | } 61 | 62 | globals::scripts::orbwalker::orbwalkState = OrbwalkState::Off; 63 | if (GetAsyncKeyState(VK_SPACE)) 64 | globals::scripts::orbwalker::orbwalkState = OrbwalkState::Attack; 65 | 66 | return false; 67 | } 68 | 69 | //DX 70 | typedef HRESULT(__stdcall* Present) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags); 71 | static Present o_presentDX; 72 | 73 | typedef LRESULT(CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM); 74 | 75 | HWND windowDX = nullptr; 76 | WNDPROC o_wndProcDX; 77 | 78 | LRESULT __stdcall wndProcDX(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { 79 | 80 | if (ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam)) 81 | return true; 82 | 83 | return CallWindowProc(o_wndProcDX, hWnd, uMsg, wParam, lParam); 84 | } 85 | 86 | typedef long(__stdcall* ResetFn)(LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*); 87 | static ResetFn o_resetDX9 = NULL; 88 | 89 | typedef long(__stdcall* EndSceneFn)(LPDIRECT3DDEVICE9); 90 | static EndSceneFn o_endSceneDX9 = NULL; 91 | 92 | HRESULT __stdcall Reset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters) 93 | { 94 | ImGui_ImplDX9_InvalidateDeviceObjects(); 95 | HRESULT result = o_resetDX9(pDevice, pPresentationParameters); 96 | ImGui_ImplDX9_CreateDeviceObjects(); 97 | 98 | return result; 99 | } 100 | 101 | //DX9 102 | HRESULT __stdcall EndScene(LPDIRECT3DDEVICE9 pDevice) 103 | { 104 | if (globals::eject) return o_endSceneDX9(pDevice); 105 | 106 | if (!_init) 107 | { 108 | D3DDEVICE_CREATION_PARAMETERS params; 109 | pDevice->GetCreationParameters(¶ms); 110 | windowDX = params.hFocusWindow; 111 | o_wndProcDX = (WNDPROC)SetWindowLongPtr(windowDX, GWLP_WNDPROC, (LONG_PTR)wndProcDX); 112 | 113 | IMGUI_CHECKVERSION(); 114 | ImGui::CreateContext(); 115 | ImGuiIO& io = ImGui::GetIO(); (void)io; 116 | io.IniFilename = "window.ini"; 117 | io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange; 118 | io.Fonts->AddFontFromFileTTF(SP_STRING("C:\\Windows\\Fonts\\Arial.ttf"), 14); 119 | 120 | ImGui_ImplWin32_Init(windowDX); 121 | ImGui_ImplDX9_Init(pDevice); 122 | 123 | Inits(); 124 | 125 | _init = true; 126 | } 127 | 128 | if (functions::IsGameFocused()) 129 | { 130 | if (KeyChecks()) 131 | { 132 | SetWindowLongPtr(windowDX, GWLP_WNDPROC, (LONG_PTR)o_wndProcDX); 133 | 134 | ImGui_ImplDX9_Shutdown(); 135 | ImGui_ImplWin32_Shutdown(); 136 | ImGui::DestroyContext(); 137 | 138 | HRESULT result = o_endSceneDX9(pDevice); 139 | 140 | kiero::shutdown(); 141 | pDevice->Release(); 142 | 143 | return result; 144 | } 145 | } 146 | 147 | ImGui_ImplDX9_NewFrame(); 148 | ImGui_ImplWin32_NewFrame(); 149 | ImGui::NewFrame(); 150 | 151 | Updates(); 152 | 153 | ImGui::EndFrame(); 154 | ImGui::Render(); 155 | ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData()); 156 | 157 | return o_endSceneDX9(pDevice); 158 | } 159 | 160 | //DX11 161 | ID3D11Device* pDeviceDX11 = nullptr; 162 | ID3D11DeviceContext* pContextDX11 = nullptr; 163 | ID3D11RenderTargetView* mainRenderTargetViewDX11; 164 | 165 | HRESULT __stdcall presentDX11(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags) 166 | { 167 | if (!_init) 168 | { 169 | if (SUCCEEDED(pSwapChain->GetDevice(__uuidof(ID3D11Device), (void**)&pDeviceDX11))) 170 | { 171 | pDeviceDX11->GetImmediateContext(&pContextDX11); 172 | DXGI_SWAP_CHAIN_DESC sd; 173 | pSwapChain->GetDesc(&sd); 174 | windowDX = sd.OutputWindow; 175 | ID3D11Texture2D* pBackBuffer; 176 | pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&pBackBuffer); 177 | if (!pBackBuffer) return o_presentDX(pSwapChain, SyncInterval, Flags); 178 | pDeviceDX11->CreateRenderTargetView(pBackBuffer, NULL, &mainRenderTargetViewDX11); 179 | pBackBuffer->Release(); 180 | o_wndProcDX = (WNDPROC)SetWindowLongPtr(windowDX, GWLP_WNDPROC, (LONG_PTR)wndProcDX); 181 | 182 | IMGUI_CHECKVERSION(); 183 | ImGui::CreateContext(); 184 | ImGuiIO& io = ImGui::GetIO(); (void)io; 185 | io.IniFilename = "window.ini"; 186 | io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange; 187 | io.Fonts->AddFontFromFileTTF(SP_STRING("C:\\Windows\\Fonts\\Arial.ttf"), 14); 188 | 189 | DXGI_SWAP_CHAIN_DESC desc; 190 | pSwapChain->GetDesc(&desc); 191 | 192 | ID3D11Device* device; 193 | pSwapChain->GetDevice(__uuidof(ID3D11Device), (void**)&device); 194 | 195 | ID3D11DeviceContext* context; 196 | device->GetImmediateContext(&context); 197 | 198 | ImGui_ImplWin32_Init(windowDX); 199 | ImGui_ImplDX11_Init(device, context); 200 | 201 | Inits(); 202 | 203 | _init = true; 204 | } 205 | else 206 | return o_presentDX(pSwapChain, SyncInterval, Flags); 207 | } 208 | 209 | if (functions::IsGameFocused()) 210 | { 211 | if (KeyChecks()) 212 | { 213 | SetWindowLongPtr(windowDX, GWLP_WNDPROC, (LONG_PTR)o_wndProcDX); 214 | 215 | ImGui_ImplDX11_Shutdown(); 216 | ImGui_ImplWin32_Shutdown(); 217 | ImGui::DestroyContext(); 218 | 219 | HRESULT result = o_presentDX(pSwapChain, SyncInterval, Flags); 220 | 221 | kiero::shutdown(); 222 | pDeviceDX11->Release(); 223 | 224 | globals::eject = true; 225 | 226 | return result; 227 | } 228 | } 229 | 230 | ImGui_ImplDX11_NewFrame(); 231 | ImGui_ImplWin32_NewFrame(); 232 | ImGui::NewFrame(); 233 | 234 | Updates(); 235 | 236 | ImGui::EndFrame(); 237 | ImGui::Render(); 238 | pContextDX11->OMSetRenderTargets(1, &mainRenderTargetViewDX11, NULL); 239 | ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData()); 240 | 241 | return o_presentDX(pSwapChain, SyncInterval, Flags); 242 | } 243 | 244 | void Init() 245 | { 246 | if (globals::renderType == "D3D9") 247 | { 248 | kiero::bind(16, (void**)&o_resetDX9, Reset); 249 | kiero::bind(42, (void**)&o_endSceneDX9, EndScene); 250 | } 251 | else if (globals::renderType == "D3D11") 252 | { 253 | kiero::bind(8, (void**)&o_presentDX, presentDX11); 254 | } 255 | } 256 | } 257 | } -------------------------------------------------------------------------------- /start/main/Injection.h: -------------------------------------------------------------------------------- 1 | //Include this file if you want to use the injection library in your own project 2 | // 3 | //Use LoadLibrary to import the injection library: 4 | //HINSTANCE hInjectionMod = LoadLibrary(GH_INJ_MOD_NAME); 5 | // 6 | //Grab the injection functions with GetProcAddress: 7 | //auto InjectA = (f_InjectA)GetProcAddress(hInjectionMod, "InjectA"); 8 | //auto InjectW = (f_InjectW)GetProcAddress(hInjectionMod, "InjectW"); 9 | // 10 | //If needed: 11 | //auto ValidateInjectionFunctions = (f_ValidateInjectionFunctions)GetProcAddress(hInjectionMod, "ValidateInjectionFunctions"); 12 | //auto RestorenjectionFunctions = (f_RestoreInjectionFunctions)GetProcAddress(hInjectionMod, "RestorenjectionFunctions"); 13 | // 14 | //Symbol state: 15 | //auto GetSymbolState = (f_GetSymbolState)GetProcAddress(hInjectionMod, "GetSymbolState"); 16 | //auto GetImportState = (f_GetImportState)GetProcAddress(hInjectionMod, "GetImportState"); 17 | // 18 | //Download progress: 19 | //auto GetDownloadProgressEx = (f_GetDownloadProgress)GetProcAddress(hInjectionMod, "GetDownloadProgressEx"); 20 | 21 | #pragma once 22 | 23 | #define GH_INJ_VERSIONW L"4.6" 24 | #define GH_INJ_VERSIONA "4.6" 25 | 26 | #define GH_INJ_MOD_NAME64W L"GH Injector - x64.dll" 27 | #define GH_INJ_MOD_NAME86W L"GH Injector - x86.dll" 28 | 29 | #define GH_INJ_MOD_NAME64A "GH Injector - x64.dll" 30 | #define GH_INJ_MOD_NAME86A "GH Injector - x86.dll" 31 | 32 | #ifdef _WIN64 33 | #define GH_INJ_MOD_NAMEW GH_INJ_MOD_NAME64W 34 | #define GH_INJ_MOD_NAMEA GH_INJ_MOD_NAME64A 35 | #else 36 | #define GH_INJ_MOD_NAMEW GH_INJ_MOD_NAME86W 37 | #define GH_INJ_MOD_NAMEA GH_INJ_MOD_NAME86A 38 | #endif 39 | 40 | #ifdef UNICODE 41 | #define GH_INJ_MOD_NAME GH_INJ_MOD_NAMEW 42 | #define GH_INJ_VERSION GH_INJ_VERSIONW 43 | #else 44 | #define GH_INJ_MOD_NAME GH_INJ_MOD_NAMEA 45 | #define GH_INJ_VERSION GH_INJ_VERSIONA 46 | #endif 47 | 48 | #include 49 | 50 | enum class INJECTION_MODE 51 | { 52 | IM_LoadLibraryExW, 53 | IM_LdrLoadDll, 54 | IM_LdrpLoadDll, 55 | IM_LdrpLoadDllInternal, 56 | IM_ManualMap 57 | }; 58 | 59 | enum class LAUNCH_METHOD 60 | { 61 | LM_NtCreateThreadEx, 62 | LM_HijackThread, 63 | LM_SetWindowsHookEx, 64 | LM_QueueUserAPC, 65 | LM_KernelCallback, 66 | LM_FakeVEH 67 | }; 68 | 69 | //ansi version of the info structure: 70 | struct INJECTIONDATAA 71 | { 72 | char szDllPath[MAX_PATH * 2]; //fullpath to the dll to inject 73 | DWORD ProcessID; //process identifier of the target process 74 | INJECTION_MODE Mode; //injection mode 75 | LAUNCH_METHOD Method; //method to execute the remote shellcode 76 | DWORD Flags; //combination of the flags defined above 77 | DWORD Timeout; //timeout for DllMain return in milliseconds 78 | DWORD hHandleValue; //optional value to identify a handle in a process 79 | HINSTANCE hDllOut; //returned image base of the injection 80 | bool GenerateErrorLog; //if true error data is generated and stored in GH_Inj_Log.txt 81 | }; 82 | 83 | //unicode version of the info structure (documentation above) 84 | struct INJECTIONDATAW 85 | { 86 | wchar_t szDllPath[MAX_PATH * 2]; 87 | wchar_t szTargetProcessExeFileName[MAX_PATH]; //exe name of the target process, this value gets set automatically and should be initialized with 0s 88 | DWORD ProcessID; 89 | INJECTION_MODE Mode; 90 | LAUNCH_METHOD Method; 91 | DWORD Flags; 92 | DWORD Timeout; 93 | DWORD hHandleValue; 94 | HINSTANCE hDllOut; 95 | bool GenerateErrorLog; 96 | }; 97 | 98 | #ifdef _UNICODE 99 | #define INJECTIONDATA INJECTIONDATAW 100 | #else 101 | #define INJECTIONDATA INJECTIONDATAA 102 | #endif 103 | 104 | //amount of bytes to be scanned by ValidateInjectionFunctions and restored by RestoreInjectionFunctions 105 | #define HOOK_SCAN_BYTE_COUNT 0x10 106 | 107 | //ValidateInjectionFunctions fills an std::vector with this info, result can simply be passed to RestoreInjectionFunctions 108 | struct HookInfo 109 | { 110 | const char* ModuleName; 111 | const char* FunctionName; 112 | 113 | HINSTANCE hModuleBase; 114 | void* pFunc; 115 | UINT ChangeCount; 116 | BYTE OriginalBytes[HOOK_SCAN_BYTE_COUNT]; 117 | 118 | DWORD ErrorCode; 119 | }; 120 | 121 | //Cloaking options: 122 | #define INJ_ERASE_HEADER 0x0001 //replaces the first 0x1000 bytes of the dll with 0's (takes priority over INJ_FAKE_HEADER if both are specified) 123 | #define INJ_FAKE_HEADER 0x0002 //replaces the dlls header with the header of the ntdll.dll (superseded by INJ_ERASE_HEADER if both are specified) 124 | #define INJ_UNLINK_FROM_PEB 0x0004 //unlinks the module from the process enviroment block (1) 125 | #define INJ_THREAD_CREATE_CLOAKED 0x0008 //passes certain flags to NtCreateThreadEx to make the thread creation more stealthy (2) 126 | #define INJ_SCRAMBLE_DLL_NAME 0x0010 //randomizes the dll name on disk before injecting it 127 | #define INJ_LOAD_DLL_COPY 0x0020 //loads a copy of the dll from %temp% directory 128 | #define INJ_HIJACK_HANDLE 0x0040 //tries to a hijack a handle from another process instead of using OpenProcess 129 | 130 | //Notes: 131 | ///(1) ignored when manual mapping 132 | ///(2) launch method must be NtCreateThreadEx, ignored otherwise 133 | 134 | //Manual mapping options: 135 | #define INJ_MM_CLEAN_DATA_DIR 0x00010000 //removes data from the dlls PE header, ignored if INJ_MM_SET_PAGE_PROTECTIONS is set 136 | #define INJ_MM_RESOLVE_IMPORTS 0x00020000 //resolves dll imports 137 | #define INJ_MM_RESOLVE_DELAY_IMPORTS 0x00040000 //resolves delayed imports 138 | #define INJ_MM_EXECUTE_TLS 0x00080000 //executes TLS callbacks and initializes static TLS data 139 | #define INJ_MM_ENABLE_EXCEPTIONS 0x00100000 //enables exception handling 140 | #define INJ_MM_SET_PAGE_PROTECTIONS 0x00200000 //sets page protections based on section characteristics, if set INJ_MM_CLEAN_DATA_DIR will be ignored 141 | #define INJ_MM_INIT_SECURITY_COOKIE 0x00400000 //initializes security cookie for buffer overrun protection 142 | #define INJ_MM_RUN_DLL_MAIN 0x00800000 //executes DllMain 143 | //this option induces INJ_MM_RESOLVE_IMPORTS 144 | #define INJ_MM_RUN_UNDER_LDR_LOCK 0x01000000 //runs the DllMain under the loader lock 145 | #define INJ_MM_SHIFT_MODULE_BASE 0x02000000 //shifts the module base by a random offset 146 | 147 | #define MM_DEFAULT (INJ_MM_RESOLVE_IMPORTS | INJ_MM_RESOLVE_DELAY_IMPORTS | INJ_MM_INIT_SECURITY_COOKIE | INJ_MM_EXECUTE_TLS | INJ_MM_ENABLE_EXCEPTIONS | INJ_MM_RUN_DLL_MAIN | INJ_MM_SET_PAGE_PROTECTIONS) 148 | 149 | //Arguments for GetDownloadProgressEx 150 | #define PDB_DOWNLOAD_INDEX_NTDLL (int)0 //ntdll pdb download 151 | #define PDB_DOWNLOAD_INDEX_KERNEL32 (int)1 //kernel32 pdb download (Windows 7 only) 152 | 153 | using f_InjectA = DWORD(__stdcall*)(INJECTIONDATAA* pData); 154 | using f_InjectW = DWORD(__stdcall*)(INJECTIONDATAW* pData); 155 | 156 | using f_ValidateInjectionFunctions = bool(__stdcall*)(DWORD dwTargetProcessId, DWORD& ErrorCode, DWORD& LastWin32Error, HookInfo* HookDataOut, UINT Count, UINT* CountOut); 157 | using f_RestoreInjectionFunctions = bool(__stdcall*)(DWORD dwTargetProcessId, DWORD& ErrorCode, DWORD& LastWin32Error, HookInfo* HookDataIn, UINT Count, UINT* CountOut); 158 | 159 | using f_GetVersionA = HRESULT(__stdcall*)(char* out, size_t cb_size); 160 | using f_GetVersionW = HRESULT(__stdcall*)(wchar_t* out, size_t cb_size); 161 | 162 | using f_GetSymbolState = DWORD(__stdcall*)(); 163 | using f_GetImportState = DWORD(__stdcall*)(); 164 | 165 | using f_GetDownloadProgressEx = float(__stdcall*)(int index, bool bWow64); 166 | using f_StartDownload = void(__stdcall*)(); 167 | using f_InterruptDownload = void(__stdcall*)(); 168 | 169 | using f_raw_print_callback = void(__stdcall*)(const char* szText); 170 | using f_SetRawPrintCallback = DWORD(__stdcall*)(f_raw_print_callback callback); -------------------------------------------------------------------------------- /start/start.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {a1a7edff-43e6-4ec2-9822-7e08b73d07cb} 25 | start 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | $(SolutionDir)$(Platform)\$(Configuration)\ 76 | $(SolutionDir)$(Platform)\$(Configuration)\ 77 | 78 | 79 | false 80 | $(SolutionDir)$(Platform)\$(Configuration)\ 81 | $(SolutionDir)$(Platform)\$(Configuration)\ 82 | 83 | 84 | true 85 | 86 | 87 | false 88 | 89 | 90 | 91 | Level3 92 | true 93 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 94 | true 95 | 96 | 97 | Console 98 | true 99 | 100 | 101 | 102 | 103 | Level3 104 | true 105 | true 106 | true 107 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 108 | true 109 | 110 | 111 | Console 112 | true 113 | true 114 | true 115 | 116 | 117 | 118 | 119 | Level3 120 | true 121 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 122 | true 123 | 124 | 125 | Console 126 | true 127 | 128 | 129 | 130 | 131 | Level3 132 | true 133 | true 134 | true 135 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 136 | true 137 | 138 | 139 | Console 140 | true 141 | true 142 | true 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /leagueoflegends/kiero/minhook/include/MinHook.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__) 32 | #error MinHook supports only x86 and x64 systems. 33 | #endif 34 | 35 | #include 36 | 37 | // MinHook Error Codes. 38 | typedef enum MH_STATUS 39 | { 40 | // Unknown error. Should not be returned. 41 | MH_UNKNOWN = -1, 42 | 43 | // Successful. 44 | MH_OK = 0, 45 | 46 | // MinHook is already initialized. 47 | MH_ERROR_ALREADY_INITIALIZED, 48 | 49 | // MinHook is not initialized yet, or already uninitialized. 50 | MH_ERROR_NOT_INITIALIZED, 51 | 52 | // The hook for the specified target function is already created. 53 | MH_ERROR_ALREADY_CREATED, 54 | 55 | // The hook for the specified target function is not created yet. 56 | MH_ERROR_NOT_CREATED, 57 | 58 | // The hook for the specified target function is already enabled. 59 | MH_ERROR_ENABLED, 60 | 61 | // The hook for the specified target function is not enabled yet, or already 62 | // disabled. 63 | MH_ERROR_DISABLED, 64 | 65 | // The specified pointer is invalid. It points the address of non-allocated 66 | // and/or non-executable region. 67 | MH_ERROR_NOT_EXECUTABLE, 68 | 69 | // The specified target function cannot be hooked. 70 | MH_ERROR_UNSUPPORTED_FUNCTION, 71 | 72 | // Failed to allocate memory. 73 | MH_ERROR_MEMORY_ALLOC, 74 | 75 | // Failed to change the memory protection. 76 | MH_ERROR_MEMORY_PROTECT, 77 | 78 | // The specified module is not loaded. 79 | MH_ERROR_MODULE_NOT_FOUND, 80 | 81 | // The specified function is not found. 82 | MH_ERROR_FUNCTION_NOT_FOUND 83 | } 84 | MH_STATUS; 85 | 86 | // Can be passed as a parameter to MH_EnableHook, MH_DisableHook, 87 | // MH_QueueEnableHook or MH_QueueDisableHook. 88 | #define MH_ALL_HOOKS NULL 89 | 90 | #ifdef __cplusplus 91 | extern "C" { 92 | #endif 93 | 94 | // Initialize the MinHook library. You must call this function EXACTLY ONCE 95 | // at the beginning of your program. 96 | MH_STATUS WINAPI MH_Initialize(VOID); 97 | 98 | // Uninitialize the MinHook library. You must call this function EXACTLY 99 | // ONCE at the end of your program. 100 | MH_STATUS WINAPI MH_Uninitialize(VOID); 101 | 102 | // Creates a Hook for the specified target function, in disabled state. 103 | // Parameters: 104 | // pTarget [in] A pointer to the target function, which will be 105 | // overridden by the detour function. 106 | // pDetour [in] A pointer to the detour function, which will override 107 | // the target function. 108 | // ppOriginal [out] A pointer to the trampoline function, which will be 109 | // used to call the original target function. 110 | // This parameter can be NULL. 111 | MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal); 112 | 113 | // Creates a Hook for the specified API function, in disabled state. 114 | // Parameters: 115 | // pszModule [in] A pointer to the loaded module name which contains the 116 | // target function. 117 | // pszTarget [in] A pointer to the target function name, which will be 118 | // overridden by the detour function. 119 | // pDetour [in] A pointer to the detour function, which will override 120 | // the target function. 121 | // ppOriginal [out] A pointer to the trampoline function, which will be 122 | // used to call the original target function. 123 | // This parameter can be NULL. 124 | MH_STATUS WINAPI MH_CreateHookApi( 125 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal); 126 | 127 | // Creates a Hook for the specified API function, in disabled state. 128 | // Parameters: 129 | // pszModule [in] A pointer to the loaded module name which contains the 130 | // target function. 131 | // pszTarget [in] A pointer to the target function name, which will be 132 | // overridden by the detour function. 133 | // pDetour [in] A pointer to the detour function, which will override 134 | // the target function. 135 | // ppOriginal [out] A pointer to the trampoline function, which will be 136 | // used to call the original target function. 137 | // This parameter can be NULL. 138 | // ppTarget [out] A pointer to the target function, which will be used 139 | // with other functions. 140 | // This parameter can be NULL. 141 | MH_STATUS WINAPI MH_CreateHookApiEx( 142 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget); 143 | 144 | // Removes an already created hook. 145 | // Parameters: 146 | // pTarget [in] A pointer to the target function. 147 | MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget); 148 | 149 | // Enables an already created hook. 150 | // Parameters: 151 | // pTarget [in] A pointer to the target function. 152 | // If this parameter is MH_ALL_HOOKS, all created hooks are 153 | // enabled in one go. 154 | MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget); 155 | 156 | // Disables an already created hook. 157 | // Parameters: 158 | // pTarget [in] A pointer to the target function. 159 | // If this parameter is MH_ALL_HOOKS, all created hooks are 160 | // disabled in one go. 161 | MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget); 162 | 163 | // Queues to enable an already created hook. 164 | // Parameters: 165 | // pTarget [in] A pointer to the target function. 166 | // If this parameter is MH_ALL_HOOKS, all created hooks are 167 | // queued to be enabled. 168 | MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget); 169 | 170 | // Queues to disable an already created hook. 171 | // Parameters: 172 | // pTarget [in] A pointer to the target function. 173 | // If this parameter is MH_ALL_HOOKS, all created hooks are 174 | // queued to be disabled. 175 | MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget); 176 | 177 | // Applies all queued changes in one go. 178 | MH_STATUS WINAPI MH_ApplyQueued(VOID); 179 | 180 | // Translates the MH_STATUS to its name as a string. 181 | const char * WINAPI MH_StatusToString(MH_STATUS status); 182 | 183 | #ifdef __cplusplus 184 | } 185 | #endif 186 | 187 | -------------------------------------------------------------------------------- /leagueoflegends/scripts/champions/syndra.cpp: -------------------------------------------------------------------------------- 1 | #include "../../stdafx.h" 2 | 3 | using namespace scripts; 4 | 5 | class SyndraModule : public ChampionModule 6 | { 7 | private: 8 | std::string name = SP_STRING("Syndra"); 9 | 10 | Skillshot q = SkillshotManager::RegisterSpell(name, SpellIndex::Q, Skillshot(800.0f, 105.0f, 0.0f, 0.6f, SkillshotType::SkillshotCircle)); 11 | Skillshot w = SkillshotManager::RegisterSpell(name, SpellIndex::W, Skillshot(950.0f, 110.0f, 1900.0f, 0.4f, SkillshotType::SkillshotCircle)); 12 | Skillshot e = SkillshotManager::RegisterSpell(name, SpellIndex::E, Skillshot(1300.0f, 90.0f, 2200.0f, 0.25f, SkillshotType::SkillshotLine)); 13 | 14 | private: 15 | float gameTime = 0.0f; 16 | 17 | float lastQForECastTime = 0.0f; 18 | float lastW1CastTime = 0.0f; 19 | float lastECastTime = 0.0f; 20 | 21 | Object* lastESphere = nullptr; 22 | 23 | Vector3 lastEObjPos = {}; 24 | Vector3 lastEProjectionPos = {}; 25 | Vector3 lastETargetPos = {}; 26 | 27 | public: 28 | SyndraModule() 29 | { 30 | ChampionModuleManager::RegisterModule(name, this); 31 | } 32 | 33 | bool CanCastW1() 34 | { 35 | return gameTime > lastW1CastTime + 0.1f; 36 | } 37 | 38 | bool SphereForEExists(Vector3 targetPos) 39 | { 40 | auto playerPos = globals::localPlayer->GetPosition(); 41 | playerPos.y = 0.0f; 42 | targetPos.y = 0.0f; 43 | 44 | std::vector includeFilterTypeHashes = { ObjectType::Special, ObjectType::Less }; 45 | 46 | for (Object* obj : *globals::minionManager) 47 | { 48 | float dist = obj->GetPosition().Distance(playerPos); 49 | if (dist > 800.0f || dist < 150.0f) continue; 50 | 51 | bool includeHashMatched = false; 52 | for (auto hash : includeFilterTypeHashes) 53 | { 54 | if (obj->GetCharacterData()->GetObjectTypeHash() == hash) 55 | { 56 | includeHashMatched = true; 57 | break; 58 | } 59 | } 60 | if (includeFilterTypeHashes.size() && !includeHashMatched) continue; 61 | 62 | if (obj->GetName() != SP_STRING("SyndraSphere") && 63 | (obj->GetName() != SP_STRING("TestCubeRender10Vision") || gameTime - lastQForECastTime > 0.5f)) continue; 64 | if (!obj->IsAlive()) continue; 65 | if ((obj->GetActionState() & 0x400) != 0) continue; 66 | 67 | auto objPos = obj->GetPosition(); 68 | objPos.y = 0.0f; 69 | 70 | auto playerToObj = objPos - playerPos; 71 | auto playerToTarget = targetPos - playerPos; 72 | 73 | if (playerToObj.Length() >= playerToTarget.Length() + 500.0f) continue; 74 | 75 | float dot1 = playerToTarget.DotProduct(playerToObj); 76 | float dot2 = playerToObj.DotProduct(playerToObj); 77 | 78 | if (dot1 < 0.0f) continue; 79 | 80 | float t = dot1 / dot2; 81 | 82 | Vector3 projection = playerPos + (playerToObj * t); 83 | projection.y = 0.0; 84 | 85 | Vector3 distVector = targetPos - projection; 86 | distVector.y = 0.0; 87 | 88 | lastEObjPos = objPos; 89 | lastEProjectionPos = projection; 90 | lastETargetPos = targetPos; 91 | 92 | float objY = obj->GetPosition().y; 93 | lastEObjPos.y = objY; 94 | lastEProjectionPos.y = objY; 95 | lastETargetPos.y = objY; 96 | 97 | if (distVector.Length() <= e.GetRadius()) 98 | { 99 | lastESphere = obj; 100 | return true; 101 | } 102 | } 103 | lastESphere = nullptr; 104 | return false; 105 | } 106 | 107 | void Init() override 108 | { 109 | ADD_SETTING("Syndra", "draw Q-E range", false); 110 | ADD_SETTING("Syndra", "draw E calculation", false); 111 | } 112 | 113 | void Update() override 114 | { 115 | gameTime = functions::GetGameTime(); 116 | } 117 | 118 | void Attack() override 119 | { 120 | prediction::PredictionOutput qPrediction; 121 | prediction::PredictionOutput wPrediction; 122 | prediction::PredictionOutput ePrediction; 123 | 124 | auto spellCast = globals::localPlayer->GetActiveSpellCast(); 125 | if (spellCast && spellCast->GetSpellId() == SpellIndex::E) return; 126 | 127 | if (e.IsCastable() && prediction::GetPrediction(e, ePrediction)) 128 | { 129 | if (q.IsCastable() && (q.GetStacks() > 0 || q.GetName().size() == 7) && 130 | globals::localPlayer->GetSpellBySlotId(SpellIndex::E)->GetManaCost() + 131 | globals::localPlayer->GetSpellBySlotId(SpellIndex::Q)->GetManaCost() <= globals::localPlayer->GetMana()) 132 | { 133 | actions::CastSpell(SpellIndex::Q, ePrediction.position); 134 | lastQForECastTime = gameTime; 135 | return; 136 | } 137 | 138 | if (lastQForECastTime > gameTime + 0.1f || SphereForEExists(ePrediction.position)) 139 | { 140 | actions::CastSpell(SpellIndex::E, ePrediction.position); 141 | lastECastTime = gameTime; 142 | return; 143 | } 144 | } 145 | else 146 | { 147 | lastEObjPos = {}; 148 | lastEProjectionPos = {}; 149 | lastETargetPos = {}; 150 | } 151 | 152 | if (w.IsCastable() && (int)w.GetName().size() == 11 && prediction::GetPrediction(w, wPrediction)) 153 | { 154 | actions::CastSpell(SpellIndex::W, wPrediction.position); 155 | return; 156 | } 157 | 158 | if (q.IsCastable() && (q.GetStacks() > 0 || q.GetName().size() == 7) && prediction::GetPrediction(q, qPrediction)) 159 | { 160 | actions::CastSpell(SpellIndex::Q, qPrediction.position); 161 | return; 162 | } 163 | 164 | if (CanCastW1() && w.IsCastable() && (int)w.GetName().size() == 7 && prediction::GetPrediction(w, wPrediction)) 165 | { 166 | auto monster = targetselector::GetObjectInRange(w.GetRange(), "", 167 | { ObjectType::Minion_Lane, ObjectType::Monster }, 168 | { ObjectType::Monster_Epic, ObjectType::Monster_Dragon }); 169 | if (monster && monster == functions::GetSelectedObject()) 170 | { 171 | actions::CastSpell(SpellIndex::W, monster->GetPosition()); 172 | lastW1CastTime = gameTime; 173 | return; 174 | } 175 | 176 | auto sphere = targetselector::GetObjectInRange(w.GetRange(), SP_STRING("SyndraSphere"), { ObjectType::Special }, {}, true); 177 | if (sphere && (sphere != lastESphere || gameTime > lastECastTime + 0.4f)) 178 | { 179 | actions::CastSpell(SpellIndex::W, sphere->GetPosition()); 180 | lastW1CastTime = gameTime; 181 | return; 182 | } 183 | 184 | if (monster) 185 | { 186 | actions::CastSpell(SpellIndex::W, monster->GetPosition()); 187 | lastW1CastTime = gameTime; 188 | return; 189 | } 190 | } 191 | } 192 | 193 | void Render() override 194 | { 195 | if (e.IsCastable() && SETTINGS_BOOL("Syndra", "draw Q-E range")) 196 | { 197 | render::RenderCircleWorld(globals::localPlayer->GetPosition(), 40, e.GetRange(), COLOR_PURPLE, 1.0f); 198 | } 199 | 200 | if (lastEObjPos.IsValid() && lastEProjectionPos.IsValid() && lastETargetPos.IsValid() && SETTINGS_BOOL("Syndra", "draw E calculation")) 201 | { 202 | render::RenderCircleWorld(lastEObjPos, 20, 30.0f, COLOR_BLUE, 3.0f); 203 | render::RenderCircleWorld(lastETargetPos, 20, 30.0f, COLOR_RED, 3.0f); 204 | 205 | auto projectionDirection = lastEProjectionPos - lastETargetPos; 206 | auto projectionDirectionN = projectionDirection.Normalized(); 207 | auto projectionSuccess = lastETargetPos + ((projectionDirection.Length() > e.GetRadius()) ? projectionDirectionN * e.GetRadius() : projectionDirection); 208 | 209 | auto objScreen = functions::WorldToScreen(lastEObjPos).ToImVec(); 210 | auto projectionScreen = functions::WorldToScreen(lastEProjectionPos).ToImVec(); 211 | auto targetScreen = functions::WorldToScreen(lastETargetPos).ToImVec(); 212 | auto projectionSuccessScreen = functions::WorldToScreen(projectionSuccess).ToImVec(); 213 | 214 | render::RenderLine(objScreen, projectionScreen, COLOR_WHITE, 3.0f); 215 | render::RenderLine(projectionSuccessScreen, projectionScreen, COLOR_RED, 3.0f); 216 | render::RenderLine(targetScreen, projectionSuccessScreen, COLOR_GREEN, 3.0f); 217 | } 218 | } 219 | }; 220 | 221 | SyndraModule module; -------------------------------------------------------------------------------- /leagueoflegends/render/renderfunctions.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace render 4 | { 5 | float Distance(Vector2 vec1, Vector2 vec2) 6 | { 7 | float x_d = (vec2.x - vec1.x); 8 | float y_d = (vec2.y - vec1.y); 9 | return sqrt((x_d * x_d) + (y_d * y_d)); 10 | } 11 | 12 | float Distance(Vector3 vec1, Vector3 vec2) 13 | { 14 | float x_d = (vec2.x - vec1.x); 15 | float y_d = (vec2.y - vec1.y); 16 | float z_d = (vec2.z - vec1.z); 17 | return sqrt((x_d * x_d) + (y_d * y_d) + (z_d * z_d)); 18 | } 19 | 20 | Vector3 CalcAngle(Vector3 src, Vector3 dst) 21 | { 22 | Vector3 angles; 23 | angles.x = (-(float)atan2(dst.x - src.x, dst.y - src.y)) / PI * 180.0f; 24 | angles.y = (atan2(dst.z - src.z, Distance(src, dst))) * 180.0f / PI; 25 | angles.z = 0.0f; 26 | return angles; 27 | } 28 | 29 | Vector3 Add(Vector3 src, Vector3 dst) 30 | { 31 | Vector3 sum; 32 | sum.x = src.x + dst.x; 33 | sum.y = src.y + dst.y; 34 | sum.z = src.z + dst.z; 35 | return sum; 36 | } 37 | 38 | Vector3 Subtract(Vector3 src, Vector3 dst) 39 | { 40 | Vector3 diff; 41 | diff.x = src.x - dst.x; 42 | diff.y = src.y - dst.y; 43 | diff.z = src.z - dst.z; 44 | return diff; 45 | } 46 | 47 | Vector3 Divide(Vector3 src, float num) 48 | { 49 | Vector3 vec; 50 | vec.x = src.x / num; 51 | vec.y = src.y / num; 52 | vec.z = src.z / num; 53 | 54 | return vec; 55 | } 56 | 57 | Vector3 Multiply(Vector3 src, float num) 58 | { 59 | Vector3 vec; 60 | vec.x = src.x * num; 61 | vec.y = src.y * num; 62 | vec.z = src.z * num; 63 | 64 | return vec; 65 | } 66 | 67 | float Magnitude(Vector3 vec) 68 | { 69 | return sqrtf(vec.x * vec.x + vec.y * vec.y + vec.z * vec.z); 70 | } 71 | 72 | Vector3 Normalize(Vector3 src) 73 | { 74 | Vector3 vec = Divide(src, Magnitude(src)); 75 | return vec; 76 | } 77 | 78 | Vector3 GetLine(Vector2 point1, Vector2 point2) 79 | { 80 | return Vector3(point1.y - point2.y, point2.x - point1.x, point1.x * point2.y - point2.x * point1.y); 81 | } 82 | 83 | Vector3 GetVector(Vector3 point1, Vector3 point2) 84 | { 85 | return Vector3(point2.x - point1.x, point2.y - point1.y, point2.z - point1.z); 86 | } 87 | 88 | float GetDistPointToLine(Vector2 point, Vector2 pointLine1, Vector2 pointLine2) 89 | { 90 | Vector3 line = GetLine(pointLine1, pointLine2); 91 | return abs(line.x * point.x + line.y * point.y + line.z) / sqrt(line.x * line.x + line.y * line.y); 92 | } 93 | 94 | bool IsVectorEqual(Vector3 vec1, Vector3 vec2) 95 | { 96 | return vec1.x == vec2.x && vec1.y == vec2.y && vec1.z == vec2.z; 97 | } 98 | 99 | bool IsVector2Null(Vector2 vec) 100 | { 101 | return vec.x == 0.0f && vec.y == 0.0f; 102 | } 103 | 104 | bool IsVector3Null(Vector3 vec) 105 | { 106 | return vec.x == 0.0f && vec.y == 0.0f && vec.z == 0.0f; 107 | } 108 | 109 | bool IsOnScreen(Vector2 pos) 110 | { 111 | return pos.x >= 0.0f && pos.y >= 0.0f && pos.x <= globals::windowWidth && pos.y <= globals::windowHeight; 112 | } 113 | 114 | void RenderText(const std::string& text, const ImVec2& position, float size, uint32_t color, bool center) 115 | { 116 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 117 | 118 | float a = (float)((color >> 24) & 0xff); 119 | float r = (float)((color >> 16) & 0xff); 120 | float g = (float)((color >> 8) & 0xff); 121 | float b = (float)((color) & 0xff); 122 | 123 | ImVec2 textSize = imFont->CalcTextSizeA(size, FLT_MAX, 0.0f, text.c_str()); 124 | 125 | float xOffset = (center) ? textSize.x / 2.0f : 0.0f; 126 | 127 | window->DrawList->AddText(imFont, size, { (position.x - xOffset) + 1.0f, (position.y + textSize.y) + 1.0f }, ImGui::GetColorU32({ 0.0f, 0.0f, 0.0f, a / 255.0f }), text.c_str()); 128 | window->DrawList->AddText(imFont, size, { (position.x - xOffset) - 1.0f, (position.y + textSize.y) - 1.0f }, ImGui::GetColorU32({ 0.0f, 0.0f, 0.0f, a / 255.0f }), text.c_str()); 129 | window->DrawList->AddText(imFont, size, { (position.x - xOffset) + 1.0f, (position.y + textSize.y) - 1.0f }, ImGui::GetColorU32({ 0.0f, 0.0f, 0.0f, a / 255.0f }), text.c_str()); 130 | window->DrawList->AddText(imFont, size, { (position.x - xOffset) - 1.0f, (position.y + textSize.y) + 1.0f }, ImGui::GetColorU32({ 0.0f, 0.0f, 0.0f, a / 255.0f }), text.c_str()); 131 | 132 | window->DrawList->AddText(imFont, size, { position.x - xOffset, position.y + textSize.y }, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }), text.c_str()); 133 | } 134 | 135 | void RenderLine(const ImVec2& from, const ImVec2& to, uint32_t color, float thickness) 136 | { 137 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 138 | 139 | float a = (float)((color >> 24) & 0xff); 140 | float r = (float)((color >> 16) & 0xff); 141 | float g = (float)((color >> 8) & 0xff); 142 | float b = (float)((color) & 0xff); 143 | 144 | window->DrawList->AddLine(from, to, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }), thickness); 145 | } 146 | 147 | void RenderCircle(const ImVec2& position, float radius, uint32_t color, float thickness, uint32_t segments) 148 | { 149 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 150 | 151 | float a = (float)((color >> 24) & 0xff); 152 | float r = (float)((color >> 16) & 0xff); 153 | float g = (float)((color >> 8) & 0xff); 154 | float b = (float)((color) & 0xff); 155 | 156 | window->DrawList->AddCircle(position, radius, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }), segments, thickness); 157 | } 158 | 159 | void RenderCircleFilled(const ImVec2& position, float radius, uint32_t color, uint32_t segments) 160 | { 161 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 162 | 163 | float a = (float)((color >> 24) & 0xff); 164 | float r = (float)((color >> 16) & 0xff); 165 | float g = (float)((color >> 8) & 0xff); 166 | float b = (float)((color) & 0xff); 167 | 168 | window->DrawList->AddCircleFilled(position, radius, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }), segments); 169 | } 170 | 171 | void RenderRect(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding, uint32_t roundingCornersFlags, float thickness) 172 | { 173 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 174 | 175 | float a = (float)((color >> 24) & 0xff); 176 | float r = (float)((color >> 16) & 0xff); 177 | float g = (float)((color >> 8) & 0xff); 178 | float b = (float)((color) & 0xff); 179 | 180 | window->DrawList->AddRect(from, to, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }), rounding, roundingCornersFlags, thickness); 181 | } 182 | 183 | void RenderRectFilled(const ImVec2& from, const ImVec2& to, uint32_t color, float rounding, uint32_t roundingCornersFlags) 184 | { 185 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 186 | 187 | float a = (float)((color >> 24) & 0xff); 188 | float r = (float)((color >> 16) & 0xff); 189 | float g = (float)((color >> 8) & 0xff); 190 | float b = (float)((color) & 0xff); 191 | 192 | window->DrawList->AddRectFilled(from, to, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }), rounding, roundingCornersFlags); 193 | } 194 | 195 | void RenderImage(ImTextureID pTexture, const ImVec2& from, const ImVec2& to, uint32_t color) 196 | { 197 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 198 | 199 | float a = (float)((color >> 24) & 0xff); 200 | float r = (float)((color >> 16) & 0xff); 201 | float g = (float)((color >> 8) & 0xff); 202 | float b = (float)((color) & 0xff); 203 | 204 | window->DrawList->AddImage(pTexture, from, to, { 0.0f, 0.0f }, { 1.0f, 1.0f }, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f })); 205 | } 206 | 207 | void RenderImageRounded(ImTextureID pTexture, const ImVec2& from, const ImVec2& to, uint32_t color, float rounding, uint32_t roundingCornersFlags) 208 | { 209 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 210 | 211 | float a = (float)((color >> 24) & 0xff); 212 | float r = (float)((color >> 16) & 0xff); 213 | float g = (float)((color >> 8) & 0xff); 214 | float b = (float)((color) & 0xff); 215 | 216 | window->DrawList->AddImageRounded(pTexture, from, to, { 0.0f, 0.0f }, { 1.0f, 1.0f }, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }), rounding, roundingCornersFlags); 217 | } 218 | 219 | void RenderCircleWorld(const Vector3& worldPos, int numPoints, float radius, uintptr_t color, float thickness) 220 | { 221 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 222 | 223 | float a = (float)((color >> 24) & 0xff); 224 | float r = (float)((color >> 16) & 0xff); 225 | float g = (float)((color >> 8) & 0xff); 226 | float b = (float)((color) & 0xff); 227 | 228 | numPoints = min(numPoints, 49); 229 | ImVec2 points[50]; 230 | 231 | float step = 6.2831f / numPoints; 232 | float theta = 0.f; 233 | for (int i = 0; i < numPoints; i++, theta += step) 234 | { 235 | Vector3 worldSpace = { worldPos.x + radius * cos(theta), worldPos.y, worldPos.z - radius * sin(theta) }; 236 | ImVec2 screenSpace = functions::WorldToScreen(worldSpace).ToImVec(); 237 | 238 | points[i] = screenSpace; 239 | } 240 | 241 | points[numPoints] = points[0]; 242 | 243 | window->DrawList->AddPolyline(points, numPoints, ImGui::GetColorU32({ r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }), true, thickness); 244 | } 245 | } -------------------------------------------------------------------------------- /leagueoflegends/scripts/scripts.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace scripts 4 | { 5 | static float gameTime = 0.0f; 6 | static float nextRngBuffer = 0.0f; 7 | 8 | std::vector>> settingsOrder = {}; 9 | 10 | void AddSetting(std::string group, std::string key, settings::SettingValue value, settings::SettingValue min, settings::SettingValue max) 11 | { 12 | std::pair>* groupData = nullptr; 13 | for (auto& pair : settingsOrder) 14 | if (pair.first == group) 15 | groupData = &pair; 16 | 17 | if (groupData) { 18 | groupData->second.push_back(key); 19 | } else { 20 | settingsOrder.push_back({ group, {key} }); 21 | } 22 | 23 | settings::Get(group, key, value); 24 | 25 | if (std::holds_alternative(value)) 26 | settings::AddBounds(group, key, std::get(min), std::get(max)); 27 | if (std::holds_alternative(value)) 28 | settings::AddBounds(group, key, std::get(min), std::get(max)); 29 | } 30 | 31 | void RefreshBuffer() 32 | { 33 | if (!SETTINGS_BOOL("orbwalker", "random action delay")) 34 | { 35 | nextRngBuffer = 0.0f; 36 | return; 37 | } 38 | nextRngBuffer = static_cast (rand()) / static_cast (RAND_MAX / 0.01f); 39 | } 40 | 41 | void Init() 42 | { 43 | srand(static_cast (time(0))); 44 | 45 | cooldowns::Init(); 46 | recalls::Init(); 47 | orbwalker::Init(); 48 | targetselector::Init(); 49 | skinchanger::Init(); 50 | debug::Init(); 51 | champions::Init(); 52 | } 53 | 54 | void Update() 55 | { 56 | gameTime = functions::GetGameTime(); 57 | champions::Update(); 58 | if (SETTINGS_BOOL("orbwalker", "enabled")) orbwalker::Update(); 59 | if (SETTINGS_BOOL("recalls", "enabled")) recalls::Update(); 60 | skinchanger::Update(); 61 | } 62 | 63 | namespace actions 64 | { 65 | float lastActionTime = 0.0f; 66 | 67 | bool CanDoAction() 68 | { 69 | if (!lastActionTime) lastActionTime = gameTime; 70 | if (gameTime < lastActionTime + SETTINGS_FLOAT("orbwalker", "clickdelay") + nextRngBuffer) return false; 71 | lastActionTime = gameTime; 72 | return true; 73 | } 74 | 75 | void Idle() 76 | { 77 | if (!(CanDoAction() && globals::localPlayer->CanMove())) return; 78 | functions::MoveToMousePos(); 79 | RefreshBuffer(); 80 | } 81 | 82 | void AttackObject(Object* obj) 83 | { 84 | if (!CanDoAction()) return; 85 | functions::AttackObject(obj); 86 | RefreshBuffer(); 87 | } 88 | 89 | void CastSpell(int spellId, Object* target) 90 | { 91 | Vector3 headPos = target->GetPosition(); 92 | const float objectHeight = *(float*)(target->GetCharacterData() + oObjCharDataDataSize) * target->GetScale(); 93 | headPos.y += objectHeight; 94 | CastSpell(spellId, headPos); 95 | } 96 | 97 | void CastSpell(int spellId, Vector3 pos) 98 | { 99 | if (!CanDoAction()) return; 100 | functions::CastSpell(spellId, pos); 101 | } 102 | } 103 | 104 | namespace orbwalker 105 | { 106 | float lastAttackTime = 0.0f; 107 | QWORD lastSpellCastAddress = 0; 108 | 109 | namespace states 110 | { 111 | void Attack() 112 | { 113 | if (globals::localPlayer->CanAttack()) { 114 | if (auto obj = targetselector::GetEnemyChampionInRange(globals::localPlayer->GetRealAttackRange())) 115 | { 116 | actions::AttackObject(obj); 117 | return; 118 | } 119 | } 120 | actions::Idle(); 121 | } 122 | } 123 | 124 | bool StopOrbwalk() 125 | { 126 | return ( 127 | !functions::CanSendInput() || 128 | gameTime < lastAttackTime + globals::localPlayer->GetAttackWindup() + SETTINGS_FLOAT("orbwalker", "windupbuffer") 129 | ); 130 | } 131 | 132 | bool IsReloading() 133 | { 134 | return gameTime < lastAttackTime + globals::localPlayer->GetAttackDelay() - SETTINGS_FLOAT("orbwalker", "attack before can attack"); 135 | } 136 | 137 | void CheckActiveAttack() 138 | { 139 | auto spellCast = globals::localPlayer->GetActiveSpellCast(); 140 | if (spellCast) 141 | { 142 | if ((spellCast->IsAutoAttack() || 143 | functions::IsAttackWindupSpell(spellCast->GetSpellId())) && 144 | (QWORD)spellCast != lastSpellCastAddress) 145 | { 146 | lastAttackTime = gameTime; 147 | } 148 | } 149 | lastSpellCastAddress = (QWORD)spellCast; 150 | } 151 | 152 | void Init() 153 | { 154 | ADD_SETTING("orbwalker", "enabled", true); 155 | ADD_SETTING_RANGE("orbwalker", "clickdelay", 0.05f, 0.03f, 1.0f); 156 | ADD_SETTING("orbwalker", "random action delay", true); 157 | ADD_SETTING_RANGE("orbwalker", "windupbuffer", 0.03f, 0.01f, 0.2f); 158 | ADD_SETTING_RANGE("orbwalker", "attack before can attack", 0.01f, 0.0f, 0.2f); 159 | } 160 | 161 | void Update() 162 | { 163 | CheckActiveAttack(); 164 | 165 | if (StopOrbwalk()) return; 166 | 167 | if (globals::scripts::orbwalker::orbwalkState && IsReloading()) 168 | { 169 | actions::Idle(); 170 | return; 171 | } 172 | 173 | switch (globals::scripts::orbwalker::orbwalkState) 174 | { 175 | case OrbwalkState::Attack: 176 | states::Attack(); 177 | break; 178 | } 179 | } 180 | } 181 | 182 | namespace cooldowns 183 | { 184 | void Init() 185 | { 186 | ADD_SETTING("cooldowns", "enabled", true); 187 | } 188 | } 189 | 190 | namespace recalls 191 | { 192 | using namespace globals::scripts::recalls; 193 | 194 | void RemoveRecall(int index) 195 | { 196 | recallList.erase(recallList.begin() + index); 197 | } 198 | 199 | int GetRecallListIndex(Object* obj) 200 | { 201 | for (int i = 0; i < recallList.size(); i++) 202 | { 203 | if (recallList[i].name == obj->GetName()) return i; 204 | } 205 | return 999; 206 | } 207 | 208 | void Init() 209 | { 210 | ADD_SETTING("recalls", "enabled", true); 211 | } 212 | 213 | void Update() 214 | { 215 | for (int i = 0; i < recallList.size(); i++) 216 | { 217 | RecallInfo recallInfo = recallList[i]; 218 | switch (recallInfo.state) 219 | { 220 | case RecallState::Recalling: 221 | if (gameTime > recallInfo.startTime + 8.0f - timeBuffer) 222 | { 223 | recallList[i].state = RecallState::RecallingFinished; 224 | } 225 | break; 226 | case RecallState::Teleporting: 227 | if (gameTime > recallInfo.startTime + 4.0f - timeBuffer) recallList[i].state = RecallState::TeleportingFinished; 228 | break; 229 | case RecallState::RecallingFinished: 230 | if (gameTime > recallInfo.startTime + 11.0f) RemoveRecall(i); 231 | break; 232 | case RecallState::TeleportingFinished: 233 | if (gameTime > recallInfo.startTime + 7.0f) RemoveRecall(i); 234 | break; 235 | } 236 | } 237 | 238 | for (int i = 0; i < globals::heroManager->GetListSize(); i++) 239 | { 240 | Object* obj = globals::heroManager->GetIndex(i); 241 | if (!IsValidPtr(obj)) continue; 242 | if (!obj->IsEnemy()) continue; 243 | int state = obj->GetRecallState(); 244 | int recallIndex = GetRecallListIndex(obj); 245 | bool isInList = recallIndex != 999; 246 | if (!isInList && (state == 6 || state == 8)) 247 | { 248 | recallList.push_back(RecallInfo((state == 6) ? RecallState::Recalling : RecallState::Teleporting, obj->GetName(), gameTime)); 249 | continue; 250 | } 251 | if (isInList && (state != 6 && state != 8) && 252 | (recallList[recallIndex].state != RecallState::RecallingFinished && recallList[recallIndex].state != RecallState::TeleportingFinished)) 253 | { 254 | RemoveRecall(recallIndex); 255 | continue; 256 | } 257 | } 258 | } 259 | } 260 | 261 | namespace skinchanger 262 | { 263 | float lastSkinUpdateTime = 0.0f; 264 | 265 | void Init() 266 | { 267 | ADD_SETTING("skinchanger", "skin id", 0); 268 | } 269 | 270 | void Update() 271 | { 272 | int skinId = SETTINGS_INT("skinchanger", "skin id"); 273 | if (skinId > 0 && 274 | globals::localPlayer->GetCharacterDataStack()->base_skin.skin != skinId && 275 | gameTime > lastSkinUpdateTime + 1.0f) 276 | { 277 | globals::localPlayer->ChangeSkin(skinId); 278 | lastSkinUpdateTime = gameTime; 279 | } 280 | } 281 | } 282 | 283 | namespace debug 284 | { 285 | void Init() 286 | { 287 | ADD_SETTING("debug", "draw object data", false); 288 | ADD_SETTING("debug", "draw bounding radius", false); 289 | ADD_SETTING("debug", "draw cursor world", false); 290 | ADD_SETTING("debug", "draw player paths", false); 291 | } 292 | } 293 | 294 | namespace champions 295 | { 296 | static ChampionModule* activeChampModule = nullptr; 297 | 298 | void Init() 299 | { 300 | activeChampModule = ChampionModuleManager::GetModule(globals::localPlayer->GetName()); 301 | if (!activeChampModule) return; 302 | 303 | activeChampModule->Init(); 304 | } 305 | 306 | void Update() 307 | { 308 | if (!activeChampModule) return; 309 | 310 | activeChampModule->Update(); 311 | 312 | switch (globals::scripts::orbwalker::orbwalkState) 313 | { 314 | case OrbwalkState::Attack: 315 | activeChampModule->Attack(); 316 | break; 317 | } 318 | } 319 | 320 | void RenderUpdate() 321 | { 322 | if (!activeChampModule) return; 323 | 324 | activeChampModule->Render(); 325 | } 326 | } 327 | } -------------------------------------------------------------------------------- /leagueoflegends/render/render.cpp: -------------------------------------------------------------------------------- 1 | #include "../stdafx.h" 2 | 3 | namespace render 4 | { 5 | ImFont* imFont = NULL; 6 | 7 | void Init() 8 | { 9 | ImGuiIO& io = ImGui::GetIO(); 10 | 11 | io.Fonts->AddFontDefault(); 12 | imFont = io.Fonts->AddFontDefault(); 13 | } 14 | 15 | void Update() 16 | { 17 | ImGuiIO& io = ImGui::GetIO(); 18 | 19 | ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f); 20 | ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 0.0f, 0.0f }); 21 | ImGui::PushStyleColor(ImGuiCol_WindowBg, { 0.0f, 0.0f, 0.0f, 0.0f }); 22 | ImGui::Begin(SP_STRING("transparentwindow"), nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs); 23 | 24 | ImGui::SetWindowPos(ImVec2(0, 0), ImGuiCond_Always); 25 | ImGui::SetWindowSize(ImVec2(io.DisplaySize.x, io.DisplaySize.y), ImGuiCond_Always); 26 | 27 | scriptsrender::Update(); 28 | 29 | ImGuiWindow* window = ImGui::GetCurrentWindow(); 30 | window->DrawList->PushClipRectFullScreen(); 31 | 32 | ImGui::End(); 33 | ImGui::PopStyleColor(); 34 | ImGui::PopStyleVar(2); 35 | } 36 | 37 | namespace scriptsrender 38 | { 39 | void Update() 40 | { 41 | scripts::champions::RenderUpdate(); 42 | if (SETTINGS_BOOL("cooldowns", "enabled")) cooldowns::Update(); 43 | if (SETTINGS_BOOL("recalls", "enabled")) recalls::Update(); 44 | debug::Update(); 45 | } 46 | 47 | namespace cooldowns 48 | { 49 | float width = 128.0f; 50 | float height = 8.0f; 51 | float cdWidth = 20.0f; 52 | float cdHeight = 6.0f; 53 | 54 | float yOffset = 0.0f; 55 | float xOffset = -width / 2.0f + 8.0f; 56 | 57 | void DrawCooldownBar(Object* obj) 58 | { 59 | Vector2 screenPos = functions::GetHpBarPosition(obj); 60 | 61 | Vector2 basePos = Vector2(screenPos.x + xOffset, screenPos.y + yOffset); 62 | 63 | Vector2 innerBorderAngle1 = Vector2(basePos.x, basePos.y); 64 | Vector2 innerBorderAngle2 = Vector2(innerBorderAngle1.x + width - 1.0f, innerBorderAngle1.y + height - 1.0f); 65 | 66 | Vector2 middleBorderAngle1 = Vector2(innerBorderAngle1.x - 1, innerBorderAngle1.y - 1); 67 | Vector2 middleBorderAngle2 = Vector2(innerBorderAngle2.x + 1, innerBorderAngle2.y + 1); 68 | 69 | Vector2 outerBorderAngle1 = Vector2(middleBorderAngle1.x - 1, middleBorderAngle1.y - 1); 70 | Vector2 outerBorderAngle2 = Vector2(middleBorderAngle2.x + 1, middleBorderAngle2.y + 1); 71 | 72 | RenderRectFilled(outerBorderAngle1.ToImVec(), outerBorderAngle2.ToImVec(), COLOR_DARK_TRANSPARENT, 0.0f, 0); 73 | RenderRectFilled(middleBorderAngle1.ToImVec(), middleBorderAngle2.ToImVec(), COLOR_GRAY, 0.0f, 0); 74 | RenderRectFilled(innerBorderAngle1.ToImVec(), innerBorderAngle2.ToImVec(), COLOR_DARK, 0.0f, 0); 75 | 76 | for (int i = 0; i < 6; i++) { 77 | Vector2 spellAngle1 = Vector2(innerBorderAngle1.x + i * (cdWidth + 1.0f) + 1.0f, innerBorderAngle1.y + 1.0f); 78 | Vector2 spellAngle2 = Vector2(innerBorderAngle1.x + (i + 1) * (cdWidth + 1.0f), innerBorderAngle1.y + cdHeight); 79 | 80 | Spell* spell = obj->GetSpellBySlotId(i); 81 | float relativeCooldown = spell->GetRelativeCooldown(); 82 | 83 | spellAngle2.x -= relativeCooldown * cdWidth; 84 | 85 | uint32_t color = relativeCooldown == 0.0f ? COLOR_LIGHT_GREEN : COLOR_ORANGE; 86 | RenderRectFilled(spellAngle1.ToImVec(), spellAngle2.ToImVec(), color, 0.0f, 0); 87 | } 88 | } 89 | 90 | void Update() 91 | { 92 | for (auto obj : *globals::heroManager) 93 | { 94 | if (obj->IsAlive() && obj->IsVisible()) DrawCooldownBar(obj); 95 | } 96 | } 97 | } 98 | 99 | namespace recalls 100 | { 101 | using namespace globals::scripts::recalls; 102 | 103 | float width = 416.0f; 104 | float height = 12.0f; 105 | 106 | float yOffset = 275.0f; 107 | 108 | float nameSize = 18.0f; 109 | 110 | Vector2 topLeft; 111 | Vector2 bottomRight; 112 | 113 | void DrawRecallFrame() 114 | { 115 | RenderRect(topLeft.ToImVec(), bottomRight.ToImVec(), COLOR_WHITE, 0.0f, NULL, 2.0f); 116 | } 117 | 118 | void DrawRecall(float relativePositionOffset, std::string name, uint32_t color, bool teleport) 119 | { 120 | Vector2 bottomPos = Vector2(topLeft.x + width * relativePositionOffset, bottomRight.y); 121 | Vector2 topPos = Vector2(bottomPos.x, bottomPos.y - height); 122 | Vector2 namePos = Vector2(topPos.x, topPos.y - nameSize * 2 - 5.0f); 123 | Vector2 teleportPos = Vector2(namePos.x, namePos.y - nameSize - 1.0f); 124 | 125 | RenderLine(topPos.ToImVec(), bottomPos.ToImVec(), color, 2.0f); 126 | RenderText(name, namePos.ToImVec(), nameSize, color, true); 127 | if (teleport) RenderText(SP_STRING("TP"), teleportPos.ToImVec(), nameSize, color, true); 128 | } 129 | 130 | void Update() 131 | { 132 | float gameTime = functions::GetGameTime(); 133 | 134 | float screenXCenter = globals::windowWidth / 2.0f; 135 | topLeft = Vector2(screenXCenter - width / 2.0f, globals::windowHeight - yOffset - height); 136 | bottomRight = Vector2(screenXCenter + width / 2.0f, globals::windowHeight - yOffset); 137 | 138 | if (recallList.size()) DrawRecallFrame(); 139 | 140 | for (RecallInfo recallInfo : recallList) 141 | { 142 | float maxRecallTime = (recallInfo.state == RecallState::Recalling || recallInfo.state == RecallState::RecallingFinished) ? 8.0f : 4.0f; 143 | maxRecallTime -= timeBuffer; 144 | float relativePositionOffset = max(0.0f, 1.0f - ((gameTime - recallInfo.startTime) / maxRecallTime)); 145 | uint32_t recallColor = (recallInfo.state == RecallState::Recalling || recallInfo.state == RecallState::Teleporting) ? COLOR_WHITE : COLOR_RED; 146 | bool teleporting = (recallInfo.state == RecallState::Teleporting || recallInfo.state == RecallState::TeleportingFinished) ? true : false; 147 | DrawRecall(relativePositionOffset, recallInfo.name, recallColor, teleporting); 148 | } 149 | } 150 | } 151 | 152 | namespace debug 153 | { 154 | void DrawData(Object* obj, int index) 155 | { 156 | Vector2 screenPos = functions::WorldToScreen(obj->GetPosition()); 157 | if (!IsOnScreen(screenPos)) return; 158 | 159 | RenderText(obj->GetName(), (screenPos - Vector2(0.0f, 22.0f)).ToImVec(), 18.0f, COLOR_WHITE, true); 160 | RenderText(SP_STRING("List id: ") + std::to_string(index), screenPos.ToImVec(), 18.0f, COLOR_WHITE, true); 161 | } 162 | 163 | void DrawObjectData() 164 | { 165 | for (int i = 0; i < globals::minionManager->GetListSize(); i++) 166 | { 167 | auto obj = globals::minionManager->GetIndex(i); 168 | if (obj->IsAlive() && obj->IsVisible()) 169 | DrawData(obj, i); 170 | } 171 | 172 | for (int i = 0; i < globals::heroManager->GetListSize(); i++) 173 | { 174 | auto obj = globals::heroManager->GetIndex(i); 175 | if (obj->IsAlive() && obj->IsVisible()) 176 | DrawData(obj, i); 177 | } 178 | } 179 | 180 | void DrawBoundingRadius(Object* obj) 181 | { 182 | Vector2 screenPos = functions::WorldToScreen(obj->GetPosition()); 183 | if (!IsOnScreen(screenPos)) return; 184 | RenderCircleWorld(obj->GetPosition(), 20, obj->GetBoundingRadius(), COLOR_WHITE, 1.0f); 185 | } 186 | 187 | void DrawObjectBoundingRadius() 188 | { 189 | auto pool = globals::minionManager; 190 | for (int i = 0; i < 2; ++i) 191 | { 192 | for (int i = 0; i < pool->GetListSize(); i++) 193 | { 194 | auto obj = pool->GetIndex(i); 195 | if (obj->IsAlive() && obj->IsVisible()) 196 | DrawBoundingRadius(obj); 197 | } 198 | pool = globals::heroManager; 199 | } 200 | } 201 | 202 | void DrawCursorWorld() 203 | { 204 | if (!IsOnScreen(functions::GetMousePos())) return; 205 | 206 | Vector3 mouseWorldPos = functions::GetMouseWorldPos(); 207 | Vector2 mouseWorldScreenPos = functions::WorldToScreen(mouseWorldPos); 208 | 209 | if (functions::IsWall(mouseWorldPos)) 210 | RenderText(SP_STRING("wall"), (mouseWorldScreenPos - Vector2(0.0f, 58.0f)).ToImVec(), 18.0f, COLOR_WHITE, true); 211 | if (functions::IsBrush(mouseWorldPos)) 212 | RenderText(SP_STRING("grass"), (mouseWorldScreenPos - Vector2(0.0f, 58.0f)).ToImVec(), 18.0f, COLOR_WHITE, true); 213 | 214 | RenderCircleWorld(mouseWorldPos, 12, 30.0f, COLOR_WHITE, 2.0f); 215 | } 216 | 217 | void DrawPlayerPaths() 218 | { 219 | for (int i = 0; i < globals::heroManager->GetListSize(); i++) 220 | { 221 | auto obj = globals::heroManager->GetIndex(i); 222 | if (obj->IsAlive() && obj->IsVisible()) 223 | { 224 | auto path = obj->GetAiManager()->GetFutureSegments(); 225 | int countSegments = (int)path.size(); 226 | if (countSegments) 227 | { 228 | for (int i = -1; i < countSegments - 1; i++) 229 | { 230 | Vector2 screenPos1 = functions::WorldToScreen((i < 0) ? obj->GetPosition() : path[i]); 231 | Vector2 screenPos2 = functions::WorldToScreen(path[i + 1]); 232 | RenderLine(screenPos1.ToImVec(), screenPos2.ToImVec(), COLOR_WHITE, 1.0f); 233 | } 234 | } 235 | } 236 | } 237 | } 238 | 239 | void Update() 240 | { 241 | if (SETTINGS_BOOL("debug", "draw object data")) DrawObjectData(); 242 | if (SETTINGS_BOOL("debug", "draw bounding radius")) DrawObjectBoundingRadius(); 243 | if (SETTINGS_BOOL("debug", "draw cursor world")) DrawCursorWorld(); 244 | if (SETTINGS_BOOL("debug", "draw player paths")) DrawPlayerPaths(); 245 | } 246 | } 247 | } 248 | } -------------------------------------------------------------------------------- /leagueoflegends/imgui/imconfig.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // COMPILE-TIME OPTIONS FOR DEAR IMGUI 3 | // Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure. 4 | // You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions. 5 | //----------------------------------------------------------------------------- 6 | // A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it) 7 | // B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template. 8 | //----------------------------------------------------------------------------- 9 | // You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp 10 | // files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures. 11 | // Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts. 12 | // Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using. 13 | //----------------------------------------------------------------------------- 14 | 15 | #pragma once 16 | 17 | //---- Define assertion handler. Defaults to calling assert(). 18 | // If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement. 19 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) 20 | //#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts 21 | 22 | //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows 23 | // Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility. 24 | // DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions() 25 | // for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details. 26 | //#define IMGUI_API __declspec( dllexport ) 27 | //#define IMGUI_API __declspec( dllimport ) 28 | 29 | //---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names. 30 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS 31 | 32 | //---- Disable all of Dear ImGui or don't implement standard windows. 33 | // It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp. 34 | //#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty. 35 | //#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended. 36 | //#define IMGUI_DISABLE_METRICS_WINDOW // Disable metrics/debugger and other debug tools: ShowMetricsWindow() and ShowStackToolWindow() will be empty. 37 | 38 | //---- Don't implement some functions to reduce linkage requirements. 39 | //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a) 40 | //#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW) 41 | //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a) 42 | //#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime). 43 | //#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default). 44 | //#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf) 45 | //#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself. 46 | //#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies) 47 | //#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function. 48 | //#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions(). 49 | //#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available 50 | 51 | //---- Include imgui_user.h at the end of imgui.h as a convenience 52 | //#define IMGUI_INCLUDE_IMGUI_USER_H 53 | 54 | //---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another) 55 | //#define IMGUI_USE_BGRA_PACKED_COLOR 56 | 57 | //---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...) 58 | //#define IMGUI_USE_WCHAR32 59 | 60 | //---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version 61 | // By default the embedded implementations are declared static and not available outside of Dear ImGui sources files. 62 | //#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" 63 | //#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" 64 | //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION 65 | //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION 66 | 67 | //---- Use stb_printf's faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined) 68 | // Requires 'stb_sprintf.h' to be available in the include path. Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by STB sprintf. 69 | // #define IMGUI_USE_STB_SPRINTF 70 | 71 | //---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui) 72 | // Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided). 73 | // On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'. 74 | //#define IMGUI_ENABLE_FREETYPE 75 | 76 | //---- Use stb_truetype to build and rasterize the font atlas (default) 77 | // The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend. 78 | //#define IMGUI_ENABLE_STB_TRUETYPE 79 | 80 | //---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4. 81 | // This will be inlined as part of ImVec2 and ImVec4 class declarations. 82 | /* 83 | #define IM_VEC2_CLASS_EXTRA \ 84 | ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \ 85 | operator MyVec2() const { return MyVec2(x,y); } 86 | 87 | #define IM_VEC4_CLASS_EXTRA \ 88 | ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \ 89 | operator MyVec4() const { return MyVec4(x,y,z,w); } 90 | */ 91 | 92 | //---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices. 93 | // Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices). 94 | // Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer. 95 | // Read about ImGuiBackendFlags_RendererHasVtxOffset for details. 96 | //#define ImDrawIdx unsigned int 97 | 98 | //---- Override ImDrawCallback signature (will need to modify renderer backends accordingly) 99 | //struct ImDrawList; 100 | //struct ImDrawCmd; 101 | //typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data); 102 | //#define ImDrawCallback MyImDrawCallback 103 | 104 | //---- Debug Tools: Macro to break in Debugger 105 | // (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.) 106 | //#define IM_DEBUG_BREAK IM_ASSERT(0) 107 | //#define IM_DEBUG_BREAK __debugbreak() 108 | 109 | //---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(), 110 | // (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.) 111 | // This adds a small runtime cost which is why it is not enabled by default. 112 | //#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX 113 | 114 | //---- Debug Tools: Enable slower asserts 115 | //#define IMGUI_DEBUG_PARANOID 116 | 117 | //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. 118 | /* 119 | namespace ImGui 120 | { 121 | void MyFunction(const char* name, const MyMatrix44& v); 122 | } 123 | */ 124 | 125 | #define IMGUI_DEFINE_MATH_OPERATORS --------------------------------------------------------------------------------