├── .gitattributes ├── .gitignore ├── .gitmodules ├── LeagueAddon.sln ├── LeagueAddon ├── AddonEngine.cpp ├── AddonEngine.h ├── BuffManager.cpp ├── BuffManager.h ├── Debug.cpp ├── Debug.h ├── DirectXHook.h ├── Enums.h ├── Evade │ ├── Evade.cpp │ └── Evade.h ├── EventManager │ ├── EventManager.cpp │ └── EventManager.h ├── Functions.cpp ├── Functions.h ├── Geometry.h ├── Health.cpp ├── Health.h ├── HealthBar.cpp ├── HealthBar.h ├── Helper.cpp ├── Helper.h ├── Hooks │ ├── DirectX.cpp │ ├── DirectX.h │ ├── Hooks.cpp │ ├── Hooks.h │ ├── makesyscall.h │ ├── ultimate_hooks.cpp │ └── ultimate_hooks.h ├── ImGui │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_draw.cpp │ ├── imgui_impl_dx11.cpp │ ├── imgui_impl_dx11.h │ ├── imgui_impl_dx9.cpp │ ├── imgui_impl_dx9.h │ ├── imgui_impl_win32.cpp │ ├── imgui_impl_win32.h │ ├── imgui_internal.h │ ├── imgui_stdlib.cpp │ ├── imgui_stdlib.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ └── imstb_truetype.h ├── Input.cpp ├── Input.h ├── JustEvade │ ├── JustEvade.cpp │ └── JustEvade.h ├── LEngine │ └── Patchables │ │ ├── Offsets.h │ │ └── Structs.h ├── League │ ├── HeroInventory.h │ ├── Item.h │ ├── ItemInfo.h │ ├── SpellBook.h │ ├── SpellData.h │ ├── SpellInfo.h │ └── SpellSlot.h ├── LeagueAddon.vcxproj ├── LeagueAddon.vcxproj.filters ├── Misc.cpp ├── Misc.h ├── ObjectManager.cpp ├── ObjectManager.h ├── Offset.h ├── Render.cpp ├── Render.h ├── Scripts.h ├── Scripts │ ├── Akali.cpp │ ├── Akali.h │ ├── Draven.cpp │ ├── Draven.h │ ├── Garen.cpp │ ├── Garen.h │ ├── OrbWalker.cpp │ ├── OrbWalker.h │ ├── Tristana.cpp │ ├── Tristana.h │ ├── Twitch.cpp │ ├── Twitch.h │ ├── Vayne.cpp │ ├── Vayne.h │ ├── Yasuo.cpp │ └── Yasuo.h ├── Settings.h ├── SkinChanger.cpp ├── SkinChanger.h ├── Structs.h ├── TargetSelector.cpp ├── TargetSelector.h ├── Utils.cpp ├── Utils.h ├── Vector.cpp ├── Vector.h ├── Visual.cpp ├── Visual.h ├── clipper.cpp ├── clipper.hpp ├── dllmain.cpp ├── kiero.cpp ├── kiero.h └── xorstr.h ├── LeagueAddonLoader ├── App.config ├── App.xaml ├── App.xaml.cs ├── LeagueAddonLoader.csproj ├── MainWindow.xaml ├── MainWindow.xaml.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── LeagueAddonResources ├── Images.h ├── LeagueAddonResources.vcxproj ├── LeagueAddonResources.vcxproj.filters ├── Resources.cpp ├── Resources.h ├── dllmain.cpp ├── framework.h ├── pch.cpp └── pch.h ├── LeagueParser ├── App.config ├── LeagueParser.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Nuget personal access tokens and Credentials 210 | nuget.config 211 | 212 | # Microsoft Azure Build Output 213 | csx/ 214 | *.build.csdef 215 | 216 | # Microsoft Azure Emulator 217 | ecf/ 218 | rcf/ 219 | 220 | # Windows Store app package directories and files 221 | AppPackages/ 222 | BundleArtifacts/ 223 | Package.StoreAssociation.xml 224 | _pkginfo.txt 225 | *.appx 226 | *.appxbundle 227 | *.appxupload 228 | 229 | # Visual Studio cache files 230 | # files ending in .cache can be ignored 231 | *.[Cc]ache 232 | # but keep track of directories ending in .cache 233 | !?*.[Cc]ache/ 234 | 235 | # Others 236 | ClientBin/ 237 | ~$* 238 | *~ 239 | *.dbmdl 240 | *.dbproj.schemaview 241 | *.jfm 242 | *.pfx 243 | *.publishsettings 244 | orleans.codegen.cs 245 | 246 | # Including strong name files can present a security risk 247 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 248 | #*.snk 249 | 250 | # Since there are multiple workflows, uncomment next line to ignore bower_components 251 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 252 | #bower_components/ 253 | 254 | # RIA/Silverlight projects 255 | Generated_Code/ 256 | 257 | # Backup & report files from converting an old project file 258 | # to a newer Visual Studio version. Backup files are not needed, 259 | # because we have git ;-) 260 | _UpgradeReport_Files/ 261 | Backup*/ 262 | UpgradeLog*.XML 263 | UpgradeLog*.htm 264 | ServiceFabricBackup/ 265 | *.rptproj.bak 266 | 267 | # SQL Server files 268 | *.mdf 269 | *.ldf 270 | *.ndf 271 | 272 | # Business Intelligence projects 273 | *.rdl.data 274 | *.bim.layout 275 | *.bim_*.settings 276 | *.rptproj.rsuser 277 | *- [Bb]ackup.rdl 278 | *- [Bb]ackup ([0-9]).rdl 279 | *- [Bb]ackup ([0-9][0-9]).rdl 280 | 281 | # Microsoft Fakes 282 | FakesAssemblies/ 283 | 284 | # GhostDoc plugin setting file 285 | *.GhostDoc.xml 286 | 287 | # Node.js Tools for Visual Studio 288 | .ntvs_analysis.dat 289 | node_modules/ 290 | 291 | # Visual Studio 6 build log 292 | *.plg 293 | 294 | # Visual Studio 6 workspace options file 295 | *.opt 296 | 297 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 298 | *.vbw 299 | 300 | # Visual Studio LightSwitch build output 301 | **/*.HTMLClient/GeneratedArtifacts 302 | **/*.DesktopClient/GeneratedArtifacts 303 | **/*.DesktopClient/ModelManifest.xml 304 | **/*.Server/GeneratedArtifacts 305 | **/*.Server/ModelManifest.xml 306 | _Pvt_Extensions 307 | 308 | # Paket dependency manager 309 | .paket/paket.exe 310 | paket-files/ 311 | 312 | # FAKE - F# Make 313 | .fake/ 314 | 315 | # CodeRush personal settings 316 | .cr/personal 317 | 318 | # Python Tools for Visual Studio (PTVS) 319 | __pycache__/ 320 | *.pyc 321 | 322 | # Cake - Uncomment if you are using it 323 | # tools/** 324 | # !tools/packages.config 325 | 326 | # Tabs Studio 327 | *.tss 328 | 329 | # Telerik's JustMock configuration file 330 | *.jmconfig 331 | 332 | # BizTalk build output 333 | *.btp.cs 334 | *.btm.cs 335 | *.odx.cs 336 | *.xsd.cs 337 | 338 | # OpenCover UI analysis results 339 | OpenCover/ 340 | 341 | # Azure Stream Analytics local run output 342 | ASALocalRun/ 343 | 344 | # MSBuild Binary and Structured Log 345 | *.binlog 346 | 347 | # NVidia Nsight GPU debugger configuration file 348 | *.nvuser 349 | 350 | # MFractors (Xamarin productivity tool) working folder 351 | .mfractor/ 352 | 353 | # Local History for Visual Studio 354 | .localhistory/ 355 | 356 | # BeatPulse healthcheck temp database 357 | healthchecksdb 358 | 359 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 360 | MigrationBackup/ 361 | 362 | # Ionide (cross platform F# VS Code tools) working folder 363 | .ionide/ 364 | 365 | # Fody - auto-generated XML schema 366 | FodyWeavers.xsd 367 | 368 | # VS Code files for those working on multiple tools 369 | .vscode/* 370 | !.vscode/settings.json 371 | !.vscode/tasks.json 372 | !.vscode/launch.json 373 | !.vscode/extensions.json 374 | *.code-workspace 375 | 376 | # Local History for Visual Studio Code 377 | .history/ 378 | 379 | # Windows Installer files from build outputs 380 | *.cab 381 | *.msi 382 | *.msix 383 | *.msm 384 | *.msp 385 | 386 | # JetBrains Rider 387 | .idea/ 388 | *.sln.iml 389 | vcpkg/ 390 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/zydis"] 2 | path = deps/zydis 3 | url = http://github.com/zyantific/zydis.git 4 | -------------------------------------------------------------------------------- /LeagueAddon.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32519.111 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LeagueAddon", "LeagueAddon\LeagueAddon.vcxproj", "{0FAAFD3D-40F9-49EC-974F-87E12657B1C5}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LeagueParser", "LeagueParser\LeagueParser.csproj", "{D90484B1-4E5F-4E93-B58A-A9A2C7415C69}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LeagueAddonResources", "LeagueAddonResources\LeagueAddonResources.vcxproj", "{0F1686AC-EE4B-44B0-8827-8DD333F13801}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LeagueAddonLoader", "LeagueAddonLoader\LeagueAddonLoader.csproj", "{A6EF0DE8-30E6-40D7-B668-542555C79864}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug|x64 = Debug|x64 18 | Debug|x86 = Debug|x86 19 | Release|Any CPU = Release|Any CPU 20 | Release|x64 = Release|x64 21 | Release|x86 = Release|x86 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Debug|Any CPU.ActiveCfg = Debug|x64 25 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Debug|Any CPU.Build.0 = Debug|x64 26 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Debug|x64.ActiveCfg = Debug|x64 27 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Debug|x64.Build.0 = Debug|x64 28 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Debug|x86.ActiveCfg = Debug|Win32 29 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Debug|x86.Build.0 = Debug|Win32 30 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Release|Any CPU.ActiveCfg = Release|x64 31 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Release|Any CPU.Build.0 = Release|x64 32 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Release|x64.ActiveCfg = Release|x64 33 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Release|x64.Build.0 = Release|x64 34 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Release|x86.ActiveCfg = Release|Win32 35 | {0FAAFD3D-40F9-49EC-974F-87E12657B1C5}.Release|x86.Build.0 = Release|Win32 36 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Debug|x64.ActiveCfg = Debug|Any CPU 39 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Debug|x64.Build.0 = Debug|Any CPU 40 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Debug|x86.ActiveCfg = Debug|Any CPU 41 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Debug|x86.Build.0 = Debug|Any CPU 42 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Release|x64.ActiveCfg = Release|Any CPU 45 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Release|x64.Build.0 = Release|Any CPU 46 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Release|x86.ActiveCfg = Release|Any CPU 47 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69}.Release|x86.Build.0 = Release|Any CPU 48 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Debug|Any CPU.ActiveCfg = Debug|x64 49 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Debug|Any CPU.Build.0 = Debug|x64 50 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Debug|x64.ActiveCfg = Debug|x64 51 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Debug|x64.Build.0 = Debug|x64 52 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Debug|x86.ActiveCfg = Debug|Win32 53 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Debug|x86.Build.0 = Debug|Win32 54 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Release|Any CPU.ActiveCfg = Release|x64 55 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Release|Any CPU.Build.0 = Release|x64 56 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Release|x64.ActiveCfg = Release|x64 57 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Release|x64.Build.0 = Release|x64 58 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Release|x86.ActiveCfg = Release|Win32 59 | {0F1686AC-EE4B-44B0-8827-8DD333F13801}.Release|x86.Build.0 = Release|Win32 60 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 61 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Debug|Any CPU.Build.0 = Debug|Any CPU 62 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Debug|x64.ActiveCfg = Debug|Any CPU 63 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Debug|x64.Build.0 = Debug|Any CPU 64 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Debug|x86.ActiveCfg = Debug|Any CPU 65 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Debug|x86.Build.0 = Debug|Any CPU 66 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Release|Any CPU.ActiveCfg = Release|Any CPU 67 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Release|Any CPU.Build.0 = Release|Any CPU 68 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Release|x64.ActiveCfg = Release|Any CPU 69 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Release|x64.Build.0 = Release|Any CPU 70 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Release|x86.ActiveCfg = Release|Any CPU 71 | {A6EF0DE8-30E6-40D7-B668-542555C79864}.Release|x86.Build.0 = Release|Any CPU 72 | EndGlobalSection 73 | GlobalSection(SolutionProperties) = preSolution 74 | HideSolutionNode = FALSE 75 | EndGlobalSection 76 | GlobalSection(ExtensibilityGlobals) = postSolution 77 | SolutionGuid = {B46BF9F3-70DC-4062-A005-B328CBF0B047} 78 | EndGlobalSection 79 | EndGlobal 80 | -------------------------------------------------------------------------------- /LeagueAddon/AddonEngine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Render.h" 3 | #include "Utils.h" 4 | #include "EventManager/EventManager.h" 5 | #include "Render.h" 6 | #include "ObjectManager.h" 7 | #include "Functions.h" 8 | #include "Scripts.h" 9 | #include "TargetSelector.h" 10 | #include "Hooks/Hooks.h" 11 | #include "psapi.h" 12 | #include 13 | #include "winternl.h" 14 | #include "Evade/Evade.h" 15 | #include "JustEvade/JustEvade.h" 16 | #include "Visual.h" 17 | #include "Debug.h" 18 | #include "SkinChanger.h" 19 | #include "Misc.h" 20 | 21 | namespace AddonEngine { 22 | bool Initialize(); 23 | void Uninitialize(); 24 | } -------------------------------------------------------------------------------- /LeagueAddon/BuffManager.cpp: -------------------------------------------------------------------------------- 1 | #include "BuffManager.h" 2 | //#include 3 | //#include 4 | 5 | ULONG BuffScript::buffHash() 6 | { 7 | return *reinterpret_cast(reinterpret_cast(this + static_cast(Offset::BuffManager::BuffHash))); 8 | } 9 | 10 | std::string BuffEntry::name() 11 | { 12 | //DWORD aux = *(DWORD*)((int)this + Offset::BuffManager::BuffName); 13 | //if (aux == NULL) 14 | // return "invalidBuff"; 15 | //if (*(DWORD*)(aux + Offset::BuffManager::BuffName2) == NULL) 16 | // return "invalidBuff"; 17 | //return (char*)(aux + Offset::BuffManager::BuffName2); 18 | 19 | const ULONG pBuffScript = *reinterpret_cast(reinterpret_cast(this) + 0x8); 20 | if (!(pBuffScript > 0x1000)) 21 | return xorstr("invalidBuff"); 22 | auto name = reinterpret_cast(pBuffScript + static_cast(Offset::BuffManager::BuffName2)); 23 | return std::string(name); 24 | } 25 | 26 | int BuffEntry::stacksAlt() 27 | { 28 | return *(int*)(reinterpret_cast(this) + static_cast(Offset::BuffManager::BuffCountAlt)); 29 | //return (*reinterpret_cast(reinterpret_cast(this) + static_cast(Offset::BuffManager::BuffCountAlt2)) - *reinterpret_cast(reinterpret_cast(this) + static_cast(Offset::BuffManager::BuffCountAlt))) >> 3; 30 | } 31 | 32 | int BuffEntry::getCount() 33 | { 34 | return *(int*)(reinterpret_cast(this) + static_cast(Offset::BuffManager::BuffCount)); 35 | } 36 | 37 | bool BuffManager::hasBuff(std::string name) 38 | { 39 | for (auto b : this->entries()) { 40 | if (b->name() == name) { 41 | return true; 42 | } 43 | } 44 | return false; 45 | } 46 | 47 | BuffEntry* BuffManager::getBuff(std::string name) 48 | { 49 | for (auto buff : this->entries()) { 50 | if (buff->name() == name) 51 | return buff; 52 | } 53 | return nullptr; 54 | } 55 | 56 | bool BuffManager::buffStrainer(BuffEntry* buff) 57 | { 58 | if (!buff || static_cast(buff->type) == -1) 59 | return false; 60 | if (reinterpret_cast(buff) == 0 || !(reinterpret_cast(buff) > 0x1000)) 61 | return false; 62 | if ((int)(*(float*)(DEFINE_RVA(Offset::Data::GameTime))) > buff->endTime) 63 | return false; 64 | if (strcmp(buff->name().c_str(), xorstr("invalidBuff")) == 0 || buff->stacksAlt() == 0) 65 | return false; 66 | return true; 67 | } 68 | 69 | std::vector BuffManager::entries() 70 | { 71 | std::vector buffs = *reinterpret_cast*>(this + static_cast(Offset::BuffManager::ArrayStart)); 72 | return filterVector(buffs, buffStrainer); 73 | } -------------------------------------------------------------------------------- /LeagueAddon/BuffManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "xorstr.h" 3 | #include "Offset.h" 4 | #include "Utils.h" 5 | 6 | enum class BuffType { 7 | Internal = 0, 8 | Aura = 1, 9 | CombatEnchancer = 2, 10 | CombatDehancer = 3, 11 | SpellShield = 4, 12 | Stun = 5, 13 | Invisibility = 6, 14 | Silence = 7, 15 | Taunt = 8, 16 | Berserk = 9, 17 | Polymorph = 10, 18 | Slow = 11, 19 | Snare = 12, 20 | Damage = 13, 21 | Heal = 14, 22 | Haste = 15, 23 | SpellImmunity = 16, 24 | PhysicalImmunity = 17, 25 | Invulnerability = 18, 26 | AttackSpeedSlow = 19, 27 | NearSight = 20, 28 | Fear = 22, 29 | Charm = 23, 30 | Poison = 24, 31 | Suppression = 25, 32 | Blind = 26, 33 | Counter = 27, 34 | Currency = 21, 35 | Shred = 28, 36 | Flee = 29, 37 | Knockup = 30, 38 | Knockback = 31, 39 | Disarm = 32, 40 | Grounded = 33, 41 | Drowsy = 34, 42 | Asleep = 35, 43 | Obscured = 36, 44 | ClickProofToEnemies = 37, 45 | Unkillable = 38 46 | }; 47 | 48 | class BuffScript 49 | { 50 | public: 51 | ULONG buffHash(); 52 | }; 53 | 54 | class BuffEntry { 55 | public: 56 | union 57 | { 58 | DEFINE_MEMBER_N(BuffScript* buffScript, Offset::BuffManager::BuffScript) 59 | DEFINE_MEMBER_N(BuffType type, Offset::BuffManager::BuffType) 60 | DEFINE_MEMBER_N(float startTime, Offset::BuffManager::StartTime) 61 | DEFINE_MEMBER_N(float endTime, Offset::BuffManager::EndTime) 62 | DEFINE_MEMBER_N(int count, Offset::BuffManager::BuffCount) 63 | DEFINE_MEMBER_N(int countAlt, Offset::BuffManager::BuffCountAlt) 64 | DEFINE_MEMBER_N(int countAlt2, Offset::BuffManager::BuffCountAlt2) 65 | }; 66 | std::string name(); 67 | int stacksAlt(); 68 | int getCount(); 69 | }; 70 | 71 | class BuffManager { 72 | public: 73 | std::vector entries(); 74 | bool hasBuff(std::string name); 75 | BuffEntry* getBuff(std::string name); 76 | private: 77 | static bool buffStrainer(BuffEntry* buff); 78 | }; -------------------------------------------------------------------------------- /LeagueAddon/Debug.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ObjectManager.h" 3 | #include "Utils.h" 4 | #include "ImGui/ImGui.h" 5 | #include "EventManager/EventManager.h" 6 | #include "Functions.h" 7 | #include "Scripts.h" 8 | #include "SkinChanger.h" 9 | #include "Visual.h" 10 | #include "JustEvade/JustEvade.h" 11 | 12 | namespace Debug { 13 | inline clock_t drawStartTime = 0; 14 | inline clock_t drawEndTime = 0; 15 | 16 | inline clock_t avarageDrawTime = 0; 17 | 18 | inline bool Enabled = false; 19 | 20 | 21 | inline bool drawSpellDirection = false; 22 | inline bool drawObjectInfo = false; 23 | inline bool drawObjectInfoBuffs = false; 24 | 25 | inline std::vector detectedSpells; 26 | inline std::vector detectedSpellsPtr; 27 | 28 | void Initialize(); 29 | void OnDraw(); 30 | void OnMenu(); 31 | void OnProcessSpell(void* spellBook, SpellInfo* castInfo); 32 | } -------------------------------------------------------------------------------- /LeagueAddon/DirectXHook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /LeagueAddon/Enums.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Vector.h" 3 | 4 | namespace GameLocation { 5 | inline const Vector3 RadiantBase = Vector3(394, 182, 462); 6 | inline const Vector3 DireBase = Vector3(14340, 172, 14390); 7 | 8 | //inline const Vector3 RadiantBaseARAM = Vector3(); 9 | //inline const Vector3 DireBaseARAM = Vector3(); 10 | } 11 | 12 | enum class kSpellSlot 13 | { 14 | SpellSlot_Unknown = -1, 15 | SpellSlot_Q, 16 | SpellSlot_W, 17 | SpellSlot_E, 18 | SpellSlot_R, 19 | SpellSlot_Summoner1, 20 | SpellSlot_Summoner2, 21 | SpellSlot_Item1, 22 | SpellSlot_Item2, 23 | SpellSlot_Item3, 24 | SpellSlot_Item4, 25 | SpellSlot_Item5, 26 | SpellSlot_Item6, 27 | SpellSlot_Trinket, 28 | SpellSlot_Recall, 29 | SpellSlot_SpecialAttack = 45, 30 | SpellSlot_BasicAttack1 = 64, 31 | SpellSlot_BasicAttack2 = 65, 32 | }; 33 | 34 | enum class CombatType 35 | { 36 | Any, 37 | Melee, 38 | Ranged 39 | }; 40 | 41 | enum class DamageType 42 | { 43 | Physical = 0, 44 | Magical = 1, 45 | True = 2, 46 | }; 47 | 48 | enum class TargetingMode 49 | { 50 | AutoPriority, 51 | 52 | LowHP, 53 | 54 | LowEfficientHP, 55 | 56 | MostAD, 57 | 58 | MostAP, 59 | 60 | Closest, 61 | 62 | NearMouse, 63 | 64 | LessAttack, 65 | 66 | LessCast, 67 | 68 | MostStack 69 | }; 70 | 71 | enum class PrintChatType { 72 | WithTime = 0xFFFFFFFF, 73 | WithoutTime = 0 74 | }; 75 | 76 | enum class kRecallState 77 | { 78 | None = 0, 79 | Odin_Recall = 6, 80 | Super_Recall = 11, 81 | Teleporting = 16, 82 | Stand_United = 19, 83 | Yuumi_W_Ally = 10 84 | }; 85 | 86 | enum class IsNotWallFlags { 87 | Ground = 0x0, 88 | Ground2 = 0x800000, 89 | wall = 0x20000, 90 | Wall2 = 0x820000, 91 | Bush = 0x10000, 92 | Bush2 = 0x810000, 93 | Structure = 0x460000 94 | }; 95 | 96 | static const char* WardTypeName[] = { "YellowTrinket", "BlueTrinket", "JammerDevice", "ShacoBox", "TeemoShroom", "NidaliTrap", "CaytlinTrap", "JinxTrap", "JhinTrap", "MaokaiTrap"}; 97 | static const char* PingTypeName[] = { "Default", "Attack", "Danger", "Missing", "On my way", "Be careful", "Help", "Warded" }; 98 | 99 | enum class WardType { 100 | Yellow = 0, 101 | Blue = 1, 102 | JammerDevice = 2, 103 | ShacoBox = 3, 104 | TeemoTrap = 4, // no 105 | NidaliTrap = 5, // no 106 | CaytlinTrap = 6, // no 107 | JinxTrap = 7, 108 | JhinTrap = 8, 109 | MaokaiTrap = 9, 110 | }; 111 | 112 | enum class PingType { 113 | Default = 0, 114 | Attack = 1, 115 | Danger = 2, 116 | Missing = 3, 117 | OnMyWay = 4, 118 | BeCareful = 5, 119 | Help = 6, 120 | Warded = 7, 121 | }; -------------------------------------------------------------------------------- /LeagueAddon/EventManager/EventManager.cpp: -------------------------------------------------------------------------------- 1 | #include "EventManager.h" 2 | std::vector EventManager::EventCallbacks[(unsigned int)EventType::Size]; 3 | 4 | void EventManager::AddEventHandler(EventType eventId, void* callback) { 5 | EventCallbacks[(unsigned int)eventId].push_back(callback); 6 | } 7 | 8 | void EventManager::RemoveEventHandler(EventType eventId, void* callback) { 9 | auto& callbacks = EventCallbacks[(unsigned int)eventId]; 10 | for (auto it = callbacks.begin(); it != callbacks.end(); it++) { 11 | if (*it == callback) { 12 | callbacks.erase(it); 13 | break; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /LeagueAddon/EventManager/EventManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | namespace EventManager { 4 | enum class EventType { 5 | OnLoad, 6 | OnUnload, 7 | OnThread, 8 | OnDraw, 9 | OnMenu, 10 | OnProcessSpell, 11 | OnKeyPressed, 12 | OnDeleteObject, 13 | Size 14 | }; 15 | 16 | extern std::vector EventCallbacks[(unsigned int)EventType::Size]; 17 | 18 | void AddEventHandler(EventType eventId, void* callback); 19 | void RemoveEventHandler(EventType eventId, void* callback); 20 | 21 | template 22 | void Trigger(EventType eventId, Args... args) { 23 | for (auto callback : EventCallbacks[(unsigned int)eventId]) { 24 | static_cast(callback)(args...); 25 | } 26 | } 27 | 28 | template 29 | bool TriggerProcess(EventType eventId, Args... args) { 30 | auto process = true; 31 | for (auto callback : EventCallbacks[(unsigned int)eventId]) { 32 | if (!static_cast(callback)(args...)) { 33 | process = false; 34 | } 35 | } 36 | return process; 37 | } 38 | } -------------------------------------------------------------------------------- /LeagueAddon/Functions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "./Structs.h" 3 | #include "Render.h" 4 | #include "Input.h" 5 | #include "Settings.h" 6 | 7 | namespace FuncType { 8 | typedef int* (__thiscall* fnIssueOrder)(GameObject* Object, int Order, Vector3* Position, GameObject* Target, bool IsAttackMove, bool IsMinion, DWORD Unknown); 9 | typedef int* (__thiscall* fnCastSpell)(DWORD* spellbook, DWORD* spelldatainst, int spellslot, Vector3* Origin, Vector3* Target, DWORD networkid); 10 | 11 | typedef int* (__thiscall* fnNewIssueOrder)(GameObject* Object, int Order, Vector3* Position, GameObject* Target, bool IsAttackMove, bool IsMinion, DWORD Unknown); 12 | 13 | typedef float(__cdecl* fnGetAttackCastDelay)(GameObject* pObj); 14 | typedef float(__cdecl* fnGetAttackDelay)(GameObject* pObj); 15 | 16 | /*typedef int* (__thiscall* fnCastSpell)(DWORD spellbook_addr, SpellSlot* spellslot, int SlotID, Vector* targetpos, Vector* startpos, DWORD NetworkID);*/ 17 | typedef void(__thiscall* fnPrintChat)(DWORD ChatClient, const char* Message, int Color); 18 | typedef int(__thiscall* fnGetPing)(char* pObj); 19 | typedef void(__cdecl* fnDrawCircle)(Vector3* position, float range, int* color, int a4, float a5, int a6, float alpha); 20 | typedef bool(__thiscall* WorldToScreen)(DWORD* th, Vector3* vectorIn, Vector3* vectorOut); 21 | typedef int(__cdecl* fnPing)(char* a1, int a2, int a3); 22 | typedef bool(__cdecl* fnIsHero)(GameObject* pObj); 23 | typedef int(__thiscall* fnGetBaseDrawPosition)(GameObject* pObj, Vector3* position); 24 | typedef float(__thiscall* fnGetBoundingRadius)(GameObject* pObj); 25 | 26 | 27 | //typedef bool(__cdecl* fnIsMissile)(GameObject* pObj); 28 | typedef bool(__cdecl* fnIsMinion)(GameObject* pObj); 29 | typedef bool(__cdecl* fnIsTurret)(GameObject* pObj); 30 | //typedef bool(__cdecl* fnIsInhibitor)(GameObject* pObj); 31 | typedef bool(__cdecl* fnIsTroyEnt)(GameObject* pObj); 32 | //typedef bool(__cdecl* fnIsNexus)(GameObject* pObj); 33 | //typedef float(__cdecl* fnGetAttackCastDelay)(GameObject* pObj); 34 | //typedef float(__cdecl* fnGetAttackDelay)(GameObject* pObj); 35 | typedef bool(__thiscall* fnIsAlive)(GameObject* pObj); 36 | //typedef bool(__thiscall* fnIsTargetable)(GameObject* pObj); 37 | //typedef bool(__thiscall* fnGetPing)(GameObject* pObj); 38 | 39 | typedef GameObject* (__thiscall* fnGetFirstObject)(char* objManager); 40 | typedef GameObject* (__thiscall* fnGetNextObject)(char* objManager, GameObject* obj); 41 | }; 42 | 43 | namespace Function { 44 | Vector3* GetMouseWorldPosition(); 45 | bool IsChatOpen(); 46 | Vector3 WorldToScreen(Vector3* in); 47 | bool World2Screen(Vector3* in, Vector3* out); 48 | bool IsAlive(GameObject* object); 49 | float GetBoundingRadius(GameObject* object); 50 | float GetAttackCastDelay(GameObject* object); 51 | float GetAttackDelay(GameObject* object); 52 | SpellData* GetBasicAttack(GameObject* unit); 53 | 54 | bool IsMinion(GameObject* Object); 55 | bool IsTurret(GameObject* Object); 56 | void BlockInput(bool block); 57 | void LockCamera(bool lock); 58 | 59 | void PrintChat(string text, PrintChatType color = PrintChatType::WithTime); 60 | void SendChat(string text, int color = 0xFFFFFF); 61 | 62 | bool IsWall(Vector3* position, unsigned __int16 uk = 0); 63 | bool IsWall(Vector3 position); 64 | 65 | int* IssueOrder(GameObject* Object, int Order, Vector3* Position, GameObject* Target, bool IsAttackMove, bool IsMinion, DWORD Unknown); 66 | void NewCastSpell(int slot, int castType, float x = 1, float y = -1); 67 | int GetBaseDrawPosition(GameObject* Object, Vector3* Position); 68 | bool GetHPBarPosition(GameObject* Object, Vector3* out); 69 | int* CastSpell(DWORD* spellbook, DWORD* spelldatainst, int spellslot, Vector3* Origin, Vector3* Target, DWORD networkid); 70 | void SendPing(Vector3* Pos, int NetworkID, PingType pingType); 71 | Vector2 WorldToMap(const Vector3& pos); 72 | int GetPing(); 73 | float GameTime(); 74 | 75 | float GameTimeTick(); 76 | 77 | 78 | int GetSelected(); 79 | void SetSelected(int IndexID); 80 | 81 | void CharacterDataStack_Push(void* hero, const char* model, std::int32_t skin) noexcept; 82 | 83 | void CharacterDataStack_Update(void* hero, bool change) noexcept; 84 | } -------------------------------------------------------------------------------- /LeagueAddon/Health.cpp: -------------------------------------------------------------------------------- 1 | #include "Health.h" 2 | #include "Functions.h" 3 | #include "ObjectManager.h" 4 | #include "Helper.h" 5 | #include "EventManager/EventManager.h" 6 | 7 | bool HealthPrediction::IsAutoAttack(std::string name) 8 | { 9 | if (ToLower(name).find("attack") != std::string::npos) 10 | return true; 11 | return false; 12 | } 13 | 14 | float HealthPrediction::GetHealthPrediction(GameObject* unit, int time, int delay) 15 | { 16 | float predictedDamage = 0.0f; 17 | 18 | for (auto attack : ActiveAttacks) 19 | { 20 | float attackDamage = 0.0f; 21 | if (attack.second->target->IsInRange(Local, FLT_MAX, false) && attack.second->target->NetworkID == unit->NetworkID) 22 | { 23 | float bonding = max(attack.second->target->GetBoundingRadius(), unit->Position.Distance(attack.second->startPos) - attack.second->source->GetBoundingRadius()); 24 | if (attack.second->source->combat == CombatType::Melee) 25 | bonding = 0; 26 | 27 | float landTime = attack.second->startTick + attack.second->delay + 1000 * bonding / attack.second->projectileSpeed + delay; 28 | 29 | if (landTime < Function::GameTimeTick() + time) 30 | attackDamage = attack.second->damage; 31 | } 32 | predictedDamage += attackDamage; 33 | } 34 | 35 | return unit->Health + (unit->Armor + unit->BonusArmor) - predictedDamage; 36 | } 37 | 38 | float HealthPrediction::LaneClearHealthPrediction(GameObject* unit, int time, int delay) 39 | { 40 | float predictedDamage = 0.0f; 41 | 42 | for (auto attack : ActiveAttacks) 43 | { 44 | int n = 0; 45 | if (Function::GameTimeTick() - 100 <= attack.second->startTick + attack.second->animationTime && attack.second->target->IsInRange(Local, FLT_MAX, false) && attack.second->source->IsInRange(Local, FLT_MAX, false) && attack.second->target->NetworkID == unit->NetworkID) 46 | { 47 | float fromT = attack.second->startTick; 48 | float toT = Function::GameTimeTick() + time; 49 | 50 | while (fromT < toT) 51 | { 52 | if (fromT >= Function::GameTimeTick() && (fromT + attack.second->delay + max(0, unit->Position.Distance(attack.second->source->Position) - attack.second->source->GetBoundingRadius() / 2) / attack.second->projectileSpeed < toT)) 53 | n++; 54 | fromT += (int)attack.second->animationTime; 55 | } 56 | } 57 | predictedDamage += n * attack.second->damage; 58 | 59 | } 60 | 61 | return unit->Health + (unit->Armor + unit->BonusArmor) - predictedDamage; 62 | } 63 | 64 | void HealthPrediction::OnGameUpdate() 65 | { 66 | for (auto pair : ActiveAttacks) 67 | { 68 | if (pair.second->startTick < Function::GameTimeTick() - 3000) 69 | ActiveAttacks.erase(pair.first); 70 | } 71 | } 72 | 73 | void HealthPrediction::OnDraw() 74 | { 75 | OnGameUpdate(); 76 | //console.Print("%d", ActiveAttacks.size()); 77 | } 78 | 79 | 80 | void HealthPrediction::OnProcessSpell(void* spellBook, SpellInfo* castInfo) { 81 | auto caster = ObjectManager::FindObjectByIndex(castInfo->source_id); 82 | if (caster->Team != Local->Team || Helper::isValidUnit(caster, 3000, false) || (!Function::IsMinion(caster) || !Function::IsTurret(caster))) 83 | return; 84 | auto target = ObjectManager::FindObjectByIndex(castInfo->targetIndex()); 85 | 86 | if (!target || target && !Helper::isValidUnit(target)) 87 | return; 88 | 89 | //console.Print("%s", caster->GetChampionName().c_str()); 90 | 91 | ActiveAttacks.erase(caster->NetworkID); 92 | 93 | 94 | 95 | auto data = new PredictedDamage( 96 | caster, 97 | target, 98 | caster->Position, 99 | Function::GameTimeTick() - Function::GetPing() / 2, 100 | Function::GetAttackCastDelay(caster) * 1000, 101 | Function::GetAttackDelay(caster) * 1000 + (Function::IsTurret(caster) ? 70 : 0), 102 | caster->combat == CombatType::Melee ? FLT_MAX : (int)castInfo->BasicAttackSpellData->Resource->MissileSpeed, 103 | caster->BaseAttackDamage + caster->BonusAttackDamage 104 | ); 105 | 106 | ActiveAttacks.insert({ caster->NetworkID, data }); 107 | 108 | } 109 | 110 | void HealthPrediction::Initialize() { 111 | EventManager::AddEventHandler(EventManager::EventType::OnProcessSpell, OnProcessSpell); 112 | EventManager::AddEventHandler(EventManager::EventType::OnDraw, OnDraw); 113 | 114 | EventManager::AddEventHandler(EventManager::EventType::OnLoad, OnLoad); 115 | EventManager::AddEventHandler(EventManager::EventType::OnUnload, OnUnload); 116 | } 117 | 118 | void HealthPrediction::OnLoad() 119 | { 120 | 121 | } 122 | 123 | void HealthPrediction::OnUnload() 124 | { 125 | EventManager::RemoveEventHandler(EventManager::EventType::OnProcessSpell, OnProcessSpell); 126 | EventManager::AddEventHandler(EventManager::EventType::OnDraw, OnDraw); 127 | } -------------------------------------------------------------------------------- /LeagueAddon/Health.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "Structs.h" 5 | 6 | struct PredictedDamage { 7 | 8 | GameObject* source; 9 | GameObject* target; 10 | Vector3 startPos; 11 | int startTick; 12 | float delay; 13 | float animationTime; 14 | int projectileSpeed; 15 | float damage; 16 | 17 | PredictedDamage(GameObject* source, GameObject* target, Vector3 startPos, int startTick, float delay, float animationTime, int projectileSpeed, float damage) 18 | { 19 | this->source = source; 20 | this->target = target; 21 | this->startPos = startPos; 22 | this->startTick = startTick; 23 | this->delay = delay; 24 | this->animationTime = animationTime; 25 | this->projectileSpeed = projectileSpeed; 26 | this->damage = damage; 27 | }; 28 | }; 29 | 30 | namespace HealthPrediction 31 | { 32 | inline std::map ActiveAttacks; 33 | 34 | bool IsAutoAttack(std::string name); 35 | 36 | void OnGameUpdate(); 37 | void OnDraw(); 38 | void OnProcessSpell(void* spellBook, SpellInfo* castInfo); 39 | void Initialize(); 40 | void OnLoad(); 41 | void OnUnload(); 42 | 43 | float GetHealthPrediction(GameObject* unit, int time, int delay = 70); 44 | float LaneClearHealthPrediction(GameObject* unit, int time, int delay = 70); 45 | }; -------------------------------------------------------------------------------- /LeagueAddon/HealthBar.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DecoderCoder/LeagueAddon/34c4fdcb996a756cb04071a2cc2ecbfedf1bec18/LeagueAddon/HealthBar.cpp -------------------------------------------------------------------------------- /LeagueAddon/HealthBar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Render.h" 3 | #include 4 | #include "Utils.h" 5 | 6 | using namespace std; 7 | 8 | enum HealthBarType { 9 | Default = 0, 10 | UnderHero = 1, 11 | }; 12 | 13 | enum HealthBarAreaType { 14 | FromLeft, 15 | FromRight, 16 | Numeric, 17 | Percents, 18 | }; 19 | 20 | class HealthBarArea { 21 | public: 22 | HealthBarArea(ImColor color, HealthBarAreaType healthBarAreaType, float from, float to) { 23 | this->Color = color; 24 | this->Type = healthBarAreaType; 25 | } 26 | 27 | HealthBarArea(ImColor color, HealthBarAreaType healthBarAreaType, float size) { 28 | this->Color = color; 29 | this->Type = healthBarAreaType; 30 | this->Size = size; 31 | } 32 | 33 | HealthBarAreaType Type = HealthBarAreaType::Numeric; 34 | ImColor Color; 35 | float From; // Numeric - 100 | Percents 0.10 or To > 1 then From / 100 = 0.x 36 | float To; // Numeric - 200 | Percents 0.20 or To > 1 then To / 100 = 0.x 37 | float Size; 38 | }; 39 | 40 | class HealthBar { 41 | public: 42 | HealthBar(HealthBarType type, float width = 140, float height = 20) { 43 | this->Type = type; 44 | if (type == HealthBarType::Default) { 45 | 46 | } 47 | else { 48 | this->Width = width; 49 | this->Height = height; 50 | } 51 | } 52 | 53 | void AddLeftArea(float size, ImColor color, HealthBarAreaType healthBarAreaType = HealthBarAreaType::FromLeft) { 54 | HealthBarArea area = HealthBarArea(color, healthBarAreaType, size); 55 | leftAreas.push_back(area); 56 | } 57 | 58 | void AddRightArea(float size, ImColor color, HealthBarAreaType healthBarAreaType = HealthBarAreaType::FromRight) { 59 | HealthBarArea area = HealthBarArea(color, healthBarAreaType, size); 60 | rightAreas.push_back(area); 61 | } 62 | 63 | void AddRightArea(float from, float to, ImColor color, HealthBarAreaType healthBarAreaType = HealthBarAreaType::Numeric) { 64 | if (healthBarAreaType == HealthBarAreaType::Percents) { 65 | if (from > 1) { 66 | from /= 100; 67 | } 68 | if (to > 1) { 69 | to /= 100; 70 | } 71 | } 72 | HealthBarArea area = HealthBarArea(color, healthBarAreaType, from, to); 73 | areas.push_back(area); 74 | } 75 | 76 | void AddArea(float from, float to, ImColor color, HealthBarAreaType healthBarAreaType = HealthBarAreaType::Numeric) { 77 | if (healthBarAreaType == HealthBarAreaType::Percents) { 78 | if (from > 1) { 79 | from /= 100; 80 | } 81 | if (to > 1) { 82 | to /= 100; 83 | } 84 | } 85 | HealthBarArea area = HealthBarArea(color, healthBarAreaType, from, to); 86 | areas.push_back(area); 87 | } 88 | 89 | void Draw(Vector3 pos, float currentHp, float maxHp, bool center = true) { 90 | const float yOffset = 0; 91 | 92 | float drawX; 93 | float drawY; 94 | 95 | Vector3 leftTop; 96 | Vector3 rightTop; 97 | Vector3 leftBottom; 98 | Vector3 rightBottom; 99 | 100 | Vector3 w2sP = Function::WorldToScreen(&pos); 101 | 102 | ; 103 | 104 | /*if (this->Type == HealthBarType::UnderHero_3D) { 105 | Vector3 newPos; 106 | if (center) { 107 | newPos = Vector3(pos.x - this->Width / (1 + w2sP.y / 1920), pos.y, pos.z); 108 | Functions.WorldToScreen(&newPos, &leftTop); 109 | newPos = Vector3(pos.x + this->Width / (1 + w2sP.y / 1920), pos.y, pos.z); 110 | Functions.WorldToScreen(&newPos, &rightTop); 111 | 112 | newPos = Vector3(pos.x - this->Width / (1 + w2sP.y / 1920), pos.y + this->Height * 2, pos.z); 113 | Functions.WorldToScreen(&newPos, &leftBottom); 114 | newPos = Vector3(pos.x + this->Width / (1 + w2sP.y / 1920), pos.y + this->Height * 2, pos.z); 115 | Functions.WorldToScreen(&newPos, &rightBottom); 116 | } 117 | else { 118 | 119 | } 120 | } 121 | else */ 122 | { 123 | Vector3 w2s = Function::WorldToScreen(&pos); 124 | 125 | if (center) { 126 | drawX = w2s.x - this->Width / 2; 127 | // drawY = w2s.y + yOffset; 128 | } 129 | else { 130 | drawX = w2s.x; 131 | //drawY = w2s.y + yOffset; 132 | } 133 | drawY = w2s.y + yOffset; 134 | } 135 | 136 | // TODO: 3D Optimization 137 | 138 | if (drawX > Render::RenderWidth || drawY > Render::RenderHeight) 139 | return; 140 | if (drawX + this->Width < 0 || drawY + this->Height < 0) 141 | return; 142 | 143 | switch (this->Type) { 144 | case HealthBarType::UnderHero: { 145 | Render::Draw_FilledRectangle(drawX, drawY, drawX + this->Width, drawY + this->Height, ImColor::ImColor(0, 0, 0)); 146 | float hpWidth = currentHp / maxHp * this->Width; 147 | 148 | float hpCoof = 1; 149 | if (currentHp > maxHp) 150 | { 151 | hpCoof = this->Width / hpWidth; 152 | hpWidth = this->Width; 153 | } 154 | 155 | Render::Draw_FilledRectangle(drawX, drawY, drawX + hpWidth, drawY + this->Height, this->HpColor); 156 | 157 | //for (auto area : areas) { 158 | // 159 | // Renderer::Draw_FilledRectangle(drawX1, drawY1, drawX1 + hpWidth, drawY1 + this->Height, this->HpColor); 160 | //} 161 | 162 | float rightAreaOffset = 0; 163 | for (auto area : rightAreas) { 164 | float leftX = hpWidth - area.Size / maxHp * this->Width * hpCoof; 165 | leftX -= rightAreaOffset; 166 | if (leftX < 0) 167 | leftX = 0; 168 | float rightX = hpWidth - rightAreaOffset; 169 | if (rightX < 0) 170 | rightX = 0; 171 | rightAreaOffset += rightX - leftX; 172 | /*Renderer::Draw_Text(drawX, drawY + abs(rightAreaOffset), to_string(area.Size) + " - " + to_string(rightAreaOffset));*/ 173 | Render::Draw_FilledRectangle(drawX + leftX, drawY, drawX + rightX, drawY + this->Height, area.Color); 174 | } 175 | 176 | std::sort(leftAreas.begin(), leftAreas.end(), this->sortLeftAreasFunc); // `cause left side is fixed, it need sort from bigest to smallest to display all 177 | 178 | for (auto area : leftAreas) { 179 | float rightX = area.Size / maxHp * this->Width * hpCoof; 180 | if (rightX > hpWidth) 181 | rightX = hpWidth; 182 | Render::Draw_FilledRectangle(drawX, drawY, drawX + rightX, drawY + this->Height, area.Color); 183 | } 184 | 185 | break; 186 | } 187 | } 188 | } 189 | 190 | private: 191 | static bool sortLeftAreasFunc(HealthBarArea area1, HealthBarArea area2) { 192 | return (area1.Size > area2.Size); 193 | } 194 | 195 | std::vector areas; 196 | std::vector leftAreas; 197 | std::vector rightAreas; 198 | HealthBarType Type; 199 | float Width; 200 | float Height; 201 | 202 | ImColor HpColor = ImColor::ImColor(39, 174, 96); 203 | }; -------------------------------------------------------------------------------- /LeagueAddon/Helper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DecoderCoder/LeagueAddon/34c4fdcb996a756cb04071a2cc2ecbfedf1bec18/LeagueAddon/Helper.cpp -------------------------------------------------------------------------------- /LeagueAddon/Helper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Structs.h" 3 | #include "ObjectManager.h" 4 | #include "Functions.h" 5 | 6 | 7 | namespace Helper 8 | { 9 | float calcReducedDamage(float rawDamage, float armor, float penetration = 0, float lethality = 0, bool calc0armor = 0); 10 | float CalcDamage(GameObject* from, GameObject* to, bool isAA, float damage, DamageType damageType); 11 | float CalcAutoAttackDamage(GameObject* from, GameObject* to); 12 | bool isValidUnit(GameObject* unit, float range = FLT_MAX, bool checkTeam = true, Vector3 from = Vector3()); 13 | }; -------------------------------------------------------------------------------- /LeagueAddon/Hooks/DirectX.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../ImGui/imgui.h" 3 | #include "../ImGui/imgui_impl_win32.h" 4 | #include "../ImGui/imgui_impl_dx11.h" 5 | #include "d3d9.h" 6 | #include "d3d11.h" 7 | #include 8 | //#include "Vector.h" 9 | #include "d3dx11tex.h" 10 | 11 | typedef HRESULT(WINAPI* PresentDX9) (LPDIRECT3DDEVICE9 Device, CONST RECT* pSrcRect, CONST RECT* pDestRect, HWND hDestWindow, CONST RGNDATA* pDirtyRegion); 12 | typedef HRESULT(__stdcall* PresentDX11) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags); 13 | typedef HRESULT(__stdcall* ResizeBuffer)(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags); 14 | 15 | namespace DirectXHook { 16 | inline bool Inited = false; 17 | 18 | bool HookDX11(); 19 | bool HookDX9(); 20 | bool HookInput(); 21 | bool unHook(); 22 | bool SupportDX9(); 23 | bool SupportDX11(); 24 | 25 | 26 | HRESULT WINAPI Hooked_PresentDX9(LPDIRECT3DDEVICE9 Device, CONST RECT* pSrcRect, CONST RECT* pDestRect, HWND hDestWindow, CONST RGNDATA* pDirtyRegion); 27 | HRESULT __stdcall Hooked_PresentDX11(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags); 28 | HRESULT __stdcall Hooked_ResizeBufferDX11(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags); 29 | } 30 | -------------------------------------------------------------------------------- /LeagueAddon/Hooks/Hooks.cpp: -------------------------------------------------------------------------------- 1 | #include "Hooks.h" 2 | #include "DirectX.h" 3 | #include "../EventManager/EventManager.h" 4 | #include "../Structs.h" 5 | #include "../Input.h" 6 | #include "winternl.h" 7 | #include "makesyscall.h" 8 | 9 | typedef BOOL(__stdcall* fGetCursorPos) (LPPOINT lpPoint); 10 | 11 | typedef int(__thiscall* fOnProcessSpell)(void* spellBook, void* spellData); 12 | fOnProcessSpell oOnProcessSpell = NULL; 13 | 14 | PVOID new_on_process_spell; 15 | 16 | bool OnProcessSpellHooked = false; 17 | 18 | int __fastcall hOnProcessSpell(void* spellBook, void* edx, SpellInfo* CastInfo) 19 | { 20 | if (spellBook == nullptr || CastInfo == nullptr) 21 | return oOnProcessSpell(spellBook, CastInfo); 22 | EventManager::Trigger(EventManager::EventType::OnProcessSpell, spellBook, CastInfo); 23 | return oOnProcessSpell(spellBook, CastInfo); 24 | } 25 | 26 | 27 | uint64_t Input::oGetCursorPos = NULL; 28 | // 29 | typedef NTSTATUS(*_NtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG); 30 | NTSTATUS hNtQueryInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, OUT PVOID ProcessInformation, IN ULONG ProcessInformationLength, OUT PULONG ReturnLength) { 31 | Utils::Log("NT_QUERY_INFO_PROCESS"); 32 | return 0; 33 | } 34 | 35 | BOOL WINAPI hGetCursorPos(LPPOINT lpPoint) 36 | { 37 | auto org = ((fGetCursorPos)Input::oGetCursorPos)(lpPoint); 38 | if (Input::mMouseX > 0 && Input::mMouseY > 0 && Input::mMouseX < Render::RenderWidth && Input::mMouseY < Render::RenderHeight) { 39 | lpPoint->x = Input::mMouseX; 40 | lpPoint->y = Input::mMouseY; 41 | Input::mMouseX = -1; 42 | Input::mMouseY = -1; 43 | } 44 | 45 | return org; 46 | } 47 | 48 | PVOID leoHandler; 49 | 50 | int __fastcall hGetPing(void* This, void* edx) { 51 | 52 | return 90; 53 | } 54 | 55 | uint64_t oGetPing = 0; 56 | PVOID new_oGetPing; 57 | 58 | void Hooks::ApplyHooks() { 59 | if (GetSystemDEPPolicy() != DEP_SYSTEM_POLICY_TYPE::DEPPolicyAlwaysOff) 60 | SetProcessDEPPolicy(PROCESS_DEP_ENABLE); 61 | 62 | 63 | //Hooks::DirectX::HookInput(); 64 | 65 | DWORD targetGCP = (DWORD)&GetCursorPos; 66 | 67 | //MessageBoxA(0, to_hex(targetGCP).c_str(), "&GetCursorPos", 0); 68 | 69 | if (*(BYTE*)&GetCursorPos == 0xE9) { 70 | targetGCP = ((DWORD)targetGCP + *(DWORD*)((DWORD)targetGCP + 1)) + 5; 71 | if (*(BYTE*)targetGCP == 0xE9) { 72 | targetGCP = ((DWORD)targetGCP + *(DWORD*)((DWORD)targetGCP + 1)) + 5; 73 | Input::oGetCursorPos = UltHook.AddEzHook(targetGCP, 6, (DWORD)&hGetCursorPos); 74 | } 75 | else 76 | Input::oGetCursorPos = UltHook.AddEzHook(targetGCP, 6, (DWORD)&hGetCursorPos); 77 | } 78 | else 79 | Input::oGetCursorPos = UltHook.AddEzHook((DWORD)&GetCursorPos, 5, (DWORD)&hGetCursorPos); 80 | if (GetSystemDEPPolicy() != DEP_SYSTEM_POLICY_TYPE::DEPPolicyAlwaysOff) { 81 | UltHook.RestoreRtlAddVectoredExceptionHandler(); 82 | //UltHook.RestoreNtProtectVirtualMemory(); 83 | //UltHook.RestoreZwQueryInformationProcess(); 84 | OnProcessSpellHooked = UltHook.DEPAddHook(DEFINE_RVA(Offset::Function::OnProcessSpell), reinterpret_cast(hOnProcessSpell), oOnProcessSpell, 0x59, new_on_process_spell, 1); 85 | Hooks::DirectX::HookDX(); 86 | //UltHook.RestoreSysDll("ntdll.dll"); 87 | } 88 | 89 | Hooked = true; 90 | } 91 | 92 | void Hooks::RemoveHooks() { 93 | if (Input::oGetCursorPos) 94 | UltHook.RemoveEzHook(Input::oGetCursorPos); 95 | 96 | Utils::Log("Hooks::DirectX::UnHookDX: " + string(Hooks::DirectX::UnHookDX() ? "Ok" : "Error")); 97 | Utils::Log("UltHook.deinit: " + string(UltHook.deinit() ? "Ok" : "Error")); 98 | Hooked = false; 99 | DWORD dwOldProtect = 0; 100 | } 101 | 102 | void Hooks::DirectX::HookDX() { 103 | if (DirectXHook::SupportDX11()) { 104 | DirectXHook::HookDX11(); 105 | } 106 | if (DirectXHook::SupportDX9()) { 107 | DirectXHook::HookDX9(); 108 | } 109 | } 110 | 111 | void Hooks::DirectX::HookInput() 112 | { 113 | DirectXHook::HookInput(); 114 | } 115 | 116 | 117 | bool Hooks::DirectX::UnHookDX() { 118 | return DirectXHook::unHook(); 119 | } -------------------------------------------------------------------------------- /LeagueAddon/Hooks/Hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../Utils.h" 4 | #include "ultimate_hooks.h" 5 | #include "../Offset.h" 6 | #include "../Render.h" 7 | 8 | #pragma comment(lib, "D3DX11.lib") 9 | #pragma comment(lib, "D3DX9.lib") 10 | 11 | 12 | 13 | namespace Hooks { 14 | inline bool Hooked = false; 15 | 16 | namespace DirectX { 17 | void HookDX(); 18 | void HookInput(); 19 | bool UnHookDX(); 20 | } 21 | 22 | void ApplyHooks(); 23 | void RemoveHooks(); 24 | } -------------------------------------------------------------------------------- /LeagueAddon/Hooks/makesyscall.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | 6 | using namespace std; 7 | 8 | template 9 | class makesyscall 10 | { 11 | public: 12 | makesyscall(BYTE sysindex1, BYTE sysindex2, BYTE sysindex3, BYTE sysindex4, LPCSTR lpFuncName, DWORD offsetToFunc, 13 | BYTE retCode, BYTE ret1, BYTE ret2); 14 | ~makesyscall(); 15 | public: 16 | template 17 | T operator()(Args ... arg); 18 | private: 19 | uint32_t GetSyscallIndex(const BYTE* pFuncAddr); 20 | void CreateShellSysCall(BYTE sysindex1, BYTE sysindex2, BYTE sysindex3, BYTE sysindex4, LPCSTR lpFuncName, 21 | DWORD offsetToFunc, BYTE retCode, BYTE ret1, BYTE ret2); 22 | private: 23 | char* m_pShellCode; 24 | }; 25 | 26 | template 27 | template 28 | T makesyscall::operator()(Args ... arg) 29 | { 30 | Utils::Log("> makesyscall: Init"); 31 | if (!m_pShellCode) 32 | return T(0); 33 | 34 | typedef T(__stdcall* mFunc)(Args ...); 35 | mFunc pFunc = mFunc(m_pShellCode); 36 | Utils::Log("> makesyscall: Call func"); 37 | 38 | auto pFuncRes = pFunc(arg...); 39 | Utils::Log("> makesyscall: Ok"); 40 | return pFuncRes; 41 | } 42 | 43 | 44 | template 45 | makesyscall::makesyscall(BYTE sysindex1, BYTE sysindex2, BYTE sysindex3, BYTE sysindex4, LPCSTR lpFuncName, 46 | DWORD offsetToFunc, BYTE retCode, BYTE ret1, BYTE ret2) 47 | { 48 | //PBYTE pFuncAddr = (PBYTE)GetProcAddress(GetModuleHandleA("ntdll.dll"), lpFuncName); 49 | CreateShellSysCall(sysindex1, sysindex2, sysindex3, sysindex4, lpFuncName, offsetToFunc, retCode, ret1, ret2); 50 | } 51 | 52 | template 53 | makesyscall::~makesyscall() 54 | { 55 | if (m_pShellCode) 56 | VirtualFree(m_pShellCode, NULL, MEM_RELEASE); 57 | } 58 | 59 | template 60 | uint32_t makesyscall::GetSyscallIndex(const BYTE* pFuncAddr) 61 | { 62 | if (!pFuncAddr) 63 | return 0; 64 | 65 | for (int8_t i = 0; i < 0xF; ++i) 66 | { 67 | if (*(pFuncAddr + i) == 0xB8) 68 | { 69 | return *PUINT(pFuncAddr + i + 1); 70 | } 71 | } 72 | 73 | return 0; 74 | } 75 | 76 | template 77 | void makesyscall::CreateShellSysCall(BYTE sysindex1, BYTE sysindex2, BYTE sysindex3, BYTE sysindex4, 78 | LPCSTR lpFuncName, DWORD offsetToFunc, BYTE retCode, BYTE ret1, BYTE ret2) 79 | { 80 | 81 | if (!sysindex1 && !sysindex2 && !sysindex3 && !sysindex4) 82 | return; 83 | 84 | #ifdef _WIN64 85 | BYTE ShellCode[] 86 | { 87 | 0x4C, 0x8B, 0xD1, //mov r10, rcx 88 | 0xB8, 0x00, 0x00, 0x00, 0x00, //mov eax, SysCallIndex 89 | 0x0F, 0x05, //syscall 90 | 0xC3 //ret 91 | }; 92 | 93 | m_pShellCode = (char*)VirtualAlloc(nullptr, sizeof(ShellCode), MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); 94 | 95 | if (!m_pShellCode) 96 | return; 97 | 98 | memcpy(m_pShellCode, ShellCode, sizeof(ShellCode)); 99 | 100 | *(BYTE*)(m_pShellCode + 4) = sysindex1; 101 | *(BYTE*)(m_pShellCode + 5) = sysindex2; 102 | *(BYTE*)(m_pShellCode + 6) = sysindex3; 103 | *(BYTE*)(m_pShellCode + 7) = sysindex4; 104 | 105 | #elif _WIN32 106 | BYTE ShellCode[] 107 | { 108 | 0xB8, 0x00, 0x00, 0x00, 0x00, //mov eax, SysCallIndex 109 | 0xBA, 0x00, 0x00, 0x00, 0x00, //mov edx, [function] 110 | 0xFF, 0xD2, //call edx 111 | 0xC2, 0x00, 0x00 //ret 112 | }; 113 | m_pShellCode = static_cast(VirtualAlloc(nullptr, sizeof(ShellCode), MEM_RESERVE | MEM_COMMIT, 114 | PAGE_EXECUTE_READWRITE)); 115 | if (!m_pShellCode) 116 | return; 117 | memcpy(m_pShellCode, ShellCode, sizeof(ShellCode)); 118 | *(uintptr_t*)(m_pShellCode + 6) = static_cast((DWORD)GetProcAddress( 119 | GetModuleHandleA("ntdll.dll"), lpFuncName) + offsetToFunc); 120 | *(BYTE*)(m_pShellCode + 1) = sysindex1; 121 | *(BYTE*)(m_pShellCode + 2) = sysindex2; 122 | *(BYTE*)(m_pShellCode + 3) = sysindex3; 123 | *(BYTE*)(m_pShellCode + 4) = sysindex4; 124 | 125 | *(BYTE*)(m_pShellCode + 12) = retCode; 126 | *(BYTE*)(m_pShellCode + 13) = ret1; 127 | *(BYTE*)(m_pShellCode + 14) = ret2; 128 | #endif 129 | } -------------------------------------------------------------------------------- /LeagueAddon/Hooks/ultimate_hooks.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DecoderCoder/LeagueAddon/34c4fdcb996a756cb04071a2cc2ecbfedf1bec18/LeagueAddon/Hooks/ultimate_hooks.cpp -------------------------------------------------------------------------------- /LeagueAddon/Hooks/ultimate_hooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include "../Utils.h" 6 | 7 | #pragma warning(4:4596) 8 | 9 | #define VP_Offset_old (0x170) 10 | #define VP_Offset (0x180) 11 | 12 | #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) 13 | 14 | struct HookDetails { 15 | DWORD hookAddress; 16 | DWORD addressToHook; 17 | }; 18 | 19 | struct HookEntries 20 | { 21 | std::vector hookDetails; 22 | DWORD addressToHookOldProtect; 23 | DWORD addressToHookMbiStart; 24 | DWORD addressToHookMbiEnd; 25 | DWORD addressToHookMbiSize; 26 | DWORD allocatedAddressStart; 27 | DWORD allocatedAddressEnd; 28 | DWORD allocatedAddressSize; 29 | DWORD addressToHookoffsetFromStart; 30 | }; 31 | 32 | struct EzHook { 33 | bool hooked; 34 | bool JMP; 35 | DWORD address; 36 | size_t hookSize; 37 | 38 | DWORD hookFunction; 39 | DWORD origFunc; 40 | }; 41 | 42 | LONG WINAPI LeoHandler(EXCEPTION_POINTERS* pExceptionInfo); 43 | 44 | class UltimateHooks { 45 | public: 46 | template 47 | bool DEPAddHook(DWORD Address, DWORD hk_Address, fnType& OldAddress, size_t Size, PVOID& Allocation, uint8_t Offset) { 48 | Utils::Log("> DEPAddHook"); 49 | Utils::Log("> DEPAddHook: VAllocate"); 50 | DWORD NewOnprocessSpellAddr = VirtualAllocateRegion(Allocation, Address, Size); 51 | Utils::Log("> DEPAddHook: VAllocate: Ok"); 52 | Utils::Log("> DEPAddHook: FFAllocate"); 53 | CopyRegion((DWORD)Allocation, Address, Size); 54 | Utils::Log("> DEPAddHook: FFAllocate: CopyRegion: Ok"); 55 | FixFuncRellocation(Address, (Address + Size), (DWORD)Allocation, Size); 56 | Utils::Log("> DEPAddHook: FFAllocate: Ok"); 57 | OldAddress = (fnType)(NewOnprocessSpellAddr); 58 | auto res = addHook(Address, (DWORD)hk_Address, Offset); 59 | Utils::Log("> DEPAddHook: Ok"); 60 | //MessageBoxA(0, to_hex((int)Allocation).c_str(), to_hex((int)Address).c_str(), 0); 61 | return res; 62 | } 63 | bool deinit(); 64 | DWORD RestoreRtlAddVectoredExceptionHandler(); 65 | DWORD RestoreZwQueryInformationProcess(); 66 | DWORD RestoreNtProtectVirtualMemory(); 67 | bool RestoreSysDll(string name); 68 | 69 | DWORD AddEzHook(DWORD target, size_t hookSize, DWORD hook); 70 | DWORD RemoveEzHook(DWORD target); 71 | 72 | ULONG ProtectVirtualMemory(PVOID addr, PSIZE_T size, ULONG protect, PULONG old); 73 | private: 74 | bool IsDoneInit = false; 75 | PVOID VEH_Handle = nullptr; 76 | 77 | DWORD VirtualAllocateRegion(PVOID& NewFunction, DWORD OrigAddress, size_t size); 78 | void CopyRegion(DWORD dest, DWORD source, size_t size); 79 | void FixFuncRellocation(DWORD OldFnAddress, DWORD OldFnAddressEnd, DWORD NewFnAddress, size_t size); 80 | bool addHook(DWORD address, DWORD hkAddress, size_t offset); 81 | bool Hook(DWORD original_fun, DWORD hooked_fun, size_t offset); 82 | void FixRellocation(DWORD OldFnAddress, DWORD OldFnAddressEnd, DWORD NewFnAddress, size_t size, size_t _offset); 83 | }; 84 | extern UltimateHooks UltHook; -------------------------------------------------------------------------------- /LeagueAddon/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 | -------------------------------------------------------------------------------- /LeagueAddon/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 | -------------------------------------------------------------------------------- /LeagueAddon/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 | #if 0 26 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 27 | #endif 28 | 29 | // DPI-related helpers (optional) 30 | // - Use to enable DPI awareness without having to create an application manifest. 31 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 32 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 33 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 34 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 35 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 36 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 37 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 38 | 39 | // Transparency related helpers (optional) [experimental] 40 | // - Use to enable alpha compositing transparency with the desktop. 41 | // - Use together with e.g. clearing your framebuffer with zero-alpha. 42 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd 43 | -------------------------------------------------------------------------------- /LeagueAddon/ImGui/imgui_stdlib.cpp: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Compatibility: 5 | // - std::string support is only guaranteed to work from C++11. 6 | // If you try to use it pre-C++11, please share your findings (w/ info about compiler/architecture) 7 | 8 | // Changelog: 9 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 10 | 11 | #include "imgui.h" 12 | #include "imgui_stdlib.h" 13 | 14 | struct InputTextCallback_UserData 15 | { 16 | std::string* Str; 17 | ImGuiInputTextCallback ChainCallback; 18 | void* ChainCallbackUserData; 19 | }; 20 | 21 | static int InputTextCallback(ImGuiInputTextCallbackData* data) 22 | { 23 | InputTextCallback_UserData* user_data = (InputTextCallback_UserData*)data->UserData; 24 | if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) 25 | { 26 | // Resize string callback 27 | // If for some reason we refuse the new length (BufTextLen) and/or capacity (BufSize) we need to set them back to what we want. 28 | std::string* str = user_data->Str; 29 | IM_ASSERT(data->Buf == str->c_str()); 30 | str->resize(data->BufTextLen); 31 | data->Buf = (char*)str->c_str(); 32 | } 33 | else if (user_data->ChainCallback) 34 | { 35 | // Forward to user callback, if any 36 | data->UserData = user_data->ChainCallbackUserData; 37 | return user_data->ChainCallback(data); 38 | } 39 | return 0; 40 | } 41 | 42 | bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 43 | { 44 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 45 | flags |= ImGuiInputTextFlags_CallbackResize; 46 | 47 | InputTextCallback_UserData cb_user_data; 48 | cb_user_data.Str = str; 49 | cb_user_data.ChainCallback = callback; 50 | cb_user_data.ChainCallbackUserData = user_data; 51 | return InputText(label, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); 52 | } 53 | 54 | bool ImGui::InputTextMultiline(const char* label, std::string* str, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 55 | { 56 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 57 | flags |= ImGuiInputTextFlags_CallbackResize; 58 | 59 | InputTextCallback_UserData cb_user_data; 60 | cb_user_data.Str = str; 61 | cb_user_data.ChainCallback = callback; 62 | cb_user_data.ChainCallbackUserData = user_data; 63 | return InputTextMultiline(label, (char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data); 64 | } 65 | 66 | bool ImGui::InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 67 | { 68 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 69 | flags |= ImGuiInputTextFlags_CallbackResize; 70 | 71 | InputTextCallback_UserData cb_user_data; 72 | cb_user_data.Str = str; 73 | cb_user_data.ChainCallback = callback; 74 | cb_user_data.ChainCallbackUserData = user_data; 75 | return InputTextWithHint(label, hint, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); 76 | } 77 | -------------------------------------------------------------------------------- /LeagueAddon/ImGui/imgui_stdlib.h: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Compatibility: 5 | // - std::string support is only guaranteed to work from C++11. 6 | // If you try to use it pre-C++11, please share your findings (w/ info about compiler/architecture) 7 | 8 | // Changelog: 9 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | namespace ImGui 16 | { 17 | // ImGui::InputText() with std::string 18 | // Because text input needs dynamic resizing, we need to setup a callback to grow the capacity 19 | IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 20 | IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 21 | IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 22 | } 23 | -------------------------------------------------------------------------------- /LeagueAddon/Input.cpp: -------------------------------------------------------------------------------- 1 | #include "Input.h" 2 | #include 3 | #include 4 | #include 5 | #include "Vector.h" 6 | #include 7 | #include "Utils.h" 8 | 9 | using namespace std::chrono; 10 | using namespace std::this_thread; 11 | using namespace std::chrono_literals; 12 | 13 | int Input::mMouseX = -1; 14 | int Input::mMouseY = -1; 15 | 16 | void Input::PressKey(HKey key) { 17 | if (!IsLeagueInForeground()) 18 | return; 19 | INPUT input; 20 | input.type = INPUT_KEYBOARD; 21 | input.ki.wScan = key; 22 | input.ki.time = 0; 23 | input.ki.dwExtraInfo = 0; 24 | input.ki.wVk = 0; 25 | input.ki.dwFlags = KEYEVENTF_SCANCODE; 26 | SendInput(1, &input, sizeof(INPUT)); 27 | input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP; 28 | SendInput(1, &input, sizeof(INPUT)); 29 | } 30 | 31 | void Input::KeyUp(HKey key) { 32 | INPUT input; 33 | input.type = INPUT_KEYBOARD; 34 | input.ki.wScan = key; 35 | input.ki.time = 0; 36 | input.ki.dwExtraInfo = 0; 37 | input.ki.wVk = 0; 38 | input.ki.dwFlags = KEYEVENTF_KEYUP; 39 | SendInput(1, &input, sizeof(INPUT)); 40 | } 41 | 42 | void Input::KeyDown(HKey key) { 43 | INPUT input; 44 | input.type = INPUT_KEYBOARD; 45 | input.ki.wScan = key; 46 | input.ki.time = 0; 47 | input.ki.dwExtraInfo = 0; 48 | input.ki.wVk = 0; 49 | input.ki.dwFlags = KEYEVENTF_SCANCODE; 50 | SendInput(1, &input, sizeof(INPUT)); 51 | } 52 | 53 | bool Input::WasKeyPressed(HKey key) { 54 | 55 | static high_resolution_clock::time_point nowTime; 56 | static high_resolution_clock::time_point lastTimePressed[300] = { high_resolution_clock::now() }; 57 | static bool pressed[300] = { 0 }; 58 | 59 | static duration timeDiff; 60 | 61 | int virtualKey = MapVirtualKeyA(key, MAPVK_VSC_TO_VK); 62 | if (virtualKey == 0) 63 | return false; 64 | 65 | nowTime = high_resolution_clock::now(); 66 | timeDiff = nowTime - lastTimePressed[virtualKey]; 67 | if (pressed[virtualKey]) { 68 | 69 | if (timeDiff.count() > 200) 70 | pressed[virtualKey] = false; 71 | return false; 72 | } 73 | 74 | bool keyDown = GetAsyncKeyState(virtualKey) & 0x8000; 75 | if (keyDown) { 76 | lastTimePressed[virtualKey] = high_resolution_clock::now(); 77 | pressed[virtualKey] = true; 78 | return true; 79 | } 80 | 81 | return false; 82 | } 83 | 84 | bool Input::IsKeyDown(HKey key) { 85 | int virtualKey = MapVirtualKeyA(key, MAPVK_VSC_TO_VK); 86 | if (virtualKey == 0) 87 | return false; 88 | 89 | return GetAsyncKeyState(virtualKey); 90 | } 91 | 92 | Vector2 Input::GetCursorPosition() 93 | { 94 | POINT pos; 95 | GetCursorPos(&pos); 96 | return { (float)pos.x, (float)pos.y }; 97 | } 98 | 99 | void Input::PressLeftClick() 100 | { 101 | MouseLeftDown(); 102 | MouseLeftUp(); 103 | } 104 | 105 | void Input::PressRightClick() 106 | { 107 | MouseRightDown(); 108 | MouseRightUp(); 109 | } 110 | 111 | void Input::Move(int x, int y) 112 | { 113 | /*DWORD nx = x * 65535 / GetSystemMetrics(0); 114 | DWORD ny = y * 65535 / GetSystemMetrics(1); 115 | mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_VIRTUALDESK | MOUSEEVENTF_ABSOLUTE, nx, ny, 0, 0); 116 | 117 | POINT mouse_pos; 118 | GetCursorPos(&mouse_pos); 119 | 120 | if (mouse_pos.x != nx || mouse_pos.y != ny) 121 | mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_VIRTUALDESK | MOUSEEVENTF_ABSOLUTE, nx, ny, 0, 0);*/ 122 | Input::mMouseX = x; 123 | Input::mMouseY = y; 124 | } 125 | 126 | void Input::ClipMouse(float x, float y) { 127 | RECT rect = RECT(); 128 | rect.bottom = y; 129 | rect.top = y; 130 | rect.right = x; 131 | rect.left = x; 132 | ClipCursor(&rect); 133 | } 134 | 135 | void Input::ClickAt(bool leftClick, float x, float y) 136 | { 137 | BlockInput(true); 138 | POINT oldPos; 139 | GetCursorPos(&oldPos); 140 | ClipMouse(x, y); 141 | Move(x, y); 142 | leftClick ? PressLeftClick() : PressRightClick(); 143 | Sleep(3); 144 | ClipCursor(NULL); 145 | 146 | if (GetAsyncKeyState(VK_RBUTTON) || GetAsyncKeyState(VK_LBUTTON)) { 147 | Sleep(5); 148 | Move(oldPos.x, oldPos.y); 149 | } 150 | BlockInput(false); 151 | } 152 | 153 | void Input::MouseRightDown() 154 | { 155 | INPUT input = { 0 }; 156 | input.type = INPUT_MOUSE; 157 | input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_VIRTUALDESK | MOUSEEVENTF_ABSOLUTE; 158 | SendInput(1, &input, sizeof(INPUT)); 159 | ZeroMemory(&input, sizeof(INPUT)); 160 | } 161 | 162 | void Input::MouseRightUp() 163 | { 164 | INPUT input = { 0 }; 165 | input.type = INPUT_MOUSE; 166 | input.mi.dwFlags = MOUSEEVENTF_RIGHTUP | MOUSEEVENTF_VIRTUALDESK | MOUSEEVENTF_ABSOLUTE; 167 | SendInput(1, &input, sizeof(INPUT)); 168 | ZeroMemory(&input, sizeof(INPUT)); 169 | } 170 | 171 | void Input::MouseLeftDown() 172 | { 173 | INPUT input = { 0 }; 174 | input.type = INPUT_MOUSE; 175 | input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN; 176 | SendInput(1, &input, sizeof(INPUT)); 177 | ZeroMemory(&input, sizeof(INPUT)); 178 | } 179 | 180 | void Input::MouseLeftUp() 181 | { 182 | INPUT input = { 0 }; 183 | input.type = INPUT_MOUSE; 184 | input.mi.dwFlags = MOUSEEVENTF_LEFTUP; 185 | SendInput(1, &input, sizeof(INPUT)); 186 | ZeroMemory(&input, sizeof(INPUT)); 187 | } 188 | 189 | void Input::MoveAndPress(HKey key, float x, float y) 190 | { 191 | BlockInput(true); 192 | POINT oldPos; 193 | GetCursorPos(&oldPos); 194 | 195 | ClipMouse(x, y); 196 | 197 | Move(x, y); 198 | 199 | PressLeftClick(); 200 | PressKey(key); 201 | Sleep(3); 202 | ClipCursor(NULL); 203 | 204 | if (GetAsyncKeyState(VK_LBUTTON) && IsKeyDown(key)) { 205 | Sleep(5); 206 | Move(oldPos.x, oldPos.y); 207 | } 208 | BlockInput(false); 209 | } -------------------------------------------------------------------------------- /LeagueAddon/Input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Vector.h" 3 | 4 | /* Took from https://www.millisecond.com/support/docs/v6/html/language/scancodes.htm */ 5 | enum HKey { 6 | NO_KEY = 0, ESC, N_1, N_2, N_3, N_4, N_5, N_6, N_7, N_8, N_9, N_0, MINUS, EQUAL, BS, Tab, Q, W, E, R, T, Y, U, I, O, P, LBRACKET, RBRACKET, ENTER, CTRL, A, S, D, F, G, 7 | H, J, K, L, SEMICOLON, SINGLE_QUOTE, TILDE, LSHIFT, BACKSLASH, Z, X, C, V, B, N, M, COMMA, DOT, FRONTSLASH, RSHIFT, PRINT_SCREEN, ALT, SPACE, CAPS, F1, F2, 8 | F3, F4, F5, F6, F7, F8, F9, F10, NUM, SCROLL, HOME, UP, PAGE_UP, NUM_MINUS, LEFT, CENTER, RIGHT, PLUS, END, DOWN, PAGE_DOWN, INSERT, DEL 9 | }; 10 | 11 | static const char* HKeyNames[] = { 12 | "None", "Esc", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "Backspace", "Tab", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "[", "]", "Enter", "Ctrl", "A", "S", "D", "F", "G", 13 | "H", "J", "K", "L", ";", "'", "`", "LShift", "\\", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/", "RShift", "PrtScrn", "Alt", "Space", "Caps", "F1", "F2", 14 | "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "Num", "Scrl", "Home", "Num8", "PgUp", "NumMinus", "Num4", "Num5", "Num6", "NumPlus", "End", "NumDown", "PgDown", "Insert", "Del" 15 | }; 16 | 17 | /// Keyboard/Mouse input related utilities. For keyboards the hardware key codes are used instead of the virtual ones. 18 | namespace Input { 19 | extern int mMouseX; 20 | extern int mMouseY; 21 | extern bool Custom; 22 | 23 | /// Presses the specified hardware key 24 | void PressKey(HKey key); 25 | 26 | void KeyUp(HKey key); 27 | void KeyDown(HKey key); 28 | 29 | /// Checks if a key was pressed recently. Only one caller can use this function for a given key. 30 | bool WasKeyPressed(HKey key); 31 | 32 | /// Checks if the key is held down. 33 | bool IsKeyDown(HKey key); 34 | 35 | /// Gets the cursor position in window coordinates 36 | Vector2 GetCursorPosition(); 37 | 38 | /// Sends a left click input 39 | void PressLeftClick(); 40 | 41 | /// Sends a right click input 42 | void PressRightClick(); 43 | 44 | void Move(int x, int y); 45 | 46 | void ClipMouse(float x, float y); 47 | 48 | /// Moves the cursor at the specified location, clicks and then moves the cursor back at the initial location 49 | void ClickAt(bool leftClick, float x, float y); 50 | 51 | void MouseRightDown(); 52 | 53 | void MouseRightUp(); 54 | 55 | void MouseLeftDown(); 56 | 57 | void MouseLeftUp(); 58 | 59 | void MoveAndPress(HKey key, float x, float y); 60 | 61 | bool HookGetCursorPos(); 62 | 63 | extern uint64_t oGetCursorPos; 64 | } -------------------------------------------------------------------------------- /LeagueAddon/JustEvade/JustEvade.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../ObjectManager.h" 3 | #include "../EventManager/EventManager.h" 4 | #include "../Render.h" 5 | //#include "../Console/Console.h" 6 | #include "../Geometry.h" 7 | #include "../Hooks/DirectX.h" 8 | #include 9 | 10 | #define MathHuge 999999.f 11 | #ifndef DEG2RAD 12 | #define DEG2RAD( x ) ( (float)(x) * (float)(M_PI_F / 180.f) ) 13 | #endif 14 | 15 | namespace JustEvade { 16 | enum class SpellType { 17 | linear, 18 | threeway, 19 | rectangular, 20 | circular, 21 | conic, 22 | polygon 23 | }; 24 | 25 | enum class CastType : int 26 | { 27 | Position, 28 | Target, 29 | Self 30 | }; 31 | 32 | enum class EvadeType { 33 | Blink, 34 | Dash, 35 | Invulnerability, 36 | MovementSpeedBuff, 37 | SpellShield, 38 | SafeTarget, 39 | Windwall 40 | }; 41 | 42 | enum class SpellSlot : int 43 | { 44 | Unknown = -1, 45 | Q = 0, 46 | W, 47 | E, 48 | R 49 | }; 50 | 51 | class EvadeSpellData 52 | { 53 | public: 54 | CastType CastType; 55 | std::string ChampionName; 56 | std::string CheckSpellName = ""; 57 | int DangerLevel; 58 | int Delay; 59 | EvadeType EvadeType; 60 | bool FixedRange; 61 | bool IsBehindTarget; 62 | bool IsInfrontTarget; 63 | bool IsItem; 64 | bool IsReversed; 65 | bool IsSpecial; 66 | bool IsSummonerSpell; 67 | int ItemId; 68 | int MaxRange; 69 | int MinRange; 70 | float MovementSpeed; 71 | std::string Name; 72 | SpellSlot Slot = SpellSlot::Unknown; 73 | int Speed; 74 | }; 75 | 76 | class Spell { 77 | public: 78 | string name; 79 | string missileName; 80 | string icon; 81 | string displayName; 82 | SpellSlot slot; 83 | SpellType type; 84 | 85 | float startY; 86 | float endY; 87 | 88 | Vector3 startPos; 89 | Vector3 endPos; 90 | Vector3 endPos2; 91 | bool useEndPos2; 92 | Vector3 currentPos; 93 | 94 | int spellIndex; 95 | SpellData* basicAttackSpellData; 96 | int sourceNetworkId; 97 | int source_id; 98 | 99 | 100 | Geometry::Polygon path; 101 | GameObject* obj; 102 | MissileSpellInfo* missileObject; 103 | float startTime; 104 | 105 | float speed; 106 | float range; 107 | float radius; 108 | float delay; 109 | float angle; 110 | int danger; 111 | bool cc; 112 | bool collisionWalls; 113 | bool collisionMinions; 114 | bool collisionChamps; 115 | bool windwall; 116 | bool hitbox; 117 | bool fow; 118 | bool exception; 119 | bool extend; 120 | 121 | 122 | // Custom settings 123 | bool Dodge; 124 | bool Evade; 125 | bool Draw = true; 126 | bool Force; 127 | bool FOW = true; 128 | int HP = 5; 129 | int ER; 130 | 131 | void SetMissileObject(MissileSpellInfo* missile) { 132 | this->missileObject = missile; 133 | } 134 | }; 135 | 136 | class Vertex { 137 | public: 138 | float x; 139 | float y; 140 | float alpha = 0; 141 | Vertex* next = NULL; 142 | Vertex* prev = NULL; 143 | Vertex* neighbor = NULL; 144 | bool visited = false; 145 | bool intersection = false; 146 | 147 | Vertex(float x, float y, float alpha, bool intersection) { 148 | this->x = x; 149 | this->y = y; 150 | this->alpha = alpha; 151 | this->intersection = intersection; 152 | } 153 | 154 | Vertex* New(float x, float y, float alpha, bool intersection) { 155 | this->x = x; 156 | this->y = y; 157 | this->alpha = alpha; 158 | this->intersection = intersection; 159 | return this; 160 | } 161 | 162 | void InitLoop() { 163 | auto last = this->GetLast(); 164 | last->prev->next = this; 165 | this->prev = last->prev; 166 | } 167 | 168 | void Insert(Vertex* first, Vertex* last) { 169 | auto res = first; 170 | while (res != last && res->alpha < this->alpha) { 171 | res = res->next; 172 | } 173 | this->next = res; 174 | this->prev = res->prev; 175 | if (this->prev) 176 | this->prev->next = this; 177 | this->next->prev = this; 178 | } 179 | 180 | Vertex* GetLast() { 181 | auto res = this; 182 | while (res->next && res->next != this) { 183 | res = res->next; 184 | } 185 | return res; 186 | } 187 | 188 | Vertex* GetNextNonIntersaction() { 189 | auto res = this; 190 | while (res && res->intersection) { 191 | res = res->next; 192 | } 193 | return res; 194 | } 195 | 196 | Vertex* GetFirstVertexOfIntersection() { 197 | auto res = this; 198 | while (true) { 199 | res = res->next; 200 | if (!res) 201 | break; 202 | if (res == this) 203 | break; 204 | if (res->intersection && !res->visited) 205 | break; 206 | } 207 | return res; 208 | }; 209 | }; 210 | 211 | class Champ { 212 | public: 213 | string Name; 214 | GameObject* obj = NULL; 215 | std::list Spells; 216 | }; 217 | 218 | namespace Core { 219 | inline float GameTimer; 220 | 221 | inline Vector3 SafePos; 222 | 223 | inline std::list DetectedSpells; 224 | inline std::list DodgeableSpells; 225 | 226 | inline std::list SpellDB; 227 | 228 | inline std::list ChampsInGame; 229 | 230 | inline bool SmoothEvade; 231 | inline bool LimitRange; 232 | inline int CQ = 16; // Circle Segments Quality 233 | inline int DS = 20; // Diagonal Search Step 234 | inline int DC = 4; // Diagonal Points Count 235 | inline int LR = 5250; // Limited Detection Range 236 | 237 | 238 | 239 | inline bool EvadeSpells; 240 | inline bool DodgeSpells; 241 | inline bool DrawSpells; 242 | inline bool DrawStatus; 243 | 244 | inline bool MissileDetection; 245 | 246 | inline bool Debug; 247 | inline bool DrawSafePosition; 248 | 249 | 250 | 251 | inline bool DoD = false; // Dodge only dangerous 252 | inline bool Evading = false; 253 | inline bool InsidePath = false; 254 | inline bool Loaded = false; 255 | 256 | inline Vector3 ExtendedPos; 257 | inline SpellSlot Flash; 258 | inline SpellSlot Flash2; 259 | inline float FlashRange; 260 | inline Vector2 MousePos; 261 | inline Vector3 MyHeroPos; 262 | 263 | void Initialize(); 264 | void OnDraw(); 265 | void OnMenu(); 266 | void OnTick(); 267 | 268 | bool IsValid(Spell& s); 269 | 270 | void DetectMissiles(); 271 | 272 | void SpellManager(); 273 | std::list GetDodgeableSpells(); 274 | void SpellExistsThenRemove(string name); 275 | Vector3 CalculateEndPos(Spell& spellInfo); 276 | Geometry::Polygon GetPath(Spell& spell, bool boundingRadius = true); 277 | void OnProcessSpell(void* spellBook, SpellInfo* castInfo); 278 | void AddSpell(Spell& spell); 279 | }; 280 | 281 | void InitSpellsDB(); 282 | } -------------------------------------------------------------------------------- /LeagueAddon/LEngine/Patchables/Offsets.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DecoderCoder/LeagueAddon/34c4fdcb996a756cb04071a2cc2ecbfedf1bec18/LeagueAddon/LEngine/Patchables/Offsets.h -------------------------------------------------------------------------------- /LeagueAddon/LEngine/Patchables/Structs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DecoderCoder/LeagueAddon/34c4fdcb996a756cb04071a2cc2ecbfedf1bec18/LeagueAddon/LEngine/Patchables/Structs.h -------------------------------------------------------------------------------- /LeagueAddon/League/HeroInventory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../Offset.h" 4 | #include "../Vector.h" 5 | #include "../Utils.h" 6 | #include "Item.h" 7 | 8 | class HeroInventory { 9 | public: 10 | Item* GetItemByID(int ID) { 11 | DWORD spellSlotPointerBuffer[12] = {}; 12 | memcpy(&spellSlotPointerBuffer, this, sizeof(DWORD) * 11); 13 | return (Item*)(*(DWORD*)(spellSlotPointerBuffer[ID] + 0xC)); 14 | } 15 | 16 | bool HasItem(int ID) { 17 | for (int i = 0; i < 11; i++) { 18 | auto item = this->GetItemByID(i); 19 | if (item != 0) 20 | if (item->Info->ID == ID) { 21 | return true; 22 | } 23 | } 24 | return false; 25 | } 26 | 27 | //bool HasItem(char* itemName) { 28 | // for (int i = 4; i < 11; i++) { 29 | // if (this->GetSpellSlotByID(i)->GetName() == itemName) { 30 | // return true; 31 | // } 32 | // } 33 | // return false; 34 | //} 35 | }; -------------------------------------------------------------------------------- /LeagueAddon/League/Item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../Offset.h" 4 | #include "../Vector.h" 5 | #include "../Utils.h" 6 | #include "Item.h" 7 | #include "ItemInfo.h" 8 | 9 | class Item { 10 | public: 11 | union { 12 | DEFINE_MEMBER_N(char* Name, Offset::Inventory::ItemSlotSpellName); 13 | DEFINE_MEMBER_N(float Price, Offset::Inventory::ItemSlotPrice); 14 | DEFINE_MEMBER_N(ItemInfo* Info, Offset::Inventory::ItemSlotInfo); 15 | }; 16 | }; -------------------------------------------------------------------------------- /LeagueAddon/League/ItemInfo.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../Offset.h" 3 | #include "../Vector.h" 4 | #include "../Utils.h" 5 | #include "Item.h" 6 | 7 | class ItemInfo { 8 | public: 9 | union { 10 | DEFINE_MEMBER_N(int ID, Offset::Inventory::ItemSlotInfoId); 11 | DEFINE_MEMBER_N(float Crit, Offset::Inventory::ItemSlotInfoPercentCritChanceMod); 12 | }; 13 | 14 | 15 | //bool HasItem(char* itemName) { 16 | // for (int i = 4; i < 11; i++) { 17 | // if (this->GetSpellSlotByID(i)->GetName() == itemName) { 18 | // return true; 19 | // } 20 | // } 21 | // return false; 22 | //} 23 | }; -------------------------------------------------------------------------------- /LeagueAddon/League/SpellBook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "../Offset.h" 4 | #include "../Vector.h" 5 | #include "../Utils.h" 6 | #include "SpellSlot.h" 7 | 8 | class CSpellBook { 9 | public: 10 | 11 | CSpellSlot* GetSpellSlotByID(int ID) { 12 | DWORD spellSlotPointerBuffer[7] = {}; 13 | memcpy(&spellSlotPointerBuffer, this, sizeof(DWORD) * 6); 14 | if (*(int*)(spellSlotPointerBuffer[ID] + 0x8) == 0) 15 | return nullptr; 16 | return (CSpellSlot*)(spellSlotPointerBuffer[ID]); 17 | } 18 | 19 | //bool HasItem(char* itemName) { 20 | // for (int i = 4; i < 11; i++) { 21 | // if (this->GetSpellSlotByID(i)->GetName() == itemName) { 22 | // return true; 23 | // } 24 | // } 25 | // return false; 26 | //} 27 | }; -------------------------------------------------------------------------------- /LeagueAddon/League/SpellData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Utils.h" 3 | #include "../Structs.h" 4 | class CSpellData 5 | { 6 | public: 7 | std::string GetSpellName() { 8 | char buff[50]; 9 | memcpy(&buff, (void*)(*(DWORD*)((DWORD)this + Offset::SpellData::SpellName)), 50); 10 | return buff; 11 | } 12 | 13 | float GetCooldownTime(int lvl = 0) { 14 | return *(float*)((DWORD)this + Offset::SpellData::CooldownTime + (lvl - 1) * sizeof(float)); 15 | } 16 | 17 | //SpellData* GetSpellData() { 18 | // return (SpellData*)(DWORD)this; 19 | //} 20 | }; -------------------------------------------------------------------------------- /LeagueAddon/League/SpellInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SpellData.h" 3 | 4 | class CSpellInfo 5 | { 6 | public: 7 | CSpellData* GetSpellData() { 8 | return *(CSpellData**)((DWORD)this + Offset::SpellInfo::SpellData); 9 | } 10 | }; -------------------------------------------------------------------------------- /LeagueAddon/League/SpellSlot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Vector.h" 3 | #include "../Utils.h" 4 | #include "SpellInfo.h" 5 | #include "../Offset.h" 6 | 7 | class CSpellSlot { 8 | public: 9 | int GetLevel() { 10 | return *(int*)((DWORD)this + Offset::SpellSlot::Level); 11 | } 12 | 13 | float GetTime() { 14 | return *(float*)((DWORD)this + Offset::SpellSlot::Time); 15 | } 16 | 17 | float GetCD() { 18 | float gameTime = *(float*)(baseAddr + Offset::Data::GameTime); 19 | if (GetTime() - gameTime > 0) 20 | return GetTime() - gameTime; 21 | return 0; 22 | } 23 | 24 | bool IsReady() { 25 | if (GetTime() <= *(float*)(baseAddr + Offset::Data::GameTime)) 26 | return true; 27 | return false; 28 | } 29 | 30 | std::string GetName() { 31 | return this->GetSpellInfo()->GetSpellData()->GetSpellName(); 32 | } 33 | 34 | 35 | CSpellInfo* GetSpellInfo() { 36 | return *(CSpellInfo**)((DWORD)this + Offset::SpellSlot::SpellInfo); 37 | } 38 | 39 | int GetCharges() { 40 | return *(int*)((DWORD)this + Offset::SpellSlot::Charges); 41 | } 42 | 43 | float GetChargeTime() { 44 | return *(float*)((DWORD)this + Offset::SpellSlot::TimeCharge); 45 | } 46 | 47 | int GetDamage() { 48 | return *(float*)((DWORD)this + Offset::SpellSlot::Damage); 49 | } 50 | 51 | }; -------------------------------------------------------------------------------- /LeagueAddon/Misc.cpp: -------------------------------------------------------------------------------- 1 | #include "Misc.h" 2 | 3 | int smiteSlotNum = 0; 4 | CSpellSlot* smiteSlot = nullptr; 5 | 6 | GameObject* enemyJungler = nullptr; 7 | 8 | void Misc::Initialize() { 9 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, OnMenu); 10 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, OnDraw); 11 | 12 | for (int i = 0; i < 6; i++) { 13 | if (StringContains(Local->SpellBook.GetSpellSlotByID(i)->GetName(), "SummonerSmite", false)) { 14 | smiteSlotNum = i; 15 | smiteSlot = Local->SpellBook.GetSpellSlotByID(i); 16 | break; 17 | } 18 | } 19 | 20 | for (auto hero : ObjectManager::HeroList()) { 21 | if (hero->IsEnemyTo(Local)) { 22 | for (int i = 0; i < 6; i++) { 23 | auto spellSlot = hero->SpellBook.GetSpellSlotByID(i); 24 | if (spellSlot && StringContains(spellSlot->GetName(), "SummonerSmite", false)) { 25 | enemyJungler = hero; 26 | break; 27 | } 28 | } 29 | } 30 | if (enemyJungler) 31 | break; 32 | } 33 | //EventManager::AddEventHandler(EventManager::EventType::OnThread, OnDraw); 34 | } 35 | 36 | void Misc::OnThread() { 37 | 38 | } 39 | 40 | void Misc::OnMenu() { 41 | if (ImGui::CollapsingHeader("Misc")) { 42 | if (ImGui::TreeNode("Anti AFK")) { 43 | ImGui::Checkbox("Enabled", &AntiAFK); 44 | ImGui::TreePop(); 45 | } 46 | if (ImGui::TreeNode("Auto smite")) { 47 | ImGui::Checkbox("Enabled", &AutoSmite); 48 | ImGui::Checkbox("Smite Dragon", &AutoSmite_Dragon); 49 | ImGui::Checkbox("Smite Baron", &AutoSmite_Baron); 50 | ImGui::Checkbox("Smite buff if enemy jungler is near", &AutoSmite_Buff); 51 | ImGui::Checkbox("Smite crab if enemy jungler is near", &AutoSmite_Crab); 52 | ImGui::Checkbox("Smite buff/craba when have 2 charges", &AutoSmite_HasSecondSmite); 53 | ImGui::TreePop(); 54 | } 55 | if (ImGui::TreeNode("Fun")) { 56 | if (ImGui::Button("Toggle \"Ping 0\"+")) { 57 | BYTE* ping = (BYTE*)(*(int*)DEFINE_RVA(Offset::Data::PingObject) + (DWORD)0x1A7); 58 | *ping += 0x1; 59 | } 60 | ImGui::SameLine(); 61 | if (ImGui::Button("Toggle \"Ping 0\"-")) { 62 | bool* ping = (bool*)(*(int*)DEFINE_RVA(Offset::Data::PingObject) + (DWORD)0x1A7); 63 | *ping -= 0x1; 64 | } 65 | int i = 0; 66 | for (auto obj : ObjectManager::HeroList()) { 67 | if (i++ == (int)(*(BYTE*)(*(int*)DEFINE_RVA(Offset::Data::PingObject) + (DWORD)0x1A7))) { 68 | ImGui::Text(obj->GetChampionName().c_str()); 69 | break; 70 | } 71 | } 72 | 73 | ImGui::TreePop(); 74 | } 75 | //ImGui::Checkbox("Autosmite", &AutoSmite); 76 | } 77 | } 78 | 79 | int lastAAFK = 0; 80 | int lastSmite = 0; 81 | 82 | void castSmite(GameObject* to) { 83 | 84 | if (lastSmite < GetTickCount()) { 85 | Vector3 w2s = Function::WorldToScreen(&to->Position); 86 | if (w2s.x > 0 && w2s.y > 0 && w2s.x < GetSystemMetrics(SM_CXSCREEN) && w2s.y < GetSystemMetrics(SM_CYSCREEN)) { 87 | Input::Move(w2s.x, w2s.y); 88 | switch (smiteSlotNum) { 89 | case 4: 90 | Input::PressKey(D); 91 | break; 92 | case 5: 93 | Input::PressKey(F); 94 | break; 95 | } 96 | } 97 | } 98 | 99 | lastSmite = GetTickCount() + 70; 100 | } 101 | 102 | bool IsValid2Smite(GameObject* target) { 103 | return target->IsVisible && !target->IsInvulnearable() && target->IsTargetable && Function::IsAlive(target); 104 | } 105 | 106 | void Misc::OnDraw() { 107 | if (AutoSmite && smiteSlot) { 108 | float smiteDamage = smiteSlot->GetDamage(); 109 | if (smiteSlot->IsReady()) { 110 | auto minionsInRange = filter(ObjectManager::MinionList(), [&](GameObject* minion) { return minion->Health <= smiteDamage && minion->IsInRange(Local, 600, false) && IsValid2Smite(minion); }); 111 | for (auto obj : minionsInRange) { 112 | if (AutoSmite_Dragon) { 113 | if (StringContains(obj->GetChampionName(), "SRU_Dragon")) { 114 | castSmite(obj); 115 | break; 116 | } 117 | } 118 | 119 | if (AutoSmite_Baron) { 120 | if (StringContains(obj->GetChampionName(), "SRU_Baron") || StringContains(obj->GetChampionName(), "SRU_RiftHerald")) { 121 | castSmite(obj); 122 | break; 123 | } 124 | } 125 | 126 | if (enemyJungler && (smiteSlot->GetCharges() == 2 || !AutoSmite_HasSecondSmite)) { 127 | if (AutoSmite_Buff) 128 | if (StringContains(obj->GetChampionName(), "SRU_Red") || StringContains(obj->GetChampionName(), "SRU_Blue")) { 129 | if (enemyJungler->IsVisible && Function::IsAlive(enemyJungler) && enemyJungler->Position.distanceTo(obj->Position) < 700) { 130 | castSmite(obj); 131 | break; 132 | } 133 | } 134 | 135 | if (AutoSmite_Crab) 136 | if (StringContains(obj->GetChampionName(), "Sru_Crab"), false) { 137 | if (enemyJungler->IsVisible && Function::IsAlive(enemyJungler) && enemyJungler->Position.distanceTo(obj->Position) < 700) { 138 | castSmite(obj); 139 | break; 140 | } 141 | } 142 | } 143 | } 144 | } 145 | } 146 | 147 | if (Settings::Global::useIssueOrder && AntiAFK && !IsLeagueInForeground() && lastAAFK < GetTickCount()) { 148 | Function::IssueOrder(Local, 2, &Local->Position, NULL, false, false, NULL); 149 | lastAAFK = GetTickCount() + 1000; 150 | } 151 | } -------------------------------------------------------------------------------- /LeagueAddon/Misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EventManager/EventManager.h" 3 | #include "ObjectManager.h" 4 | #include "ImGui/imgui.h" 5 | #include "Functions.h" 6 | #include "Input.h" 7 | #include "Settings.h" 8 | 9 | namespace Misc { 10 | inline bool AutoSmite = true; 11 | inline bool AutoSmite_Dragon = true; 12 | inline bool AutoSmite_Baron = true; 13 | inline bool AutoSmite_Buff = true; 14 | inline bool AutoSmite_Crab = true; 15 | inline bool AutoSmite_HasSecondSmite = true; 16 | 17 | inline bool AntiAFK = false; 18 | 19 | void Initialize(); 20 | 21 | void OnThread(); 22 | void OnMenu(); 23 | void OnDraw(); 24 | } 25 | -------------------------------------------------------------------------------- /LeagueAddon/ObjectManager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DecoderCoder/LeagueAddon/34c4fdcb996a756cb04071a2cc2ecbfedf1bec18/LeagueAddon/ObjectManager.cpp -------------------------------------------------------------------------------- /LeagueAddon/ObjectManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Structs.h" 4 | 5 | class ObjectManager { 6 | public: 7 | //static GameObject* GetFirstObject() 8 | //{ 9 | // typedef GameObject* (__thiscall* fnGetFirst)(void*); 10 | // return ((fnGetFirst)(DEFINE_RVA(Offset::Function::GetFirstObject)))(*(void**)(DEFINE_RVA(Offset::Data::ObjectManager))); 11 | //} 12 | //static GameObject* GetNextObject(GameObject* object) 13 | //{ 14 | // typedef GameObject* (__thiscall* fnGetNext)(void*, GameObject*); 15 | // return ((fnGetNext)(DEFINE_RVA(Offset::Function::GetNextObject)))(*(void**)(DEFINE_RVA(Offset::Data::ObjectManager)), object); 16 | //} 17 | 18 | static GameObject* GetObjectByIndex(int Index) 19 | { 20 | for (auto obj : HeroList()) { 21 | if (obj->Index == Index) 22 | return obj; 23 | } 24 | for (auto obj : TurretList()) { 25 | if (obj->Index == Index) 26 | return obj; 27 | } 28 | for (auto obj : MinionList()) { 29 | if (obj->Index == Index) 30 | return obj; 31 | } 32 | return nullptr; 33 | } 34 | 35 | static std::list GetAllObjects() { 36 | std::list ObjectList; 37 | for (auto obj : HeroList()) { 38 | ObjectList.push_back(obj); 39 | } 40 | for (auto obj : TurretList()) { 41 | ObjectList.push_back(obj); 42 | } 43 | for (auto obj : MinionList()) { 44 | ObjectList.push_back(obj); 45 | } 46 | 47 | return ObjectList; 48 | } 49 | 50 | static GameObject* GetObjectByNetworkID(int NetworkID) 51 | { 52 | for (auto obj : HeroList()) { 53 | if (obj->NetworkID == NetworkID) 54 | return obj; 55 | } 56 | for (auto obj : TurretList()) { 57 | if (obj->NetworkID == NetworkID) 58 | return obj; 59 | } 60 | for (auto obj : MinionList()) { 61 | if (obj->NetworkID == NetworkID) 62 | return obj; 63 | } 64 | return nullptr; 65 | } 66 | 67 | static std::list MinionList() { 68 | std::list ObjectList; 69 | 70 | auto Object_list = *reinterpret_cast**>(DEFINE_RVA(Offset::Data::ManagerTemplate_Minions)); 71 | for (size_t i = 0; i < Object_list->size; i++) { 72 | auto Object = Object_list->entities[i]; 73 | ObjectList.push_back(Object); 74 | } 75 | return ObjectList; 76 | } 77 | 78 | static std::list TurretList() { 79 | std::list ObjectList; 80 | auto Object_list = *reinterpret_cast**>(DEFINE_RVA(Offset::Data::ManagerTemplate_Turrets)); 81 | for (size_t i = 0; i < Object_list->size; i++) { 82 | auto Object = Object_list->entities[i]; 83 | ObjectList.push_back(Object); 84 | } 85 | return ObjectList; 86 | } 87 | 88 | static std::list HeroList() { 89 | std::list ObjectList; 90 | auto Object_list = *reinterpret_cast**>(DEFINE_RVA(Offset::Data::ManagerTemplate_Heroes)); 91 | for (size_t i = 0; i < Object_list->size; i++) { 92 | auto Object = Object_list->entities[i]; 93 | ObjectList.push_back(Object); 94 | } 95 | return ObjectList; 96 | } 97 | 98 | static std::list MissileList() { 99 | 100 | std::list ObjectList; 101 | 102 | int missiles_count = *(int*)(*(int*)DEFINE_RVA(Offset::Data::ManagerTemplate_Missiles) + 0x8); 103 | if (missiles_count == 1) { 104 | auto obj = *(MissileSpellInfo**)(**(int**)(*(int*)DEFINE_RVA(Offset::Data::ManagerTemplate_Missiles) + 0x4) + 0x14); 105 | //MessageBoxA(0, to_hex((int)obj).c_str(), "", 0); 106 | ObjectList.push_back(obj); 107 | return ObjectList; 108 | } 109 | auto missiles_mgr = *(MissileManager**)(*(int*)DEFINE_RVA(Offset::Data::ManagerTemplate_Missiles) + 0x4); 110 | for (auto& i : missiles_mgr->missile_map) 111 | { 112 | DWORD network_id = i.first; 113 | ObjectList.push_back((MissileSpellInfo*)i.second); 114 | } 115 | return ObjectList; 116 | } 117 | 118 | static GameObject* GetLocalPlayer() { 119 | return (GameObject*)*(DWORD*)DEFINE_RVA(Offset::Data::LocalPlayer); 120 | } 121 | 122 | static GameObject* FindObjectByIndex(std::list heroList, int casterIndex) 123 | { 124 | for (GameObject* a : heroList) 125 | { 126 | if (casterIndex == a->Index) 127 | return a; 128 | } 129 | return nullptr; 130 | } 131 | 132 | static MissileSpellInfo* FindObjectByIndex(std::list heroList, int casterIndex) 133 | { 134 | for (MissileSpellInfo* a : heroList) 135 | { 136 | if (casterIndex == a->Index) 137 | return a; 138 | } 139 | return nullptr; 140 | } 141 | 142 | static GameObject* FindObjectByIndex(int casterIndex) 143 | { 144 | 145 | for (auto obj : HeroList()) { 146 | if (obj->Index == casterIndex) 147 | return obj; 148 | } 149 | for (auto obj : TurretList()) { 150 | if (obj->Index == casterIndex) 151 | return obj; 152 | } 153 | for (auto obj : MinionList()) { 154 | if (obj->Index == casterIndex) 155 | return obj; 156 | } 157 | return nullptr; 158 | /*GameObject* target = nullptr; 159 | auto Object = GetFirstObject(); 160 | while (Object) { 161 | if (casterIndex == Object->Index) 162 | target = Object; 163 | Object = GetNextObject(Object); 164 | } 165 | return target;*/ 166 | } 167 | }; 168 | 169 | inline GameObject* Local = nullptr; -------------------------------------------------------------------------------- /LeagueAddon/Render.cpp: -------------------------------------------------------------------------------- 1 | #include "Render.h" 2 | 3 | //ImFont* overlayFont; 4 | 5 | void Render::BeginOverlay() { 6 | //if (!OnProcessSpellHooked) { 7 | 8 | // style->Colors[ImGuiCol_TitleBg] = ImVec4(192 / 255.f, 57 / 255.f, 43 / 255.f, 1.0); 9 | // style->Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(192 / 255.f, 57 / 255.f, 43 / 255.f, 1.0); 10 | // style->Colors[ImGuiCol_TitleBgActive] = ImVec4(231 / 255.f, 76 / 255.f, 60 / 255.f, 1.0); 11 | //} 12 | //else { 13 | // style->Colors[ImGuiCol_TitleBg] = ImVec4(0.039f, 0.039f, 0.039f, 1.000f); 14 | // style->Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.000f, 0.000f, 0.000f, 0.510f); 15 | // style->Colors[ImGuiCol_TitleBgActive] = ImVec4(0.160f, 0.290f, 0.480f, 1.000f); 16 | //} 17 | ImGui::Begin("Overlay", NULL, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoTitleBar); 18 | } 19 | 20 | void Render::EndOverlay() { 21 | ImGui::End(); 22 | } 23 | 24 | void Render::BeginOverlayTab(string name) { 25 | if (GetAsyncKeyState(VK_TAB)) 26 | ImGui::Begin(name.c_str()); 27 | 28 | else 29 | ImGui::Begin(name.c_str(), NULL, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoTitleBar); 30 | 31 | } 32 | void Render::EndOverlayTab() { 33 | ImGui::End(); 34 | } 35 | 36 | void Render::Draw_Circle(float_t x, float_t y, float_t radius, ImColor color, float thickness) { 37 | ImGui::GetWindowDrawList()->AddCircle(ImVec2(x, y), radius, color, 0, thickness); 38 | } 39 | 40 | void Render::Draw_Circle3DFilled(Vector3 center, float radius, ImColor color) { 41 | ImVec2 vertices[46]; 42 | Vector3 vertices2[46]; 43 | bool verticesValid[46]; 44 | 45 | float angle = 0; 46 | const float angleStep = (M_PI * 2) / 45; 47 | 48 | for (int i = 0; i <= 45; ++i, angle += angleStep) 49 | { 50 | Vector3 pos = Vector3(radius * cosf(angle) + center.x, center.y, radius * sinf(angle) + center.z); 51 | Vector3 w2sPos = Function::WorldToScreen(&pos); 52 | verticesValid[i] = w2sPos.x > 0 && w2sPos.x < Render::RenderWidth&& w2sPos.y > 0 && w2sPos.y < Render::RenderHeight;; 53 | vertices[i] = ImVec2(w2sPos.x, w2sPos.y); 54 | vertices2[i] = Vector3(w2sPos.x, w2sPos.y, 0); 55 | } 56 | 57 | for (int i = 0; i < 45; ++i) 58 | if (vertices2[i].distanceTo(vertices2[i + 1]) > radius) 59 | return; 60 | ImGui::GetWindowDrawList()->AddConvexPolyFilled(vertices, 46, color); 61 | } 62 | 63 | void Render::Draw_Circle3D(Vector3 center, float radius, ImColor color, float thickness) { 64 | Vector3 vertices[46]; 65 | bool verticesValid[46]; 66 | 67 | float angle = 0; 68 | const float angleStep = (M_PI * 2) / 45; 69 | 70 | for (int i = 0; i <= 45; ++i, angle += angleStep) 71 | { 72 | Vector3 pos = Vector3(radius * cosf(angle) + center.x, center.y, radius * sinf(angle) + center.z); 73 | Vector3 w2sPos = Function::WorldToScreen(&pos); 74 | verticesValid[i] = w2sPos.x > 0 && w2sPos.x < Render::RenderWidth && w2sPos.y > 0 && w2sPos.y < Render::RenderHeight; 75 | vertices[i] = Vector3(w2sPos.x, w2sPos.y, 0); 76 | } 77 | 78 | for (int i = 0; i < 45; ++i) { 79 | /*Renderer::Draw_Text(vertices[i].x, vertices[i].y, std::to_string(vertices[i].x).c_str(), color); 80 | Renderer::Draw_Text(vertices[i].x, vertices[i].y + 20, std::to_string(vertices[i].y).c_str(), color);*/ 81 | if (vertices[i].distanceTo(vertices[i + 1]) < radius) 82 | if ((verticesValid[i] && verticesValid[i + 1])) 83 | ImGui::GetWindowDrawList()->AddLine({ vertices[i].x, vertices[i].y }, { vertices[i + 1].x, vertices[i + 1].y }, color, thickness); 84 | } 85 | } 86 | 87 | void Render::Draw_Line3D(Vector3 pos1, Vector3 pos2, ImColor color, float thickness) { 88 | Render::Draw_Line(Function::WorldToScreen(&pos1), Function::WorldToScreen(&pos2), color, thickness); 89 | } 90 | 91 | 92 | void Render::Draw_Line(ImVec2 pos1, ImVec2 pos2, ImColor color, float thickness) { 93 | Render::Draw_Line(pos1.x, pos1.y, pos2.x, pos2.y, color, thickness); 94 | } 95 | 96 | int random(int min, int max) //range : [min, max] 97 | { 98 | static bool first = true; 99 | if (first) 100 | { 101 | srand(time(NULL)); //seeding for the first time only! 102 | first = false; 103 | } 104 | return min + rand() % ((max + 1) - min); 105 | } 106 | 107 | void Render::Draw_Line(float_t x1, float_t y1, float_t x2, float_t y2, ImColor color, float thickness) { 108 | 109 | //Vector3 vec1; 110 | //Vector3 vec2; 111 | 112 | //vec1.x = x1; 113 | //vec1.y = y1; 114 | 115 | //vec2.x = x2; 116 | //vec2.y = y2; 117 | 118 | //float distance = vec1.distanceTo(vec2); 119 | 120 | 121 | 122 | //if (distance > 1000) { 123 | // Vector3 lastVec = vec1; 124 | // Vector3 newVec; 125 | // for (int i = 0; i < distance / 200; i++) { 126 | // color = ImColor(random(0, 255), random(0, 255), random(0, 255)); 127 | // newVec = lastVec.Extend(vec2, min(200, lastVec.distanceTo(vec2))); 128 | // ImGui::GetWindowDrawList()->AddLine(ImVec2(lastVec.x, lastVec.y), ImVec2(newVec.x, newVec.y), color, thickness); 129 | // lastVec = newVec; 130 | // } 131 | //} 132 | //else 133 | ImGui::GetWindowDrawList()->AddLine(ImVec2(x1, y1), ImVec2(x2, y2), color, thickness); 134 | } 135 | 136 | void Render::Draw_FilledRectangle(ImVec2 pos, ImVec2 size, ImColor color, ImColor borderColor, float thickness) { 137 | Render::Draw_FilledRectangle(pos.x, pos.y, pos.x + size.x, pos.y + size.y, color, borderColor, thickness); 138 | } 139 | 140 | void Render::Draw_FilledRectangle(float_t x1, float_t y1, float_t x2, float_t y2, ImColor color, ImColor borderColor, float thickness) { 141 | ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(x1, y1), ImVec2(x2, y2), color); 142 | if (borderColor != ImColor::ImColor(0, 0, 0, 0)) { 143 | ImGui::GetWindowDrawList()->AddLine(ImVec2(x1, y1), ImVec2(x2, y1), borderColor, thickness); 144 | ImGui::GetWindowDrawList()->AddLine(ImVec2(x2, y1), ImVec2(x2, y2), borderColor, thickness); 145 | 146 | ImGui::GetWindowDrawList()->AddLine(ImVec2(x1, y2), ImVec2(x2, y2), borderColor, thickness); 147 | ImGui::GetWindowDrawList()->AddLine(ImVec2(x1, y2), ImVec2(x1, y1), borderColor, thickness); 148 | } 149 | } 150 | 151 | void Render::Polygon(Geometry::Polygon poly, ImColor color, float tick) 152 | { 153 | //Vector3 out; 154 | ImVec2 points[200]; 155 | int i = 0; 156 | for (auto& point : poly.Points) 157 | { 158 | //out = Function::WorldToScreen(&point); 159 | Vector2 screenSpace = Function::WorldToScreen(&point); 160 | points[i].x = screenSpace.x; 161 | points[i].y = screenSpace.y; 162 | i++; 163 | } 164 | 165 | ImGui::GetWindowDrawList()->AddPolyline(points, i, color, true, tick); 166 | } 167 | 168 | void draw_line(Vector2 start_pos, Vector2 end_pos, ImColor color, float thickness) 169 | { 170 | ImGui::GetWindowDrawList()->AddLine(ImVec2(start_pos.x, start_pos.y), ImVec2(end_pos.x, end_pos.y), color, thickness); 171 | } 172 | void draw_line(Vector3 start_pos, Vector3 end_pos, ImColor color, float thickness) 173 | { 174 | //delete temp; 175 | ImGui::GetWindowDrawList()->AddLine(Function::WorldToScreen(&start_pos), Function::WorldToScreen(&end_pos), color, thickness); 176 | } 177 | void draw_line3D(Vector3 start_pos, Vector3 end_pos, ImColor color, float thickness) 178 | { 179 | //delete temp; 180 | ImGui::GetWindowDrawList()->AddLine(Function::WorldToScreen(&start_pos), Function::WorldToScreen(&end_pos), color, thickness); 181 | } 182 | 183 | void Render::Rect(Vector3 start, Vector3 end, float radius, float width, ImColor color) { 184 | Vector3 vector = (end - start).Normalized(); 185 | Vector3 value = vector.Perpendicular(); 186 | Vector3 point2 = start + value * radius; 187 | Vector3 point3 = start - value * radius; 188 | Vector3 point4 = end + value * radius; 189 | Vector3 point5 = end - value * radius; 190 | 191 | draw_line(point2, point4, color, width); 192 | draw_line(point3, point5, color, width); 193 | draw_line(point2, point3, color, width); 194 | draw_line(point5, point4, color, width); 195 | } 196 | 197 | void Render::Draw_Text(ImVec2 pos, std::string text, ImU32 color, int fontSize) { 198 | Render::Draw_Text(pos.x, pos.y, text, color, fontSize); 199 | } 200 | 201 | void Render::Draw_Text(float_t x, float_t y, std::string text, ImU32 color, int fontSize) { 202 | ImGui::GetWindowDrawList()->AddText(NULL, fontSize, ImVec2(x, y), color, text.c_str()); 203 | } 204 | 205 | void Render::Draw_Text_Centered(ImVec2 pos, ImVec2 size, std::string text, ImU32 color, int fontSize) { 206 | Render::Draw_Text_Centered(pos.x, pos.y, size.x, size.y, text, color, fontSize); 207 | } 208 | 209 | void Render::Draw_Text_Centered(float_t x, float_t y, float_t width, float_t height, std::string text, ImU32 color, int fontSize) { 210 | ImVec2 textSize = ImGui::CalcTextSize(text.c_str()); 211 | 212 | ImGui::GetWindowDrawList()->AddText(NULL, fontSize, ImVec2(x + width / 2 - textSize.x / 2, y + height / 2 - textSize.y / 2), color, text.c_str()); 213 | } 214 | 215 | void Render::Draw_Image(ImVec2 pos, ImVec2 size, ID3D11ShaderResourceView* image) { 216 | Render::Draw_Image(pos.x, pos.y, size.x, size.y, image); 217 | } 218 | 219 | void Render::Draw_Image(float_t x, float_t y, float_t width, float_t height, ID3D11ShaderResourceView* image) { 220 | ImGui::GetWindowDrawList()->AddImage(image, ImVec2(x, y), ImVec2(x + width, y + height)); 221 | } -------------------------------------------------------------------------------- /LeagueAddon/Render.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ImGui/imgui.h" 3 | #include "Vector.h" 4 | #include "Functions.h" 5 | #include "Geometry.h" 6 | #include "Resources.h" 7 | #include "directxmath.h" 8 | 9 | namespace Render { 10 | inline Image_Manager Images_Manager = nullptr; 11 | 12 | inline int RenderWidth; 13 | inline int RenderHeight; 14 | 15 | void BeginOverlay(); 16 | void EndOverlay(); 17 | 18 | void BeginOverlayTab(string name); 19 | void EndOverlayTab(); 20 | 21 | void Draw_Line(ImVec2 pos1, ImVec2 pos2, ImColor color, float thickness); 22 | void Draw_Line(float_t x1, float_t y1, float_t x2, float_t y2, ImColor color, float thickness); 23 | void Draw_Line3D(Vector3 pos1, Vector3 pos2, ImColor color, float thickness); 24 | 25 | void Draw_FilledRectangle(ImVec2 pos, ImVec2 size, ImColor color, ImColor borderColor = ImColor::ImColor(0, 0, 0, 0), float thickness = 1); 26 | void Draw_FilledRectangle(float_t x1, float_t y1, float_t x2, float_t y2, ImColor color, ImColor borderColor = ImColor::ImColor(0, 0, 0, 0), float thickness = 1); 27 | 28 | 29 | void Draw_Circle(float_t x, float_t y, float_t radius, ImColor color, float thickness); 30 | void Draw_Circle3DFilled(Vector3 center, float radius, ImColor color); 31 | void Draw_Circle3D(Vector3 center, float radius, ImColor color, float thickness); 32 | 33 | void Polygon(Geometry::Polygon poly, ImColor color, float tick); 34 | void Rect(Vector3 start, Vector3 end, float radius, float width, ImColor color); 35 | 36 | void Draw_Text(ImVec2 pos, std::string text, ImU32 color = 0xFFFFFFFF, int fontSize = 13); 37 | void Draw_Text(float_t x, float_t y, std::string text, ImU32 color = 0xFFFFFFFF, int fontSize = 13); 38 | void Draw_Text_Centered(ImVec2 pos, ImVec2 size, std::string text, ImU32 color = 0xFFFFFFFF, int fontSize = 13); 39 | void Draw_Text_Centered(float_t x, float_t y, float_t width, float_t height, std::string text, ImU32 color = 0xFFFFFFFF, int fontSize = 13); 40 | 41 | void Draw_Image(ImVec2 pos, ImVec2 size, ID3D11ShaderResourceView* image); 42 | void Draw_Image(float_t x, float_t y, float_t width, float_t height, ID3D11ShaderResourceView* image); 43 | } -------------------------------------------------------------------------------- /LeagueAddon/Scripts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Scripts/OrbWalker.h" 4 | #include "Scripts/Twitch.h" 5 | #include "Scripts/Garen.h" 6 | #include "Scripts/Akali.h" 7 | #include "Scripts/Yasuo.h" 8 | #include "Scripts/Draven.h" 9 | #include "Scripts/Vayne.h" 10 | #include "Scripts/Tristana.h" -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Akali.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EventManager/EventManager.h" 3 | #include "../Structs.h" 4 | #include "../Functions.h" 5 | #include "../Render.h" 6 | #include "../ObjectManager.h" 7 | #include "../Helper.h" 8 | 9 | namespace Akali { 10 | static bool SkillDamage = false; 11 | 12 | void OnDraw(); 13 | void OnMenu(); 14 | void Initialize(); 15 | } 16 | -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Draven.cpp: -------------------------------------------------------------------------------- 1 | #include "Draven.h" 2 | 3 | int lastWPressed = 0; 4 | 5 | void Draven::OnDraw() 6 | { 7 | Render::BeginOverlay(); 8 | 9 | if (GetAsyncKeyStateN(VK_SPACE) && Local->SpellBook.GetSpellSlotByID(1)->IsReady() && lastWPressed < GetTickCount()) { 10 | Input::PressKey(W); 11 | lastWPressed = GetTickCount() + 70; 12 | } 13 | 14 | Render::EndOverlay(); 15 | } 16 | 17 | void Draven::OnMenu() 18 | { 19 | if (ImGui::CollapsingHeader("Draven")) { 20 | if (ImGui::TreeNode("Q")) { 21 | ImGui::Checkbox("OrbWalking Draven Mode", &OrbWalker::dravenMode); 22 | ImGui::TreePop(); 23 | } 24 | if (ImGui::TreeNode("W")) { 25 | ImGui::Checkbox("Auto W", &autoW); 26 | ImGui::TreePop(); 27 | } 28 | } 29 | } 30 | 31 | void Draven::Initialize() 32 | { 33 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, &OnMenu); 34 | EventManager::AddEventHandler(EventManager::EventType::OnDraw, &OnDraw); 35 | } 36 | -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Draven.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EventManager/EventManager.h" 3 | #include "../Structs.h" 4 | #include "../Functions.h" 5 | #include "../Render.h" 6 | #include "../ObjectManager.h" 7 | #include "../HealthBar.h" 8 | #include "../Helper.h" 9 | #include "../Input.h" 10 | #include "OrbWalker.h" 11 | 12 | namespace Draven { 13 | inline int prevAxesCount = 0; 14 | inline bool autoW = false; 15 | 16 | void OnDraw(); 17 | void OnMenu(); 18 | void Initialize(); 19 | } -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Garen.cpp: -------------------------------------------------------------------------------- 1 | #include "Garen.h" 2 | #include "../HealthBar.h" 3 | #include "../Input.h" 4 | #include "windows.h" 5 | #include "../Utils.h" 6 | 7 | float Last_E_Pressed = 0; 8 | float Last_R_Pressed = 0; 9 | 10 | void Garen::OnMenu() { 11 | if (ImGui::CollapsingHeader("Garen")) { 12 | ImGui::Checkbox("Ult Autocast", &AutoCast); 13 | ImGui::Checkbox("Show skill Damage", &SkillDamage); 14 | ImGui::Separator(); 15 | } 16 | } 17 | 18 | GameObject* FindHoveredHero() { 19 | int heroIndex = *(int*)(*(uintptr_t*)(baseAddr + Offset::Data::HudInstance) + 0x1C0); 20 | int heroIndexPractice = *(int*)(*(uintptr_t*)(baseAddr + Offset::Data::HudInstance) + 0x13C); // pointer in Practice mode 21 | 22 | for (auto obj : ObjectManager::HeroList()) { 23 | if (obj->Index == heroIndex || obj->Index == heroIndexPractice) { 24 | 25 | return obj; 26 | } 27 | 28 | } 29 | return NULL; 30 | } 31 | 32 | bool IsBadHeroToUlt(GameObject* hero) { 33 | BuffManager* buffMng = &hero->BuffManager; 34 | if ( 35 | hero->IsTargetable 36 | && !hero->IsInvulnearable(Local) 37 | && !buffMng->hasBuff("UndyingRage") 38 | && !buffMng->hasBuff("sionpassivezombie") 39 | ) 40 | return false; 41 | return true; 42 | } 43 | 44 | void Garen::OnDraw() { 45 | if (GetAsyncKeyState('E') && Local->SpellBook.GetSpellSlotByID(2)->IsReady()) { 46 | Last_E_Pressed = Function::GameTime(); 47 | } 48 | 49 | int ultLvl = Local->SpellBook.GetSpellSlotByID(3)->GetLevel(); 50 | Render::BeginOverlay(); 51 | ImGui::SetWindowPos(ImVec2(0, 0)); 52 | ImGui::SetWindowSize(ImVec2(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN))); 53 | 54 | for (auto obj : ObjectManager::HeroList()) { 55 | float health = obj->Health; 56 | float shield = obj->Shield; 57 | float maxHealth = obj->MaxHealth; 58 | Vector3 pos = obj->Position; 59 | //Vector3 w2sPos = obj.GetHpBarPosition(); 60 | //Vector3 HpBarPosition = obj.GetHpBarPosition(); 61 | Vector3 w2sPos = Function::WorldToScreen(&pos); 62 | 63 | 64 | HealthBar hpBar = HealthBar(HealthBarType::UnderHero); 65 | 66 | 67 | if (obj->isValid() && obj->IsEnemyTo(Local) && Function::IsAlive(obj) && obj->IsVisible) { 68 | float percents = 0; 69 | float hp = 0; 70 | 71 | if (ultLvl == 1) { 72 | percents = 25; 73 | hp = 150; 74 | } 75 | else if (ultLvl == 2) { 76 | percents = 30; 77 | hp = 300; 78 | } 79 | else if (ultLvl == 3) { 80 | percents = 35; 81 | hp = 450; 82 | } 83 | 84 | float damage = hp + ((maxHealth - health) / 100 * percents); 85 | if (damage < 0) 86 | damage = 0; 87 | 88 | float dmg = 0; 89 | float dhp = maxHealth; 90 | 91 | //if (!CheatEngine::PerformanceMode) { 92 | for (dhp = maxHealth; (dhp + 0) > dmg; dhp--) { 93 | dmg = hp + ((maxHealth - dhp) / 100 * percents); 94 | } 95 | //} 96 | if ((health + shield) < damage) { 97 | hpBar.AddLeftArea(health + shield, ImColor::ImColor(192, 57, 43)); 98 | hpBar.Draw(pos, health, maxHealth); 99 | if (AutoCast && Local->SpellBook.GetSpellSlotByID(3)->IsReady()) { 100 | GameObject* hovered = FindHoveredHero(); 101 | if (hovered != NULL && hovered->NetworkID == obj->NetworkID) 102 | { 103 | if (Local->Position.Distance(pos) <= 400 && !IsBadHeroToUlt(obj) && Last_R_Pressed < GetTickCount()) { // Garen Ult distance 384 104 | Input::PressKey(HKey::R); 105 | Last_R_Pressed = GetTickCount() + 80; 106 | } 107 | } 108 | } 109 | } 110 | else { 111 | if (SkillDamage) { 112 | CSpellSlot* QSpell = Local->SpellBook.GetSpellSlotByID(0); 113 | CSpellSlot* ESpell = Local->SpellBook.GetSpellSlotByID(2); 114 | 115 | int drawOffset = 0; 116 | if (QSpell->GetLevel() > 0 && QSpell->IsReady()) { // Q Damage 117 | int baseDamage = 0; 118 | int summaryDamage = 0; 119 | switch (QSpell->GetLevel()) { 120 | case 1: 121 | { 122 | baseDamage = 30; 123 | break; 124 | } 125 | case 2: 126 | { 127 | baseDamage = 60; 128 | break; 129 | } 130 | case 3: 131 | { 132 | baseDamage = 90; 133 | break; 134 | } 135 | case 4: 136 | { 137 | baseDamage = 120; 138 | break; 139 | } 140 | case 5: 141 | { 142 | baseDamage = 150; 143 | break; 144 | } 145 | } 146 | 147 | summaryDamage = GetDamageWithArmor(baseDamage + (Local->BaseAttackDamage + Local->BonusAttackDamage) * 1.50, obj->Armor); 148 | hpBar.AddRightArea(summaryDamage, ImColor::ImColor(243, 156, 18)); 149 | } 150 | 151 | 152 | 153 | if (ESpell->GetLevel() > 0 && ESpell->IsReady() || Last_E_Pressed + 3 >= Function::GameTime()) { // E Damage 154 | const int duration = 3; 155 | 156 | float coefficient = 0; 157 | float coefficientN = 0; 158 | int ticks = 7; 159 | int baseDamage = 0; 160 | int baseDamageN = 0; 161 | int summaryDamage = 0; 162 | int summaryDamageN = 0; 163 | switch (ESpell->GetLevel()) { 164 | case 1: 165 | { 166 | baseDamage = 4; 167 | baseDamageN = 5; 168 | coefficient = 32; 169 | coefficientN = 40; 170 | break; 171 | } 172 | case 2: 173 | { 174 | baseDamage = 8; 175 | baseDamageN = 10; 176 | coefficient = 34; 177 | coefficientN = 42.5; 178 | break; 179 | } 180 | case 3: 181 | { 182 | baseDamage = 12; 183 | baseDamageN = 15; 184 | coefficient = 36; 185 | coefficientN = 45; 186 | break; 187 | } 188 | case 4: 189 | { 190 | baseDamage = 16; 191 | baseDamageN = 20; 192 | coefficient = 38; 193 | coefficientN = 47.5; 194 | break; 195 | } 196 | case 5: 197 | { 198 | baseDamage = 20; 199 | baseDamageN = 25; 200 | coefficient = 40; 201 | coefficientN = 50; 202 | break; 203 | } 204 | } 205 | ticks += floor(Local->AttackSpeedMulti * 100 / 25); 206 | coefficient /= 100; 207 | coefficientN /= 100; 208 | const float dmgPerTick = GetDamageWithArmor((baseDamage + (Local->BaseAttackDamage + Local->BonusAttackDamage) * coefficient), obj->Armor); 209 | const float dmgPerTickN = GetDamageWithArmor((baseDamageN + (Local->BaseAttackDamage + Local->BonusAttackDamage) * coefficientN), obj->Armor); 210 | summaryDamage = dmgPerTick * ticks; 211 | summaryDamageN = dmgPerTickN * ticks; 212 | if (ESpell->GetSpellInfo()->GetSpellData()->GetSpellName() == "GarenECancel") { 213 | float timePassed = Last_E_Pressed - Function::GameTime(); 214 | float damageGiven = dmgPerTick * floor(timePassed / duration * ticks); 215 | float damageGivenN = dmgPerTickN * floor(timePassed / duration * ticks); 216 | summaryDamage += damageGiven; 217 | summaryDamageN += damageGivenN; 218 | } 219 | hpBar.AddRightArea(summaryDamage, ImColor::ImColor(236, 240, 241)); 220 | hpBar.AddRightArea(-(summaryDamageN - summaryDamage), ImColor::ImColor(127, 140, 141)); // dont know why, but nearest damage is not nearest damage 221 | } 222 | } 223 | 224 | if (ultLvl > 0 && Local->SpellBook.GetSpellSlotByID(3)->IsReady()) 225 | hpBar.AddLeftArea(dhp, ImColor::ImColor(241, 196, 15)); 226 | hpBar.Draw(pos, health + shield, maxHealth); 227 | 228 | } 229 | 230 | } 231 | } 232 | 233 | Render::EndOverlay(); 234 | } 235 | 236 | void Garen::Initialize() { 237 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, &OnMenu); 238 | EventManager::AddEventHandler(EventManager::EventType::OnDraw, &OnDraw); 239 | } -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Garen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EventManager/EventManager.h" 3 | #include "../Structs.h" 4 | #include "../Functions.h" 5 | #include "../Render.h" 6 | #include "../ObjectManager.h" 7 | 8 | namespace Garen { 9 | static bool AutoCast = false; 10 | static bool SkillDamage = false; 11 | static double Last_E_Pressed = 0; 12 | 13 | void OnDraw(); 14 | void OnMenu(); 15 | void Initialize(); 16 | } 17 | -------------------------------------------------------------------------------- /LeagueAddon/Scripts/OrbWalker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Offset.h" 3 | #include "../Utils.h" 4 | #include "../ObjectManager.h" 5 | #include "../Helper.h" 6 | #include "../Health.h" 7 | #include "../Settings.h" 8 | 9 | namespace OrbWalker { 10 | inline std::list MinionListAA; 11 | 12 | enum class OrbwalkingMode 13 | { 14 | LastHit, 15 | Mixed, 16 | LaneClear, 17 | Combo, 18 | Freeze, 19 | CustomMode, 20 | None 21 | }; 22 | 23 | enum TargetType { 24 | LowestHealth, 25 | }; 26 | 27 | inline GameObject* _prevMinion = nullptr; 28 | inline int DelayOnFire = 0; 29 | inline unsigned int DelayOnFireId = 0; 30 | inline int BrainFarmInt = -100; 31 | inline float LaneClearWaitTimeMod = 2.f; 32 | inline OrbwalkingMode _mode = OrbwalkingMode::None; 33 | inline TargetingMode _targetingMode = TargetingMode::LowHP; 34 | 35 | inline bool enabled = false; 36 | inline bool selectedPriority = false; 37 | 38 | inline bool _working = false; 39 | 40 | inline bool lockCamera = true; 41 | 42 | inline bool Reseted = false; 43 | inline float LastAttackCommandT; 44 | inline float LastMoveCommandT; 45 | 46 | inline bool dravenMode = false; 47 | inline bool TristanaTargetE = false; 48 | inline bool vayneQMode = false; 49 | inline float vayneQDelay = 0; 50 | inline float vayneCanAttack = 0; 51 | 52 | float GetMyProjectileSpeed(); 53 | 54 | bool ShouldWait(); 55 | 56 | bool CanAttack(); 57 | bool CanMove(float extraWindup); 58 | GameObject* GetTarget(); 59 | void Orbwalk(GameObject* target, float extraWindup = 0.0f); 60 | void OnUpdate(); 61 | void OnDraw(); 62 | void OnMenu(); 63 | void OnProcessSpell(void* spellBook, SpellInfo* castInfo); 64 | void OnDeleteObject(void* thisPtr, GameObject* obj); 65 | void Initialize(); 66 | void OnLoad(); 67 | void OnUnload(); 68 | 69 | std::string AttackResets[]; 70 | } -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Tristana.cpp: -------------------------------------------------------------------------------- 1 | #include "Tristana.h" 2 | 3 | float lastPressTimeTristana = 0; 4 | 5 | void Tristana::OnDraw() 6 | { 7 | Render::BeginOverlay(); 8 | 9 | if (autoE) { 10 | auto eSpell = Local->SpellBook.GetSpellSlotByID(2); 11 | if (true) { 12 | GameObject* target = TargetSelector::GetTarget(550, DamageType::Physical, false); 13 | //auto target = Local; 14 | if (target) { 15 | Vector3 targetPos = target->Position; 16 | 17 | 18 | if (eSpell->IsReady() && Local->Mana > 90 && GetAsyncKeyStateN(VK_SPACE)) { 19 | Vector3 w2s = Function::WorldToScreen(&target->Position); 20 | if (lastPressTimeTristana < GetTickCount()) 21 | { 22 | Input::Move(w2s.x, w2s.y); 23 | Input::PressKey(E); 24 | lastPressTimeTristana = GetTickCount() + 70; 25 | } 26 | } 27 | } 28 | } 29 | } 30 | 31 | 32 | Render::EndOverlay(); 33 | } 34 | 35 | void Tristana::OnMenu() 36 | { 37 | if (ImGui::CollapsingHeader("Tristana")) { 38 | if (ImGui::TreeNode("AutoE##Tristana")) { 39 | ImGui::Checkbox("Enabled##TristanaTargetE", &autoE); 40 | 41 | ImGui::TreePop(); 42 | } 43 | if (ImGui::TreeNode("OrbWalker##Tristana")) { 44 | ImGui::Checkbox("E Priority", &OrbWalker::TristanaTargetE); 45 | ImGui::TreePop(); 46 | } 47 | } 48 | } 49 | 50 | void Tristana::Initialize() 51 | { 52 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, &OnMenu); 53 | EventManager::AddEventHandler(EventManager::EventType::OnDraw, &OnDraw); 54 | } 55 | -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Tristana.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EventManager/EventManager.h" 3 | #include "../Structs.h" 4 | #include "../Functions.h" 5 | #include "../Render.h" 6 | #include "../ObjectManager.h" 7 | #include "../HealthBar.h" 8 | #include "../Helper.h" 9 | #include "../Input.h" 10 | #include "OrbWalker.h" 11 | #include "../TargetSelector.h" 12 | 13 | namespace Tristana { 14 | inline bool autoE = false; 15 | 16 | void OnDraw(); 17 | void OnMenu(); 18 | void Initialize(); 19 | } -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Twitch.cpp: -------------------------------------------------------------------------------- 1 | #include "Twitch.h" 2 | 3 | void Twitch::OnDraw() 4 | { 5 | Render::BeginOverlay(); 6 | if (_eDamage) { 7 | CSpellSlot* spellE = Local->SpellBook.GetSpellSlotByID(2); 8 | if (spellE->GetLevel() > 0 && spellE->IsReady()) { 9 | float baseDmg = 20 + (10 * (spellE->GetLevel() - 1)); 10 | float baseStackDmg = 15 + (5 * (spellE->GetLevel() - 1)); 11 | float baseStackAddPhysDmg = Local->BonusAttackDamage * 0.35; // Base stack additional Physical damage 12 | float baseStackAddMagDmg = Local->BaseAbilityDamage * 0.35; 13 | 14 | for (auto obj : ObjectManager::HeroList()) { 15 | if (obj->IsEnemyTo(Local) && Function::IsAlive(obj) && obj->Position.Distance(Local->Position) < 1200) { 16 | HealthBar healthBar = HealthBar(HealthBarType::UnderHero); 17 | BuffManager* buffMng = &obj->BuffManager; 18 | BuffEntry* venom = buffMng->getBuff("TwitchDeadlyVenom"); 19 | if (venom) { 20 | float objHealth = obj->Health + obj->Shield; 21 | int stacks = venom->getCount(); 22 | float physDamage = Helper::calcReducedDamage(baseDmg + ((baseStackDmg + baseStackAddPhysDmg) * stacks), obj->Armor, Local->ArmorPenMod, Local->ArmorPen, false); 23 | float magDamage = Helper::calcReducedDamage(baseStackAddMagDmg * stacks, obj->MagicRes, Local->MagicPenMod, Local->MagicPenFlat, false); 24 | 25 | ImColor color; 26 | if (obj->Health + obj->Shield < physDamage + magDamage) 27 | color = ImColor::ImColor(192, 57, 43); 28 | else if (stacks == 6) 29 | color = ImColor::ImColor(243, 156, 18); 30 | else color = ImColor::ImColor(52, 152, 219); 31 | healthBar.AddRightArea(physDamage + magDamage, color); 32 | 33 | healthBar.Draw(obj->Position, obj->Health + obj->Shield, obj->MaxHealth); 34 | } 35 | } 36 | } 37 | } 38 | 39 | } 40 | Render::EndOverlay(); 41 | } 42 | 43 | void Twitch::OnMenu() 44 | { 45 | if (ImGui::CollapsingHeader("Twitch")) { 46 | ImGui::Checkbox("Show E Damage", &_eDamage); 47 | } 48 | } 49 | 50 | void Twitch::Initialize() 51 | { 52 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, &OnMenu); 53 | EventManager::AddEventHandler(EventManager::EventType::OnDraw, &OnDraw); 54 | } 55 | -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Twitch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EventManager/EventManager.h" 3 | #include "../Structs.h" 4 | #include "../Functions.h" 5 | #include "../Render.h" 6 | #include "../ObjectManager.h" 7 | #include "../HealthBar.h" 8 | #include "../Helper.h" 9 | 10 | namespace Twitch { 11 | inline bool _eDamage = false; 12 | 13 | void OnDraw(); 14 | void OnMenu(); 15 | void Initialize(); 16 | } -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Vayne.cpp: -------------------------------------------------------------------------------- 1 | #include "Vayne.h" 2 | 3 | float lastPressTime = 0; 4 | 5 | void Vayne::OnDraw() 6 | { 7 | Render::BeginOverlay(); 8 | 9 | if (autoE) { 10 | auto eSpell = Local->SpellBook.GetSpellSlotByID(2); 11 | if (true) { 12 | GameObject* target = TargetSelector::GetTarget(550, DamageType::Physical, false); 13 | //auto target = Local; 14 | if (target) { 15 | Vector3 targetPos = target->Position; 16 | // knockback dist = 475 17 | // missilespeed 2200 18 | const float castTime = 0.413f; // in seconds 19 | const float flyTime = Local->Position.distanceTo(target->Position) / 2200; 20 | auto targetAI = target->GetAIManager(); 21 | Vector3 velocity = targetAI->Velocity; 22 | 23 | Vector3 nextPos = targetPos + velocity * ((castTime + flyTime) * 10); 24 | 25 | Vector3 hitPos1 = nextPos.Extend(Local->Position, -475); 26 | Vector3 hitPos2 = targetPos.Extend(Local->Position, -475); 27 | 28 | bool hitWall1 = false, hitWall2 = false; 29 | int i1, i2; 30 | for (i1 = 0; i1 < 475; i1 += 5) { 31 | if (Function::IsWall(nextPos.Extend(hitPos1, i1))) { 32 | hitWall1 = true; 33 | break; 34 | } 35 | } 36 | 37 | for (i2 = 0; i2 < 475; i2 += 5) { 38 | if (Function::IsWall(targetPos.Extend(hitPos2, i2))) { 39 | hitWall2 = true; 40 | break; 41 | } 42 | } 43 | 44 | Render::Draw_Line3D(targetPos, nextPos, hitWall1 ? ImColor(231, 76, 60) : ImColor(52, 152, 219), 1); 45 | Render::Draw_Line3D(nextPos, nextPos.Extend(hitPos1, i1), hitWall1 ? ImColor(231, 76, 60) : ImColor(52, 152, 219), 1); 46 | 47 | if (hitWall1 && (!autoEHighChance || hitWall2) && eSpell->IsReady() && Local->Mana > 90 && GetAsyncKeyStateN(VK_SPACE)) { 48 | Vector3 w2s = Function::WorldToScreen(&target->Position); 49 | 50 | if (lastPressTime < GetTickCount()) 51 | { 52 | Input::Move(w2s.x, w2s.y); 53 | Input::PressKey(E); 54 | lastPressTime = GetTickCount() + 70; 55 | } 56 | } 57 | } 58 | } 59 | } 60 | 61 | 62 | Render::EndOverlay(); 63 | } 64 | 65 | void Vayne::OnMenu() 66 | { 67 | if (ImGui::CollapsingHeader("Vayne")) { 68 | if (ImGui::TreeNode("AutoE##Vayne")) { 69 | ImGui::Checkbox("Enabled##VayneAutoE", &autoE); 70 | ImGui::Checkbox("High precision##VayneAutoE", &autoEHighChance); 71 | 72 | ImGui::TreePop(); 73 | } 74 | if (ImGui::TreeNode("OrbWalker##Vayne")) { 75 | ImGui::Checkbox("Wait before attack in Q", &OrbWalker::vayneQMode); 76 | ImGui::SliderFloat("Delay", &OrbWalker::vayneQDelay, 0, 1, "%1.2f"); 77 | ImGui::TreePop(); 78 | } 79 | } 80 | } 81 | 82 | void Vayne::Initialize() 83 | { 84 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, &OnMenu); 85 | EventManager::AddEventHandler(EventManager::EventType::OnDraw, &OnDraw); 86 | } 87 | -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Vayne.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EventManager/EventManager.h" 3 | #include "../Structs.h" 4 | #include "../Functions.h" 5 | #include "../Render.h" 6 | #include "../ObjectManager.h" 7 | #include "../HealthBar.h" 8 | #include "../Helper.h" 9 | #include "../Input.h" 10 | #include "OrbWalker.h" 11 | #include "../TargetSelector.h" 12 | 13 | namespace Vayne { 14 | inline bool autoE = false; 15 | inline bool autoEHighChance = false; 16 | 17 | void OnDraw(); 18 | void OnMenu(); 19 | void Initialize(); 20 | } -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Yasuo.cpp: -------------------------------------------------------------------------------- 1 | #include "Yasuo.h" 2 | //#include "HealthBar.h" 3 | #include 4 | #include 5 | #include "../AddonEngine.h" 6 | #include "../Structs.h" 7 | #include "../ObjectManager.h" 8 | #include "../Input.h" 9 | #include "../EventManager/EventManager.h" 10 | 11 | //#include "Prediction.h" 12 | 13 | Vector3 Predict(Vector3 startPoint, Vector3 velocity, double milliseconds) { 14 | milliseconds /= 1000; 15 | milliseconds *= 16; 16 | return startPoint + (velocity * milliseconds); 17 | } 18 | 19 | GameObject* GetNearestToCursor(POINT cursorPos, std::vector* objects, double nearestDistance) { 20 | if (objects->size() > 0) { 21 | GameObject* nearest = NULL; 22 | /* for (int i = 0; i < objects->size(); i++) 23 | { 24 | if (obj.NetworkId != CheatEngine::localPlayer.NetworkId) { 25 | nearest = &obj; 26 | break; 27 | } 28 | } */ 29 | for (auto obj : ObjectManager::HeroList()) { 30 | if (obj->NetworkID != Local->NetworkID) { 31 | Vector3 cursor = Vector3(cursorPos.x, cursorPos.y, 0); 32 | Vector3 lpW2S = Function::WorldToScreen(&Local->Position); 33 | Vector3 objW2S = Function::WorldToScreen(&obj->Position); 34 | 35 | 36 | if (cursor.Distance(objW2S) < nearestDistance) { 37 | if (Function::IsAlive(obj) && obj->IsVisible && obj->IsEnemyTo(Local)) { 38 | nearest = obj; 39 | nearestDistance = lpW2S.Distance(objW2S); 40 | } 41 | 42 | } 43 | } 44 | } 45 | return nearest; 46 | } 47 | return NULL; 48 | } 49 | 50 | void Yasuo::MainThread() { 51 | 52 | CSpellSlot* QSpell = Local->SpellBook.GetSpellSlotByID(0); 53 | //CSpellSlot* WSpell = Local->SpellBook.GetSpellSlotByID(1); 54 | CSpellSlot* ESpell = Local->SpellBook.GetSpellSlotByID(2); 55 | //CSpellSlot* RSpell = Local->SpellBook.GetSpellSlotByID(3); 56 | AIManager* localAIManager = Local->GetAIManager(); 57 | 58 | POINT cursorPos; 59 | typedef BOOL(__stdcall* fGetCursorPos) (LPPOINT lpPoint); 60 | if (Q_Aim && (QSpell->GetName() == "YasuoQ1Wrapper" || QSpell->GetName() == "YasuoQ2Wrapper") && GetAsyncKeyStateN('Q') && QSpell->IsReady()) { 61 | if (Input::oGetCursorPos == 0) 62 | return; 63 | ((fGetCursorPos)Input::oGetCursorPos)(&cursorPos); 64 | std::list nearPlayers; 65 | for (auto obj : ObjectManager::HeroList()) { 66 | if (Local->Position.Distance(obj->Position) < 520) { 67 | nearPlayers.push_back(obj); 68 | } 69 | } 70 | if (nearPlayers.size() == 0) { 71 | nearPlayers = ObjectManager::HeroList(); 72 | } 73 | GameObject* obj = GetNearestToCursor(cursorPos, (vector*) & nearPlayers, 520); 74 | if (obj != NULL) { 75 | AIManager* aiManager = obj->GetAIManager(); 76 | if (obj != NULL && obj->NetworkID != Local->NetworkID) { 77 | Vector3 pos = obj->Position; 78 | Vector3 predictedPath = Predict(pos, aiManager->Velocity, 350 - (Local->AttackSpeedMulti * 100) / 2); 79 | Vector3 w2s = Function::WorldToScreen(&predictedPath); 80 | 81 | if (Local->Position.Distance(predictedPath) <= 520) { 82 | //Functions.WorldToScreen(&pos, &w2s); 83 | if (!Settings::Global::useCastSpell) { 84 | Function::NewCastSpell(0, 2, w2s.x, w2s.y); 85 | } 86 | 87 | 88 | 89 | //if (w2s.x >= 0 && w2s.y >= 0 && w2s.x <= Render::RenderWidth && w2s.y <= Render::RenderHeight) { 90 | 91 | //Functions.PrintChat(Offset::Chat, ("Input::Move called Input::mMouse [" + to_string(Input::mMouseX) + "] [" + to_string(Input::mMouseY) + "]").c_str(), 0xFFFFFF); 92 | Q_Pressed = Function::GameTimeTick(); 93 | //} 94 | } 95 | } 96 | } 97 | } 98 | /*if (UseQinEWhenFlash) { 99 | if (GetAsyncKeyStateN('D')) { 100 | Input::PressKey(HKey::Q); 101 | } 102 | }*/ 103 | } 104 | 105 | void Yasuo::OnMenu() { 106 | if (Local->NetworkID != -1 && Local->GetChampionName() == "Yasuo") { 107 | if (ImGui::CollapsingHeader("Yasuo")) { 108 | ImGui::Checkbox("Q Aim Assist", &Q_Aim); 109 | ImGui::Checkbox("Use Q when Flash in E", &UseQinEWhenFlash); 110 | 111 | //ImGui::Checkbox("Show skill damage", &SkillDamage); 112 | 113 | //ImGui::Checkbox("Ult Autocast", &AutoCast); 114 | //ImGui::Checkbox("Show skill Damage", &SkillDamage); 115 | ImGui::Separator(); 116 | } 117 | } 118 | } 119 | 120 | void Yasuo::OnDraw() { 121 | MainThread(); 122 | //int ultLvl = CheatEngine::localPlayer.GetSpellBook()->GetSpellSlotByID(3)->GetLevel(); 123 | //ImGui::Begin("Overlay", &CheatEngine::OverlayOpen, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoTitleBar); 124 | Render::BeginOverlay(); 125 | 126 | if (Yasuo::Q_Aim) 127 | for (auto obj : ObjectManager::HeroList()) { 128 | if (obj->IsEnemyTo(Local) && Function::IsAlive(obj)) { 129 | AIManager* aiManager = obj->GetAIManager(); 130 | Vector3 pos = obj->Position; 131 | //Vector3 w2sPos = obj.GetHpBarPosition(); 132 | //Vector3 HpBarPosition = obj.GetHpBarPosition(); 133 | Vector3 w2sPos = Function::WorldToScreen(&pos); 134 | 135 | 136 | Vector3 predictedPath = Predict(pos, aiManager->Velocity, 350 - (Local->AttackSpeedMulti * 100) / 2); 137 | Vector3 w2sPrediction = Function::WorldToScreen(&predictedPath); 138 | 139 | ImColor color; 140 | if (Local->Position.Distance(predictedPath) < 520) 141 | color = ImColor(192, 57, 43); 142 | else 143 | color = ImColor(41, 128, 185); 144 | Render::Draw_Line(ImVec2(w2sPos.x, w2sPos.y), ImVec2(w2sPrediction.x, w2sPrediction.y), color, 1); 145 | Render::Draw_Circle3D(predictedPath, 10, color, 1); 146 | } 147 | } 148 | 149 | Render::EndOverlay(); 150 | } 151 | 152 | void Yasuo::Initialize() { 153 | EventManager::AddEventHandler(EventManager::EventType::OnDraw, OnDraw); 154 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, OnMenu); 155 | } -------------------------------------------------------------------------------- /LeagueAddon/Scripts/Yasuo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace Yasuo { 5 | /*static bool AutoCast = false; 6 | static bool SkillDamage = false; 7 | static double Last_E_Pressed = 0;*/ 8 | static double Q_Pressed = 0; 9 | static double Q_Pressed_Frames = -1; 10 | static bool Q_Aim = false; 11 | static bool Q_Lasthit = false; 12 | 13 | static bool UseQinEWhenFlash = false; 14 | 15 | static bool SkillDamage = false; 16 | 17 | void Initialize(); 18 | void MainThread(); 19 | void OnMenu(); 20 | void OnDraw(); 21 | } 22 | -------------------------------------------------------------------------------- /LeagueAddon/Settings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Input.h" 3 | 4 | namespace Settings { 5 | namespace Global { 6 | inline bool useIssueOrder = true; 7 | inline bool useInput = true; 8 | inline bool useCastSpell; 9 | inline bool useNewCastSpell; 10 | } 11 | 12 | namespace Binding { 13 | inline HKey Spell1 = HKey::Q; 14 | inline HKey Spell2 = HKey::W; 15 | inline HKey Spell3 = HKey::E; 16 | inline HKey Spell4 = HKey::R; 17 | inline HKey Spell5 = HKey::D; 18 | inline HKey Spell6 = HKey::F; 19 | 20 | inline HKey Slot1 = HKey::Z; 21 | inline HKey Slot2 = HKey::X; 22 | inline HKey Slot3 = HKey::C; 23 | inline HKey Slot4 = HKey::V; 24 | inline HKey Slot5 = HKey::B; 25 | inline HKey Slot6 = HKey::N; 26 | 27 | static HKey GetSpellSlotBinding(int spellslot) { 28 | switch (spellslot) { 29 | case 0: 30 | return Spell1; 31 | break; 32 | case 1: 33 | return Spell2; 34 | break; 35 | case 2: 36 | return Spell3; 37 | break; 38 | case 3: 39 | return Spell4; 40 | break; 41 | case 4: 42 | return Spell5; 43 | break; 44 | case 5: 45 | return Spell6; 46 | break; 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /LeagueAddon/SkinChanger.cpp: -------------------------------------------------------------------------------- 1 | #include "SkinChanger.h" 2 | 3 | void SkinChanger::changeSkin2Player(GameObject* object, int skin) { 4 | 5 | auto addr = &object->CharacterDataStack; 6 | 7 | Function::CharacterDataStack_Push(addr, object->ChampionName, skin); 8 | Function::CharacterDataStack_Update(addr, true); 9 | //MessageBoxA(0, *(const char**)((uintptr_t)object->GetPtr() + (uintptr_t)0x2AC4), to_string(skin).c_str(), 0); 10 | } 11 | 12 | void SkinChanger::Initialize() { 13 | Resources::LoadSkinsDB(SkinsDB); 14 | 15 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, OnMenu); 16 | EventManager::AddEventHandler(EventManager::EventType::OnMenu, OnDraw); 17 | 18 | for (auto hero : ObjectManager::HeroList()) { 19 | heroesSkins[hero] = *(int*)((int)hero->SkinPtr + 0x14); 20 | } 21 | } 22 | 23 | 24 | void SkinChanger::OnThread() { 25 | 26 | } 27 | 28 | 29 | 30 | void SkinChanger::OnMenu() { 31 | if (ImGui::CollapsingHeader("SkinChanger")) { 32 | //ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth()); 33 | if (ImGui::Button("Disable all skins")) { 34 | for (auto obj : heroesSkins) { 35 | changeSkin2Player(obj.first, 0); 36 | } 37 | } 38 | 39 | int counter = 0; 40 | for (auto obj : heroesSkins) { 41 | Skin currentSkin; 42 | for (auto dbSkin : SkinsDB[obj.first->GetChampionName()]) { 43 | if (dbSkin.Id == obj.second) { 44 | currentSkin = dbSkin; 45 | break; 46 | } 47 | } 48 | if (ImGui::BeginCombo((obj.first->GetChampionName() + "##" + to_string(counter++)).c_str(), currentSkin.Name[currentLang].c_str())) { 49 | for (auto dbSkin : SkinsDB[obj.first->GetChampionName()]) { 50 | if (ImGui::Selectable(dbSkin.Name[currentLang].c_str(), dbSkin.Id == heroesSkins[obj.first])) { 51 | changeSkin2Player(obj.first, dbSkin.Id); 52 | heroesSkins[obj.first] = dbSkin.Id; 53 | } 54 | } 55 | ImGui::EndCombo(); 56 | } 57 | } 58 | } 59 | } 60 | 61 | void SkinChanger::OnDraw() { 62 | 63 | } -------------------------------------------------------------------------------- /LeagueAddon/SkinChanger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EventManager/EventManager.h" 3 | #include "ObjectManager.h" 4 | #include "Render.h" 5 | #include 6 | #include "Resources.h" 7 | 8 | namespace SkinChanger { 9 | inline string currentLang = "en_US"; 10 | 11 | inline std::map> SkinsDB; // string = ChampionName 12 | inline std::map heroesSkins; 13 | 14 | void changeSkin2Player(GameObject* object, int skin); 15 | 16 | void Initialize(); 17 | 18 | void OnThread(); 19 | void OnMenu(); 20 | void OnDraw(); 21 | } -------------------------------------------------------------------------------- /LeagueAddon/TargetSelector.cpp: -------------------------------------------------------------------------------- 1 | #include "TargetSelector.h" 2 | //#include "../Constants.h" 3 | #include "Helper.h" 4 | 5 | bool TargetSelector::checkUnit(GameObject* unit) 6 | { 7 | if (!Function::IsAlive(unit) || !unit->IsVisible) 8 | return false; 9 | if (unit->IsAllyTo(ObjectManager::GetLocalPlayer())) 10 | return false; 11 | 12 | return true; 13 | } 14 | 15 | void TargetSelector::Initialize() { 16 | attackOrder.clear(); 17 | attackOrderIgnore.clear(); 18 | attackOrderLast.clear(); 19 | for (auto hero : ObjectManager::HeroList()) { 20 | if (hero->IsEnemyTo(Local)) { 21 | attackOrderIgnore.push_back(hero); 22 | if (hero->GetChampionName() == "Yasuo") 23 | enemyYasuo = true; 24 | if (hero->GetChampionName() == "Samira") 25 | enemySamira.push_back(hero); 26 | } 27 | } 28 | } 29 | 30 | bool TargetSelector::IsValidUnit(GameObject* unit, float range, bool checkTeam, Vector3 from) 31 | { 32 | if (unit == nullptr || !Function::IsAlive(unit) || !unit->IsVisible) 33 | return false; 34 | if (checkTeam && unit->IsAllyTo(ObjectManager::GetLocalPlayer())) 35 | return false; 36 | if (unit->ChampionName == "WardCorpse") 37 | return false; 38 | if (!ObjectManager::GetLocalPlayer()->IsInRange(unit, range, true)) 39 | false; 40 | return true; 41 | } 42 | 43 | GameObject* TargetSelector::GetTarget(float range, DamageType damageType, bool ignoreShield, Vector3 rangeCheckFrom) 44 | { 45 | return GetTarget(Local, range, damageType, ignoreShield, rangeCheckFrom); 46 | } 47 | 48 | float calcActiveHP(float hp, float armor, float penetration, float lethality) { 49 | //1. Armor reduction, flat 50 | //2. Armor reduction, percentage 51 | //3. Armor penetration, percentage 52 | //4. Lethality 53 | 54 | armor = armor * penetration - lethality; 55 | return (1 + armor / 100) * hp; 56 | } 57 | 58 | GameObject* TargetSelector::GetTarget(GameObject* champion, float range, DamageType damageType, bool ignoreShield, Vector3 rangeCheckFrom) 59 | { 60 | GameObject* first = nullptr; 61 | int prevPriority = attackOrder.size(); 62 | TargetingMode prevTargetMode = mode; 63 | std::list objects = filter(ObjectManager::HeroList(), [&](GameObject* enemy) { return Helper::isValidUnit(enemy) && enemy->IsInRange(Local, range, true); }); 64 | 65 | //Render::BeginOverlay(); 66 | if (!ignoreShield && (enemyYasuo || enemySamira.size() > 0)) { 67 | std::vector shields; 68 | if (enemyYasuo) { 69 | auto yasuoShields = filter(ObjectManager::MissileList(), [&](MissileSpellInfo* mis) { return StringCompare(mis->BasicAttackSpellData->Name, "YasuoW_VisualMis"); }); 70 | 71 | for (auto shield : yasuoShields) { 72 | auto yas = ObjectManager::FindObjectByIndex(shield->source_id); 73 | if (yas->IsEnemyTo(Local)) { 74 | float shieldWidth = 250 + 70 * ObjectManager::FindObjectByIndex(shield->source_id)->SpellBook.GetSpellSlotByID(1)->GetLevel(); 75 | Geometry::Polygon area = Geometry::Rectangle(shield->EndPosition.Extend(shield->StartPosition, shield->BasicAttackSpellData->Resource->Radius * 2), shield->EndPosition, shieldWidth / 2).ToPolygon(); 76 | shields.push_back(area); 77 | } 78 | } 79 | } 80 | 81 | if (enemySamira.size() > 0) { 82 | for (auto samira : enemySamira) 83 | if (samira->BuffManager.hasBuff("SamiraW")) { 84 | auto area = Geometry::Circle(samira->Position, Function::GetBoundingRadius(samira) / 2 + 325).ToPolygon(); 85 | shields.push_back(area); 86 | } 87 | } 88 | 89 | //for (auto shield : shields) { 90 | // Render::Polygon(shield, ImColor(255, 255, 255), 1); 91 | //} 92 | 93 | if (shields.size() > 0) { 94 | auto it = objects.begin(); 95 | while (it != objects.end()) { 96 | bool intersec = false; 97 | for (auto shield : shields) { 98 | if (Evade::Core::FindIntersections(shield, Local->Position, (*it)->Position).size() > 0) { 99 | intersec = true; 100 | break; 101 | } 102 | } 103 | if (intersec) { 104 | it = objects.erase(it); 105 | } 106 | else { 107 | ++it; 108 | } 109 | } 110 | } 111 | } 112 | 113 | //for (auto h : objects) { 114 | // Render::Draw_Line3D(Local->Position, h->Position, ImColor(255, 0, 0), 1); 115 | //} 116 | 117 | //Render::EndOverlay(); 118 | 119 | std::list withoutLast = filter(objects, [&](GameObject* enemy) { return std::find(attackOrderLast.begin(), attackOrderLast.end(), enemy) == attackOrderLast.end(); }); 120 | if (withoutLast.size() > 0) { 121 | objects = withoutLast; 122 | } 123 | 124 | for (GameObject* next : objects) 125 | { 126 | switch (mode) 127 | { 128 | case TargetingMode::AutoPriority: 129 | //if (first == nullptr) 130 | // first = next; 131 | //if (first != nullptr) 132 | for (int i = 0; i < attackOrder.size(); i++) { 133 | if (next->NetworkID == attackOrder[i]->NetworkID && i < prevPriority) { 134 | prevPriority = i; 135 | first = next; 136 | break; 137 | } 138 | } 139 | break; 140 | case TargetingMode::LowHP: 141 | if (first == nullptr) 142 | first = next; 143 | if (first != nullptr && first->Health >= next->Health) 144 | first = next; 145 | break; 146 | case TargetingMode::LowEfficientHP: 147 | if (first == nullptr) 148 | first = next; 149 | if (first != nullptr && calcActiveHP(first->Health, first->Armor + first->BonusArmor, first->ArmorPenMod, first->ArmorPen) >= calcActiveHP(next->Health, next->Armor + next->BonusArmor, next->ArmorPenMod, next->ArmorPen)) 150 | first = next; 151 | break; 152 | case TargetingMode::MostAD: 153 | if (first == nullptr) 154 | first = next; 155 | if (first != nullptr && first->BaseAttackDamage + first->FlatPhysicalDamageMod > next->BaseAttackDamage + next->FlatPhysicalDamageMod) 156 | first = next; 157 | break; 158 | //case TargetingMode::MostAP: 159 | // if (first == nullptr) 160 | // first = next; 161 | // if (first != nullptr && first->BaseAbilityDamage + first->FlatMagicDamageMod > next->BaseAbilityDamage + next->FlatMagicDamageMod) 162 | // first = next; 163 | // break; 164 | case TargetingMode::Closest: 165 | if (first == nullptr) 166 | first = next; 167 | if (first != nullptr && (rangeCheckFrom.IsValid() ? rangeCheckFrom : champion->Position).DistanceSquared(first->Position) >= (rangeCheckFrom.IsValid() ? rangeCheckFrom : champion->Position).DistanceSquared(next->Position)) 168 | first = next; 169 | break; 170 | case TargetingMode::NearMouse: 171 | if (first == nullptr) 172 | first = next; 173 | if (first != nullptr && first->Position.DistanceSquared(*Function::GetMouseWorldPosition()) >= next->Position.DistanceSquared(*Function::GetMouseWorldPosition())) 174 | first = next; 175 | break; 176 | }; 177 | } 178 | if (first == nullptr && mode == TargetingMode::AutoPriority && objects.size() > 0) { 179 | mode = mode2; 180 | first = GetTarget(champion, range, damageType, ignoreShield, rangeCheckFrom); 181 | mode = prevTargetMode; 182 | } 183 | return first; 184 | } -------------------------------------------------------------------------------- /LeagueAddon/TargetSelector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "./ObjectManager.h" 3 | #include 4 | #include "Geometry.h" 5 | #include "Evade/Evade.h" 6 | 7 | using namespace std; 8 | 9 | namespace TargetSelector 10 | { 11 | inline bool enemyYasuo = false; 12 | inline std::list enemySamira; // URF All4One etc. 13 | inline bool IgnoreMissileShield = false; 14 | 15 | inline const char* targetingModeLabels[] = { "AutoPriority", "LowHP", "LowEfficientHP", "MostAD", "MostAP", "Closest", "NearMouse", "LessAttack", "LessCast", "MostStack" }; 16 | 17 | inline std::vector attackOrder; 18 | inline std::vector attackOrderIgnore; 19 | inline std::vector attackOrderLast; 20 | inline TargetingMode mode = TargetingMode::LowEfficientHP; 21 | inline TargetingMode mode2 = TargetingMode::LowEfficientHP; 22 | 23 | void Initialize(); 24 | bool checkUnit(GameObject* unit); 25 | bool IsValidUnit(GameObject* unit, float range = FLT_MAX, bool checkTeam = true, Vector3 from = Vector3()); 26 | GameObject* GetTarget(float range, DamageType damageType, bool ignoreShield = false, Vector3 rangeCheckFrom = Vector3()); 27 | GameObject* GetTarget(GameObject* champion, float range, DamageType damageType, bool ignoreShield = false, Vector3 rangeCheckFrom = Vector3(0, 0, 0)); 28 | } -------------------------------------------------------------------------------- /LeagueAddon/Utils.cpp: -------------------------------------------------------------------------------- 1 | #include "Utils.h" 2 | #include 3 | #include 4 | #include 5 | #include "Offset.h" 6 | 7 | using namespace std; 8 | 9 | bool IsLeagueInForeground() 10 | { 11 | //return true; 12 | return !*(bool*)((*(int*)DEFINE_RVA(Offset::Data::HudInstance)) + 0x69); 13 | 14 | /*TCHAR title[500]; 15 | GetWindowText(GetForegroundWindow(), title, 500); 16 | return wcscmp(title, L"League of Legends (TM) Client") == 0;*/ 17 | } 18 | 19 | HWND GetHwndProc() 20 | { 21 | HWND g_hWindow = GetTopWindow(NULL); 22 | DWORD currentPID = GetCurrentProcessId(); 23 | do 24 | { 25 | char title[256]; 26 | if ((GetWindowTextA(g_hWindow, title, 256) > 0) && (IsWindowVisible(g_hWindow))) 27 | { 28 | DWORD procId; 29 | GetWindowThreadProcessId(g_hWindow, &procId); 30 | 31 | if (procId == currentPID) 32 | { 33 | return g_hWindow; 34 | } 35 | } 36 | 37 | g_hWindow = GetNextWindow(g_hWindow, GW_HWNDNEXT); 38 | } while (g_hWindow); 39 | return NULL; 40 | } 41 | 42 | 43 | 44 | //std::string to_hex(int i) { 45 | // std::stringstream stream; 46 | // stream << std::hex << i; 47 | // std::string result(stream.str()); 48 | // 49 | // return result; 50 | //} 51 | 52 | bool firstTime = true; 53 | 54 | void Utils::Log(string text) { 55 | auto time = chrono::system_clock::now(); 56 | auto time_t = chrono::system_clock::to_time_t(time); 57 | ofstream myfile; 58 | if (firstTime) { 59 | myfile.open("Log.txt"); 60 | firstTime = !firstTime; 61 | } 62 | else { 63 | myfile.open("Log.txt", ios_base::app); 64 | } 65 | 66 | myfile << "[" + string(strtok(ctime(&time_t), "\n")) + "] " + text + "\n"; 67 | myfile.close(); 68 | 69 | //lastLog = text; 70 | 71 | //std::this_thread::sleep_for(100ms); 72 | } 73 | 74 | bool Utils::IsBadReadPtr(void* p, int size) { 75 | 76 | for (int i = 0; i < size / 0x80; i++) { 77 | MEMORY_BASIC_INFORMATION mbi = { 0 }; 78 | if (::VirtualQuery((LPCVOID)((DWORD)p + i * 0x80), &mbi, sizeof(mbi))) 79 | { 80 | DWORD mask = (PAGE_READONLY | PAGE_READWRITE | PAGE_WRITECOPY | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY); 81 | bool b = !(mbi.Protect & mask); 82 | // check the page is not a guard page 83 | if (mbi.Protect & (PAGE_GUARD | PAGE_NOACCESS)) 84 | { 85 | Utils::Log(">> IsBadReadPtr: Error: [" + to_string(i) + "] " + to_hex((DWORD)p + i * 0x100) + " (" + to_string((int)((DWORD)p + i * 0x100)) + ")"); 86 | return true; 87 | } 88 | 89 | 90 | } 91 | } 92 | return false; 93 | } 94 | 95 | std::string ToLower(std::string str) 96 | { 97 | std::string strLower; 98 | strLower.resize(str.size()); 99 | 100 | std::transform(str.begin(), 101 | str.end(), 102 | strLower.begin(), 103 | ::tolower); 104 | 105 | return strLower; 106 | return str; 107 | } 108 | 109 | std::wstring ToLower(std::wstring str) 110 | { 111 | std::wstring strLower; 112 | strLower.resize(str.size()); 113 | 114 | std::transform(str.begin(), 115 | str.end(), 116 | strLower.begin(), 117 | ::tolower); 118 | 119 | return strLower; 120 | return str; 121 | } 122 | 123 | bool StringContains(std::string strA, std::string strB, bool ignore_case) 124 | { 125 | if (strA.empty() || strB.empty()) 126 | return true; 127 | 128 | if (ignore_case) 129 | { 130 | strA = ToLower(strA); 131 | strB = ToLower(strB); 132 | } 133 | 134 | if (strA.find(strB) != std::string::npos) 135 | return true; 136 | 137 | return false; 138 | } 139 | 140 | bool StringContains(std::wstring strA, std::wstring strB, bool ignore_case) 141 | { 142 | if (strA.empty() || strB.empty()) 143 | return true; 144 | 145 | if (ignore_case) 146 | { 147 | strA = ToLower(strA); 148 | strB = ToLower(strB); 149 | } 150 | 151 | if (strA.find(strB) != std::wstring::npos) 152 | return true; 153 | 154 | return false; 155 | } 156 | 157 | bool StringCompare(std::string strA, std::string strB, bool ignore_case) { 158 | if (strA.empty() && strB.empty()) 159 | return false; 160 | if (ignore_case) 161 | { 162 | strA = ToLower(strA); 163 | strB = ToLower(strB); 164 | } 165 | 166 | return strA.compare(strB) == 0; 167 | } 168 | 169 | bool StringCompare(std::wstring strA, std::wstring strB, bool ignore_case) { 170 | if (strA.empty() && strB.empty()) 171 | return false; 172 | if (ignore_case) 173 | { 174 | strA = ToLower(strA); 175 | strB = ToLower(strB); 176 | } 177 | 178 | return strA.compare(strB) == 0; 179 | } -------------------------------------------------------------------------------- /LeagueAddon/Utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "xorstr.h" 13 | #include 14 | 15 | using namespace std; 16 | 17 | #define baseAddr (DWORD)GetModuleHandleA(NULL) 18 | #define DEFINE_RVA(address) (baseAddr + (DWORD)address) 19 | #define STR_MERGE_IMPL(x, y) x##y 20 | #define STR_MERGE(x,y) STR_MERGE_IMPL(x,y) 21 | #define MAKE_PAD(size) BYTE STR_MERGE(pad_, __COUNTER__) [ size ] 22 | #define DEFINE_MEMBER_0(x) x; 23 | #define DEFINE_MEMBER_N(x,offset) struct { MAKE_PAD((DWORD)offset); x; }; 24 | #define GetAsyncKeyStateN(key) GetAsyncKeyState(key) & 0x8000 25 | #define Compare(x, y, z) StringCompare(x, y, z) 26 | 27 | bool IsLeagueInForeground(); 28 | HWND GetHwndProc(); 29 | 30 | template< typename T > 31 | std::string to_hex(T i) 32 | { 33 | std::stringstream stream; 34 | stream 35 | << std::setfill('0') << std::setw(sizeof(T) * 2) 36 | << std::hex << i; 37 | return stream.str(); 38 | } 39 | 40 | template 41 | class Not 42 | { 43 | public: 44 | Not(Functor& f) : func(f) {} 45 | 46 | template 47 | bool operator()(ArgType& arg) { return !func(arg); } 48 | 49 | private: 50 | Functor& func; 51 | }; 52 | 53 | template 54 | T filter(T list, B pred) { 55 | T ret; 56 | std::remove_copy_if( 57 | list.begin(), 58 | list.end(), 59 | std::back_insert_iterator(ret), 60 | Not(pred) 61 | ); 62 | 63 | return ret; 64 | } 65 | 66 | template 67 | T filterVector(T vector, B pred) { 68 | T ret; 69 | std::remove_copy_if( 70 | vector.begin(), 71 | vector.end(), 72 | std::back_insert_iterator(ret), 73 | Not(pred) 74 | ); 75 | 76 | return ret; 77 | } 78 | 79 | template 80 | struct min_max 81 | { 82 | T min; 83 | T max; 84 | 85 | void emplace_value(T& val) 86 | { 87 | if (val > max) 88 | max = val; 89 | 90 | if (val < min) 91 | min = val; 92 | } 93 | float percentage(T& val) { return (float(val - min)) / float(max - min); } 94 | }; 95 | 96 | template Function CallVirtual(PVOID Base, DWORD Index) 97 | { 98 | PDWORD* VTablePointer = (PDWORD*)Base; 99 | PDWORD VTableFunctionBase = *VTablePointer; 100 | DWORD dwAddress = VTableFunctionBase[Index]; 101 | 102 | return (Function)(dwAddress); 103 | } 104 | 105 | bool StringContains(std::string strA, std::string strB, bool ignore_case = false); 106 | bool StringContains(std::wstring strA, std::wstring strB, bool ignore_case = false); 107 | bool StringCompare(std::string strA, std::string strB, bool ignore_case = false); 108 | bool StringCompare(std::wstring strA, std::wstring strB, bool ignore_case = false); 109 | 110 | template 111 | struct encrypted_buffer 112 | { 113 | BYTE get_is_filled() { return *reinterpret_cast(reinterpret_cast(this) + 0x0); } 114 | BYTE get_length_xor32() { return *reinterpret_cast(reinterpret_cast(this) + 0x1); } 115 | BYTE get_length_xor8() { return *reinterpret_cast(reinterpret_cast(this) + 0x2); } 116 | 117 | BYTE* get_key_array() 118 | { 119 | if constexpr (sizeof(Type) % 4 == 0) 120 | return reinterpret_cast(reinterpret_cast(this) + 0x4); 121 | else 122 | return reinterpret_cast(reinterpret_cast(this) + 0x3); 123 | } 124 | 125 | BYTE get_index() 126 | { 127 | if constexpr (sizeof(Type) % 4 == 0) 128 | return *reinterpret_cast(reinterpret_cast(this) + 0x8); 129 | else 130 | return *reinterpret_cast(reinterpret_cast(this) + 0x4); 131 | } 132 | 133 | Type* get_values_array() 134 | { 135 | if constexpr (sizeof(Type) % 4 == 0) 136 | return reinterpret_cast(reinterpret_cast(this) + 0xC); 137 | else 138 | return reinterpret_cast(reinterpret_cast(this) + 0x5); 139 | } 140 | Type decrypt() 141 | { 142 | Type result = get_values_array()[get_index()]; 143 | 144 | if (const auto length_xor32 = get_length_xor32()) { 145 | for (auto i = 0; i < length_xor32; ++i) { 146 | reinterpret_cast(&result)[i] ^= ~(reinterpret_cast(get_key_array())[i]); 147 | } 148 | } 149 | 150 | if (const auto length_xor8 = get_length_xor8()) { 151 | for (auto i = (sizeof(Type) - length_xor8); i < sizeof(Type); ++i) { 152 | reinterpret_cast(&result)[i] ^= ~(get_key_array()[i]); 153 | } 154 | } 155 | 156 | 157 | return result; 158 | } 159 | }; 160 | 161 | inline float GetDamageWithArmor(float Damage, float Armor) { 162 | if (Armor >= 0) { 163 | return Damage * (100 / (100 + Armor)); 164 | } 165 | else { 166 | return Damage * (2 - (100 / (100 + Armor))); 167 | } 168 | } 169 | 170 | namespace Utils { 171 | //extern string lastLog; 172 | void Log(std::string text); 173 | //void ScriptLog(string text); 174 | //Vector2 WorldToScreen(const Vector3& pos); 175 | //bool IsLeagueInForeground(); 176 | bool IsBadReadPtr(void* p, int size); 177 | } 178 | 179 | std::string ToLower(std::string str); 180 | std::wstring ToLower(std::wstring str); 181 | 182 | inline char* GetStr(DWORD offset) { 183 | if (*(int*)(offset + 0x10) > 15) 184 | return (char*)(*(DWORD*)offset); 185 | else 186 | return (char*)offset; 187 | } 188 | 189 | inline string QWERDF[6] = { "Q", "W", "E", "R", "D", "F" }; -------------------------------------------------------------------------------- /LeagueAddon/Vector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include "ImGui/imgui.h" 7 | 8 | #ifndef M_PI 9 | #define M_PI 3.14159265358979323846f 10 | #define M_PI_F (float)M_PI 11 | #endif 12 | 13 | struct ProjectionInfo; 14 | struct IntersectionResult; 15 | class Vector2 16 | { 17 | 18 | public: 19 | float x, y; 20 | 21 | Vector2() = default; 22 | Vector2(float xx, float yy) : x(xx), y(yy) {} 23 | operator float* (); 24 | 25 | operator ImVec2() const { return ImVec2(this->x, this->y); } 26 | 27 | Vector2& operator+=(const Vector2& v); 28 | Vector2& operator+=(float fl); 29 | Vector2 operator+(const Vector2& v) const; 30 | Vector2 operator+(float mod) const; 31 | 32 | Vector2& operator-=(const Vector2& v); 33 | Vector2& operator-=(float fl); 34 | Vector2 operator-(const Vector2& v) const; 35 | Vector2 operator-(float mod) const; 36 | 37 | Vector2& operator*=(const Vector2& v); 38 | Vector2& operator*=(float s); 39 | Vector2 operator*(const Vector2& v) const; 40 | Vector2 operator*(float mod) const; 41 | 42 | Vector2& operator/=(const Vector2& v); 43 | Vector2& operator/=(float s); 44 | Vector2 operator/(const Vector2& v) const; 45 | Vector2 operator/(float mod) const; 46 | }; 47 | class Vector3 48 | { 49 | public: 50 | float x, y, z; 51 | 52 | Vector3(float xx, float yy, float zz) : x(xx), y(yy), z(zz) {} 53 | Vector3(); 54 | operator float* (); 55 | 56 | bool IsValid() const; 57 | Vector3 toGround() const; 58 | bool operator==(const Vector3& other) const; 59 | bool operator!=(const Vector3& other) const; 60 | /*Vector3& operator/=(const Vector3& v); 61 | Vector3& operator/=(float fl);*/ 62 | bool IsZero(float tolerance = 0.01f) const; 63 | 64 | float DistanceLine(Vector3 segmentStart, Vector3 segmentEnd, bool onlyIfOnSegment, bool squared); 65 | 66 | float getX() const; 67 | float getY() const; 68 | float getZ() const; 69 | 70 | float Distance(const Vector3& v) const; 71 | 72 | float distanceTo(const Vector3& v) const; 73 | float LengthSquared() const; 74 | float Distance(Vector3 const& segment_start, Vector3 const& segment_end, bool only_if_on_segment = false, bool squared = false) const; 75 | float DistanceSquared(Vector3 const& to) const; 76 | 77 | operator Vector2() const { return Vector2(this->x, this->y); } 78 | operator ImVec2() const { return ImVec2(this->x, this->y); } 79 | 80 | Vector3& operator*=(const Vector3& v); 81 | Vector3& operator*=(float s); 82 | 83 | Vector3& operator/=(const Vector3& v); 84 | Vector3& operator/=(float s); 85 | 86 | Vector3& operator+=(const Vector3& v); 87 | Vector3& operator+=(float fl); 88 | 89 | Vector3& operator-=(const Vector3& v); 90 | Vector3& operator-=(float fl); 91 | 92 | Vector3 operator-(const Vector3& v) const; 93 | Vector3 operator-(float mod) const; 94 | Vector3 operator+(const Vector3& v) const; 95 | Vector3 operator+(float mod) const; 96 | 97 | Vector3 operator/(const Vector3& v) const; 98 | Vector3 operator/(float mod) const; 99 | Vector3 operator*(const Vector3& v) const; 100 | Vector3 operator*(float mod) const; 101 | 102 | Vector3& operator=(const Vector3& v); 103 | 104 | Vector3& SwitchYZ(); 105 | Vector3& Negate(); 106 | 107 | float Length() const; 108 | Vector3 Rotate_x(float angle) const; 109 | Vector3 Rotate_y(float angle) const; 110 | Vector3 Normalized() const; 111 | float NormalizeInPlace() const; 112 | 113 | float DotProduct(Vector3 const& other) const; 114 | float CrossProduct(Vector3 const& other) const; 115 | float Polar() const; 116 | float AngleBetween(Vector3 const& other) const; 117 | 118 | bool Close(float a, float b, float eps) const; 119 | 120 | Vector3 Rotated(float angle) const; 121 | Vector3 Perpendicular() const; 122 | Vector3 Perpendicular2() const; 123 | Vector3 Extend(Vector3 const& to, float distance) const; 124 | 125 | Vector3 Append(Vector3 pos1, Vector3 pos2, float dist) const; 126 | Vector3 Prepend(Vector3 pos1, Vector3 pos2, float dist) const; 127 | 128 | ProjectionInfo ProjectOn(Vector3 const& segment_start, Vector3 const& segment_end) const; 129 | IntersectionResult Intersection(Vector3 const& line_segment_end, Vector3 const& line_segment2_start, Vector3 const& line_segment2_end) const; 130 | 131 | Vector3 Scale(float s) 132 | { 133 | return Vector3(x * s, y * s, z * s); 134 | } 135 | 136 | Vector3 Rotate(Vector3 startPos, float theta) 137 | { 138 | float dx = this->x - startPos.x; 139 | float dz = this->z - startPos.z; 140 | 141 | float px = dx * cos(theta) - dz * sin(theta); 142 | float pz = dx * sin(theta) + dz * cos(theta); 143 | return { px + startPos.x, this->y, pz + startPos.z }; 144 | } 145 | 146 | std::string ToString() { 147 | return std::to_string(this->x) + "\n" + std::to_string(this->y) + "\n" + std::to_string(this->z); 148 | } 149 | }; 150 | 151 | struct ProjectionInfo 152 | { 153 | bool IsOnSegment; 154 | Vector3 LinePoint; 155 | Vector3 SegmentPoint; 156 | 157 | ProjectionInfo(bool is_on_segment, Vector3 const& segment_point, Vector3 const& line_point); 158 | }; 159 | 160 | struct IntersectionResult 161 | { 162 | bool Intersects; 163 | Vector3 Point; 164 | 165 | IntersectionResult(bool intersects = false, Vector3 const& point = Vector3()); 166 | }; 167 | 168 | struct Vector4 { 169 | Vector4() {}; 170 | Vector4(float _x, float _y, float _z, float _w) { 171 | x = _x; 172 | y = _y; 173 | z = _z; 174 | w = _w; 175 | } 176 | 177 | float x; 178 | float y; 179 | float z; 180 | float w; 181 | 182 | float length() { 183 | return sqrt(x * x + y * y + z * z + w * w); 184 | } 185 | 186 | float distance(const Vector4& o) { 187 | return sqrt(pow(x - o.x, 2) + pow(y - o.y, 2) + pow(z - o.z, 2) + pow(w - o.w, 2)); 188 | } 189 | 190 | Vector4 vscale(const Vector4& s) { 191 | return Vector4(x * s.x, y * s.y, z * s.z, w * s.w); 192 | } 193 | 194 | Vector4 scale(float s) { 195 | return Vector4(x * s, y * s, z * s, w * s); 196 | } 197 | 198 | Vector4 normalize() { 199 | float l = length(); 200 | return Vector4(x / l, y / l, z / l, w / l); 201 | } 202 | 203 | Vector4 add(const Vector4& o) { 204 | return Vector4(x + o.x, y + o.y, z + o.z, w + o.w); 205 | } 206 | 207 | Vector4 sub(const Vector4& o) { 208 | return Vector4(x - o.x, y - o.y, z - o.z, w - o.w); 209 | } 210 | 211 | Vector4 clone() { 212 | return Vector4(x, y, z, w); 213 | } 214 | }; -------------------------------------------------------------------------------- /LeagueAddon/Visual.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ImGui/imgui.h" 3 | #include "EventManager/EventManager.h" 4 | #include "ObjectManager.h" 5 | #include "Render.h" 6 | #include 7 | 8 | namespace Visual { 9 | inline bool blink = false; 10 | inline float blinkTimer = 0; 11 | 12 | 13 | inline bool ESP = true; 14 | inline int ESP_Distance = 5000; 15 | inline bool ESP_ShowNav = true; 16 | 17 | inline bool HighlightSelected = false; 18 | 19 | inline bool ShowAttackRadius = true; 20 | inline bool ShowBoundingRadius = true; 21 | 22 | inline bool AlwaysVisible = true; 23 | inline bool ShowLastPos = true; 24 | inline bool PingInvisibleEnemy = false; 25 | inline PingType PingInvisibleEnemyTypeTo = PingType::Danger; 26 | inline PingType PingInvisibleEnemyTypeFrom= PingType::Missing; 27 | 28 | inline bool SpellTrackerMenu = true; 29 | inline bool RecallTracker = true; 30 | inline bool RecallTrackerMenu = true; 31 | 32 | inline bool VisionTracker = false; 33 | inline std::list trackableObjects; 34 | 35 | void Initialize(); 36 | void Unload(); 37 | 38 | void OnThread(); 39 | void OnMenu(); 40 | void OnDraw(); 41 | } -------------------------------------------------------------------------------- /LeagueAddon/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Utils.h" 3 | #include "Hooks/Hooks.h" 4 | #include "AddonEngine.h" 5 | #include "EventManager/EventManager.h" 6 | #include "psapi.h" 7 | #include "Hooks/ultimate_hooks.h" 8 | 9 | HMODULE g_module; 10 | uintptr_t initThreadHandle; 11 | PVOID exceptionHandler; 12 | 13 | bool hooked = true; 14 | 15 | void OnExit() noexcept { 16 | Utils::Log("OnExit"); 17 | RemoveVectoredExceptionHandler(exceptionHandler); 18 | //EventManager::Trigger(EventManager::EventType::OnUnLoad); 19 | if (hooked) { 20 | Hooks::RemoveHooks(); 21 | hooked = false; 22 | } 23 | 24 | // render.Free(); 25 | //config.save(g_module); 26 | Utils::Log("OnExit: Ok"); 27 | CloseHandle((HANDLE)initThreadHandle); 28 | } 29 | 30 | MODULEINFO GetModuleInfo(HMODULE m) 31 | { 32 | MODULEINFO modinfo = { 0 }; 33 | HMODULE hModule; 34 | if (m) 35 | hModule = m; 36 | else 37 | hModule = GetModuleHandle(NULL); 38 | if (hModule == 0) 39 | return modinfo; 40 | GetModuleInformation(GetCurrentProcess(), hModule, &modinfo, sizeof(MODULEINFO)); 41 | return modinfo; 42 | } 43 | 44 | DWORD cheatAddr = (DWORD)GetModuleHandleA("LeagueAddon.dll"); 45 | DWORD cheatEndAddr = (DWORD)(cheatAddr + GetModuleInfo(GetModuleHandleA("LeagueAddon.dll")).SizeOfImage); 46 | 47 | LONG CALLBACK TopLevelHandler(EXCEPTION_POINTERS* info) 48 | { 49 | 50 | if (info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) 51 | { 52 | 53 | if (info->ExceptionRecord->ExceptionAddress > (PVOID)cheatAddr && info->ExceptionRecord->ExceptionAddress < (PVOID)cheatEndAddr) { 54 | Utils::Log("Cheat Addr : " + to_hex(cheatAddr)); 55 | Utils::Log("Error Addr : " + to_hex((int)info->ExceptionRecord->ExceptionAddress)); 56 | Utils::Log("Error Addr : " + to_hex((int)((int)info->ExceptionRecord->ExceptionAddress - cheatAddr))); 57 | Utils::Log("IDA Addr : " + to_hex((int)((int)info->ExceptionRecord->ExceptionAddress - cheatAddr + 0x10000000))); 58 | } 59 | //Utils::Log("Global Error Addr : " + to_hex((int)info->ExceptionRecord->ExceptionAddress)); 60 | //{ 61 | // HMODULE hMods[1024]; 62 | // DWORD cbNeeded; 63 | // unsigned int i; 64 | 65 | // if (EnumProcessModules(GetCurrentProcess(), hMods, sizeof(hMods), &cbNeeded)) 66 | // { 67 | // for (i = 0; i < (cbNeeded / sizeof(HMODULE)); i++) 68 | // { 69 | // CHAR szModName[MAX_PATH]; 70 | 71 | // // Get the full path to the module's file. 72 | 73 | // if (GetModuleFileNameExA(GetCurrentProcess(), hMods[i], szModName, 74 | // sizeof(szModName) / sizeof(TCHAR))) 75 | // { 76 | // MODULEINFO mInfo = GetModuleInfo(hMods[i]); 77 | 78 | // string str; 79 | // str.append(szModName); 80 | // if (mInfo.EntryPoint < info->ExceptionRecord->ExceptionAddress && (DWORD)mInfo.EntryPoint + mInfo.SizeOfImage >(DWORD)info->ExceptionRecord->ExceptionAddress) { 81 | 82 | // Utils::Log("GetModuleFileNameExA : " + str); 83 | // Utils::Log("EntryPoint : " + to_hex((int)mInfo.EntryPoint)); 84 | // Utils::Log("ErrorAddress : " + to_hex((int)((DWORD)info->ExceptionRecord->ExceptionAddress))); 85 | // Utils::Log("IDA ErrorAddress : " + to_hex((int)((DWORD)info->ExceptionRecord->ExceptionAddress - (int)mInfo.EntryPoint + 0x10000000))); 86 | // Utils::Log("EndPoint : " + to_hex((int)((DWORD)mInfo.EntryPoint + mInfo.SizeOfImage))); 87 | // } 88 | 89 | 90 | // } 91 | // } 92 | // } 93 | //} 94 | 95 | } 96 | if (info->ExceptionRecord->ExceptionCode == EXCEPTION_BREAKPOINT) { 97 | *(BYTE*)info->ExceptionRecord->ExceptionAddress = 0x90; 98 | MessageBoxA(0, to_hex(info->ExceptionRecord->ExceptionAddress).c_str(), "BRK", 0); 99 | } 100 | 101 | return EXCEPTION_CONTINUE_SEARCH; 102 | } 103 | 104 | void WINAPI hOutputDebugStringW(_In_opt_ LPCWSTR lpOutputString) { 105 | MessageBoxA(0, "hOutputDebugStringW", "odsAddr", 0); 106 | return; 107 | } 108 | 109 | void WINAPI hOutputDebugStringA(_In_opt_ LPCSTR lpOutputString) { 110 | MessageBoxA(0, "hOutputDebugStringA", "odsAddr", 0); 111 | return; 112 | } 113 | 114 | DWORD WINAPI MainThread(LPVOID param) { 115 | Utils::Log(">> LEAGUE ADDON INJECTED <<"); 116 | //#if _DEBUG 117 | Utils::Log(">> LEAGUE ADDON ADDR: " + to_hex((int)GetModuleHandleA("LeagueAddon.dll")) + " <<"); 118 | //#endif 119 | 120 | exceptionHandler = AddVectoredExceptionHandler(TRUE, TopLevelHandler); 121 | 122 | 123 | 124 | 125 | 126 | 127 | UltHook.RestoreNtProtectVirtualMemory(); 128 | UltHook.RestoreSysDll("ntdll.dll"); 129 | MessageBoxA(0, to_hex((int)&OutputDebugStringW).c_str(), to_hex((int)&OutputDebugStringA).c_str(), 0); 130 | UltHook.AddEzHook((DWORD)&OutputDebugStringW, 6, (DWORD)&hOutputDebugStringW); 131 | UltHook.AddEzHook((DWORD)&OutputDebugStringA, 6, (DWORD)&hOutputDebugStringA); 132 | 133 | //DWORD old; 134 | //UltHook.RestoreNtProtectVirtualMemory(); 135 | //HMODULE ntdll = GetModuleHandleA("ntdll.dll"); 136 | //auto Ldr = (DWORD)GetProcAddress(ntdll, "LdrInitializeThunk"); 137 | // 138 | //VirtualProtect((LPVOID)Ldr, 1, 0x40, &old); 139 | 140 | //MessageBoxA(0, to_hex(Ldr).c_str(), "LdrInitializeThunk", 0); 141 | 142 | //VirtualProtect((LPVOID)Ldr, 1, old, &old); 143 | 144 | //*(BYTE*)Ldr = 0x90; 145 | 146 | while (!GetAsyncKeyState(VK_END)) { 147 | Sleep(1); 148 | } 149 | return 1; 150 | 151 | while (Function::GameTime() < 2) { 152 | std::this_thread::sleep_for(1ms); 153 | } 154 | int* recall = (int*)&((GameObject*)*(DWORD*)DEFINE_RVA(Offset::Data::LocalPlayer))->RecallState; 155 | while ((*(int*)DEFINE_RVA(Offset::Data::LocalPlayer) == 0 || (*recall == (int)kRecallState::None || *recall == (int)kRecallState::Yuumi_W_Ally)) && !GetAsyncKeyState(VK_INSERT)) { 156 | std::this_thread::sleep_for(1ms); 157 | } 158 | 159 | std::this_thread::sleep_for(1s); 160 | 161 | Hooks::ApplyHooks(); 162 | 163 | AddonEngine::Initialize(); 164 | 165 | while (!GetAsyncKeyState(VK_END)) { 166 | EventManager::Trigger(EventManager::EventType::OnThread); 167 | Sleep(1); 168 | } 169 | return 1; 170 | } 171 | 172 | BOOL APIENTRY DllMain(HMODULE hModule, 173 | DWORD ul_reason_for_call, 174 | LPVOID lpReserved 175 | ) 176 | { 177 | g_module = hModule; 178 | DisableThreadLibraryCalls(hModule); 179 | switch (ul_reason_for_call) 180 | { 181 | case DLL_PROCESS_ATTACH: 182 | std::atexit(OnExit); 183 | initThreadHandle = _beginthreadex(nullptr, 0, (_beginthreadex_proc_type)MainThread, hModule, 0, nullptr); 184 | FreeLibrary(hModule); 185 | break; 186 | case DLL_THREAD_ATTACH: 187 | case DLL_THREAD_DETACH: 188 | // 189 | break; 190 | case DLL_PROCESS_DETACH: 191 | OnExit(); 192 | break; 193 | } 194 | return TRUE; 195 | } 196 | 197 | -------------------------------------------------------------------------------- /LeagueAddon/kiero.h: -------------------------------------------------------------------------------- 1 | #ifndef __KIERO_H__ 2 | #define __KIERO_H__ 3 | 4 | #include 5 | #include 6 | #include "polyhook2/CapstoneDisassembler.hpp" 7 | #include "polyhook2/Detour/x86Detour.hpp" 8 | 9 | #define KIERO_VERSION "1.2.12" 10 | 11 | #define KIERO_INCLUDE_D3D9 1 // 1 if you need D3D9 hook 12 | #define KIERO_INCLUDE_D3D10 0 // 1 if you need D3D10 hook 13 | #define KIERO_INCLUDE_D3D11 1 // 1 if you need D3D11 hook 14 | #define KIERO_INCLUDE_D3D12 0 // 1 if you need D3D12 hook 15 | #define KIERO_INCLUDE_OPENGL 0 // 1 if you need OpenGL hook 16 | #define KIERO_INCLUDE_VULKAN 0 // 1 if you need Vulkan hook 17 | #define KIERO_USE_MINHOOK 0 // 1 if you will use kiero::bind function 18 | 19 | #define KIERO_ARCH_X64 0 20 | #define KIERO_ARCH_X86 0 21 | 22 | #if defined(_M_X64) 23 | # undef KIERO_ARCH_X64 24 | # define KIERO_ARCH_X64 1 25 | #else 26 | # undef KIERO_ARCH_X86 27 | # define KIERO_ARCH_X86 1 28 | #endif 29 | 30 | #if KIERO_ARCH_X64 31 | typedef uint64_t uint150_t; 32 | #else 33 | typedef uint32_t uint150_t; 34 | #endif 35 | 36 | namespace kiero 37 | { 38 | struct Status 39 | { 40 | enum Enum 41 | { 42 | UnknownError = -1, 43 | NotSupportedError = -2, 44 | ModuleNotFoundError = -3, 45 | 46 | AlreadyInitializedError = -4, 47 | NotInitializedError = -5, 48 | 49 | Success = 0, 50 | }; 51 | }; 52 | 53 | struct RenderType 54 | { 55 | enum Enum 56 | { 57 | None, 58 | 59 | D3D9, 60 | D3D10, 61 | D3D11, 62 | D3D12, 63 | 64 | OpenGL, 65 | Vulkan, 66 | 67 | Auto 68 | }; 69 | }; 70 | 71 | Status::Enum init(RenderType::Enum renderType); 72 | void shutdown(); 73 | 74 | Status::Enum bind(uint16_t index, void** original, void* function); 75 | void unbind(uint16_t index); 76 | 77 | RenderType::Enum getRenderType(); 78 | uint150_t* getMethodsTable(); 79 | } 80 | 81 | #endif // __KIERO_H__ -------------------------------------------------------------------------------- /LeagueAddon/xorstr.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010-2014, Sebastien Andrivet 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // 1. Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // 3. Neither the name of the copyright holder nor the names of its 15 | // contributors may be used to endorse or promote products derived from this 16 | // software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | // POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #pragma once 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | namespace xorstr_impl { 37 | 38 | #ifdef _MSC_VER 39 | #define XORSTR_INLINE __forceinline 40 | #else 41 | #define XORSTR_INLINE inline 42 | #endif 43 | 44 | constexpr auto time = __TIME__; 45 | constexpr auto seed = static_cast(time[7]) + 46 | static_cast(time[6]) * 10 + 47 | static_cast(time[4]) * 60 + 48 | static_cast(time[3]) * 600 + 49 | static_cast(time[1]) * 3600 + 50 | static_cast(time[0]) * 36000; 51 | 52 | // 1988, Stephen Park and Keith Miller 53 | // "Random Number Generators: Good Ones Are Hard To Find", considered as "minimal standard" 54 | // Park-Miller 31 bit pseudo-random number generator, implemented with G. Carta's optimisation: 55 | // with 32-bit math and without division 56 | 57 | template 58 | struct random_generator { 59 | private: 60 | static constexpr unsigned a = 16807; // 7^5 61 | static constexpr unsigned m = 2147483647; // 2^31 - 1 62 | static constexpr unsigned s = random_generator::value; 63 | static constexpr unsigned lo = a * (s & 0xFFFF); // multiply lower 16 bits by 16807 64 | static constexpr unsigned hi = a * (s >> 16); // multiply higher 16 bits by 16807 65 | static constexpr unsigned lo2 = lo + ((hi & 0x7FFF) << 16); // combine lower 15 bits of hi with lo's upper bits 66 | static constexpr unsigned hi2 = hi >> 15; // discard lower 15 bits of hi 67 | static constexpr unsigned lo3 = lo2 + hi; 68 | 69 | public: 70 | static constexpr unsigned max = m; 71 | static constexpr unsigned value = lo3 > m ? lo3 - m : lo3; 72 | }; 73 | 74 | template <> 75 | struct random_generator<0> { 76 | static constexpr unsigned value = seed; 77 | }; 78 | 79 | template 80 | struct random_int { 81 | static constexpr auto value = random_generator::value % M; 82 | }; 83 | 84 | template 85 | struct random_char { 86 | static const char value = static_cast(1 + random_int::value); 87 | }; 88 | 89 | template 90 | struct string { 91 | private: 92 | const char key_; 93 | std::array encrypted_; 94 | 95 | constexpr char enc(char c) const { 96 | return c ^ key_; 97 | } 98 | 99 | char dec(char c) const { 100 | return c ^ key_; 101 | } 102 | 103 | public: 104 | template 105 | constexpr XORSTR_INLINE string(const char* str, std::index_sequence) : 106 | key_(random_char::value), encrypted_{ { enc(str[Is])... } } {} 107 | 108 | XORSTR_INLINE decltype(auto) decrypt() { 109 | for (size_t i = 0; i < N; ++i) { 110 | encrypted_[i] = dec(encrypted_[i]); 111 | } 112 | encrypted_[N] = '\0'; 113 | return encrypted_.data(); 114 | } 115 | }; 116 | 117 | #undef XORSTR_INLINE 118 | 119 | } // namespace xorstr_impl 120 | 121 | #define xorstr(s) (xorstr_impl::string(s, std::make_index_sequence()).decrypt()) -------------------------------------------------------------------------------- /LeagueAddonLoader/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LeagueAddonLoader/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /LeagueAddonLoader/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace LeagueAddonLoader 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /LeagueAddonLoader/LeagueAddonLoader.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {A6EF0DE8-30E6-40D7-B668-542555C79864} 8 | WinExe 9 | LeagueAddonLoader 10 | LeagueAddonLoader 11 | v4.7.2 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | true 17 | 18 | 19 | 20 | 21 | AnyCPU 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | 30 | 31 | AnyCPU 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE 36 | prompt 37 | 4 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 4.0 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | MSBuild:Compile 58 | Designer 59 | 60 | 61 | MSBuild:Compile 62 | Designer 63 | 64 | 65 | App.xaml 66 | Code 67 | 68 | 69 | MainWindow.xaml 70 | Code 71 | 72 | 73 | 74 | 75 | Code 76 | 77 | 78 | True 79 | True 80 | Resources.resx 81 | 82 | 83 | True 84 | Settings.settings 85 | True 86 | 87 | 88 | ResXFileCodeGenerator 89 | Resources.Designer.cs 90 | 91 | 92 | SettingsSingleFileGenerator 93 | Settings.Designer.cs 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 10.0.17134.1000 102 | 103 | 104 | 4.6.0 105 | 106 | 107 | 4.6.0 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /LeagueAddonLoader/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /LeagueAddonLoader/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace LeagueAddonLoader 17 | { 18 | /// 19 | /// Interaction logic for MainWindow.xaml 20 | /// 21 | public partial class MainWindow : Window 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LeagueAddonLoader/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("LeagueAddonLoader")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("LeagueAddonLoader")] 15 | [assembly: AssemblyCopyright("Copyright © 2022")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /LeagueAddonLoader/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace LeagueAddonLoader.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LeagueAddonLoader.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /LeagueAddonLoader/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /LeagueAddonLoader/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace LeagueAddonLoader.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /LeagueAddonLoader/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /LeagueAddonResources/LeagueAddonResources.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 | {0f1686ac-ee4b-44b0-8827-8dd333f13801} 25 | LeagueAddonResources 26 | 10.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | DynamicLibrary 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 | C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath) 75 | C:\Users\ByDec\source\repos\LeagueAddon\LeagueAddon;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath) 76 | 77 | 78 | C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath) 79 | C:\Users\ByDec\source\repos\LeagueAddon\LeagueAddon;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath) 80 | 81 | 82 | 83 | Level3 84 | true 85 | WIN32;_DEBUG;LEAGUEADDONRESOURCES_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 86 | true 87 | Use 88 | pch.h 89 | 90 | 91 | Windows 92 | true 93 | false 94 | 95 | 96 | 97 | 98 | Level3 99 | true 100 | true 101 | true 102 | WIN32;NDEBUG;LEAGUEADDONRESOURCES_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 103 | true 104 | Use 105 | pch.h 106 | Speed 107 | AdvancedVectorExtensions2 108 | 109 | 110 | Windows 111 | true 112 | true 113 | true 114 | false 115 | 116 | 117 | 118 | 119 | Level3 120 | true 121 | _DEBUG;LEAGUEADDONRESOURCES_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 122 | true 123 | Use 124 | pch.h 125 | 126 | 127 | Windows 128 | true 129 | false 130 | 131 | 132 | 133 | 134 | Level3 135 | true 136 | true 137 | true 138 | NDEBUG;LEAGUEADDONRESOURCES_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 139 | true 140 | Use 141 | pch.h 142 | 143 | 144 | Windows 145 | true 146 | true 147 | true 148 | false 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | Create 161 | Create 162 | Create 163 | Create 164 | 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /LeagueAddonResources/LeagueAddonResources.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 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | -------------------------------------------------------------------------------- /LeagueAddonResources/Resources.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "d3d11.h" 4 | #include "d3dx11tex.h" 5 | #include 6 | #include 7 | #include "vector" 8 | #include 9 | #include 10 | 11 | //#include "Structs.h" 12 | 13 | #pragma comment(lib, "d3d11.lib") 14 | #pragma comment(lib, "d3dx11.lib") 15 | 16 | #ifdef MAKEDLL 17 | # define EXPORT __declspec(dllexport) 18 | #else 19 | # define EXPORT __declspec(dllexport) 20 | #endif 21 | 22 | using namespace std; 23 | 24 | extern "C" class EXPORT Skin { 25 | public: 26 | std::map Name; 27 | int Id; 28 | bool Chromas; 29 | }; 30 | 31 | extern "C" class EXPORT RImage { 32 | public: 33 | std::string Name; 34 | ID3D11ShaderResourceView* Image = nullptr; 35 | RImage(std::string Name, char* ImageBytes, int Size, ID3D11Device* pDevice) { 36 | this->Name = Name; 37 | 38 | D3DX11_IMAGE_LOAD_INFO info; 39 | ID3DX11ThreadPump* pump{ nullptr }; 40 | 41 | D3DX11CreateShaderResourceViewFromMemory(pDevice, ImageBytes, Size, &info, 42 | pump, &this->Image, 0); 43 | } 44 | }; 45 | 46 | extern "C" class EXPORT Image_Manager { 47 | public: 48 | Image_Manager(ID3D11Device* pDevice) { 49 | this->pDevice = pDevice; 50 | } 51 | 52 | int ImagesCount() { 53 | return this->Images.size(); 54 | } 55 | 56 | void AddImage(std::string Name, char* Bytes, int Size) { 57 | this->Images.push_back(RImage(Name, Bytes, Size, this->pDevice)); 58 | } 59 | 60 | bool HasImage(std::string name) { 61 | for (auto obj : this->Images) { 62 | if (name.compare(obj.Name) == 0) 63 | return true; 64 | } 65 | return false; 66 | } 67 | 68 | ID3D11ShaderResourceView* GetImageByName(std::string name) { 69 | for (auto obj : this->Images) { 70 | if (name.compare(obj.Name) == 0) 71 | { 72 | return obj.Image; 73 | } 74 | } 75 | 76 | return nullptr; 77 | } 78 | 79 | std::vector* GetVector() { 80 | return &Images; 81 | } 82 | 83 | private: 84 | ID3D11Device* pDevice; 85 | std::vector Images; 86 | }; 87 | 88 | namespace Resources { 89 | extern "C" EXPORT void LoadImages(Image_Manager & Images_Manager); 90 | extern "C" EXPORT void LoadSkinsDB(std::map>&SkinsDB); 91 | } 92 | -------------------------------------------------------------------------------- /LeagueAddonResources/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "pch.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /LeagueAddonResources/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 4 | // Windows Header Files 5 | #include 6 | -------------------------------------------------------------------------------- /LeagueAddonResources/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /LeagueAddonResources/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // add headers that you want to pre-compile here 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /LeagueParser/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LeagueParser/LeagueParser.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D90484B1-4E5F-4E93-B58A-A9A2C7415C69} 8 | Exe 9 | LeagueParser 10 | LeagueParser 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | E:\2.C#\Library\Newtonsoft.Json.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | E:\2.C#\ModifedLibrary\xNet.dll 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /LeagueParser/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SkinNameParser")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SkinNameParser")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d90484b1-4e5f-4e93-b58a-a9a2c7415c69")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LeagueAddon 2 | 3 | --------------------------------------------------------------------------------