├── .gitattributes ├── .gitignore ├── LICENSE ├── PythonScripts └── lolskin_to_skin.py ├── R3nzSkin.sln ├── R3nzSkin ├── CheatManager.hpp ├── Config.cpp ├── Config.hpp ├── GUI.cpp ├── GUI.hpp ├── Hooks.cpp ├── Hooks.hpp ├── Logger.hpp ├── R3nzSkin.cpp ├── R3nzSkin.rc ├── R3nzSkin.vcxproj ├── R3nzSkin.vcxproj.filters ├── SDK │ ├── AIBaseCommon.cpp │ ├── AIBaseCommon.hpp │ ├── AIHero.hpp │ ├── AIMinionClient.cpp │ ├── AIMinionClient.hpp │ ├── AITurret.hpp │ ├── AString.hpp │ ├── Champion.hpp │ ├── ChampionManager.hpp │ ├── CharacterDataStack.cpp │ ├── CharacterDataStack.hpp │ ├── CharacterStackData.hpp │ ├── GameClient.hpp │ ├── GameObject.hpp │ ├── GameState.hpp │ ├── ManagerTemplate.hpp │ ├── Pad.hpp │ ├── RiotArray.hpp │ └── Skin.hpp ├── SkinDatabase.cpp ├── SkinDatabase.hpp ├── Utils.cpp ├── Utils.hpp ├── encryption.hpp ├── fnv_hash.hpp ├── imgui │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_impl_dx11.cpp │ ├── imgui_impl_dx11.h │ ├── imgui_impl_win32.cpp │ ├── imgui_impl_win32.h │ ├── imgui_internal.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ └── imstb_truetype.h ├── json │ └── json.hpp ├── memory.cpp ├── memory.hpp ├── offsets.hpp ├── resource.h └── vmt_smart_hook.hpp ├── R3nzSkin_Injector ├── Injector.cpp ├── Injector.hpp ├── R3nzSkin_Injector.rc ├── R3nzSkin_Injector.vcxproj ├── R3nzSkin_Injector.vcxproj.filters ├── R3nzUI.hpp ├── R3nzUI.resx ├── icon.ico ├── lazy_importer.hpp ├── main.cpp ├── resource.h └── xorstr.hpp └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.h linguist-language=Assembly 2 | *.hpp linguist-language=C++ 3 | *.c linguist-language=C 4 | *.cpp linguist-language=C++ 5 | -------------------------------------------------------------------------------- /.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 | RiotGamesServers/ 25 | ChinaServer/ 26 | x64/ 27 | x86/ 28 | [Aa][Rr][Mm]/ 29 | [Aa][Rr][Mm]64/ 30 | bld/ 31 | [Bb]in/ 32 | [Oo]bj/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # StyleCop 67 | StyleCopReport.xml 68 | 69 | # Files built by Visual Studio 70 | *_i.c 71 | *_p.c 72 | *_h.h 73 | *.ilk 74 | *.meta 75 | *.obj 76 | *.iobj 77 | *.pch 78 | *.pdb 79 | *.ipdb 80 | *.pgc 81 | *.pgd 82 | *.rsp 83 | *.sbr 84 | *.tlb 85 | *.tli 86 | *.tlh 87 | *.tmp 88 | *.tmp_proj 89 | *_wpftmp.csproj 90 | *.log 91 | *.vspscc 92 | *.vssscc 93 | .builds 94 | *.pidb 95 | *.svclog 96 | *.scc 97 | 98 | # Chutzpah Test files 99 | _Chutzpah* 100 | 101 | # Visual C++ cache files 102 | ipch/ 103 | *.aps 104 | *.ncb 105 | *.opendb 106 | *.opensdf 107 | *.sdf 108 | *.cachefile 109 | *.VC.db 110 | *.VC.VC.opendb 111 | 112 | # Visual Studio profiler 113 | *.psess 114 | *.vsp 115 | *.vspx 116 | *.sap 117 | 118 | # Visual Studio Trace Files 119 | *.e2e 120 | 121 | # TFS 2012 Local Workspace 122 | $tf/ 123 | 124 | # Guidance Automation Toolkit 125 | *.gpState 126 | 127 | # ReSharper is a .NET coding add-in 128 | _ReSharper*/ 129 | *.[Rr]e[Ss]harper 130 | *.DotSettings.user 131 | 132 | # TeamCity is a build add-in 133 | _TeamCity* 134 | 135 | # DotCover is a Code Coverage Tool 136 | *.dotCover 137 | 138 | # AxoCover is a Code Coverage Tool 139 | .axoCover/* 140 | !.axoCover/settings.json 141 | 142 | # Visual Studio code coverage results 143 | *.coverage 144 | *.coveragexml 145 | 146 | # NCrunch 147 | _NCrunch_* 148 | .*crunch*.local.xml 149 | nCrunchTemp_* 150 | 151 | # MightyMoose 152 | *.mm.* 153 | AutoTest.Net/ 154 | 155 | # Web workbench (sass) 156 | .sass-cache/ 157 | 158 | # Installshield output folder 159 | [Ee]xpress/ 160 | 161 | # DocProject is a documentation generator add-in 162 | DocProject/buildhelp/ 163 | DocProject/Help/*.HxT 164 | DocProject/Help/*.HxC 165 | DocProject/Help/*.hhc 166 | DocProject/Help/*.hhk 167 | DocProject/Help/*.hhp 168 | DocProject/Help/Html2 169 | DocProject/Help/html 170 | 171 | # Click-Once directory 172 | publish/ 173 | 174 | # Publish Web Output 175 | *.[Pp]ublish.xml 176 | *.azurePubxml 177 | # Note: Comment the next line if you want to checkin your web deploy settings, 178 | # but database connection strings (with potential passwords) will be unencrypted 179 | *.pubxml 180 | *.publishproj 181 | 182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 183 | # checkin your Azure Web App publish settings, but sensitive information contained 184 | # in these scripts will be unencrypted 185 | PublishScripts/ 186 | 187 | # NuGet Packages 188 | *.nupkg 189 | # NuGet Symbol Packages 190 | *.snupkg 191 | # The packages folder can be ignored because of Package Restore 192 | **/[Pp]ackages/* 193 | # except build/, which is used as an MSBuild target. 194 | !**/[Pp]ackages/build/ 195 | # Uncomment if necessary however generally it will be regenerated when needed 196 | #!**/[Pp]ackages/repositories.config 197 | # NuGet v3's project.json files produces more ignorable files 198 | *.nuget.props 199 | *.nuget.targets 200 | 201 | # Microsoft Azure Build Output 202 | csx/ 203 | *.build.csdef 204 | 205 | # Microsoft Azure Emulator 206 | ecf/ 207 | rcf/ 208 | 209 | # Windows Store app package directories and files 210 | AppPackages/ 211 | BundleArtifacts/ 212 | Package.StoreAssociation.xml 213 | _pkginfo.txt 214 | *.appx 215 | *.appxbundle 216 | *.appxupload 217 | 218 | # Visual Studio cache files 219 | # files ending in .cache can be ignored 220 | *.[Cc]ache 221 | # but keep track of directories ending in .cache 222 | !?*.[Cc]ache/ 223 | 224 | # Others 225 | ClientBin/ 226 | ~$* 227 | *~ 228 | *.dbmdl 229 | *.dbproj.schemaview 230 | *.jfm 231 | *.pfx 232 | *.publishsettings 233 | orleans.codegen.cs 234 | 235 | # Including strong name files can present a security risk 236 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 237 | #*.snk 238 | 239 | # Since there are multiple workflows, uncomment next line to ignore bower_components 240 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 241 | #bower_components/ 242 | 243 | # RIA/Silverlight projects 244 | Generated_Code/ 245 | 246 | # Backup & report files from converting an old project file 247 | # to a newer Visual Studio version. Backup files are not needed, 248 | # because we have git ;-) 249 | _UpgradeReport_Files/ 250 | Backup*/ 251 | UpgradeLog*.XML 252 | UpgradeLog*.htm 253 | ServiceFabricBackup/ 254 | *.rptproj.bak 255 | 256 | # SQL Server files 257 | *.mdf 258 | *.ldf 259 | *.ndf 260 | 261 | # Business Intelligence projects 262 | *.rdl.data 263 | *.bim.layout 264 | *.bim_*.settings 265 | *.rptproj.rsuser 266 | *- [Bb]ackup.rdl 267 | *- [Bb]ackup ([0-9]).rdl 268 | *- [Bb]ackup ([0-9][0-9]).rdl 269 | 270 | # Microsoft Fakes 271 | FakesAssemblies/ 272 | 273 | # GhostDoc plugin setting file 274 | *.GhostDoc.xml 275 | 276 | # Node.js Tools for Visual Studio 277 | .ntvs_analysis.dat 278 | node_modules/ 279 | 280 | # Visual Studio 6 build log 281 | *.plg 282 | 283 | # Visual Studio 6 workspace options file 284 | *.opt 285 | 286 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 287 | *.vbw 288 | 289 | # Visual Studio LightSwitch build output 290 | **/*.HTMLClient/GeneratedArtifacts 291 | **/*.DesktopClient/GeneratedArtifacts 292 | **/*.DesktopClient/ModelManifest.xml 293 | **/*.Server/GeneratedArtifacts 294 | **/*.Server/ModelManifest.xml 295 | _Pvt_Extensions 296 | 297 | # Paket dependency manager 298 | .paket/paket.exe 299 | paket-files/ 300 | 301 | # FAKE - F# Make 302 | .fake/ 303 | 304 | # CodeRush personal settings 305 | .cr/personal 306 | 307 | # Python Tools for Visual Studio (PTVS) 308 | __pycache__/ 309 | *.pyc 310 | 311 | # Cake - Uncomment if you are using it 312 | # tools/** 313 | # !tools/packages.config 314 | 315 | # Tabs Studio 316 | *.tss 317 | 318 | # Telerik's JustMock configuration file 319 | *.jmconfig 320 | 321 | # BizTalk build output 322 | *.btp.cs 323 | *.btm.cs 324 | *.odx.cs 325 | *.xsd.cs 326 | 327 | # OpenCover UI analysis results 328 | OpenCover/ 329 | 330 | # Azure Stream Analytics local run output 331 | ASALocalRun/ 332 | 333 | # MSBuild Binary and Structured Log 334 | *.binlog 335 | 336 | # NVidia Nsight GPU debugger configuration file 337 | *.nvuser 338 | 339 | # MFractors (Xamarin productivity tool) working folder 340 | .mfractor/ 341 | 342 | # Local History for Visual Studio 343 | .localhistory/ 344 | 345 | # BeatPulse healthcheck temp database 346 | healthchecksdb 347 | 348 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 349 | MigrationBackup/ 350 | 351 | # Ionide (cross platform F# VS Code tools) working folder 352 | .ionide/ 353 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-2023 R3nzTheCodeGOD and B3akers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PythonScripts/lolskin_to_skin.py: -------------------------------------------------------------------------------- 1 | import configparser 2 | import json 3 | import os 4 | 5 | 6 | def skin_to_dictionary(path): 7 | config = configparser.ConfigParser() 8 | 9 | config.read(path, encoding="utf-8") 10 | ini_dict = {} 11 | for key, values in config.items(): 12 | ini_dict[key] = dict(config.items(key)) 13 | print(values) 14 | lolskin_hero_skin = ini_dict["SKIN_CHAMPION_ACTIVED"] 15 | del lolskin_hero_skin['custom_file'] 16 | 17 | return lolskin_hero_skin 18 | 19 | 20 | def forward_data(lolskin_hero_skin: dict): 21 | # Convert lolskin's skin data to R3nzSkin 22 | dict_from_list = {} 23 | 24 | for key, value in lolskin_hero_skin.items(): 25 | key = key.capitalize() 26 | key = key + ".current_combo_skin_index" 27 | value = int(value) + int(1) 28 | dict_from_list[key] = value 29 | 30 | return dict_from_list 31 | 32 | 33 | 34 | if __name__ == '__main__': 35 | LOLSKIN_CONFIG_PATH = r"C:\Fraps\data\My\Config.ini" 36 | 37 | if os.path.exists(LOLSKIN_CONFIG_PATH): 38 | hero_skin = skin_to_dictionary(LOLSKIN_CONFIG_PATH) 39 | else: 40 | LOLSKIN_CONFIG_PATH = input( 41 | "lolskin Configuration file path Example:\t" + LOLSKIN_CONFIG_PATH + "\n") 42 | to_skin = forward_data(lolskin_hero_skin=hero_skin) 43 | 44 | json_str = json.dumps(to_skin) 45 | print("JSON 对象:", json_str) 46 | with open('data.json', 'w', encoding="utf-8") as fp: 47 | json.dump(to_skin, fp) -------------------------------------------------------------------------------- /R3nzSkin.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32922.545 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "R3nzSkin", "R3nzSkin\R3nzSkin.vcxproj", "{17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "R3nzSkin_Injector", "R3nzSkin_Injector\R3nzSkin_Injector.vcxproj", "{40F6875E-C1E5-4C10-A129-6E84CE034801}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D1C9DAFE-154E-443E-9E7E-DAC46C839AAB}" 11 | ProjectSection(SolutionItems) = preProject 12 | .gitattributes = .gitattributes 13 | .gitignore = .gitignore 14 | LICENSE = LICENSE 15 | README.md = README.md 16 | EndProjectSection 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PythonScripts", "PythonScripts", "{D80EC08B-EC70-4DA6-8DE2-36EA4AC99769}" 19 | ProjectSection(SolutionItems) = preProject 20 | PythonScripts\lolskin_to_skin.py = PythonScripts\lolskin_to_skin.py 21 | EndProjectSection 22 | EndProject 23 | Global 24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 25 | ChinaServer|x64 = ChinaServer|x64 26 | ChinaServer|x86 = ChinaServer|x86 27 | RiotGamesServers|x64 = RiotGamesServers|x64 28 | RiotGamesServers|x86 = RiotGamesServers|x86 29 | EndGlobalSection 30 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 31 | {17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}.ChinaServer|x64.ActiveCfg = ChinaServer|x64 32 | {17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}.ChinaServer|x64.Build.0 = ChinaServer|x64 33 | {17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}.ChinaServer|x86.ActiveCfg = ChinaServer|Win32 34 | {17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}.ChinaServer|x86.Build.0 = ChinaServer|Win32 35 | {17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}.RiotGamesServers|x64.ActiveCfg = RiotGamesServers|x64 36 | {17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}.RiotGamesServers|x64.Build.0 = RiotGamesServers|x64 37 | {17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}.RiotGamesServers|x86.ActiveCfg = RiotGamesServers|Win32 38 | {17B6E7A6-AA76-4C09-B2AA-E2055EF748D2}.RiotGamesServers|x86.Build.0 = RiotGamesServers|Win32 39 | {40F6875E-C1E5-4C10-A129-6E84CE034801}.ChinaServer|x64.ActiveCfg = ChinaServer|x64 40 | {40F6875E-C1E5-4C10-A129-6E84CE034801}.ChinaServer|x64.Build.0 = ChinaServer|x64 41 | {40F6875E-C1E5-4C10-A129-6E84CE034801}.ChinaServer|x86.ActiveCfg = ChinaServer|Win32 42 | {40F6875E-C1E5-4C10-A129-6E84CE034801}.ChinaServer|x86.Build.0 = ChinaServer|Win32 43 | {40F6875E-C1E5-4C10-A129-6E84CE034801}.RiotGamesServers|x64.ActiveCfg = RiotGamesServers|x64 44 | {40F6875E-C1E5-4C10-A129-6E84CE034801}.RiotGamesServers|x64.Build.0 = RiotGamesServers|x64 45 | {40F6875E-C1E5-4C10-A129-6E84CE034801}.RiotGamesServers|x86.ActiveCfg = RiotGamesServers|Win32 46 | {40F6875E-C1E5-4C10-A129-6E84CE034801}.RiotGamesServers|x86.Build.0 = RiotGamesServers|Win32 47 | EndGlobalSection 48 | GlobalSection(SolutionProperties) = preSolution 49 | HideSolutionNode = FALSE 50 | EndGlobalSection 51 | GlobalSection(ExtensibilityGlobals) = postSolution 52 | SolutionGuid = {E95A1774-0E1C-43AD-B120-3B91B5D5302F} 53 | EndGlobalSection 54 | EndGlobal 55 | -------------------------------------------------------------------------------- /R3nzSkin/CheatManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "Config.hpp" 6 | #include "GUI.hpp" 7 | #include "Hooks.hpp" 8 | #include "Logger.hpp" 9 | #include "Memory.hpp" 10 | #include "SkinDatabase.hpp" 11 | 12 | class CheatManager { 13 | public: 14 | void start() noexcept 15 | { 16 | this->hooks = std::make_unique(); 17 | this->config = std::make_unique(); 18 | this->gui = std::make_unique(); 19 | this->memory = std::make_unique(); 20 | this->database = std::make_unique(); 21 | this->logger = std::make_unique(); 22 | } 23 | 24 | bool cheatState{ true }; 25 | std::unique_ptr hooks; 26 | std::unique_ptr config; 27 | std::unique_ptr gui; 28 | std::unique_ptr memory; 29 | std::unique_ptr database; 30 | std::unique_ptr logger; 31 | }; 32 | 33 | inline CheatManager cheatManager; 34 | -------------------------------------------------------------------------------- /R3nzSkin/Config.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include "Json/json.hpp" 9 | 10 | #include "CheatManager.hpp" 11 | #include "Memory.hpp" 12 | #include "Utils.hpp" 13 | 14 | void Config::init() noexcept 15 | { 16 | if (PWSTR pathToDocuments; SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Documents, 0, nullptr, &pathToDocuments))) { 17 | this->path = pathToDocuments; 18 | CoTaskMemFree(pathToDocuments); 19 | } 20 | 21 | this->path /= "R3nzSkin"; 22 | } 23 | 24 | void Config::save() noexcept 25 | { 26 | const auto player{ cheatManager.memory->localPlayer }; 27 | std::error_code ec; 28 | std::filesystem::create_directory(this->path, ec); 29 | auto out{ std::ofstream(this->path / u8"R3nzSkin64")}; 30 | 31 | if (!out.good()) 32 | return; 33 | 34 | if (player) 35 | config_json[std::string(player->get_character_data_stack()->base_skin.model.str) + ".current_combo_skin_index"] = this->current_combo_skin_index; 36 | 37 | config_json["menuKey"] = this->menuKey.toString(); 38 | config_json["nextSkinKey"] = this->nextSkinKey.toString(); 39 | config_json["previousSkinKey"] = this->previousSkinKey.toString(); 40 | config_json["heroName"] = this->heroName; 41 | config_json["raibowText"] = this->rainbowText; 42 | config_json["quickSkinChange"] = this->quickSkinChange; 43 | config_json["fontScale"] = this->fontScale; 44 | config_json["current_combo_ward_index"] = this->current_combo_ward_index; 45 | config_json["current_ward_skin_index"] = this->current_ward_skin_index; 46 | config_json["current_minion_skin_index"] = this->current_minion_skin_index; 47 | 48 | for (const auto& [fst, snd] : this->current_combo_ally_skin_index) 49 | config_json["current_combo_ally_skin_index"][std::to_string(fst)] = snd; 50 | 51 | for (const auto& [fst, snd] : this->current_combo_enemy_skin_index) 52 | config_json["current_combo_enemy_skin_index"][std::to_string(fst)] = snd; 53 | 54 | for (const auto& [fst, snd] : this->current_combo_jungle_mob_skin_index) 55 | config_json["current_combo_jungle_mob_skin_index"][std::to_string(fst)] = snd; 56 | 57 | out << config_json.dump(); 58 | out.close(); 59 | } 60 | 61 | void Config::load() noexcept 62 | { 63 | const auto player{ cheatManager.memory->localPlayer }; 64 | auto in{ std::ifstream(this->path / u8"R3nzSkin64") }; 65 | 66 | if (!in.good()) 67 | return; 68 | 69 | if (json j{ json::parse(in, nullptr, false, true) }; j.is_discarded()) 70 | return; 71 | else 72 | config_json = j; 73 | 74 | if (player) 75 | this->current_combo_skin_index = config_json.value(std::string(player->get_character_data_stack()->base_skin.model.str) + ".current_combo_skin_index", 0); 76 | 77 | this->menuKey = KeyBind(config_json.value("menuKey", "INSERT").c_str()); 78 | this->nextSkinKey = KeyBind(config_json.value("nextSkinKey", "PAGE_UP").c_str()); 79 | this->previousSkinKey = KeyBind(config_json.value("previousSkinKey", "PAGE_DOWN").c_str()); 80 | this->heroName = config_json.value("heroName", true); 81 | this->rainbowText = config_json.value("raibowText", false); 82 | this->quickSkinChange = config_json.value("quickSkinChange", true); 83 | this->fontScale = config_json.value("fontScale", 1.0f); 84 | this->current_combo_ward_index = config_json.value("current_combo_ward_index", 0); 85 | this->current_ward_skin_index = config_json.value("current_ward_skin_index", -1); 86 | this->current_minion_skin_index = config_json.value("current_minion_skin_index", -1); 87 | 88 | const auto ally_skins{ config_json.find("current_combo_ally_skin_index") }; 89 | if (ally_skins != config_json.end()) 90 | for (const auto& it : ally_skins.value().items()) 91 | this->current_combo_ally_skin_index[std::stoull(it.key())] = it.value().get(); 92 | 93 | const auto enemy_skins{ config_json.find("current_combo_enemy_skin_index") }; 94 | if (enemy_skins != config_json.end()) 95 | for (const auto& it : enemy_skins.value().items()) 96 | this->current_combo_enemy_skin_index[std::stoull(it.key())] = it.value().get(); 97 | 98 | const auto jungle_mobs_skins{ config_json.find("current_combo_jungle_mob_skin_index") }; 99 | if (jungle_mobs_skins != config_json.end()) 100 | for (const auto& it : jungle_mobs_skins.value().items()) 101 | this->current_combo_jungle_mob_skin_index[std::stoull(it.key())] = it.value().get(); 102 | 103 | in.close(); 104 | } 105 | 106 | void Config::reset() noexcept 107 | { 108 | this->menuKey = KeyBind(KeyBind::INSERT); 109 | this->nextSkinKey = KeyBind(KeyBind::PAGE_UP); 110 | this->previousSkinKey = KeyBind(KeyBind::PAGE_DOWN); 111 | this->heroName = true; 112 | this->rainbowText = true; 113 | this->quickSkinChange = false; 114 | this->fontScale = 1.0f; 115 | this->current_combo_skin_index = 0; 116 | this->current_combo_ward_index = 0; 117 | this->current_combo_minion_index = 0; 118 | this->current_minion_skin_index = -1; 119 | this->current_ward_skin_index = -1; 120 | this->current_combo_order_turret_index = 0; 121 | this->current_combo_chaos_turret_index = 0; 122 | this->current_combo_ally_skin_index.clear(); 123 | this->current_combo_enemy_skin_index.clear(); 124 | this->current_combo_jungle_mob_skin_index.clear(); 125 | } 126 | -------------------------------------------------------------------------------- /R3nzSkin/Config.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "json/json.hpp" 8 | 9 | #include "Utils.hpp" 10 | 11 | using json = nlohmann::json; 12 | 13 | class Config { 14 | public: 15 | void init() noexcept; 16 | void save() noexcept; 17 | void load() noexcept; 18 | void reset() noexcept; 19 | 20 | KeyBind menuKey{ KeyBind(KeyBind::INSERT) }; 21 | KeyBind nextSkinKey{ KeyBind(KeyBind::PAGE_UP) }; 22 | KeyBind previousSkinKey{ KeyBind(KeyBind::PAGE_DOWN) }; 23 | bool rainbowText{ false }; 24 | float fontScale{ 1.0f }; 25 | bool heroName{ true }; 26 | bool quickSkinChange{ false }; 27 | // player 28 | std::int32_t current_combo_skin_index{ 0 }; 29 | 30 | // minion 31 | std::int32_t current_combo_minion_index{ 0 }; 32 | std::int32_t current_minion_skin_index{ -1 }; 33 | 34 | // ward 35 | std::int32_t current_combo_ward_index{ 0 }; 36 | std::int32_t current_ward_skin_index{ -1 }; 37 | 38 | // turrets, don't save them in config 39 | std::int32_t current_combo_order_turret_index{ 0 }; 40 | std::int32_t current_combo_chaos_turret_index{ 0 }; 41 | 42 | // other champions 43 | std::map current_combo_ally_skin_index; 44 | std::map current_combo_enemy_skin_index; 45 | 46 | // jungle mobs 47 | std::map current_combo_jungle_mob_skin_index; 48 | private: 49 | std::filesystem::path path; 50 | json config_json{ json() }; 51 | }; 52 | -------------------------------------------------------------------------------- /R3nzSkin/GUI.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "CheatManager.hpp" 7 | #include "GUI.hpp" 8 | 9 | #include 10 | 11 | #include "Memory.hpp" 12 | #include "SkinDatabase.hpp" 13 | #include "Utils.hpp" 14 | #include "fnv_hash.hpp" 15 | #include "imgui/imgui.h" 16 | 17 | inline static void footer() noexcept 18 | { 19 | using namespace std::string_literals; 20 | static const auto buildText{ "Last Build: "s + __DATE__ + " - " + __TIME__ }; 21 | ImGui::Separator(); 22 | ImGui::textUnformattedCentered(buildText.c_str()); 23 | ImGui::textUnformattedCentered("Copyright (C) 2021-2024 R3nzTheCodeGOD"); 24 | } 25 | 26 | static void changeTurretSkin(const std::int32_t skinId, const std::int32_t team) noexcept 27 | { 28 | if (skinId == -1) 29 | return; 30 | 31 | const auto turrets{ cheatManager.memory->turretList }; 32 | const auto playerTeam{ cheatManager.memory->localPlayer->get_team() }; 33 | 34 | for (auto i{ 0u }; i < turrets->length; ++i) { 35 | if (const auto turret{ turrets->list[i] }; turret->get_team() == team) { 36 | if (playerTeam == team) { 37 | turret->get_character_data_stack()->base_skin.skin = skinId * 2; 38 | turret->get_character_data_stack()->update(true); 39 | } 40 | else { 41 | turret->get_character_data_stack()->base_skin.skin = skinId * 2 + 1; 42 | turret->get_character_data_stack()->update(true); 43 | } 44 | } 45 | } 46 | } 47 | 48 | void GUI::render() noexcept 49 | { 50 | std::call_once(set_font_scale, [&] 51 | { 52 | ImGui::GetIO().FontGlobalScale = cheatManager.config->fontScale; 53 | }); 54 | 55 | const auto player{ cheatManager.memory->localPlayer }; 56 | const auto heroes{ cheatManager.memory->heroList }; 57 | static const auto my_team{ player ? player->get_team() : 100 }; 58 | static int gear{ player ? player->get_character_data_stack()->base_skin.gear : 0 }; 59 | 60 | static const auto vector_getter_skin = [](void* vec, const std::int32_t idx, const char** out_text) noexcept { 61 | const auto& vector{ *static_cast*>(vec) }; 62 | if (idx < 0 || idx > static_cast(vector.size())) return false; 63 | *out_text = idx == 0 ? "Default" : vector.at(idx - 1).skin_name.c_str(); 64 | return true; 65 | }; 66 | 67 | static const auto vector_getter_ward_skin = [](void* vec, const std::int32_t idx, const char** out_text) noexcept { 68 | const auto& vector{ *static_cast>*>(vec) }; 69 | if (idx < 0 || idx > static_cast(vector.size())) return false; 70 | *out_text = idx == 0 ? "Default" : vector.at(idx - 1).second; 71 | return true; 72 | }; 73 | 74 | static auto vector_getter_gear = [](void* vec, const std::int32_t idx, const char** out_text) noexcept { 75 | const auto& vector{ *static_cast*>(vec) }; 76 | if (idx < 0 || idx > static_cast(vector.size())) return false; 77 | *out_text = vector[idx]; 78 | return true; 79 | }; 80 | 81 | static auto vector_getter_default = [](void* vec, const std::int32_t idx, const char** out_text) noexcept { 82 | const auto& vector{ *static_cast*>(vec) }; 83 | if (idx < 0 || idx > static_cast(vector.size())) return false; 84 | *out_text = idx == 0 ? "Default" : vector.at(idx - 1); 85 | return true; 86 | }; 87 | 88 | ImGui::Begin("R3nzSkin", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_AlwaysAutoResize); 89 | { 90 | ImGui::rainbowText(); 91 | if (ImGui::BeginTabBar("TabBar", ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_FittingPolicyScroll | ImGuiTabBarFlags_NoTooltip)) { 92 | if (player) { 93 | if (ImGui::BeginTabItem("Local Player")) { 94 | auto& values{ cheatManager.database->champions_skins[fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str)] }; 95 | ImGui::Text("Player Skins Settings:"); 96 | 97 | if (ImGui::Combo("Current Skin", &cheatManager.config->current_combo_skin_index, vector_getter_skin, static_cast(&values), values.size() + 1)) 98 | if (cheatManager.config->current_combo_skin_index > 0) 99 | player->change_skin(values[cheatManager.config->current_combo_skin_index - 1].model_name, values[cheatManager.config->current_combo_skin_index - 1].skin_id); 100 | 101 | const auto playerHash{ fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str) }; 102 | if (const auto it{ std::ranges::find_if(cheatManager.database->specialSkins, 103 | [&skin = player->get_character_data_stack()->base_skin.skin, &ph = playerHash](const SkinDatabase::specialSkin& x) noexcept -> bool 104 | { 105 | return x.champHash == ph && (x.skinIdStart <= skin && x.skinIdEnd >= skin); 106 | }) 107 | }; it != cheatManager.database->specialSkins.end()) 108 | { 109 | const auto stack{ player->get_character_data_stack() }; 110 | gear = stack->base_skin.gear; 111 | 112 | if (ImGui::Combo("Current Gear", &gear, vector_getter_gear, static_cast(&it->gears), it->gears.size())) { 113 | player->get_character_data_stack()->base_skin.gear = static_cast(gear); 114 | player->get_character_data_stack()->update(true); 115 | } 116 | ImGui::Separator(); 117 | } 118 | 119 | if (ImGui::Combo("Current Ward Skin", &cheatManager.config->current_combo_ward_index, vector_getter_ward_skin, static_cast(&cheatManager.database->wards_skins), cheatManager.database->wards_skins.size() + 1)) 120 | cheatManager.config->current_ward_skin_index = cheatManager.config->current_combo_ward_index == 0 ? -1 : cheatManager.database->wards_skins.at(cheatManager.config->current_combo_ward_index - 1).first; 121 | footer(); 122 | ImGui::EndTabItem(); 123 | } 124 | } 125 | 126 | static std::int32_t temp_heroes_length = heroes->length; 127 | if (temp_heroes_length > 1) 128 | { 129 | if (ImGui::BeginTabItem("Other Champs")) { 130 | ImGui::Text("Other Champs Skins Settings:"); 131 | std::int32_t last_team{ 0 }; 132 | for (auto i{ 0u }; i < heroes->length; ++i) { 133 | const auto hero{ heroes->list[i] }; 134 | 135 | if (hero == player) 136 | { 137 | continue; 138 | } 139 | 140 | 141 | const auto champion_name_hash{ fnv::hash_runtime(hero->get_character_data_stack()->base_skin.model.str) }; 142 | if (champion_name_hash == FNV("PracticeTool_TargetDummy")) 143 | { 144 | temp_heroes_length = heroes->length - 1; 145 | continue; 146 | } 147 | 148 | const auto hero_team{ hero->get_team() }; 149 | const auto is_enemy{ hero_team != my_team }; 150 | 151 | if (last_team == 0 || hero_team != last_team) { 152 | if (last_team != 0) 153 | ImGui::Separator(); 154 | if (is_enemy) 155 | ImGui::Text(" Enemy champions"); 156 | else 157 | ImGui::Text(" Ally champions"); 158 | last_team = hero_team; 159 | } 160 | 161 | auto& config_array{ is_enemy ? cheatManager.config->current_combo_enemy_skin_index : cheatManager.config->current_combo_ally_skin_index }; 162 | const auto [fst, snd] { config_array.insert({ champion_name_hash, 0 }) }; 163 | 164 | std::snprintf(this->str_buffer, sizeof(this->str_buffer), cheatManager.config->heroName ? "HeroName: [ %s ]##%X" : "PlayerName: [ %s ]##%X", cheatManager.config->heroName ? hero->get_character_data_stack()->base_skin.model.str : hero->get_name()->c_str(), reinterpret_cast(hero)); 165 | 166 | auto& values{ cheatManager.database->champions_skins[champion_name_hash] }; 167 | if (ImGui::Combo(str_buffer, &fst->second, vector_getter_skin, static_cast(&values), values.size() + 1)) 168 | if (fst->second > 0) 169 | hero->change_skin(values[fst->second - 1].model_name, values[fst->second - 1].skin_id); 170 | } 171 | footer(); 172 | ImGui::EndTabItem(); 173 | } 174 | } 175 | 176 | if (ImGui::BeginTabItem("Global Skins")) { 177 | ImGui::Text("Global Skins Settings:"); 178 | if (ImGui::Combo("Minion Skins:", &cheatManager.config->current_combo_minion_index, vector_getter_default, static_cast(&cheatManager.database->minions_skins), cheatManager.database->minions_skins.size() + 1)) 179 | cheatManager.config->current_minion_skin_index = cheatManager.config->current_combo_minion_index - 1; 180 | ImGui::Separator(); 181 | if (ImGui::Combo("Order Turret Skins:", &cheatManager.config->current_combo_order_turret_index, vector_getter_default, static_cast(&cheatManager.database->turret_skins), cheatManager.database->turret_skins.size() + 1)) 182 | changeTurretSkin(cheatManager.config->current_combo_order_turret_index - 1, 100); 183 | if (ImGui::Combo("Chaos Turret Skins:", &cheatManager.config->current_combo_chaos_turret_index, vector_getter_default, static_cast(&cheatManager.database->turret_skins), cheatManager.database->turret_skins.size() + 1)) 184 | changeTurretSkin(cheatManager.config->current_combo_chaos_turret_index - 1, 200); 185 | ImGui::Separator(); 186 | ImGui::Text("Jungle Mobs Skins Settings:"); 187 | for (auto& [name, name_hashes, skins] : cheatManager.database->jungle_mobs_skins) { 188 | std::snprintf(str_buffer, 256, "Current %s skin", name); 189 | const auto [fst, snd] { cheatManager.config->current_combo_jungle_mob_skin_index.insert({ name_hashes.front(), 0 }) }; 190 | if (ImGui::Combo(str_buffer, &fst->second, vector_getter_default, &skins, skins.size() + 1)) 191 | for (const auto& hash : name_hashes) 192 | cheatManager.config->current_combo_jungle_mob_skin_index[hash] = fst->second; 193 | } 194 | footer(); 195 | ImGui::EndTabItem(); 196 | } 197 | 198 | if (ImGui::BeginTabItem("Logger")) { 199 | cheatManager.logger->draw(); 200 | ImGui::EndTabItem(); 201 | } 202 | 203 | if (ImGui::BeginTabItem("Extras")) { 204 | ImGui::hotkey("Menu Key", cheatManager.config->menuKey); 205 | ImGui::Checkbox(cheatManager.config->heroName ? "HeroName based" : "PlayerName based", &cheatManager.config->heroName); 206 | ImGui::Checkbox("Rainbow Text", &cheatManager.config->rainbowText); 207 | ImGui::Checkbox("Quick Skin Change", &cheatManager.config->quickSkinChange); 208 | ImGui::hoverInfo("It allows you to change skin without opening the menu with the key you assign from the keyboard."); 209 | 210 | if (cheatManager.config->quickSkinChange) { 211 | ImGui::Separator(); 212 | ImGui::hotkey("Previous Skin Key", cheatManager.config->previousSkinKey); 213 | ImGui::hotkey("Next Skin Key", cheatManager.config->nextSkinKey); 214 | ImGui::Separator(); 215 | } 216 | 217 | if (player) 218 | ImGui::InputText("Change Nick", player->get_name()); 219 | 220 | if (ImGui::Button("No skins except local player")) { 221 | for (auto& val : cheatManager.config->current_combo_enemy_skin_index | std::views::values) 222 | val = 1; 223 | 224 | for (auto& val : cheatManager.config->current_combo_ally_skin_index | std::views::values) 225 | val = 1; 226 | 227 | for (auto i{ 0u }; i < heroes->length; ++i) { 228 | if (const auto hero{ heroes->list[i] }; hero != player) 229 | hero->change_skin(hero->get_character_data_stack()->base_skin.model.str, 0); 230 | } 231 | } ImGui::hoverInfo("Sets the skins of all champions except the local player to the default skin."); 232 | 233 | if (ImGui::Button("Random Skins")) { 234 | for (auto i{ 0u }; i < heroes->length; ++i) { 235 | const auto hero{ heroes->list[i] }; 236 | const auto championHash{ fnv::hash_runtime(hero->get_character_data_stack()->base_skin.model.str) }; 237 | 238 | if (championHash == FNV("PracticeTool_TargetDummy")) 239 | continue; 240 | 241 | const auto skinCount{ cheatManager.database->champions_skins[championHash].size() }; 242 | auto& skinDatabase{ cheatManager.database->champions_skins[championHash] }; 243 | auto& config{ (hero->get_team() != my_team) ? cheatManager.config->current_combo_enemy_skin_index : cheatManager.config->current_combo_ally_skin_index }; 244 | 245 | if (hero == player) { 246 | cheatManager.config->current_combo_skin_index = random(1ull, skinCount); 247 | hero->change_skin(skinDatabase[cheatManager.config->current_combo_skin_index - 1].model_name, skinDatabase[cheatManager.config->current_combo_skin_index - 1].skin_id); 248 | } 249 | else { 250 | auto& data{ config[championHash] }; 251 | data = random(1ull, skinCount); 252 | hero->change_skin(skinDatabase[data - 1].model_name, skinDatabase[data - 1].skin_id); 253 | } 254 | } 255 | } ImGui::hoverInfo("Randomly changes the skin of all champions."); 256 | 257 | ImGui::SliderFloat("Font Scale", &cheatManager.config->fontScale, 1.0f, 2.0f, "%.3f"); 258 | if (ImGui::GetIO().FontGlobalScale != cheatManager.config->fontScale) { 259 | ImGui::GetIO().FontGlobalScale = cheatManager.config->fontScale; 260 | } ImGui::hoverInfo("Changes the menu font scale."); 261 | 262 | if (ImGui::Button("Force Close")) 263 | cheatManager.hooks->uninstall(); 264 | ImGui::hoverInfo("You will be returned to the reconnect screen."); 265 | ImGui::Text("FPS: %.0f FPS", ImGui::GetIO().Framerate); 266 | footer(); 267 | ImGui::EndTabItem(); 268 | } 269 | } 270 | } 271 | ImGui::End(); 272 | } -------------------------------------------------------------------------------- /R3nzSkin/GUI.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class GUI { 4 | public: 5 | void render() noexcept; 6 | 7 | bool is_open{ true }; 8 | std::once_flag set_font_scale; 9 | private: 10 | char str_buffer[256]; 11 | }; 12 | -------------------------------------------------------------------------------- /R3nzSkin/Hooks.cpp: -------------------------------------------------------------------------------- 1 | #pragma warning(disable : 6011) 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "fnv_hash.hpp" 10 | #include "imgui/imgui.h" 11 | #include "imgui/imgui_impl_dx11.h" 12 | #include "imgui/imgui_impl_win32.h" 13 | #include "vmt_smart_hook.hpp" 14 | 15 | #include "CheatManager.hpp" 16 | #include "Hooks.hpp" 17 | #include "Memory.hpp" 18 | #include "SDK/AIBaseCommon.hpp" 19 | #include "SDK/GameState.hpp" 20 | 21 | LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 22 | 23 | static inline void testFunc() noexcept 24 | { 25 | // The codes you write here are executed when you press the F7 key in the game. 26 | 27 | // Example Func 28 | const auto minions{ cheatManager.memory->minionList }; 29 | for (auto i{ 0u }; i < minions->length; ++i) { 30 | const auto minion{ minions->list[i] }; 31 | const auto owner{ minion->getGoldRedirectTarget() }; 32 | cheatManager.logger->addLog("Minion: %s\n\tModelName: %s\n\t", minion->get_name()->c_str(), minion->get_character_data_stack()->base_skin.model.str); 33 | if (owner) 34 | cheatManager.logger->addLog("OwnerName: %s\n\t\tModelName: %s\n\t", owner->get_name()->c_str(), owner->get_character_data_stack()->base_skin.model.str); 35 | cheatManager.logger->addLog("IsLaneMinion: %d\n\t", minion->isLaneMinion()); 36 | cheatManager.logger->addLog("IsEliteMinion: %d\n\t", minion->isEliteMinion()); 37 | cheatManager.logger->addLog("IsEpicMinion: %d\n\t", minion->isEpicMinion()); 38 | cheatManager.logger->addLog("IsMinion: %d\n\t", minion->isMinion()); 39 | cheatManager.logger->addLog("IsJungle: %d\n\n", minion->isJungle()); 40 | } 41 | } 42 | 43 | static LRESULT WINAPI wndProc(const HWND window, const UINT msg, const WPARAM wParam, const LPARAM lParam) noexcept 44 | { 45 | if (ImGui_ImplWin32_WndProcHandler(window, msg, wParam, lParam)) 46 | return true; 47 | 48 | if (msg == WM_KEYDOWN) { 49 | if (wParam == cheatManager.config->menuKey.getKey()) { 50 | cheatManager.gui->is_open = !cheatManager.gui->is_open; 51 | if (!cheatManager.gui->is_open) 52 | cheatManager.config->save(); 53 | } else if (wParam == 0x35) { 54 | const auto player{ cheatManager.memory->localPlayer }; 55 | if (const auto player{ cheatManager.memory->localPlayer }; (::GetAsyncKeyState(VK_LCONTROL) & 0x8000) && player) { 56 | const auto playerHash{ fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str) }; 57 | if (const auto it{ std::ranges::find_if(cheatManager.database->specialSkins, 58 | [&skin = player->get_character_data_stack()->base_skin.skin, &ph = playerHash](const SkinDatabase::specialSkin& x) noexcept -> bool 59 | { 60 | return x.champHash == ph && (x.skinIdStart <= skin && x.skinIdEnd >= skin); 61 | })}; it != cheatManager.database->specialSkins.end()) 62 | { 63 | const auto stack{ player->get_character_data_stack() }; 64 | if (stack->base_skin.gear < static_cast(it->gears.size()) - 1) 65 | ++stack->base_skin.gear; 66 | else 67 | stack->base_skin.gear = static_cast(0); 68 | 69 | stack->update(true); 70 | } 71 | } 72 | } else if (wParam == cheatManager.config->nextSkinKey.getKey() && cheatManager.config->quickSkinChange) { 73 | if (const auto player{ cheatManager.memory->localPlayer }; player) { 74 | const auto& values{ cheatManager.database->champions_skins[fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str)] }; 75 | if (++cheatManager.config->current_combo_skin_index > static_cast(values.size())) 76 | cheatManager.config->current_combo_skin_index = static_cast(values.size()); 77 | if (cheatManager.config->current_combo_skin_index > 0) 78 | player->change_skin(values[cheatManager.config->current_combo_skin_index - 1].model_name, values[cheatManager.config->current_combo_skin_index - 1].skin_id); 79 | cheatManager.config->save(); 80 | } 81 | } else if (wParam == cheatManager.config->previousSkinKey.getKey() && cheatManager.config->quickSkinChange) { 82 | if (const auto player{ cheatManager.memory->localPlayer }; player) { 83 | const auto& values{ cheatManager.database->champions_skins[fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str)] }; 84 | if (--cheatManager.config->current_combo_skin_index > 0) 85 | player->change_skin(values[cheatManager.config->current_combo_skin_index - 1].model_name, values[cheatManager.config->current_combo_skin_index - 1].skin_id); 86 | else 87 | cheatManager.config->current_combo_skin_index = 1; 88 | cheatManager.config->save(); 89 | } 90 | } else if (wParam == VK_F7) { 91 | testFunc(); 92 | } 93 | } 94 | 95 | return ::CallWindowProc(originalWndProc, window, msg, wParam, lParam); 96 | } 97 | 98 | std::once_flag init_device; 99 | std::unique_ptr<::vmt_smart_hook> swap_chain_vmt{ nullptr }; 100 | 101 | static const ImWchar tahomaRanges[] = { 102 | 0x0020, 0x00FF, // Basic Latin + Latin Supplement 103 | 0x0100, 0x024F, // Latin Extended-A + Latin Extended-B 104 | 0x0250, 0x02FF, // IPA Extensions + Spacing Modifier Letters 105 | 0x0300, 0x03FF, // Combining Diacritical Marks + Greek/Coptic 106 | 0x0400, 0x052F, // Cyrillic + Cyrillic Supplement 107 | 0x0530, 0x06FF, // Armenian + Hebrew + Arabic 108 | 0x0E00, 0x0E7F, // Thai 109 | 0x1E00, 0x1FFF, // Latin Extended Additional + Greek Extended 110 | 0x2000, 0x20CF, // General Punctuation + Superscripts and Subscripts + Currency Symbols 111 | 0x2100, 0x218F, // Letterlike Symbols + Number Forms 112 | 0, 113 | }; 114 | 115 | namespace d3d_vtable { 116 | ID3D11Device* d3d11_device{ nullptr }; 117 | ID3D11DeviceContext* d3d11_device_context{ nullptr }; 118 | ID3D11RenderTargetView* main_render_target_view{ nullptr }; 119 | IDXGISwapChain* p_swap_chain{ nullptr }; 120 | 121 | static void WINAPI create_render_target() noexcept 122 | { 123 | ID3D11Texture2D* back_buffer{ nullptr }; 124 | p_swap_chain->GetBuffer(0u, IID_PPV_ARGS(&back_buffer)); 125 | 126 | if (back_buffer) { 127 | d3d11_device->CreateRenderTargetView(back_buffer, nullptr, &main_render_target_view); 128 | back_buffer->Release(); 129 | } 130 | } 131 | 132 | static void init_imgui(IDXGISwapChain* device) noexcept 133 | { 134 | cheatManager.database->load(); 135 | cheatManager.logger->addLog("All skins loaded from memory!\n"); 136 | ImGui::CreateContext(); 137 | auto& style{ ImGui::GetStyle() }; 138 | 139 | style.WindowPadding = ImVec2(6.0f, 6.0f); 140 | style.FramePadding = ImVec2(6.0f, 4.0f); 141 | style.ItemSpacing = ImVec2(6.0f, 4.0f); 142 | style.WindowTitleAlign = ImVec2(0.5f, 0.5f); 143 | 144 | style.ScrollbarSize = 12.0f; 145 | 146 | style.WindowBorderSize = 0.5f; 147 | style.ChildBorderSize = 0.5f; 148 | style.PopupBorderSize = 0.5f; 149 | style.FrameBorderSize = 0; 150 | 151 | style.WindowRounding = 0.0f; 152 | style.ChildRounding = 0.0f; 153 | style.FrameRounding = 0.0f; 154 | style.ScrollbarRounding = 0.0f; 155 | style.GrabRounding = 0.0f; 156 | style.TabRounding = 0.0f; 157 | style.PopupRounding = 0.0f; 158 | 159 | style.AntiAliasedFill = true; 160 | style.AntiAliasedLines = true; 161 | 162 | const auto colors{ style.Colors }; 163 | 164 | colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); 165 | colors[ImGuiCol_TextDisabled] = ImVec4(0.44f, 0.44f, 0.44f, 1.00f); 166 | colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 1.00f); 167 | colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); 168 | colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f); 169 | colors[ImGuiCol_Border] = ImVec4(0.51f, 0.36f, 0.15f, 1.00f); 170 | colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); 171 | colors[ImGuiCol_FrameBg] = ImVec4(0.11f, 0.11f, 0.11f, 1.00f); 172 | colors[ImGuiCol_FrameBgHovered] = ImVec4(0.51f, 0.36f, 0.15f, 1.00f); 173 | colors[ImGuiCol_FrameBgActive] = ImVec4(0.78f, 0.55f, 0.21f, 1.00f); 174 | colors[ImGuiCol_TitleBg] = ImVec4(0.51f, 0.36f, 0.15f, 1.00f); 175 | colors[ImGuiCol_TitleBgActive] = ImVec4(0.91f, 0.64f, 0.13f, 1.00f); 176 | colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f); 177 | colors[ImGuiCol_MenuBarBg] = ImVec4(0.11f, 0.11f, 0.11f, 1.00f); 178 | colors[ImGuiCol_ScrollbarBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.53f); 179 | colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.21f, 0.21f, 0.21f, 1.00f); 180 | colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.47f, 0.47f, 0.47f, 1.00f); 181 | colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.81f, 0.83f, 0.81f, 1.00f); 182 | colors[ImGuiCol_CheckMark] = ImVec4(0.78f, 0.55f, 0.21f, 1.00f); 183 | colors[ImGuiCol_SliderGrab] = ImVec4(0.91f, 0.64f, 0.13f, 1.00f); 184 | colors[ImGuiCol_SliderGrabActive] = ImVec4(0.91f, 0.64f, 0.13f, 1.00f); 185 | colors[ImGuiCol_Button] = ImVec4(0.51f, 0.36f, 0.15f, 1.00f); 186 | colors[ImGuiCol_ButtonHovered] = ImVec4(0.91f, 0.64f, 0.13f, 1.00f); 187 | colors[ImGuiCol_ButtonActive] = ImVec4(0.78f, 0.55f, 0.21f, 1.00f); 188 | colors[ImGuiCol_Header] = ImVec4(0.51f, 0.36f, 0.15f, 1.00f); 189 | colors[ImGuiCol_HeaderHovered] = ImVec4(0.91f, 0.64f, 0.13f, 1.00f); 190 | colors[ImGuiCol_HeaderActive] = ImVec4(0.93f, 0.65f, 0.14f, 1.00f); 191 | colors[ImGuiCol_Separator] = ImVec4(0.21f, 0.21f, 0.21f, 1.00f); 192 | colors[ImGuiCol_SeparatorHovered] = ImVec4(0.91f, 0.64f, 0.13f, 1.00f); 193 | colors[ImGuiCol_SeparatorActive] = ImVec4(0.78f, 0.55f, 0.21f, 1.00f); 194 | colors[ImGuiCol_ResizeGrip] = ImVec4(0.21f, 0.21f, 0.21f, 1.00f); 195 | colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.91f, 0.64f, 0.13f, 1.00f); 196 | colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.55f, 0.21f, 1.00f); 197 | colors[ImGuiCol_Tab] = ImVec4(0.51f, 0.36f, 0.15f, 1.00f); 198 | colors[ImGuiCol_TabHovered] = ImVec4(0.91f, 0.64f, 0.13f, 1.00f); 199 | colors[ImGuiCol_TabActive] = ImVec4(0.78f, 0.55f, 0.21f, 1.00f); 200 | colors[ImGuiCol_TabUnfocused] = ImVec4(0.07f, 0.10f, 0.15f, 0.97f); 201 | colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.14f, 0.26f, 0.42f, 1.00f); 202 | colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f); 203 | colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); 204 | colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); 205 | colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); 206 | colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); 207 | colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); 208 | colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); 209 | colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); 210 | colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); 211 | colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f); 212 | 213 | auto& io{ ImGui::GetIO() }; (void)io; 214 | io.IniFilename = nullptr; 215 | io.LogFilename = nullptr; 216 | io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange; 217 | 218 | if (PWSTR pathToFonts; SUCCEEDED(::SHGetKnownFolderPath(FOLDERID_Fonts, 0, nullptr, &pathToFonts))) { 219 | const std::filesystem::path path{ pathToFonts }; 220 | ::CoTaskMemFree(pathToFonts); 221 | ImFontConfig cfg; 222 | cfg.SizePixels = 15.0f; 223 | io.Fonts->AddFontFromFileTTF((path / "tahoma.ttf").string().c_str(), cfg.SizePixels, &cfg, tahomaRanges); 224 | cfg.MergeMode = true; 225 | io.Fonts->AddFontFromFileTTF((path / "malgun.ttf").string().c_str(), cfg.SizePixels, &cfg, io.Fonts->GetGlyphRangesKorean()); 226 | io.Fonts->AddFontFromFileTTF((path / "msyh.ttc").string().c_str(), cfg.SizePixels, &cfg, io.Fonts->GetGlyphRangesChineseFull()); 227 | cfg.MergeMode = false; 228 | cheatManager.logger->addLog("Fonts loaded!\n"); 229 | } 230 | 231 | ImGui_ImplWin32_Init(cheatManager.memory->window); 232 | 233 | p_swap_chain = device; 234 | p_swap_chain->GetDevice(__uuidof(d3d11_device), reinterpret_cast(&(d3d11_device))); 235 | d3d11_device->GetImmediateContext(&d3d11_device_context); 236 | create_render_target(); 237 | ::ImGui_ImplDX11_Init(d3d11_device, d3d11_device_context); 238 | ::ImGui_ImplDX11_CreateDeviceObjects(); 239 | 240 | originalWndProc = WNDPROC(::SetWindowLongPtr(cheatManager.memory->window, GWLP_WNDPROC, reinterpret_cast(&wndProc))); 241 | cheatManager.logger->addLog("WndProc hooked!\n\tOriginal: 0x%X\n\tNew: 0x%X\n", &originalWndProc, &wndProc); 242 | } 243 | 244 | static void render() noexcept 245 | { 246 | const auto client{ cheatManager.memory->client }; 247 | if (client && client->game_state == GGameState_s::Running) { 248 | cheatManager.hooks->init(); 249 | if (cheatManager.gui->is_open) { 250 | ::ImGui_ImplDX11_NewFrame(); 251 | ::ImGui_ImplWin32_NewFrame(); 252 | ImGui::NewFrame(); 253 | cheatManager.gui->render(); 254 | ImGui::EndFrame(); 255 | ImGui::Render(); 256 | d3d11_device_context->OMSetRenderTargets(1, &main_render_target_view, nullptr); 257 | ::ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData()); 258 | } 259 | } 260 | } 261 | 262 | struct dxgi_present { 263 | static long WINAPI hooked(IDXGISwapChain* p_swap_chain, UINT sync_interval, UINT flags) noexcept 264 | { 265 | std::call_once(init_device, [&]() { init_imgui(p_swap_chain); }); 266 | render(); 267 | return m_original(p_swap_chain, sync_interval, flags); 268 | } 269 | static decltype(&hooked) m_original; 270 | }; 271 | decltype(dxgi_present::m_original) dxgi_present::m_original; 272 | 273 | struct dxgi_resize_buffers { 274 | static long WINAPI hooked(IDXGISwapChain* p_swap_chain, UINT buffer_count, UINT width, UINT height, DXGI_FORMAT new_format, UINT swap_chain_flags) noexcept 275 | { 276 | if (main_render_target_view) { main_render_target_view->Release(); main_render_target_view = nullptr; } 277 | const auto hr{ m_original(p_swap_chain, buffer_count, width, height, new_format, swap_chain_flags) }; 278 | create_render_target(); 279 | return hr; 280 | } 281 | static decltype(&hooked) m_original; 282 | }; 283 | decltype(dxgi_resize_buffers::m_original) dxgi_resize_buffers::m_original; 284 | }; 285 | 286 | static void changeModelForObject(const AIBaseCommon* obj, const char* model, const std::int32_t skin) noexcept 287 | { 288 | if (skin == -1) 289 | return; 290 | 291 | if (const auto stack{ obj->get_character_data_stack() }; stack->base_skin.skin != skin) { 292 | stack->base_skin.skin = skin; 293 | stack->stack.clear(); 294 | stack->push(model, skin); 295 | } 296 | } 297 | 298 | static void changeSkinForObject(const AIBaseCommon* obj, const std::int32_t skin) noexcept 299 | { 300 | if (skin == -1) 301 | return; 302 | 303 | if (const auto stack{ obj->get_character_data_stack() }; stack->base_skin.skin != skin) { 304 | stack->base_skin.skin = skin; 305 | stack->update(true); 306 | } 307 | } 308 | 309 | void Hooks::init() noexcept 310 | { 311 | const auto player{ cheatManager.memory->localPlayer }; 312 | const auto heroes{ cheatManager.memory->heroList }; 313 | const auto minions{ cheatManager.memory->minionList }; 314 | static const auto playerHash{ player ? fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str) : 0u }; 315 | 316 | std::call_once(change_skins, [&]() noexcept -> void { 317 | if (player) { 318 | if (cheatManager.config->current_combo_skin_index > 0) { 319 | const auto& values{ cheatManager.database->champions_skins[fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str)] }; 320 | player->change_skin(values[cheatManager.config->current_combo_skin_index - 1].model_name, values[cheatManager.config->current_combo_skin_index - 1].skin_id); 321 | } 322 | } 323 | 324 | const auto my_team{ player ? player->get_team() : 100 }; 325 | for (auto i{ 0u }; i < heroes->length; ++i) { 326 | const auto hero{ heroes->list[i] }; 327 | if (hero == player) 328 | continue; 329 | 330 | const auto champion_name_hash{ fnv::hash_runtime(hero->get_character_data_stack()->base_skin.model.str) }; 331 | if (champion_name_hash == FNV("PracticeTool_TargetDummy")) 332 | continue; 333 | 334 | const auto is_enemy{ my_team != hero->get_team() }; 335 | const auto& config_array{ is_enemy ? cheatManager.config->current_combo_enemy_skin_index : cheatManager.config->current_combo_ally_skin_index }; 336 | const auto config_entry{ config_array.find(champion_name_hash) }; 337 | if (config_entry == config_array.end()) 338 | continue; 339 | 340 | if (config_entry->second > 0) { 341 | const auto& values = cheatManager.database->champions_skins[champion_name_hash]; 342 | hero->change_skin(values[config_entry->second - 1].model_name, values[config_entry->second - 1].skin_id); 343 | } 344 | } 345 | }); 346 | 347 | for (auto i{ 0u }; i < heroes->length; ++i) { 348 | if (const auto hero{ heroes->list[i] }; !hero->get_character_data_stack()->stack.empty()) { 349 | // Viego transforms into another champion as 2nd form, our own skin's id may not match for every champion. (same problem exists in sylas) 350 | if (const auto championName{ fnv::hash_runtime(hero->get_character_data_stack()->base_skin.model.str) }; championName == FNV("Viego") || championName == FNV("Sylas")) 351 | continue; 352 | 353 | if (auto& stack{ hero->get_character_data_stack()->stack.front() }; stack.skin != hero->get_character_data_stack()->base_skin.skin) { 354 | stack.skin = hero->get_character_data_stack()->base_skin.skin; 355 | hero->get_character_data_stack()->update(true); 356 | } 357 | } 358 | } 359 | 360 | for (auto i{ 0u }; i < minions->length; ++i) { 361 | const auto minion{ minions->list[i] }; 362 | 363 | if (minion->isLaneMinion()) { 364 | if (player && player->get_team() == 200) 365 | changeSkinForObject(minion, cheatManager.config->current_minion_skin_index * 2 + 1); 366 | else 367 | changeSkinForObject(minion, cheatManager.config->current_minion_skin_index * 2); 368 | continue; 369 | } 370 | 371 | const auto hash{ fnv::hash_runtime(minion->get_character_data_stack()->base_skin.model.str) }; 372 | 373 | if (const auto owner{ minion->getGoldRedirectTarget() }; owner) { 374 | if (hash == FNV("JammerDevice") || hash == FNV("SightWard") || hash == FNV("YellowTrinket") || hash == FNV("VisionWard") || hash == FNV("BlueTrinket") || hash == FNV("TestCubeRender10Vision")) { 375 | if (!player || owner == player) { 376 | if (hash == FNV("TestCubeRender10Vision") && playerHash == FNV("Yone")) 377 | changeModelForObject(minion, "Yone", owner->get_character_data_stack()->base_skin.skin); 378 | else if (hash == FNV("TestCubeRender10Vision")) 379 | changeSkinForObject(minion, 0); 380 | else 381 | changeSkinForObject(minion, cheatManager.config->current_ward_skin_index); 382 | } 383 | } else if (hash != FNV("SRU_Jungle_Companions") && hash != FNV("DominationScout")) 384 | changeSkinForObject(minion, owner->get_character_data_stack()->base_skin.skin); 385 | continue; 386 | } 387 | 388 | if (const auto config_entry{ cheatManager.config->current_combo_jungle_mob_skin_index.find(hash) }; config_entry != cheatManager.config->current_combo_jungle_mob_skin_index.end() && config_entry->second != 0) { 389 | changeSkinForObject(minion, config_entry->second - 1); 390 | continue; 391 | } 392 | 393 | // Just LocalPlayer 394 | if ((hash == FNV("NunuSnowball") && playerHash == FNV("Nunu")) || (hash == FNV("KindredWolf") && playerHash == FNV("Kindred")) || (hash == FNV("QuinnValor") && playerHash == FNV("Quinn"))) 395 | changeSkinForObject(minion, player->get_character_data_stack()->base_skin.skin); 396 | } 397 | } 398 | 399 | void Hooks::install() noexcept 400 | { 401 | if (cheatManager.memory->swapChain) { 402 | swap_chain_vmt = std::make_unique<::vmt_smart_hook>(cheatManager.memory->swapChain); 403 | swap_chain_vmt->apply_hook(8); 404 | swap_chain_vmt->apply_hook(13); 405 | cheatManager.logger->addLog("DX11 Hooked!\n"); 406 | } else { 407 | ::MessageBoxA(nullptr, "Uncheck legacy dx9 in the client settings cuz it is no longer supported.", "R3nzSkin", MB_OK | MB_ICONWARNING); 408 | ::ExitProcess(EXIT_SUCCESS); 409 | } 410 | } 411 | 412 | void Hooks::uninstall() noexcept 413 | { 414 | ::SetWindowLongW(cheatManager.memory->window, GWLP_WNDPROC, reinterpret_cast(originalWndProc)); 415 | swap_chain_vmt->unhook(); 416 | cheatManager.cheatState = false; 417 | } 418 | -------------------------------------------------------------------------------- /R3nzSkin/Hooks.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | inline std::once_flag change_skins; 7 | inline WNDPROC originalWndProc; 8 | 9 | class Hooks { 10 | public: 11 | void init() noexcept; 12 | void install() noexcept; 13 | void uninstall() noexcept; 14 | }; 15 | -------------------------------------------------------------------------------- /R3nzSkin/Logger.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "imgui/imgui.h" 4 | 5 | class R3nzSkinLogger { 6 | public: 7 | R3nzSkinLogger() { this->clear(); } 8 | 9 | void clear() noexcept 10 | { 11 | this->buffer.clear(); 12 | this->lineOffsets.clear(); 13 | this->lineOffsets.push_back(0); 14 | } 15 | 16 | void addLog(const char* fmt, ...) noexcept 17 | { 18 | auto old_size{ this->buffer.size() }; 19 | va_list args; 20 | va_start(args, fmt); 21 | buffer.appendfv(fmt, args); 22 | va_end(args); 23 | for (const auto new_size{ this->buffer.size() }; old_size < new_size; ++old_size) { 24 | if (this->buffer[old_size] == '\n') 25 | this->lineOffsets.push_back(old_size + 1); 26 | } 27 | } 28 | 29 | void draw() noexcept 30 | { 31 | if (ImGui::BeginPopup("Options")) { 32 | ImGui::Checkbox("Auto-scroll", &this->autoScroll); 33 | ImGui::EndPopup(); 34 | } 35 | 36 | if (ImGui::Button("Options")) 37 | ImGui::OpenPopup("Options"); 38 | 39 | ImGui::SameLine(); 40 | if (ImGui::Button("Clear")) 41 | this->clear(); 42 | 43 | ImGui::SameLine(); 44 | if (ImGui::Button("Copy")) 45 | ImGui::LogToClipboard(); 46 | 47 | ImGui::SameLine(); 48 | filter.Draw("Filter", -100.0f); 49 | 50 | ImGui::Separator(); 51 | ImGui::BeginChild("scrolling", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar); 52 | 53 | ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); 54 | 55 | const auto buf{ this->buffer.begin() }; 56 | const auto bufEnd{ this->buffer.end() }; 57 | 58 | if (this->filter.IsActive()) { 59 | for (auto line_no{ 0 }; line_no < this->lineOffsets.Size; ++line_no) { 60 | const auto line_start{ buf + this->lineOffsets[line_no] }; 61 | const auto line_end{ (line_no + 1 < this->lineOffsets.Size) ? (buf + this->lineOffsets[line_no + 1] - 1) : bufEnd }; 62 | if (this->filter.PassFilter(line_start, line_end)) 63 | ImGui::TextUnformatted(line_start, line_end); 64 | } 65 | } else { 66 | ImGuiListClipper clipper; 67 | clipper.Begin(this->lineOffsets.Size); 68 | while (clipper.Step()) { 69 | for (auto line_no{ clipper.DisplayStart }; line_no < clipper.DisplayEnd; ++line_no) { 70 | const auto line_start{ buf + this->lineOffsets[line_no] }; 71 | const auto line_end{ (line_no + 1 < this->lineOffsets.Size) ? (buf + this->lineOffsets[line_no + 1] - 1) : bufEnd }; 72 | ImGui::TextUnformatted(line_start, line_end); 73 | } 74 | } 75 | clipper.End(); 76 | } 77 | 78 | ImGui::PopStyleVar(); 79 | 80 | if (this->autoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) 81 | ImGui::SetScrollHereY(1.0f); 82 | 83 | ImGui::EndChild(); 84 | } 85 | private: 86 | ImGuiTextBuffer buffer; 87 | ImGuiTextFilter filter; 88 | ImVector lineOffsets; 89 | bool autoScroll{ true }; 90 | }; 91 | -------------------------------------------------------------------------------- /R3nzSkin/R3nzSkin.cpp: -------------------------------------------------------------------------------- 1 | #pragma warning(disable : 6387 4715) 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "CheatManager.hpp" 9 | 10 | #include "Config.hpp" 11 | #include "Hooks.hpp" 12 | #include "Memory.hpp" 13 | 14 | #include "SDK/GameState.hpp" 15 | 16 | bool WINAPI HideThread(const HANDLE hThread) noexcept 17 | { 18 | __try { 19 | using FnSetInformationThread = NTSTATUS(NTAPI*)(HANDLE ThreadHandle, UINT ThreadInformationClass, PVOID ThreadInformation, ULONG ThreadInformationLength); 20 | const auto NtSetInformationThread{ reinterpret_cast(::GetProcAddress(::GetModuleHandleW(L"ntdll.dll"), "NtSetInformationThread")) }; 21 | 22 | if (!NtSetInformationThread) 23 | return false; 24 | 25 | if (const auto status{ NtSetInformationThread(hThread, 0x11u, nullptr, 0ul) }; status == 0x00000000) 26 | return true; 27 | } __except (TRUE) { 28 | return false; 29 | } 30 | return false; 31 | } 32 | 33 | __declspec(safebuffers) static void WINAPI DllAttach([[maybe_unused]] LPVOID lp) noexcept 34 | { 35 | using namespace std::chrono_literals; 36 | 37 | cheatManager.start(); 38 | if (HideThread(::GetCurrentThread())) 39 | cheatManager.logger->addLog("Thread Hidden!\n"); 40 | 41 | cheatManager.memory->Search(true); 42 | while (true) { 43 | std::this_thread::sleep_for(1s); 44 | 45 | if (!cheatManager.memory->client) 46 | cheatManager.memory->Search(true); 47 | else if (cheatManager.memory->client->game_state == GGameState_s::Running) 48 | break; 49 | } 50 | cheatManager.logger->addLog("GameClient found!\n"); 51 | 52 | std::this_thread::sleep_for(500ms); 53 | cheatManager.memory->Search(false); 54 | cheatManager.logger->addLog("All offsets found!\n"); 55 | std::this_thread::sleep_for(500ms); 56 | 57 | cheatManager.config->init(); 58 | cheatManager.config->load(); 59 | cheatManager.logger->addLog("CFG loaded!\n"); 60 | 61 | cheatManager.hooks->install(); 62 | 63 | while (cheatManager.cheatState) 64 | std::this_thread::sleep_for(250ms); 65 | 66 | ::ExitProcess(0u); 67 | } 68 | 69 | __declspec(safebuffers) BOOL APIENTRY DllMain(const HMODULE hModule, const DWORD reason, [[maybe_unused]] LPVOID reserved) 70 | { 71 | DisableThreadLibraryCalls(hModule); 72 | 73 | if (reason != DLL_PROCESS_ATTACH) 74 | return FALSE; 75 | 76 | HideThread(hModule); 77 | std::setlocale(LC_ALL, ".utf8"); 78 | 79 | ::_beginthreadex(nullptr, 0u, reinterpret_cast<_beginthreadex_proc_type>(DllAttach), nullptr, 0u, nullptr); 80 | ::CloseHandle(hModule); 81 | return TRUE; 82 | } 83 | -------------------------------------------------------------------------------- /R3nzSkin/R3nzSkin.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFHJavaer/R3Archive/021a1c88e18b237e78e50ec8cbd6868a66eef3a4/R3nzSkin/R3nzSkin.rc -------------------------------------------------------------------------------- /R3nzSkin/R3nzSkin.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ChinaServer 6 | x64 7 | 8 | 9 | RiotGamesServers 10 | Win32 11 | 12 | 13 | ChinaServer 14 | Win32 15 | 16 | 17 | RiotGamesServers 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {17b6e7a6-aa76-4c09-b2aa-e2055ef748d2} 25 | R3nzSkin 26 | 10.0 27 | R3nzSkin 28 | 29 | 30 | 31 | DynamicLibrary 32 | false 33 | v143 34 | true 35 | Unicode 36 | 37 | 38 | DynamicLibrary 39 | false 40 | v143 41 | true 42 | Unicode 43 | 44 | 45 | DynamicLibrary 46 | false 47 | v143 48 | true 49 | Unicode 50 | x86 51 | 52 | 53 | DynamicLibrary 54 | false 55 | v143 56 | true 57 | Unicode 58 | x64 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | false 80 | $(SolutionDir)Release\$(Configuration)\ 81 | 82 | 83 | false 84 | $(SolutionDir)Release\$(Configuration)\ 85 | 86 | 87 | false 88 | $(SolutionDir)Release\$(Configuration)\ 89 | false 90 | 91 | 92 | false 93 | false 94 | $(SolutionDir)Release\$(Configuration)\ 95 | 96 | 97 | false 98 | 99 | 100 | 101 | Level3 102 | true 103 | true 104 | true 105 | __SSE__;__SSE2__;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;R3NZSKIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 106 | true 107 | NotUsing 108 | pch.h 109 | stdcpplatest 110 | StreamingSIMDExtensions2 111 | Default 112 | 113 | 114 | Windows 115 | true 116 | true 117 | false 118 | false 119 | RequireAdministrator 120 | 121 | 122 | 123 | 124 | Level3 125 | true 126 | true 127 | true 128 | __SSE2__;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;R3NZSKIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 129 | true 130 | NotUsing 131 | pch.h 132 | stdcpplatest 133 | StreamingSIMDExtensions2 134 | Default 135 | 136 | 137 | Windows 138 | true 139 | true 140 | false 141 | false 142 | RequireAdministrator 143 | 144 | 145 | 146 | 147 | Level3 148 | true 149 | true 150 | false 151 | __SSE__;__SSE2__;_CRT_SECURE_NO_WARNINGS;_RIOT;WIN32;NDEBUG;R3NZSKIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 152 | true 153 | NotUsing 154 | pch.h 155 | stdcpplatest 156 | StreamingSIMDExtensions2 157 | Default 158 | Speed 159 | true 160 | false 161 | MultiThreaded 162 | false 163 | false 164 | false 165 | false 166 | false 167 | 168 | 169 | Windows 170 | true 171 | true 172 | false 173 | false 174 | false 175 | 176 | 177 | 178 | 179 | TurnOffAllWarnings 180 | true 181 | true 182 | false 183 | __SSE2__;_CRT_SECURE_NO_WARNINGS;_RIOT;WIN32;NDEBUG;R3NZSKIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 184 | true 185 | NotUsing 186 | pch.h 187 | stdcpplatest 188 | StreamingSIMDExtensions2 189 | Default 190 | Speed 191 | true 192 | false 193 | MultiThreaded 194 | false 195 | false 196 | false 197 | false 198 | false 199 | true 200 | /EHsc %(AdditionalOptions) 201 | 202 | 203 | Windows 204 | true 205 | true 206 | false 207 | false 208 | false 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | -------------------------------------------------------------------------------- /R3nzSkin/R3nzSkin.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {6e1c3fe0-7b4e-4ddc-b0af-ef2565509bab} 6 | 7 | 8 | {24604dbf-d26d-4752-9537-7815e59a2e32} 9 | 10 | 11 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 12 | cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx 13 | 14 | 15 | {e168d0f0-d453-47c1-867e-8e15f16f1918} 16 | 17 | 18 | {d978207e-684f-4e9b-a516-3a1bdf6da43a} 19 | 20 | 21 | {908bf81e-18df-417d-bcd9-8e3458213e73} 22 | 23 | 24 | {6df88be6-4732-4c12-ab2a-b0e38f717525} 25 | 26 | 27 | {fb0c6058-a093-4f26-bc23-dd4f3d31e4c3} 28 | 29 | 30 | {6b382e58-2f4f-42a8-8d19-ea492ca17eb7} 31 | 32 | 33 | {4c536b17-7ff4-4861-9586-0981e0bd981b} 34 | 35 | 36 | {a2d7fdd0-5331-4fcc-95c6-864f9d9d19bf} 37 | 38 | 39 | 40 | 41 | 42 | Source Files\Skins 43 | 44 | 45 | Source Files\GUI 46 | 47 | 48 | Source Files\Memory 49 | 50 | 51 | Source Files\Hooks 52 | 53 | 54 | Imgui 55 | 56 | 57 | Imgui 58 | 59 | 60 | Imgui 61 | 62 | 63 | Imgui 64 | 65 | 66 | Imgui 67 | 68 | 69 | Imgui 70 | 71 | 72 | Imgui 73 | 74 | 75 | Source Files\Config 76 | 77 | 78 | Source Files\Utils 79 | 80 | 81 | Source Files\SDK 82 | 83 | 84 | Source Files\SDK 85 | 86 | 87 | Source Files\SDK 88 | 89 | 90 | 91 | 92 | Source Files\Skins 93 | 94 | 95 | Source Files\Utils 96 | 97 | 98 | Source Files\Utils 99 | 100 | 101 | Source Files\Offsets 102 | 103 | 104 | Source Files\GUI 105 | 106 | 107 | Source Files\Memory 108 | 109 | 110 | Source Files\Hooks 111 | 112 | 113 | 114 | Imgui 115 | 116 | 117 | Imgui 118 | 119 | 120 | Imgui 121 | 122 | 123 | Imgui 124 | 125 | 126 | Imgui 127 | 128 | 129 | Imgui 130 | 131 | 132 | Imgui 133 | 134 | 135 | Imgui 136 | 137 | 138 | Json 139 | 140 | 141 | Source Files\Config 142 | 143 | 144 | Source Files\Utils 145 | 146 | 147 | Source Files\SDK 148 | 149 | 150 | Source Files\SDK 151 | 152 | 153 | Source Files\SDK 154 | 155 | 156 | Source Files\SDK 157 | 158 | 159 | Source Files\SDK 160 | 161 | 162 | Source Files\SDK 163 | 164 | 165 | Source Files\SDK 166 | 167 | 168 | Source Files\SDK 169 | 170 | 171 | Source Files\SDK 172 | 173 | 174 | Source Files\SDK 175 | 176 | 177 | Source Files\SDK 178 | 179 | 180 | Source Files\SDK 181 | 182 | 183 | Source Files\SDK 184 | 185 | 186 | Source Files\SDK 187 | 188 | 189 | Source Files\SDK 190 | 191 | 192 | 193 | Source Files\SDK 194 | 195 | 196 | Source Files\SDK 197 | 198 | 199 | Source Files\Utils 200 | 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/AIBaseCommon.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "AIBaseCommon.hpp" 5 | 6 | #include "../encryption.hpp" 7 | #include "../fnv_hash.hpp" 8 | #include "../offsets.hpp" 9 | 10 | #include "../CheatManager.hpp" 11 | 12 | bool AIBaseCommon::checkSpecialSkins(const char* model, const std::int32_t skin) noexcept 13 | { 14 | const auto stack{ this->get_character_data_stack() }; 15 | const auto champ_name{ fnv::hash_runtime(stack->base_skin.model.str) }; 16 | 17 | if (champ_name == FNV("Katarina") && (skin >= 29 && skin <= 36)) { 18 | stack->base_skin.gear = static_cast(0); 19 | } else if (champ_name == FNV("Renekton") && (skin >= 26 && skin <= 32)) { 20 | stack->base_skin.gear = static_cast(0); 21 | } else if (champ_name == FNV("MissFortune") && skin == 16) { 22 | stack->base_skin.gear = static_cast(0); 23 | } else if (champ_name == FNV("Lux") || champ_name == FNV("Sona")) { 24 | if ((skin == 7 && champ_name == FNV("Lux")) || (skin == 6 && champ_name == FNV("Sona"))) { 25 | stack->stack.clear(); 26 | stack->push(model, skin); 27 | return true; 28 | } else stack->stack.clear(); 29 | } else if (stack->base_skin.gear != static_cast(-1) && champ_name != FNV("Kayn")) { 30 | stack->base_skin.gear = static_cast(-1); 31 | } 32 | 33 | return false; 34 | } 35 | 36 | void AIBaseCommon::change_skin(const char* model, const std::int32_t skin) noexcept 37 | { 38 | const auto stack{ this->get_character_data_stack() }; 39 | reinterpret_cast*>(std::uintptr_t(this) + offsets::AIBaseCommon::SkinId)->encrypt(skin); 40 | stack->base_skin.skin = skin; 41 | 42 | if (!this->checkSpecialSkins(model, skin)) 43 | stack->update(true); 44 | } 45 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/AIBaseCommon.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "CharacterDataStack.hpp" 6 | #include "GameObject.hpp" 7 | 8 | class AIBaseCommon : public GameObject { 9 | public: 10 | [[nodiscard]] CharacterDataStack* get_character_data_stack() const noexcept { return reinterpret_cast(std::uintptr_t(this) + offsets::AIBaseCommon::CharacterDataStack); } 11 | 12 | void change_skin(const char* model, const std::int32_t skin) noexcept; 13 | private: 14 | bool checkSpecialSkins(const char* model, const std::int32_t skin) noexcept; 15 | }; 16 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/AIHero.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AIBaseCommon.hpp" 4 | 5 | class AIHero : public AIBaseCommon { 6 | public: 7 | }; 8 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/AIMinionClient.cpp: -------------------------------------------------------------------------------- 1 | #include "AIMinionClient.hpp" 2 | 3 | #include 4 | 5 | #include "../CheatManager.hpp" 6 | 7 | AIBaseCommon* AIMinionClient::getGoldRedirectTarget() const noexcept 8 | { 9 | static const auto getOwner{ reinterpret_cast(cheatManager.memory->base + offsets::functions::GetGoldRedirectTarget) }; 10 | return getOwner(std::uintptr_t(this)); 11 | } 12 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/AIMinionClient.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AIBaseCommon.hpp" 4 | 5 | class AIMinionClient : public AIBaseCommon { 6 | public: 7 | [[nodiscard]] AIBaseCommon* getGoldRedirectTarget() const noexcept; 8 | }; 9 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/AITurret.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AIBaseCommon.hpp" 4 | 5 | class AITurret : public AIBaseCommon { 6 | public: 7 | }; 8 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/AString.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class AString { 6 | public: 7 | const char* str; 8 | std::int32_t length; 9 | std::int32_t capacity; 10 | }; 11 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/Champion.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AString.hpp" 4 | #include "Pad.hpp" 5 | #include "Skin.hpp" 6 | #include "RiotArray.hpp" 7 | 8 | class Champion { 9 | PAD(0x8) 10 | AString champion_name; 11 | PAD(0xA0) 12 | RiotArray skins; 13 | }; 14 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/ChampionManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "Champion.hpp" 6 | #include "Pad.hpp" 7 | #include "RiotArray.hpp" 8 | 9 | class ChampionManager { 10 | PAD(0x18) 11 | RiotArray champions; 12 | }; 13 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/CharacterDataStack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "../CheatManager.hpp" 4 | #include "../Offsets.hpp" 5 | 6 | #include "CharacterDataStack.hpp" 7 | 8 | void CharacterDataStack::push(const char* model, const std::int32_t skin) const noexcept 9 | { 10 | using push_t = __int64(__fastcall*)(std::uintptr_t, const char*, std::int32_t, std::int32_t, bool, bool, bool, bool, bool, bool, std::int8_t, const char*, std::int32_t, const char*, std::int32_t, bool, std::int32_t); 11 | static const auto _push{ reinterpret_cast(cheatManager.memory->base + offsets::functions::CharacterDataStack__Push) }; 12 | _push(std::uintptr_t(this), model, skin, 0, false, false, false, false, true, false, -1, "\x00", 0, "\x00", 0, false, 1); 13 | } 14 | 15 | void CharacterDataStack::update(const bool change) const noexcept 16 | { 17 | static const auto _update{ reinterpret_cast<__int64(__fastcall*)(std::uintptr_t, bool)>(cheatManager.memory->base + offsets::functions::CharacterDataStack__Update) }; 18 | _update(std::uintptr_t(this), change); 19 | } 20 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/CharacterDataStack.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "CharacterStackData.hpp" 7 | 8 | class CharacterDataStack { 9 | public: 10 | std::vector stack; 11 | CharacterStackData base_skin; 12 | 13 | void update(const bool change) const noexcept; 14 | void push(const char* model, const std::int32_t skin) const noexcept; 15 | }; 16 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/CharacterStackData.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "AString.hpp" 6 | #include "Pad.hpp" 7 | 8 | class CharacterStackData { 9 | public: 10 | AString model; 11 | PAD(0x10) 12 | std::int32_t skin; 13 | PAD(0x60) 14 | std::int8_t gear; 15 | PAD(0x7) 16 | }; 17 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/GameClient.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GameState.hpp" 4 | #include "Pad.hpp" 5 | 6 | class GameClient { 7 | PAD(0xC) 8 | GGameState_s game_state; 9 | }; 10 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/GameObject.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "../offsets.hpp" 7 | #include "Pad.hpp" 8 | 9 | class GameObject { 10 | public: 11 | CLASS_GETTER_P(std::string, get_name, offsets::GameObject::Name) 12 | CLASS_GETTER(std::int32_t, get_team, offsets::GameObject::Team) 13 | 14 | // Returns true for lane minions. 15 | [[nodiscard]] bool isLaneMinion() const noexcept { return CallVirtual(std::uintptr_t(this)); } 16 | 17 | // Returns true for blue, red and crab. 18 | [[nodiscard]] bool isEliteMinion() const noexcept { return CallVirtual(std::uintptr_t(this)); } 19 | 20 | // Returns true for dragon, baron, and rift. 21 | [[nodiscard]] bool isEpicMinion() const noexcept { return CallVirtual(std::uintptr_t(this)); } 22 | 23 | // Returns true for minion. 24 | [[nodiscard]] bool isMinion() const noexcept { return CallVirtual(std::uintptr_t(this)); } 25 | 26 | // Returns true for objects that both teams can damage, such as jungle objects, gangplain barrels, etc. 27 | [[nodiscard]] bool isJungle() const noexcept { return CallVirtual(std::uintptr_t(this)); } 28 | }; 29 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/GameState.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | enum class GGameState_s : std::int32_t { 6 | LoadingScreen = 0, 7 | Connecting = 1, 8 | Running = 2, 9 | Poaused = 3, 10 | Finished = 4, 11 | Exiting = 5 12 | }; 13 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/ManagerTemplate.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "Pad.hpp" 6 | 7 | template 8 | class ManagerTemplate { 9 | PAD(0x8) 10 | T** list; 11 | std::int32_t length; 12 | std::int32_t capacity; 13 | }; 14 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/Pad.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define CONCAT(a, b) a##b 6 | #define PAD_NAME(n) CONCAT(pad, n) 7 | #define PAD(size) \ 8 | private: \ 9 | std::byte PAD_NAME(__LINE__)[size]; \ 10 | public: 11 | 12 | #define CLASS_GETTER(returnType, name, offset) \ 13 | [[nodiscard]] inline returnType name() const noexcept \ 14 | { \ 15 | return *reinterpret_cast(std::uintptr_t(this) + offset); \ 16 | } 17 | 18 | #define CLASS_GETTER_P(returnType, name, offset) \ 19 | [[nodiscard]] inline returnType* name() const noexcept \ 20 | { \ 21 | return reinterpret_cast(std::uintptr_t(this) + offset); \ 22 | } 23 | 24 | template 25 | ReturnType CallVirtual(std::uintptr_t instance, Args... args) 26 | { 27 | using Fn = ReturnType(__fastcall*)(std::uintptr_t, Args...); 28 | const auto function{ (*reinterpret_cast(instance))[Index] }; 29 | return function(instance, args...); 30 | } -------------------------------------------------------------------------------- /R3nzSkin/SDK/RiotArray.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | template 6 | class RiotArray { 7 | public: 8 | T* list; 9 | std::int32_t size; 10 | std::int32_t cap; 11 | }; 12 | -------------------------------------------------------------------------------- /R3nzSkin/SDK/Skin.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "AString.hpp" 6 | #include "Pad.hpp" 7 | 8 | class Skin { 9 | public: 10 | std::int32_t skin_id; 11 | PAD(0x4) 12 | AString skin_name; 13 | }; 14 | -------------------------------------------------------------------------------- /R3nzSkin/SkinDatabase.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "CheatManager.hpp" 9 | #include "SkinDatabase.hpp" 10 | #include "fnv_hash.hpp" 11 | 12 | void SkinDatabase::load() noexcept 13 | { 14 | for (auto j{ 0 }; j < cheatManager.memory->championManager->champions.size; ++j) { 15 | const auto& champion = cheatManager.memory->championManager->champions.list[j]; 16 | std::vector skins_ids; 17 | 18 | for (auto i{ 0 }; i < champion->skins.size; ++i) 19 | skins_ids.push_back(champion->skins.list[i].skin_id); 20 | 21 | std::ranges::sort(skins_ids); 22 | 23 | std::map temp_skin_list; 24 | for (const auto& i : skins_ids) { 25 | const auto skin_display_name{ std::string("game_character_skin_displayname_") + champion->champion_name.str + "_" + std::to_string(i) }; 26 | auto skin_display_name_translated{ i > 0 ? std::string(cheatManager.memory->translateString(skin_display_name.c_str())) : std::string(champion->champion_name.str) }; 27 | 28 | if (skin_display_name_translated == skin_display_name) 29 | continue; 30 | 31 | if (const auto it{ temp_skin_list.find(skin_display_name_translated) }; it == temp_skin_list.end()) { 32 | temp_skin_list[skin_display_name_translated] = 1; 33 | } else { 34 | skin_display_name_translated.append(" Chroma " + std::to_string(it->second)); 35 | it->second = it->second + 1; 36 | } 37 | 38 | const auto champ_name{ fnv::hash_runtime(champion->champion_name.str) }; 39 | this->champions_skins[champ_name].push_back({ champion->champion_name.str, skin_display_name_translated, i }); 40 | 41 | if (i == 7 && champ_name == FNV("Lux")) { 42 | this->champions_skins[champ_name].push_back({ "LuxAir", "Elementalist Air Lux", i }); 43 | this->champions_skins[champ_name].push_back({ "LuxDark", "Elementalist Dark Lux", i }); 44 | this->champions_skins[champ_name].push_back({ "LuxFire", "Elementalist Fire Lux", i }); 45 | this->champions_skins[champ_name].push_back({ "LuxIce", "Elementalist Ice Lux", i }); 46 | this->champions_skins[champ_name].push_back({ "LuxMagma", "Elementalist Magma Lux", i }); 47 | this->champions_skins[champ_name].push_back({ "LuxMystic", "Elementalist Mystic Lux", i }); 48 | this->champions_skins[champ_name].push_back({ "LuxNature", "Elementalist Nature Lux", i }); 49 | this->champions_skins[champ_name].push_back({ "LuxStorm", "Elementalist Storm Lux", i }); 50 | this->champions_skins[champ_name].push_back({ "LuxWater", "Elementalist Water Lux", i }); 51 | } else if (i == 6 && champ_name == FNV("Sona")) { 52 | this->champions_skins[champ_name].push_back({ "SonaDJGenre02", "DJ Sona 2", i }); 53 | this->champions_skins[champ_name].push_back({ "SonaDJGenre03", "DJ Sona 3", i }); 54 | } 55 | } 56 | } 57 | 58 | for (auto ward_skin_id{ 1u };; ++ward_skin_id) { 59 | const auto ward_display_name{ "game_character_skin_displayname_SightWard_" + std::to_string(ward_skin_id) }; 60 | const auto ward_display_name_translated{ cheatManager.memory->translateString(ward_display_name.c_str()) }; 61 | 62 | if (ward_display_name == ward_display_name_translated) 63 | break; 64 | 65 | this->wards_skins.emplace_back(ward_skin_id, ward_display_name_translated); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /R3nzSkin/SkinDatabase.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "fnv_hash.hpp" 9 | 10 | class SkinDatabase { 11 | public: 12 | class skin_info { 13 | public: 14 | const char* model_name; 15 | std::string skin_name; 16 | std::int32_t skin_id; 17 | }; 18 | 19 | class jungle_mob_skin_info { 20 | public: 21 | const char* name; 22 | std::vector name_hashes; 23 | std::vector skins; 24 | }; 25 | 26 | class specialSkin { 27 | public: 28 | std::uint64_t champHash; 29 | std::int32_t skinIdStart; 30 | std::int32_t skinIdEnd; 31 | std::vector gears; 32 | }; 33 | 34 | void load() noexcept; 35 | 36 | std::map> champions_skins; 37 | std::vector> wards_skins; 38 | 39 | std::vector minions_skins{ 40 | "Minion", "Summer Minion", 41 | "Project Minion", "Snowdown Minion", 42 | "Draven Minion", "Star Guardian Minion", 43 | "Arcade Minion", "Snowdown 2 Minion", 44 | "Odyssey Minion", "Mouse Minion", "Arcane Minion" 45 | }; 46 | 47 | std::vector turret_skins{ 48 | "Default Order Turret", "Default Chaos Turret", 49 | "Snow Order Turret", "Snow Chaos Turret", 50 | "Twisted Treeline Order Turret", "Twisted Treeline Chaos Turret", 51 | "URF Order Turret", "URF Chaos Turret", 52 | "Arcade Turret", 53 | "Temple of Lily and Lotus Turret", 54 | "Arcane Order Turret", "Arcane Chaos Turret", 55 | "Butcher's Bridge Order Turret", "Butcher's Bridge Chaos Turret", 56 | "Howling Abyss Order Turret", "Howling Abyss Chaos Turret" 57 | }; 58 | 59 | std::vector jungle_mobs_skins{ 60 | { 61 | "Baron", 62 | { FNV("SRU_Baron") }, 63 | { "Baron", "Snowdown Baron", "Championship Baron", "Lunar Revel Baron", "MSI Baron", "Odyssey Baron", "Championship Birthday Baron", "Ruined King Baron" } 64 | }, 65 | { 66 | "Blue", 67 | { FNV("SRU_Blue") }, 68 | { "Blue", "Dark Blue", "Pool Party Blue", "Ruined King Blue" } 69 | }, 70 | { 71 | "Red", 72 | { FNV("SRU_Red") }, 73 | { "Red", "Pool Party Red", "Ruined King Red" } 74 | }, 75 | { 76 | "Scuttle", 77 | { FNV("Sru_Crab") }, 78 | { "Scuttle", "Halloween Light Scuttle", "Halloween Dark Scuttle", "Ruined King Scuttle" } 79 | }, 80 | { 81 | "Krug", 82 | { FNV("SRU_Krug"), FNV("SRU_KrugMini"), FNV("SRU_KrugMiniMini") }, 83 | { "Krug", "Dark Krug" } 84 | }, 85 | { 86 | "Razorbeak", 87 | { FNV("SRU_Razorbeak"), FNV("SRU_RazorbeakMini") }, 88 | { "Razorbeak", "Chicken Razorbeak" } 89 | } 90 | }; 91 | //左开右闭 92 | std::vector specialSkins{ 93 | { FNV("Katarina"), 29, 36, { "Dagger 1", "Dagger 2", "Dagger 3", "Dagger 4", "Dagger 5", "Dagger 6" }}, 94 | { FNV("Renekton"), 26, 32, { "Head off", "Head on", "Fins", "Ultimate" } }, 95 | { FNV("MissFortune"), 16, 16, { "Scarlet fair", "Zero hour", "Royal arms", "Starswarm" } }, 96 | { FNV("Ezreal"), 5, 5, { "Level 1", "Level 2", "Level 3" } }, 97 | { FNV("Ahri"), 86, 87, { "Level 1", "Level 2", "Level 3" } } 98 | }; 99 | }; 100 | -------------------------------------------------------------------------------- /R3nzSkin/Utils.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "imgui/imgui.h" 7 | #define IMGUI_DEFINE_MATH_OPERATORS 8 | #include "imgui/imgui_internal.h" 9 | 10 | #include "CheatManager.hpp" 11 | #include "Utils.hpp" 12 | 13 | struct Key { 14 | constexpr Key(std::string_view name, int code) : name{ name }, code{ code } { } 15 | 16 | std::string_view name; 17 | int code; 18 | }; 19 | 20 | // indices must match KeyBind::KeyCode enum 21 | static constexpr auto keyMap = std::to_array({ 22 | { "'", VK_OEM_7 }, 23 | { ",", VK_OEM_COMMA }, 24 | { "-", VK_OEM_MINUS }, 25 | { ".", VK_OEM_PERIOD }, 26 | { "/", VK_OEM_2 }, 27 | { "0", '0' }, 28 | { "1", '1' }, 29 | { "2", '2' }, 30 | { "3", '3' }, 31 | { "4", '4' }, 32 | { "5", '5' }, 33 | { "6", '6' }, 34 | { "7", '7' }, 35 | { "8", '8' }, 36 | { "9", '9' }, 37 | { ";", VK_OEM_1 }, 38 | { "=", VK_OEM_PLUS }, 39 | { "A", 'A' }, 40 | { "ADD", VK_ADD }, 41 | { "B", 'B' }, 42 | { "BACKSPACE", VK_BACK }, 43 | { "C", 'C' }, 44 | { "CAPSLOCK", VK_CAPITAL }, 45 | { "D", 'D' }, 46 | { "DECIMAL", VK_DECIMAL }, 47 | { "DELETE", VK_DELETE }, 48 | { "DIVIDE", VK_DIVIDE }, 49 | { "DOWN", VK_DOWN }, 50 | { "E", 'E' }, 51 | { "END", VK_END }, 52 | { "ENTER", VK_RETURN }, 53 | { "F", 'F' }, 54 | { "F1", VK_F1 }, 55 | { "F10", VK_F10 }, 56 | { "F11", VK_F11 }, 57 | { "F12", VK_F12 }, 58 | { "F2", VK_F2 }, 59 | { "F3", VK_F3 }, 60 | { "F4", VK_F4 }, 61 | { "F5", VK_F5 }, 62 | { "F6", VK_F6 }, 63 | { "F7", VK_F7 }, 64 | { "F8", VK_F8 }, 65 | { "F9", VK_F9 }, 66 | { "G", 'G' }, 67 | { "H", 'H' }, 68 | { "HOME", VK_HOME }, 69 | { "I", 'I' }, 70 | { "INSERT", VK_INSERT }, 71 | { "J", 'J' }, 72 | { "K", 'K' }, 73 | { "L", 'L' }, 74 | { "LALT", VK_LMENU }, 75 | { "LCTRL", VK_LCONTROL }, 76 | { "LEFT", VK_LEFT }, 77 | { "LSHIFT", VK_LSHIFT }, 78 | { "M", 'M' }, 79 | { "MOUSE1", 0x0 }, 80 | { "MOUSE2", 0x1 }, 81 | { "MOUSE3", 0x2 }, 82 | { "MOUSE4", 0x3 }, 83 | { "MOUSE5", 0x4 }, 84 | { "MULTIPLY", VK_MULTIPLY }, 85 | { "MWHEEL_DOWN", 0x0 }, 86 | { "MWHEEL_UP", 0x0 }, 87 | { "N", 'N' }, 88 | { "NONE", 0x0 }, 89 | { "NUMPAD_0", VK_NUMPAD0 }, 90 | { "NUMPAD_1", VK_NUMPAD1 }, 91 | { "NUMPAD_2", VK_NUMPAD2 }, 92 | { "NUMPAD_3", VK_NUMPAD3 }, 93 | { "NUMPAD_4", VK_NUMPAD4 }, 94 | { "NUMPAD_5", VK_NUMPAD5 }, 95 | { "NUMPAD_6", VK_NUMPAD6 }, 96 | { "NUMPAD_7", VK_NUMPAD7 }, 97 | { "NUMPAD_8", VK_NUMPAD8 }, 98 | { "NUMPAD_9", VK_NUMPAD9 }, 99 | { "O", 'O' }, 100 | { "P", 'P' }, 101 | { "PAGE_DOWN", VK_NEXT }, 102 | { "PAGE_UP", VK_PRIOR }, 103 | { "Q", 'Q' }, 104 | { "R", 'R' }, 105 | { "RALT", VK_RMENU }, 106 | { "RCTRL", VK_RCONTROL }, 107 | { "RIGHT", VK_RIGHT }, 108 | { "RSHIFT", VK_RSHIFT }, 109 | { "S", 'S' }, 110 | { "SPACE", VK_SPACE }, 111 | { "SUBTRACT", VK_SUBTRACT }, 112 | { "T", 'T' }, 113 | { "TAB", VK_TAB }, 114 | { "U", 'U' }, 115 | { "UP", VK_UP }, 116 | { "V", 'V' }, 117 | { "W", 'W' }, 118 | { "X", 'X' }, 119 | { "Y", 'Y' }, 120 | { "Z", 'Z' }, 121 | { "[", VK_OEM_4 }, 122 | { "\\", VK_OEM_5 }, 123 | { "]", VK_OEM_6 }, 124 | { "`", VK_OEM_3 } 125 | }); 126 | 127 | static_assert(keyMap.size() == KeyBind::MAX); 128 | static_assert(std::ranges::is_sorted(keyMap, {}, &Key::name)); 129 | 130 | KeyBind::KeyBind(const KeyCode keyCode) noexcept : keyCode{ static_cast(keyCode) < keyMap.size() ? keyCode : KeyCode::NONE } { } 131 | 132 | KeyBind::KeyBind(const char* keyName) noexcept 133 | { 134 | if (const auto it{ std::ranges::lower_bound(keyMap, keyName, {}, &Key::name) }; it != keyMap.end() && it->name == keyName) 135 | keyCode = static_cast(std::distance(keyMap.begin(), it)); 136 | else 137 | keyCode = KeyCode::NONE; 138 | } 139 | 140 | const char* KeyBind::toString() const noexcept 141 | { 142 | return keyMap[static_cast(keyCode) < keyMap.size() ? keyCode : KeyCode::NONE].name.data(); 143 | } 144 | 145 | int KeyBind::getKey() const noexcept 146 | { 147 | return keyMap[static_cast(keyCode) < keyMap.size() ? keyCode : KeyCode::NONE].code; 148 | } 149 | 150 | bool KeyBind::isPressed() const noexcept 151 | { 152 | if (keyCode == KeyCode::NONE) 153 | return false; 154 | 155 | if (keyCode == KeyCode::MOUSEWHEEL_DOWN) 156 | return ImGui::GetIO().MouseWheel < 0.0f; 157 | 158 | if (keyCode == KeyCode::MOUSEWHEEL_UP) 159 | return ImGui::GetIO().MouseWheel > 0.0f; 160 | 161 | if (keyCode >= KeyCode::MOUSE1 && keyCode <= KeyCode::MOUSE5) 162 | return ImGui::IsMouseClicked(keyMap[keyCode].code); 163 | 164 | return static_cast(keyCode) < keyMap.size() && ImGui::IsKeyPressed(keyMap[keyCode].code, false); 165 | } 166 | 167 | bool KeyBind::isDown() const noexcept 168 | { 169 | if (keyCode == KeyCode::NONE) 170 | return false; 171 | 172 | if (keyCode == KeyCode::MOUSEWHEEL_DOWN) 173 | return ImGui::GetIO().MouseWheel < 0.0f; 174 | 175 | if (keyCode == KeyCode::MOUSEWHEEL_UP) 176 | return ImGui::GetIO().MouseWheel > 0.0f; 177 | 178 | if (keyCode >= KeyCode::MOUSE1 && keyCode <= KeyCode::MOUSE5) 179 | return ImGui::IsMouseDown(keyMap[keyCode].code); 180 | 181 | return static_cast(keyCode) < keyMap.size() && ImGui::IsKeyDown(keyMap[keyCode].code); 182 | } 183 | 184 | bool KeyBind::setToPressedKey() noexcept 185 | { 186 | if (ImGui::IsKeyPressed(ImGui::GetIO().KeyMap[ImGuiKey_Escape])) { 187 | keyCode = KeyCode::NONE; 188 | return true; 189 | } else if (ImGui::GetIO().MouseWheel < 0.0f) { 190 | keyCode = KeyCode::MOUSEWHEEL_DOWN; 191 | return true; 192 | } else if (ImGui::GetIO().MouseWheel > 0.0f) { 193 | keyCode = KeyCode::MOUSEWHEEL_UP; 194 | return true; 195 | } 196 | 197 | for (auto i{ 0u }; i < IM_ARRAYSIZE(ImGui::GetIO().MouseDown); ++i) { 198 | if (ImGui::IsMouseClicked(i)) { 199 | keyCode = static_cast(KeyCode::MOUSE1 + i); 200 | return true; 201 | } 202 | } 203 | 204 | for (auto i{ 0u }; i < IM_ARRAYSIZE(ImGui::GetIO().KeysDown); ++i) { 205 | if (!ImGui::IsKeyPressed(i)) 206 | continue; 207 | 208 | if (const auto it{ std::ranges::find(keyMap, i, &Key::code) }; it != keyMap.end()) { 209 | keyCode = static_cast(std::distance(keyMap.begin(), it)); 210 | if (keyCode == KeyCode::LCTRL && ImGui::IsKeyPressed(keyMap[KeyCode::RALT].code)) 211 | keyCode = KeyCode::RALT; 212 | return true; 213 | } 214 | } 215 | return false; 216 | } 217 | 218 | void KeyBindToggle::handleToggle() noexcept 219 | { 220 | if (isPressed()) 221 | toggledOn = !toggledOn; 222 | } 223 | 224 | void ImGui::textUnformattedCentered(const char* text) noexcept 225 | { 226 | ImGui::SetCursorPosX((ImGui::GetWindowSize().x - ImGui::CalcTextSize(text).x) / 2.0f); 227 | ImGui::TextUnformatted(text); 228 | } 229 | 230 | void ImGui::hoverInfo(const char* desc) noexcept 231 | { 232 | if (ImGui::IsItemHovered()) { 233 | ImGui::BeginTooltip(); 234 | ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); 235 | ImGui::TextUnformatted(desc); 236 | ImGui::PopTextWrapPos(); 237 | ImGui::EndTooltip(); 238 | } 239 | } 240 | 241 | void ImGui::rainbowText() noexcept 242 | { 243 | static float r{ 1.0f }; 244 | static float g{ 0.f }; 245 | static float b{ 0.f }; 246 | 247 | if (cheatManager.config->rainbowText) { 248 | if (r == 1.f && g >= 0.f && b <= 0.f) { 249 | g += 0.005f; 250 | b = 0.f; 251 | } 252 | if (r <= 1.f && g >= 1.f && b == 0.f) { 253 | g = 1.f; 254 | r -= 0.005f; 255 | } 256 | if (r <= 0.f && g == 1.f && b >= 0.f) { 257 | r = 0.f; 258 | b += 0.005f; 259 | } 260 | if (r == 0.f && g <= 1.f && b >= 1.f) { 261 | b = 1.f; 262 | g -= 0.005f; 263 | } 264 | if (r >= 0.f && g <= 0.f && b == 1.f) { 265 | g = 0.f; 266 | r += 0.005f; 267 | } 268 | if (r >= 1.f && g >= 0.f && b <= 1.f) { 269 | r = 1.f; 270 | b -= 0.005f; 271 | } 272 | ImGui::GetStyle().Colors[ImGuiCol_Text] = ImVec4(r, g, b, 1.00f); 273 | } else { 274 | if (auto& clr{ ImGui::GetStyle().Colors[ImGuiCol_Text] }; clr.x != 0.92f && clr.y != 0.92f && clr.z != 0.92f) 275 | clr = ImVec4(0.92f, 0.92f, 0.92f, 0.92f); 276 | } 277 | } 278 | 279 | struct InputTextCallback_UserData { 280 | std::string* Str; 281 | ImGuiInputTextCallback ChainCallback; 282 | void* ChainCallbackUserData; 283 | }; 284 | 285 | static int InputTextCallback(ImGuiInputTextCallbackData* data) noexcept 286 | { 287 | const auto user_data{ static_cast(data->UserData) }; 288 | if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) { 289 | const auto str{ user_data->Str }; 290 | IM_ASSERT(data->Buf == str->c_str()); 291 | str->resize(data->BufTextLen); 292 | data->Buf = const_cast(str->c_str()); 293 | } else if (user_data->ChainCallback) { 294 | data->UserData = user_data->ChainCallbackUserData; 295 | return user_data->ChainCallback(data); 296 | } 297 | return 0; 298 | } 299 | 300 | bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* userData) noexcept 301 | { 302 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 303 | flags |= ImGuiInputTextFlags_CallbackResize; 304 | auto cbUserData{ InputTextCallback_UserData(str, callback, userData) }; 305 | return InputText(label, const_cast(str->c_str()), str->capacity() + 1, flags, InputTextCallback, &cbUserData); 306 | } 307 | 308 | void ImGui::hotkey(const char* label, KeyBind& key, float samelineOffset, const ImVec2& size) noexcept 309 | { 310 | const auto id{ GetID(label) }; 311 | PushID(label); 312 | 313 | TextUnformatted(label); 314 | SameLine(samelineOffset); 315 | 316 | if (GetActiveID() == id) { 317 | PushStyleColor(ImGuiCol_Button, GetColorU32(ImGuiCol_ButtonActive)); 318 | Button("...", size); 319 | PopStyleColor(); 320 | 321 | GetCurrentContext()->ActiveIdAllowOverlap = true; 322 | if ((!IsItemHovered() && GetIO().MouseClicked[0]) || key.setToPressedKey()) 323 | ClearActiveID(); 324 | } else if (Button(key.toString(), size)) { 325 | SetActiveID(id, GetCurrentWindow()); 326 | } 327 | 328 | PopID(); 329 | } 330 | -------------------------------------------------------------------------------- /R3nzSkin/Utils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "imgui/imgui.h" 9 | 10 | class RandomGenerator { 11 | public: 12 | template 13 | [[nodiscard]] static T random(T min, T max) noexcept 14 | { 15 | std::scoped_lock lock{ mutex }; 16 | return std::uniform_int_distribution{ min, max }(gen); 17 | } 18 | 19 | template 20 | [[nodiscard]] static T random(T min, T max) noexcept 21 | { 22 | std::scoped_lock lock{ mutex }; 23 | return std::uniform_real_distribution{ min, max }(gen); 24 | } 25 | 26 | template 27 | [[nodiscard]] static std::enable_if_t, T> random(T min, T max) noexcept 28 | { 29 | return static_cast(random(static_cast>(min), static_cast>(max))); 30 | } 31 | private: 32 | inline static std::mt19937 gen{ std::random_device{}() }; 33 | inline static std::mutex mutex; 34 | }; 35 | 36 | template 37 | [[nodiscard]] T random(T min, T max) noexcept 38 | { 39 | return RandomGenerator::random(min, max); 40 | } 41 | 42 | class KeyBind { 43 | public: 44 | enum KeyCode : unsigned char { 45 | APOSTROPHE = 0, COMMA, MINUS, PERIOD, SLASH, KEY_0, KEY_1, KEY_2, 46 | KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, SEMICOLON, EQUALS, 47 | A, ADD, B, BACKSPACE, C, CAPSLOCK, D, DECIMAL, DEL, DIVIDE, DOWN, E, 48 | END, ENTER, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, G, 49 | H, HOME, I, INSERT, J, K, L, LALT, LCTRL, LEFT, LSHIFT, M, MOUSE1, MOUSE2, 50 | MOUSE3, MOUSE4, MOUSE5, MULTIPLY, MOUSEWHEEL_DOWN, MOUSEWHEEL_UP, N, NONE, 51 | NUMPAD_0, NUMPAD_1, NUMPAD_2, NUMPAD_3, NUMPAD_4, NUMPAD_5, NUMPAD_6, NUMPAD_7, 52 | NUMPAD_8, NUMPAD_9, O, P, PAGE_DOWN, PAGE_UP, Q, R, RALT, RCTRL, RIGHT, RSHIFT, 53 | S, SPACE, SUBTRACT, T, TAB, U, UP, V, W, X, Y, Z, LEFTBRACKET, BACKSLASH, 54 | RIGHTBRACKET, BACKTICK, MAX 55 | }; 56 | 57 | KeyBind() = default; 58 | explicit KeyBind(KeyCode keyCode) noexcept; 59 | explicit KeyBind(const char* keyName) noexcept; 60 | 61 | bool operator==(KeyCode keyCode) const noexcept { return this->keyCode == keyCode; } 62 | friend bool operator==(const KeyBind& a, const KeyBind& b) noexcept { return a.keyCode == b.keyCode; } 63 | 64 | const char* toString() const noexcept; 65 | int getKey() const noexcept; 66 | bool isPressed() const noexcept; 67 | bool isDown() const noexcept; 68 | bool isSet() const noexcept { return keyCode != KeyCode::NONE; } 69 | 70 | bool setToPressedKey() noexcept; 71 | private: 72 | KeyCode keyCode{ KeyCode::NONE }; 73 | }; 74 | 75 | class KeyBindToggle : public KeyBind { 76 | public: 77 | using KeyBind::KeyBind; 78 | 79 | void handleToggle() noexcept; 80 | bool isToggled() const noexcept { return toggledOn; } 81 | private: 82 | bool toggledOn = true; 83 | }; 84 | 85 | namespace ImGui 86 | { 87 | bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* userData = nullptr) noexcept; 88 | void textUnformattedCentered(const char* text) noexcept; 89 | void rainbowText() noexcept; 90 | void hotkey(const char* label, KeyBind& key, float samelineOffset = 0.0f, const ImVec2& size = { 100.0f, 0.0f }) noexcept; 91 | void hoverInfo(const char* desc) noexcept; 92 | }; 93 | -------------------------------------------------------------------------------- /R3nzSkin/encryption.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #pragma pack(push, 4) 7 | template 8 | class xor_value { 9 | T xor_key; 10 | T values_table[4]; 11 | bool xor_key_was_init{ 0 }; 12 | std::uint8_t bytes_xor_count; 13 | std::uint8_t bytes_xor_count_8; 14 | std::uint8_t value_index{ 0 }; 15 | public: 16 | T decrypt() noexcept 17 | { 18 | if (xor_key_was_init != 1) 19 | return 0; 20 | 21 | auto xored_value{ values_table[value_index] }; 22 | auto xor_key_value{ xor_key }; 23 | 24 | { 25 | auto* xor_value_ptr{ reinterpret_cast(&xor_key_value) }; 26 | for (auto i{ 0u }; i < bytes_xor_count; i++) 27 | *(reinterpret_cast(&xored_value) + i) ^= ~xor_value_ptr[i]; 28 | } 29 | 30 | { 31 | auto* xor_value_ptr{ reinterpret_cast(&xor_key_value) }; 32 | 33 | for (auto i{ sizeof(T) - bytes_xor_count_8 }; i < sizeof(T); ++i) 34 | *(reinterpret_cast(&xored_value) + i) ^= ~xor_value_ptr[i]; 35 | } 36 | 37 | return xored_value; 38 | } 39 | 40 | void encrypt(T value) noexcept 41 | { 42 | if (!xor_key_was_init) { 43 | if (sizeof(T) <= 2) { 44 | bytes_xor_count_8 = sizeof(T); 45 | bytes_xor_count = 0; 46 | } else { 47 | bytes_xor_count_8 = sizeof(T) % 4; 48 | bytes_xor_count = (sizeof(T) - bytes_xor_count_8) / 4; 49 | } 50 | 51 | auto key{ ::__rdtsc() }; 52 | auto key_index{ 0 }; 53 | 54 | for (auto i{ 0u }; i < sizeof(T); i++) { 55 | *(reinterpret_cast(&xor_key) + i) = *(reinterpret_cast(&key) + key_index++); 56 | 57 | if (key_index == 8) { 58 | key = ::__rdtsc(); 59 | key_index = 0; 60 | } 61 | } 62 | 63 | value_index = 0; 64 | xor_key_was_init = 1; 65 | } 66 | 67 | auto xored_value{ value }; 68 | auto xor_key_value{ xor_key }; 69 | 70 | { 71 | auto* xor_value_ptr{ reinterpret_cast(&xor_key_value) }; 72 | for (auto i{ 0u }; i < bytes_xor_count; i++) 73 | *(reinterpret_cast(&xored_value) + i) ^= ~xor_value_ptr[i]; 74 | } 75 | 76 | { 77 | auto* xor_value_ptr{ reinterpret_cast(&xor_key_value) }; 78 | 79 | for (auto i{ sizeof(T) - bytes_xor_count_8 }; i < sizeof(T); ++i) 80 | *(reinterpret_cast(&xored_value) + i) ^= ~xor_value_ptr[i]; 81 | } 82 | 83 | auto new_value_index{ std::uint8_t(value_index + 1) & 3 }; 84 | values_table[new_value_index] = xored_value; 85 | value_index = new_value_index; 86 | } 87 | }; 88 | #pragma pack(pop) 89 | -------------------------------------------------------------------------------- /R3nzSkin/fnv_hash.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace detail { 7 | template 8 | struct size_dependant_data { 9 | using type = Type; 10 | constexpr static auto k_offset_basis{ OffsetBasis }; 11 | constexpr static auto k_prime{ Prime }; 12 | }; 13 | 14 | template 15 | struct size_selector; 16 | 17 | template <> 18 | struct size_selector<32> { 19 | using type = size_dependant_data; 20 | }; 21 | 22 | template <> 23 | struct size_selector<64> { 24 | using type = size_dependant_data; 25 | }; 26 | 27 | template 28 | class fnv_hash { 29 | private: 30 | using data_t = typename size_selector::type; 31 | 32 | public: 33 | using hash = typename data_t::type; 34 | 35 | private: 36 | constexpr static auto k_offset_basis{ data_t::k_offset_basis }; 37 | constexpr static auto k_prime{ data_t::k_prime }; 38 | 39 | public: 40 | template 41 | static __forceinline constexpr auto hash_constexpr(const char(&str)[N], const std::size_t size = N) -> hash { 42 | return static_cast(1ull * (size == 1 ? (k_offset_basis ^ str[0]) : (hash_constexpr(str, size - 1) ^ str[size - 1])) * k_prime); 43 | } 44 | 45 | static auto __forceinline hash_runtime(const char* str) -> hash { 46 | auto result{ k_offset_basis }; 47 | do { 48 | result ^= *str++; 49 | result *= k_prime; 50 | } while (*(str - 1) != '\0'); 51 | 52 | return result; 53 | } 54 | }; 55 | } 56 | 57 | using fnv = ::detail::fnv_hash; 58 | 59 | #define FNV(str) (std::integral_constant::value) 60 | -------------------------------------------------------------------------------- /R3nzSkin/imgui/imconfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define IMGUI_DISABLE_DEMO_WINDOWS 4 | #define IMGUI_DISABLE_METRICS_WINDOW 5 | #define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD 6 | #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS 7 | -------------------------------------------------------------------------------- /R3nzSkin/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 | -------------------------------------------------------------------------------- /R3nzSkin/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 | -------------------------------------------------------------------------------- /R3nzSkin/imgui/imstb_rectpack.h: -------------------------------------------------------------------------------- 1 | // [DEAR IMGUI] 2 | // This is a slightly modified version of stb_rect_pack.h 1.00. 3 | // Those changes would need to be pushed into nothings/stb: 4 | // - Added STBRP__CDECL 5 | // Grep for [DEAR IMGUI] to find the changes. 6 | 7 | // stb_rect_pack.h - v1.00 - public domain - rectangle packing 8 | // Sean Barrett 2014 9 | // 10 | // Useful for e.g. packing rectangular textures into an atlas. 11 | // Does not do rotation. 12 | // 13 | // Not necessarily the awesomest packing method, but better than 14 | // the totally naive one in stb_truetype (which is primarily what 15 | // this is meant to replace). 16 | // 17 | // Has only had a few tests run, may have issues. 18 | // 19 | // More docs to come. 20 | // 21 | // No memory allocations; uses qsort() and assert() from stdlib. 22 | // Can override those by defining STBRP_SORT and STBRP_ASSERT. 23 | // 24 | // This library currently uses the Skyline Bottom-Left algorithm. 25 | // 26 | // Please note: better rectangle packers are welcome! Please 27 | // implement them to the same API, but with a different init 28 | // function. 29 | // 30 | // Credits 31 | // 32 | // Library 33 | // Sean Barrett 34 | // Minor features 35 | // Martins Mozeiko 36 | // github:IntellectualKitty 37 | // 38 | // Bugfixes / warning fixes 39 | // Jeremy Jaussaud 40 | // Fabian Giesen 41 | // 42 | // Version history: 43 | // 44 | // 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles 45 | // 0.99 (2019-02-07) warning fixes 46 | // 0.11 (2017-03-03) return packing success/fail result 47 | // 0.10 (2016-10-25) remove cast-away-const to avoid warnings 48 | // 0.09 (2016-08-27) fix compiler warnings 49 | // 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0) 50 | // 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0) 51 | // 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort 52 | // 0.05: added STBRP_ASSERT to allow replacing assert 53 | // 0.04: fixed minor bug in STBRP_LARGE_RECTS support 54 | // 0.01: initial release 55 | // 56 | // LICENSE 57 | // 58 | // See end of file for license information. 59 | 60 | ////////////////////////////////////////////////////////////////////////////// 61 | // 62 | // INCLUDE SECTION 63 | // 64 | 65 | #ifndef STB_INCLUDE_STB_RECT_PACK_H 66 | #define STB_INCLUDE_STB_RECT_PACK_H 67 | 68 | #define STB_RECT_PACK_VERSION 1 69 | 70 | #ifdef STBRP_STATIC 71 | #define STBRP_DEF static 72 | #else 73 | #define STBRP_DEF extern 74 | #endif 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | typedef struct stbrp_context stbrp_context; 81 | typedef struct stbrp_node stbrp_node; 82 | typedef struct stbrp_rect stbrp_rect; 83 | 84 | #ifdef STBRP_LARGE_RECTS 85 | typedef int stbrp_coord; 86 | #else 87 | typedef unsigned short stbrp_coord; 88 | #endif 89 | 90 | STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects); 91 | // Assign packed locations to rectangles. The rectangles are of type 92 | // 'stbrp_rect' defined below, stored in the array 'rects', and there 93 | // are 'num_rects' many of them. 94 | // 95 | // Rectangles which are successfully packed have the 'was_packed' flag 96 | // set to a non-zero value and 'x' and 'y' store the minimum location 97 | // on each axis (i.e. bottom-left in cartesian coordinates, top-left 98 | // if you imagine y increasing downwards). Rectangles which do not fit 99 | // have the 'was_packed' flag set to 0. 100 | // 101 | // You should not try to access the 'rects' array from another thread 102 | // while this function is running, as the function temporarily reorders 103 | // the array while it executes. 104 | // 105 | // To pack into another rectangle, you need to call stbrp_init_target 106 | // again. To continue packing into the same rectangle, you can call 107 | // this function again. Calling this multiple times with multiple rect 108 | // arrays will probably produce worse packing results than calling it 109 | // a single time with the full rectangle array, but the option is 110 | // available. 111 | // 112 | // The function returns 1 if all of the rectangles were successfully 113 | // packed and 0 otherwise. 114 | 115 | struct stbrp_rect 116 | { 117 | // reserved for your use: 118 | int id; 119 | 120 | // input: 121 | stbrp_coord w, h; 122 | 123 | // output: 124 | stbrp_coord x, y; 125 | int was_packed; // non-zero if valid packing 126 | 127 | }; // 16 bytes, nominally 128 | 129 | 130 | STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes); 131 | // Initialize a rectangle packer to: 132 | // pack a rectangle that is 'width' by 'height' in dimensions 133 | // using temporary storage provided by the array 'nodes', which is 'num_nodes' long 134 | // 135 | // You must call this function every time you start packing into a new target. 136 | // 137 | // There is no "shutdown" function. The 'nodes' memory must stay valid for 138 | // the following stbrp_pack_rects() call (or calls), but can be freed after 139 | // the call (or calls) finish. 140 | // 141 | // Note: to guarantee best results, either: 142 | // 1. make sure 'num_nodes' >= 'width' 143 | // or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1' 144 | // 145 | // If you don't do either of the above things, widths will be quantized to multiples 146 | // of small integers to guarantee the algorithm doesn't run out of temporary storage. 147 | // 148 | // If you do #2, then the non-quantized algorithm will be used, but the algorithm 149 | // may run out of temporary storage and be unable to pack some rectangles. 150 | 151 | STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem); 152 | // Optionally call this function after init but before doing any packing to 153 | // change the handling of the out-of-temp-memory scenario, described above. 154 | // If you call init again, this will be reset to the default (false). 155 | 156 | 157 | STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic); 158 | // Optionally select which packing heuristic the library should use. Different 159 | // heuristics will produce better/worse results for different data sets. 160 | // If you call init again, this will be reset to the default. 161 | 162 | enum 163 | { 164 | STBRP_HEURISTIC_Skyline_default=0, 165 | STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default, 166 | STBRP_HEURISTIC_Skyline_BF_sortHeight 167 | }; 168 | 169 | 170 | ////////////////////////////////////////////////////////////////////////////// 171 | // 172 | // the details of the following structures don't matter to you, but they must 173 | // be visible so you can handle the memory allocations for them 174 | 175 | struct stbrp_node 176 | { 177 | stbrp_coord x,y; 178 | stbrp_node *next; 179 | }; 180 | 181 | struct stbrp_context 182 | { 183 | int width; 184 | int height; 185 | int align; 186 | int init_mode; 187 | int heuristic; 188 | int num_nodes; 189 | stbrp_node *active_head; 190 | stbrp_node *free_head; 191 | stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' 192 | }; 193 | 194 | #ifdef __cplusplus 195 | } 196 | #endif 197 | 198 | #endif 199 | 200 | ////////////////////////////////////////////////////////////////////////////// 201 | // 202 | // IMPLEMENTATION SECTION 203 | // 204 | 205 | #ifdef STB_RECT_PACK_IMPLEMENTATION 206 | #ifndef STBRP_SORT 207 | #include 208 | #define STBRP_SORT qsort 209 | #endif 210 | 211 | #ifndef STBRP_ASSERT 212 | #include 213 | #define STBRP_ASSERT assert 214 | #endif 215 | 216 | // [DEAR IMGUI] Added STBRP__CDECL 217 | #ifdef _MSC_VER 218 | #define STBRP__NOTUSED(v) (void)(v) 219 | #define STBRP__CDECL __cdecl 220 | #else 221 | #define STBRP__NOTUSED(v) (void)sizeof(v) 222 | #define STBRP__CDECL 223 | #endif 224 | 225 | enum 226 | { 227 | STBRP__INIT_skyline = 1 228 | }; 229 | 230 | STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic) 231 | { 232 | switch (context->init_mode) { 233 | case STBRP__INIT_skyline: 234 | STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight); 235 | context->heuristic = heuristic; 236 | break; 237 | default: 238 | STBRP_ASSERT(0); 239 | } 240 | } 241 | 242 | STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem) 243 | { 244 | if (allow_out_of_mem) 245 | // if it's ok to run out of memory, then don't bother aligning them; 246 | // this gives better packing, but may fail due to OOM (even though 247 | // the rectangles easily fit). @TODO a smarter approach would be to only 248 | // quantize once we've hit OOM, then we could get rid of this parameter. 249 | context->align = 1; 250 | else { 251 | // if it's not ok to run out of memory, then quantize the widths 252 | // so that num_nodes is always enough nodes. 253 | // 254 | // I.e. num_nodes * align >= width 255 | // align >= width / num_nodes 256 | // align = ceil(width/num_nodes) 257 | 258 | context->align = (context->width + context->num_nodes-1) / context->num_nodes; 259 | } 260 | } 261 | 262 | STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes) 263 | { 264 | int i; 265 | #ifndef STBRP_LARGE_RECTS 266 | STBRP_ASSERT(width <= 0xffff && height <= 0xffff); 267 | #endif 268 | 269 | for (i=0; i < num_nodes-1; ++i) 270 | nodes[i].next = &nodes[i+1]; 271 | nodes[i].next = NULL; 272 | context->init_mode = STBRP__INIT_skyline; 273 | context->heuristic = STBRP_HEURISTIC_Skyline_default; 274 | context->free_head = &nodes[0]; 275 | context->active_head = &context->extra[0]; 276 | context->width = width; 277 | context->height = height; 278 | context->num_nodes = num_nodes; 279 | stbrp_setup_allow_out_of_mem(context, 0); 280 | 281 | // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) 282 | context->extra[0].x = 0; 283 | context->extra[0].y = 0; 284 | context->extra[0].next = &context->extra[1]; 285 | context->extra[1].x = (stbrp_coord) width; 286 | #ifdef STBRP_LARGE_RECTS 287 | context->extra[1].y = (1<<30); 288 | #else 289 | context->extra[1].y = 65535; 290 | #endif 291 | context->extra[1].next = NULL; 292 | } 293 | 294 | // find minimum y position if it starts at x1 295 | static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste) 296 | { 297 | stbrp_node *node = first; 298 | int x1 = x0 + width; 299 | int min_y, visited_width, waste_area; 300 | 301 | STBRP__NOTUSED(c); 302 | 303 | STBRP_ASSERT(first->x <= x0); 304 | 305 | #if 0 306 | // skip in case we're past the node 307 | while (node->next->x <= x0) 308 | ++node; 309 | #else 310 | STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency 311 | #endif 312 | 313 | STBRP_ASSERT(node->x <= x0); 314 | 315 | min_y = 0; 316 | waste_area = 0; 317 | visited_width = 0; 318 | while (node->x < x1) { 319 | if (node->y > min_y) { 320 | // raise min_y higher. 321 | // we've accounted for all waste up to min_y, 322 | // but we'll now add more waste for everything we've visted 323 | waste_area += visited_width * (node->y - min_y); 324 | min_y = node->y; 325 | // the first time through, visited_width might be reduced 326 | if (node->x < x0) 327 | visited_width += node->next->x - x0; 328 | else 329 | visited_width += node->next->x - node->x; 330 | } else { 331 | // add waste area 332 | int under_width = node->next->x - node->x; 333 | if (under_width + visited_width > width) 334 | under_width = width - visited_width; 335 | waste_area += under_width * (min_y - node->y); 336 | visited_width += under_width; 337 | } 338 | node = node->next; 339 | } 340 | 341 | *pwaste = waste_area; 342 | return min_y; 343 | } 344 | 345 | typedef struct 346 | { 347 | int x,y; 348 | stbrp_node **prev_link; 349 | } stbrp__findresult; 350 | 351 | static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height) 352 | { 353 | int best_waste = (1<<30), best_x, best_y = (1 << 30); 354 | stbrp__findresult fr; 355 | stbrp_node **prev, *node, *tail, **best = NULL; 356 | 357 | // align to multiple of c->align 358 | width = (width + c->align - 1); 359 | width -= width % c->align; 360 | STBRP_ASSERT(width % c->align == 0); 361 | 362 | // if it can't possibly fit, bail immediately 363 | if (width > c->width || height > c->height) { 364 | fr.prev_link = NULL; 365 | fr.x = fr.y = 0; 366 | return fr; 367 | } 368 | 369 | node = c->active_head; 370 | prev = &c->active_head; 371 | while (node->x + width <= c->width) { 372 | int y,waste; 373 | y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste); 374 | if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL 375 | // bottom left 376 | if (y < best_y) { 377 | best_y = y; 378 | best = prev; 379 | } 380 | } else { 381 | // best-fit 382 | if (y + height <= c->height) { 383 | // can only use it if it first vertically 384 | if (y < best_y || (y == best_y && waste < best_waste)) { 385 | best_y = y; 386 | best_waste = waste; 387 | best = prev; 388 | } 389 | } 390 | } 391 | prev = &node->next; 392 | node = node->next; 393 | } 394 | 395 | best_x = (best == NULL) ? 0 : (*best)->x; 396 | 397 | // if doing best-fit (BF), we also have to try aligning right edge to each node position 398 | // 399 | // e.g, if fitting 400 | // 401 | // ____________________ 402 | // |____________________| 403 | // 404 | // into 405 | // 406 | // | | 407 | // | ____________| 408 | // |____________| 409 | // 410 | // then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned 411 | // 412 | // This makes BF take about 2x the time 413 | 414 | if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) { 415 | tail = c->active_head; 416 | node = c->active_head; 417 | prev = &c->active_head; 418 | // find first node that's admissible 419 | while (tail->x < width) 420 | tail = tail->next; 421 | while (tail) { 422 | int xpos = tail->x - width; 423 | int y,waste; 424 | STBRP_ASSERT(xpos >= 0); 425 | // find the left position that matches this 426 | while (node->next->x <= xpos) { 427 | prev = &node->next; 428 | node = node->next; 429 | } 430 | STBRP_ASSERT(node->next->x > xpos && node->x <= xpos); 431 | y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste); 432 | if (y + height <= c->height) { 433 | if (y <= best_y) { 434 | if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) { 435 | best_x = xpos; 436 | STBRP_ASSERT(y <= best_y); 437 | best_y = y; 438 | best_waste = waste; 439 | best = prev; 440 | } 441 | } 442 | } 443 | tail = tail->next; 444 | } 445 | } 446 | 447 | fr.prev_link = best; 448 | fr.x = best_x; 449 | fr.y = best_y; 450 | return fr; 451 | } 452 | 453 | static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height) 454 | { 455 | // find best position according to heuristic 456 | stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height); 457 | stbrp_node *node, *cur; 458 | 459 | // bail if: 460 | // 1. it failed 461 | // 2. the best node doesn't fit (we don't always check this) 462 | // 3. we're out of memory 463 | if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) { 464 | res.prev_link = NULL; 465 | return res; 466 | } 467 | 468 | // on success, create new node 469 | node = context->free_head; 470 | node->x = (stbrp_coord) res.x; 471 | node->y = (stbrp_coord) (res.y + height); 472 | 473 | context->free_head = node->next; 474 | 475 | // insert the new node into the right starting point, and 476 | // let 'cur' point to the remaining nodes needing to be 477 | // stiched back in 478 | 479 | cur = *res.prev_link; 480 | if (cur->x < res.x) { 481 | // preserve the existing one, so start testing with the next one 482 | stbrp_node *next = cur->next; 483 | cur->next = node; 484 | cur = next; 485 | } else { 486 | *res.prev_link = node; 487 | } 488 | 489 | // from here, traverse cur and free the nodes, until we get to one 490 | // that shouldn't be freed 491 | while (cur->next && cur->next->x <= res.x + width) { 492 | stbrp_node *next = cur->next; 493 | // move the current node to the free list 494 | cur->next = context->free_head; 495 | context->free_head = cur; 496 | cur = next; 497 | } 498 | 499 | // stitch the list back in 500 | node->next = cur; 501 | 502 | if (cur->x < res.x + width) 503 | cur->x = (stbrp_coord) (res.x + width); 504 | 505 | #ifdef _DEBUG 506 | cur = context->active_head; 507 | while (cur->x < context->width) { 508 | STBRP_ASSERT(cur->x < cur->next->x); 509 | cur = cur->next; 510 | } 511 | STBRP_ASSERT(cur->next == NULL); 512 | 513 | { 514 | int count=0; 515 | cur = context->active_head; 516 | while (cur) { 517 | cur = cur->next; 518 | ++count; 519 | } 520 | cur = context->free_head; 521 | while (cur) { 522 | cur = cur->next; 523 | ++count; 524 | } 525 | STBRP_ASSERT(count == context->num_nodes+2); 526 | } 527 | #endif 528 | 529 | return res; 530 | } 531 | 532 | // [DEAR IMGUI] Added STBRP__CDECL 533 | static int STBRP__CDECL rect_height_compare(const void *a, const void *b) 534 | { 535 | const stbrp_rect *p = (const stbrp_rect *) a; 536 | const stbrp_rect *q = (const stbrp_rect *) b; 537 | if (p->h > q->h) 538 | return -1; 539 | if (p->h < q->h) 540 | return 1; 541 | return (p->w > q->w) ? -1 : (p->w < q->w); 542 | } 543 | 544 | // [DEAR IMGUI] Added STBRP__CDECL 545 | static int STBRP__CDECL rect_original_order(const void *a, const void *b) 546 | { 547 | const stbrp_rect *p = (const stbrp_rect *) a; 548 | const stbrp_rect *q = (const stbrp_rect *) b; 549 | return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed); 550 | } 551 | 552 | #ifdef STBRP_LARGE_RECTS 553 | #define STBRP__MAXVAL 0xffffffff 554 | #else 555 | #define STBRP__MAXVAL 0xffff 556 | #endif 557 | 558 | STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects) 559 | { 560 | int i, all_rects_packed = 1; 561 | 562 | // we use the 'was_packed' field internally to allow sorting/unsorting 563 | for (i=0; i < num_rects; ++i) { 564 | rects[i].was_packed = i; 565 | } 566 | 567 | // sort according to heuristic 568 | STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare); 569 | 570 | for (i=0; i < num_rects; ++i) { 571 | if (rects[i].w == 0 || rects[i].h == 0) { 572 | rects[i].x = rects[i].y = 0; // empty rect needs no space 573 | } else { 574 | stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); 575 | if (fr.prev_link) { 576 | rects[i].x = (stbrp_coord) fr.x; 577 | rects[i].y = (stbrp_coord) fr.y; 578 | } else { 579 | rects[i].x = rects[i].y = STBRP__MAXVAL; 580 | } 581 | } 582 | } 583 | 584 | // unsort 585 | STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order); 586 | 587 | // set was_packed flags and all_rects_packed status 588 | for (i=0; i < num_rects; ++i) { 589 | rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL); 590 | if (!rects[i].was_packed) 591 | all_rects_packed = 0; 592 | } 593 | 594 | // return the all_rects_packed status 595 | return all_rects_packed; 596 | } 597 | #endif 598 | 599 | /* 600 | ------------------------------------------------------------------------------ 601 | This software is available under 2 licenses -- choose whichever you prefer. 602 | ------------------------------------------------------------------------------ 603 | ALTERNATIVE A - MIT License 604 | Copyright (c) 2017 Sean Barrett 605 | Permission is hereby granted, free of charge, to any person obtaining a copy of 606 | this software and associated documentation files (the "Software"), to deal in 607 | the Software without restriction, including without limitation the rights to 608 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 609 | of the Software, and to permit persons to whom the Software is furnished to do 610 | so, subject to the following conditions: 611 | The above copyright notice and this permission notice shall be included in all 612 | copies or substantial portions of the Software. 613 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 614 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 615 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 616 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 617 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 618 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 619 | SOFTWARE. 620 | ------------------------------------------------------------------------------ 621 | ALTERNATIVE B - Public Domain (www.unlicense.org) 622 | This is free and unencumbered software released into the public domain. 623 | Anyone is free to copy, modify, publish, use, compile, sell, or distribute this 624 | software, either in source code form or as a compiled binary, for any purpose, 625 | commercial or non-commercial, and by any means. 626 | In jurisdictions that recognize copyright laws, the author or authors of this 627 | software dedicate any and all copyright interest in the software to the public 628 | domain. We make this dedication for the benefit of the public at large and to 629 | the detriment of our heirs and successors. We intend this dedication to be an 630 | overt act of relinquishment in perpetuity of all present and future rights to 631 | this software under copyright law. 632 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 633 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 634 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 635 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 636 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 637 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 638 | ------------------------------------------------------------------------------ 639 | */ 640 | -------------------------------------------------------------------------------- /R3nzSkin/memory.cpp: -------------------------------------------------------------------------------- 1 | #pragma warning(disable: 28182 6011) 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "CheatManager.hpp" 11 | #include "Memory.hpp" 12 | #include "Offsets.hpp" 13 | 14 | [[nodiscard]] static std::uint8_t* find_signature(const wchar_t* szModule, const char* szSignature) noexcept 15 | { 16 | const auto module{ ::GetModuleHandleW(szModule) }; 17 | 18 | using bytes_t = std::vector; 19 | 20 | static const auto pattern_to_byte = [](const char* pattern) noexcept -> bytes_t 21 | { 22 | bytes_t bytes{}; 23 | const auto start{ const_cast(pattern) }; 24 | const auto end{ const_cast(pattern) + strlen(pattern) }; 25 | 26 | for (auto current{ start }; current < end; ++current) { 27 | if (*current == '?') { 28 | ++current; 29 | if (*current == '?') 30 | ++current; 31 | bytes.push_back(-1); 32 | } else { 33 | bytes.push_back(strtoul(current, ¤t, 16)); 34 | } 35 | } 36 | 37 | return bytes; 38 | }; 39 | 40 | const auto dosHeader{ reinterpret_cast(module) }; 41 | const auto ntHeaders{ reinterpret_cast(reinterpret_cast(module) + dosHeader->e_lfanew) }; 42 | const auto textSection{ IMAGE_FIRST_SECTION(ntHeaders) }; 43 | 44 | const auto sizeOfImage{ textSection->SizeOfRawData }; 45 | const auto patternBytes{ pattern_to_byte(szSignature) }; 46 | const auto scanBytes{ reinterpret_cast(module) + textSection->VirtualAddress }; 47 | 48 | const auto s{ patternBytes.size() }; 49 | const auto d{ patternBytes.data() }; 50 | 51 | MEMORY_BASIC_INFORMATION mbi{ nullptr }; 52 | const std::uint8_t* next_check_address{ nullptr }; 53 | 54 | for (auto i{ 0ul }; i < sizeOfImage - s; ++i) { 55 | bool found{ true }; 56 | for (auto j{ 0ul }; j < s; ++j) { 57 | const auto current_address{ scanBytes + i + j }; 58 | if (current_address >= next_check_address) { 59 | if (!::VirtualQuery(current_address, &mbi, sizeof(mbi))) 60 | break; 61 | 62 | if (mbi.Protect == PAGE_NOACCESS) { 63 | i += reinterpret_cast(mbi.BaseAddress) + mbi.RegionSize - (reinterpret_cast(scanBytes) + i); 64 | i--; 65 | found = false; 66 | break; 67 | } else { 68 | next_check_address = static_cast(mbi.BaseAddress) + mbi.RegionSize; 69 | } 70 | } 71 | 72 | if (scanBytes[i + j] != d[j] && d[j] != -1) { 73 | found = false; 74 | break; 75 | } 76 | } 77 | 78 | if (found) 79 | return &scanBytes[i]; 80 | } 81 | 82 | return nullptr; 83 | 84 | } 85 | 86 | void Memory::update(bool gameClient) noexcept 87 | { 88 | if (gameClient) { 89 | this->client = *reinterpret_cast(this->base + offsets::global::GameClient); 90 | } else { 91 | this->localPlayer = *reinterpret_cast(this->base + offsets::global::Player); 92 | this->heroList = *reinterpret_cast**>(this->base + offsets::global::ManagerTemplate_AIHero_); 93 | this->minionList = *reinterpret_cast**>(this->base + offsets::global::ManagerTemplate_AIMinionClient_); 94 | this->turretList = *reinterpret_cast**>(this->base + offsets::global::ManagerTemplate_AITurret_); 95 | this->championManager = *reinterpret_cast(this->base + offsets::global::ChampionManager); 96 | this->materialRegistry = reinterpret_cast(this->base + offsets::functions::Riot__Renderer__MaterialRegistry__GetSingletonPtr)(); 97 | this->swapChain = *reinterpret_cast(this->materialRegistry + offsets::MaterialRegistry::SwapChain); 98 | this->window = *reinterpret_cast(this->base + offsets::global::Riot__g_window); 99 | this->translateString = reinterpret_cast(this->base + offsets::functions::translateString_UNSAFE_DONOTUSE); 100 | } 101 | } 102 | 103 | void Memory::Search(bool gameClient) 104 | { 105 | using namespace std::chrono_literals; 106 | 107 | try { 108 | this->base = reinterpret_cast(::GetModuleHandle(nullptr)); 109 | const auto& signatureToSearch{ (gameClient ? this->gameClientSig : this->sigs) }; 110 | 111 | for (const auto& sig : signatureToSearch) 112 | *sig.offset = 0; 113 | 114 | while (true) { 115 | bool missing_offset{ false }; 116 | for (auto& sig : signatureToSearch) { 117 | 118 | if (*sig.offset != 0) 119 | continue; 120 | 121 | for (auto& pattern : sig.pattern) { 122 | auto address{ find_signature(nullptr, pattern.c_str()) }; 123 | 124 | if (!address) { 125 | ::MessageBoxA(nullptr, ("Failed to find pattern: " + pattern).c_str(), "R3nzSkin", MB_OK | MB_ICONWARNING); 126 | // cheatManager.logger->addLog("Not found: %s\n", pattern.c_str()); 127 | continue; 128 | } 129 | 130 | if (sig.read) 131 | address = *reinterpret_cast(address + (pattern.find_first_of('?') / 3)); 132 | else if (sig.relative) 133 | address = address + *reinterpret_cast(address + 3) + 7; 134 | else if (address[0] == 0xE8) 135 | address = address + *reinterpret_cast(address + 1) + 5; 136 | 137 | if (sig.sub_base) 138 | address -= this->base; 139 | 140 | address += sig.additional; 141 | 142 | *sig.offset = reinterpret_cast(address); 143 | // cheatManager.logger->addLog("Found: %s\n\tAddress: 0x%X\n", pattern.c_str(), *sig.offset); 144 | break; 145 | } 146 | 147 | if (!*sig.offset) { 148 | missing_offset = true; 149 | break; 150 | } 151 | } 152 | 153 | if (!missing_offset) 154 | break; 155 | 156 | std::this_thread::sleep_for(2s); 157 | } 158 | this->update(gameClient); 159 | } catch (const std::exception& e) { 160 | ::MessageBoxA(nullptr, e.what(), "R3nzSkin", MB_OK | MB_ICONWARNING); 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /R3nzSkin/memory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "Offsets.hpp" 8 | 9 | #include "SDK/AIBaseCommon.hpp" 10 | #include "SDK/AIHero.hpp" 11 | #include "SDK/AITurret.hpp" 12 | #include "SDK/AIMinionClient.hpp" 13 | #include "SDK/ChampionManager.hpp" 14 | #include "SDK/GameClient.hpp" 15 | #include "SDK/ManagerTemplate.hpp" 16 | 17 | class offset_signature { 18 | public: 19 | std::vector pattern; 20 | bool sub_base; 21 | bool read; 22 | bool relative; 23 | std::int32_t additional; 24 | std::uint64_t* offset; 25 | }; 26 | 27 | class Memory { 28 | public: 29 | void Search(bool gameClient = true); 30 | 31 | std::uintptr_t base; 32 | HWND window; 33 | 34 | GameClient* client; 35 | AIBaseCommon* localPlayer; 36 | ManagerTemplate* heroList; 37 | ManagerTemplate* minionList; 38 | ManagerTemplate* turretList; 39 | ChampionManager* championManager; 40 | 41 | std::uintptr_t materialRegistry; 42 | IDXGISwapChain* swapChain; 43 | 44 | using translateString_t = const char* (__fastcall*)(const char*); 45 | 46 | translateString_t translateString; 47 | private: 48 | void update(bool gameClient = true) noexcept; 49 | 50 | std::vector gameClientSig 51 | { 52 | { 53 | { 54 | "48 8B 05 ? ? ? ? 4C 8B FA 83 78 0C 02" 55 | }, true, false, true, 0, &offsets::global::GameClient 56 | } 57 | }; 58 | 59 | std::vector sigs 60 | { 61 | { 62 | { 63 | "48 8B 1D ? ? ? ? 48 85 DB 74 15 48 81 C3" 64 | }, true, false, true, 0, &offsets::global::Player 65 | }, 66 | { 67 | { 68 | "48 8B 05 ? ? ? ? 48 8B 58 08 8B 40 10 48 8D 34 C3 48 3B DE" 69 | }, true, false, true, 0, &offsets::global::ManagerTemplate_AIHero_ 70 | }, 71 | { 72 | { 73 | "48 8B 0D ? ? ? ? 48 69 D0 ? ? 00 00 48 8B 05" 74 | }, true, false, true, 0, &offsets::global::ChampionManager 75 | }, 76 | { 77 | { 78 | "48 8B 0D ? ? ? ? E8 ? ? ? ? 48 8B 0D ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? E8 ? ? ? ? 48 8B C8" 79 | }, true, false, true, 0, &offsets::global::ManagerTemplate_AIMinionClient_ 80 | }, 81 | { 82 | { 83 | "48 8B 1D ? ? ? ? 48 8B 5B 28 48 85 DB" 84 | }, true, false, true, 0, &offsets::global::ManagerTemplate_AITurret_ 85 | }, 86 | { 87 | { 88 | "48 8B 0D ? ? ? ? FF 15 ? ? ? ? 48 8B 05 ? ? ? ?" 89 | }, true, false, true, 0, &offsets::global::Riot__g_window 90 | }, 91 | { 92 | { 93 | "48 8D 8D ? ? 00 00 44 8B 8C 24 ? ? 00 00" 94 | }, false, true, false, 0, &offsets::AIBaseCommon::CharacterDataStack 95 | }, 96 | { 97 | { 98 | "88 87 ? ? 00 00 48 89 44 24 38 0F B6 44 24 39 88 87 ?" 99 | }, false, true, false, 0, &offsets::AIBaseCommon::SkinId 100 | }, 101 | { 102 | { 103 | "48 8D BB ? ? ? ? C6 83 ? ? ? ? ? 0F 84" 104 | }, false, true, false, 0, &offsets::MaterialRegistry::SwapChain 105 | }, 106 | { 107 | { 108 | "E8 ? ? ? ? 48 8D 8D ? ? 00 00 E8 ? ? ? ? 48 85 C0 74 ? 48 85 ED" 109 | }, true, false, false, 0, &offsets::functions::CharacterDataStack__Push 110 | }, 111 | { 112 | { 113 | "88 54 24 10 53 55 56 57 41 54 41 55 41 56" 114 | }, true, false, false, 0, &offsets::functions::CharacterDataStack__Update 115 | }, 116 | { 117 | { 118 | "E8 ? ? ? ? 8B 57 34" 119 | }, true, false, false, 0, &offsets::functions::Riot__Renderer__MaterialRegistry__GetSingletonPtr 120 | }, 121 | { 122 | { 123 | "E8 ? ? ? ? 0F 57 DB 4C 8B C0 F3 0F 5A DE" 124 | }, true, false, false, 0, &offsets::functions::translateString_UNSAFE_DONOTUSE 125 | }, 126 | { 127 | { 128 | "E8 ? ? ? ? 4C 3B ? 0F 94 C0" 129 | }, true, false, false, 0, &offsets::functions::GetGoldRedirectTarget 130 | } 131 | }; 132 | }; 133 | -------------------------------------------------------------------------------- /R3nzSkin/offsets.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace offsets { 6 | namespace GameObject { 7 | namespace VTable { 8 | enum { 9 | IsLaneMinion = 0xEB, // E8 ? ? ? ? 84 C0 0F 84 ? ? ? ? 39 1F 10 | IsEliteMinion = IsLaneMinion + 0x1, 11 | IsEpicMinion = IsEliteMinion + 0x1, 12 | IsMinion = IsEpicMinion + 0x4, 13 | IsJungle = IsMinion + 0x1 14 | }; 15 | }; 16 | enum { 17 | Team = 0x3C, 18 | Name = 0x58 19 | }; 20 | }; 21 | 22 | namespace global { 23 | inline std::uint64_t Player{ 0 }; 24 | inline std::uint64_t ChampionManager{ 0 }; 25 | inline std::uint64_t Riot__g_window{ 0 }; 26 | inline std::uint64_t ManagerTemplate_AIMinionClient_{ 0 }; 27 | inline std::uint64_t ManagerTemplate_AIHero_{ 0 }; 28 | inline std::uint64_t ManagerTemplate_AITurret_{ 0 }; 29 | inline std::uint64_t GameClient{ 0 }; 30 | }; 31 | 32 | namespace AIBaseCommon { 33 | inline std::uint64_t CharacterDataStack{ 0 }; 34 | inline std::uint64_t SkinId{ 0 }; 35 | }; 36 | 37 | namespace MaterialRegistry { 38 | inline std::uint64_t SwapChain{ 0 }; 39 | }; 40 | 41 | namespace functions { 42 | inline std::uint64_t Riot__Renderer__MaterialRegistry__GetSingletonPtr{ 0 }; 43 | inline std::uint64_t translateString_UNSAFE_DONOTUSE{ 0 }; 44 | inline std::uint64_t CharacterDataStack__Push{ 0 }; 45 | inline std::uint64_t CharacterDataStack__Update{ 0 }; 46 | inline std::uint64_t GetGoldRedirectTarget{ 0 }; 47 | }; 48 | }; 49 | -------------------------------------------------------------------------------- /R3nzSkin/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFHJavaer/R3Archive/021a1c88e18b237e78e50ec8cbd6868a66eef3a4/R3nzSkin/resource.h -------------------------------------------------------------------------------- /R3nzSkin/vmt_smart_hook.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | auto is_code_ptr(void* ptr) -> bool { 10 | constexpr const DWORD protect_flags{ PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY }; 11 | 12 | MEMORY_BASIC_INFORMATION out; 13 | ::VirtualQuery(ptr, &out, sizeof(out)); 14 | 15 | return out.Type && !(out.Protect & (PAGE_GUARD | PAGE_NOACCESS)) && out.Protect & protect_flags; 16 | } 17 | 18 | class table_hook { 19 | public: 20 | constexpr table_hook(): m_new_vmt{ nullptr } , m_old_vmt{ nullptr } {} 21 | 22 | ~table_hook() { 23 | if (m_new_vmt) 24 | delete[](m_new_vmt - 1); 25 | } 26 | 27 | protected: 28 | auto initialize(void** original_table) -> void { 29 | m_old_vmt = original_table; 30 | 31 | std::size_t size{ 0 }; 32 | while (m_old_vmt[size] && is_code_ptr(m_old_vmt[size])) 33 | ++size; 34 | 35 | m_new_vmt = (new void* [size + 1]) + 1; 36 | ::memcpy(m_new_vmt - 1, m_old_vmt - 1, sizeof(void*) * (size + 1)); 37 | } 38 | 39 | constexpr auto leak_table() -> void { m_new_vmt = nullptr; } 40 | 41 | auto hook_instance(void* inst) const -> void { 42 | auto& vtbl{ *reinterpret_cast(inst) }; 43 | assert(vtbl == m_old_vmt || vtbl == m_new_vmt); 44 | vtbl = m_new_vmt; 45 | } 46 | 47 | auto unhook_instance(void* inst) const -> void { 48 | auto& vtbl{ *reinterpret_cast(inst) }; 49 | assert(vtbl == m_old_vmt || vtbl == m_new_vmt); 50 | vtbl = m_old_vmt; 51 | } 52 | 53 | auto initialize_and_hook_instance(void* inst) -> bool { 54 | auto& vtbl{ *reinterpret_cast(inst) }; 55 | bool initialized{ false }; 56 | if (!m_old_vmt) { 57 | initialized = true; 58 | initialize(vtbl); 59 | } 60 | hook_instance(inst); 61 | return initialized; 62 | } 63 | 64 | template 65 | auto hook_function(Fn hooked_fn, const std::size_t index) -> Fn { 66 | m_new_vmt[index] = (void*)(hooked_fn); 67 | return (Fn)(m_old_vmt[index]); 68 | } 69 | 70 | template 71 | auto apply_hook(std::size_t idx) -> void { T::m_original = hook_function(&T::hooked, idx); } 72 | 73 | template 74 | auto get_original_function(const int index) -> Fn { return (Fn)(m_old_vmt[index]); } 75 | 76 | private: 77 | void** m_new_vmt{ nullptr }; 78 | void** m_old_vmt{ nullptr }; 79 | }; 80 | 81 | class vmt_smart_hook : table_hook { 82 | public: 83 | vmt_smart_hook(void* class_base) : m_class{ class_base } { initialize_and_hook_instance(class_base); } 84 | ~vmt_smart_hook() { unhook_instance(m_class); } 85 | 86 | auto rehook() const -> void { hook_instance(m_class); } 87 | auto unhook() const -> void { unhook_instance(m_class); } 88 | 89 | using table_hook::apply_hook; 90 | using table_hook::get_original_function; 91 | using table_hook::hook_function; 92 | 93 | private: 94 | void* m_class{ nullptr }; 95 | }; 96 | 97 | class vmt_multi_hook : table_hook { 98 | public: 99 | constexpr vmt_multi_hook() { } 100 | 101 | ~vmt_multi_hook() { leak_table(); } 102 | 103 | using table_hook::apply_hook; 104 | using table_hook::get_original_function; 105 | using table_hook::hook_function; 106 | using table_hook::hook_instance; 107 | using table_hook::unhook_instance; 108 | using table_hook::initialize; 109 | using table_hook::initialize_and_hook_instance; 110 | }; 111 | -------------------------------------------------------------------------------- /R3nzSkin_Injector/Injector.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "Injector.hpp" 12 | #include "R3nzUI.hpp" 13 | #include "xorstr.hpp" 14 | #include "lazy_importer.hpp" 15 | 16 | using namespace System; 17 | using namespace System::Windows::Forms; 18 | using namespace System::Threading; 19 | using namespace System::Globalization; 20 | using namespace System::Net; 21 | 22 | #define xor_clrstr_w(x) msclr::interop::marshal_as(static_cast(_XorStrW(x))) 23 | 24 | proclist_t WINAPI Injector::findProcesses(const std::wstring& name) noexcept 25 | { 26 | auto process_snap{ LI_FN(CreateToolhelp32Snapshot)(TH32CS_SNAPPROCESS, 0) }; 27 | proclist_t list; 28 | 29 | if (process_snap == INVALID_HANDLE_VALUE) 30 | return list; 31 | 32 | PROCESSENTRY32W pe32{}; 33 | pe32.dwSize = sizeof(PROCESSENTRY32W); 34 | 35 | if (LI_FN(Process32FirstW).get()(process_snap, &pe32)) { 36 | if (pe32.szExeFile == name) 37 | list.push_back(pe32.th32ProcessID); 38 | 39 | while (LI_FN(Process32NextW).get()(process_snap, &pe32)) { 40 | if (pe32.szExeFile == name) 41 | list.push_back(pe32.th32ProcessID); 42 | } 43 | } 44 | 45 | LI_FN(CloseHandle)(process_snap); 46 | return list; 47 | } 48 | 49 | bool WINAPI Injector::isInjected(const std::uint32_t pid) noexcept 50 | { 51 | auto hProcess{ LI_FN(OpenProcess)(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid) }; 52 | 53 | if (nullptr == hProcess) 54 | return false; 55 | 56 | HMODULE hMods[1024]; 57 | DWORD cbNeeded{}; 58 | 59 | if (LI_FN(K32EnumProcessModules)(hProcess, hMods, sizeof(hMods), &cbNeeded)) { 60 | for (auto i{ 0u }; i < (cbNeeded / sizeof(HMODULE)); ++i) { 61 | TCHAR szModName[MAX_PATH]; 62 | if (LI_FN(K32GetModuleBaseNameW)(hProcess, hMods[i], szModName, sizeof(szModName) / sizeof(TCHAR))) { 63 | if (std::wcscmp(szModName, _XorStrW(L"R3nzSkin.dll")) == 0) { 64 | LI_FN(CloseHandle)(hProcess); 65 | return true; 66 | } 67 | } 68 | } 69 | } 70 | LI_FN(CloseHandle)(hProcess); 71 | return false; 72 | } 73 | 74 | bool WINAPI Injector::inject(const std::uint32_t pid) noexcept 75 | { 76 | TCHAR current_dir[MAX_PATH]; 77 | LI_FN(GetCurrentDirectoryW)(MAX_PATH, current_dir); 78 | const auto handle{ LI_FN(OpenProcess)(PROCESS_ALL_ACCESS, false, pid) }; 79 | 80 | if (!handle || handle == INVALID_HANDLE_VALUE) 81 | return false; 82 | 83 | FILETIME ft{}; 84 | SYSTEMTIME st{}; 85 | LI_FN(GetSystemTime)(&st); 86 | LI_FN(SystemTimeToFileTime)(&st, &ft); 87 | FILETIME create{}, exit{}, kernel{}, user{}; 88 | LI_FN(GetProcessTimes)(handle, &create, &exit, &kernel, &user); 89 | 90 | const auto delta{ 10 - static_cast((*reinterpret_cast(&ft) - *reinterpret_cast(&create.dwLowDateTime)) / 10000000U) }; 91 | 92 | if (delta > 0) 93 | std::this_thread::sleep_for(std::chrono::seconds(delta)); 94 | 95 | const auto dll_path{ std::wstring(current_dir) + _XorStrW(L"\\R3nzSkin.dll") }; 96 | 97 | if (const auto f{ std::ifstream(dll_path) }; !f.is_open()) { 98 | LI_FN(MessageBoxW)(nullptr, _XorStrW(L"R3nzSkin.dll file could not be found.\nTry reinstalling the cheat."), _XorStrW(L"R3nzSkin"), MB_ICONERROR | MB_OK); 99 | LI_FN(CloseHandle)(handle); 100 | return false; 101 | } 102 | 103 | const auto dll_path_remote{ LI_FN(VirtualAllocEx).get()(handle, nullptr, (dll_path.size() + 1) * sizeof(wchar_t), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE) }; 104 | 105 | if (!dll_path_remote) { 106 | LI_FN(CloseHandle)(handle); 107 | return false; 108 | } 109 | 110 | if (!LI_FN(WriteProcessMemory).get()(handle, dll_path_remote, dll_path.data(), (dll_path.size() + 1) * sizeof(wchar_t), nullptr)) { 111 | LI_FN(VirtualFreeEx).get()(handle, dll_path_remote, 0u, MEM_RELEASE); 112 | LI_FN(CloseHandle)(handle); 113 | return false; 114 | } 115 | 116 | HANDLE thread{}; 117 | LI_FN(NtCreateThreadEx).nt_cached()(&thread, GENERIC_ALL, nullptr, handle, reinterpret_cast(LI_FN(GetProcAddress).get()(LI_FN(GetModuleHandleW).get()(_XorStrW(L"kernel32.dll")), _XorStr("LoadLibraryW"))), dll_path_remote, FALSE, NULL, NULL, NULL, nullptr); 118 | 119 | if (!thread || thread == INVALID_HANDLE_VALUE) { 120 | LI_FN(VirtualFreeEx).get()(handle, dll_path_remote, 0u, MEM_RELEASE); 121 | LI_FN(CloseHandle)(handle); 122 | return false; 123 | } 124 | 125 | LI_FN(WaitForSingleObject)(thread, INFINITE); 126 | LI_FN(CloseHandle)(thread); 127 | LI_FN(VirtualFreeEx).get()(handle, dll_path_remote, 0u, MEM_RELEASE); 128 | LI_FN(CloseHandle)(handle); 129 | return true; 130 | } 131 | 132 | void WINAPI Injector::enableDebugPrivilege() noexcept 133 | { 134 | HANDLE token{}; 135 | if (OpenProcessToken(LI_FN(GetCurrentProcess).get()(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) { 136 | LUID value; 137 | if (LookupPrivilegeValueW(nullptr, _XorStrW(SE_DEBUG_NAME), &value)) { 138 | TOKEN_PRIVILEGES tp{}; 139 | tp.PrivilegeCount = 1; 140 | tp.Privileges[0].Luid = value; 141 | tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 142 | if (AdjustTokenPrivileges(token, FALSE, &tp, sizeof(tp), nullptr, nullptr)) 143 | LI_FN(CloseHandle)(token); 144 | } 145 | } 146 | } 147 | 148 | void Injector::autoUpdate() 149 | { 150 | /* do not even bother if we are from Chinese regions and Brazil */ 151 | auto whitelisted_regions = gcnew array { 152 | xor_clrstr_w(L"zh-CN"), 153 | xor_clrstr_w(L"zh-TW"), 154 | xor_clrstr_w(L"zh-HK"), 155 | xor_clrstr_w(L"zh-MO"), 156 | xor_clrstr_w(L"zh-SG"), 157 | xor_clrstr_w(L"pt-BR") 158 | }; 159 | auto current_culture = CultureInfo::CurrentCulture; 160 | auto region = current_culture->Name; 161 | for each (auto whitelisted_region in whitelisted_regions) 162 | { 163 | if (region->Equals(whitelisted_region, StringComparison::OrdinalIgnoreCase)) 164 | { 165 | return; 166 | } 167 | } 168 | 169 | auto client = gcnew WebClient(); 170 | ServicePointManager::Expect100Continue = true; 171 | ServicePointManager::SecurityProtocol = SecurityProtocolType::Tls12; 172 | client->Headers->Add(xor_clrstr_w(L"User-Agent"), xor_clrstr_w(L"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0")); 173 | 174 | try 175 | { 176 | auto json = msclr::interop::marshal_as(client->DownloadString(xor_clrstr_w(L"https://api.github.com/repos/R3nzTheCodeGOD/R3nzSkin/releases/latest"))); 177 | std::regex tagnameRegex(_XorStr("\"tag_name\"\\s*:\\s*\"([^\"]+)")); 178 | std::regex urlRegex(_XorStr("\"browser_download_url\"\\s*:\\s*\"([^\"]+)")); 179 | std::regex dateRegex(_XorStr("\"created_at\"\\s*:\\s*\"([^\"]+)")); 180 | 181 | if (std::smatch tagnameMatch; std::regex_search(json, tagnameMatch, tagnameRegex)) 182 | { 183 | auto version = gcnew String(tagnameMatch[1].str().c_str()); 184 | if (std::smatch dateMatch; std::regex_search(json, dateMatch, dateRegex)) 185 | { 186 | if (!System::IO::File::Exists(xor_clrstr_w(L"R3nzSkin.dll"))) 187 | { 188 | throw gcnew Exception(xor_clrstr_w(L"Failed to find R3nzSkin.dll in the current directory")); 189 | } 190 | const auto date_of_github_release = DateTime::ParseExact(gcnew String(dateMatch[1].str().c_str()), xor_clrstr_w(L"yyyy-MM-ddTHH:mm:ssZ"), CultureInfo::InvariantCulture).ToString(xor_clrstr_w(L"dd.MM.yyyy HH:00")); 191 | const auto date_of_current_release = System::IO::File::GetLastWriteTime(xor_clrstr_w(L"R3nzSkin.dll")).ToString(xor_clrstr_w(L"dd.MM.yyyy HH:00")); 192 | if (date_of_current_release != date_of_github_release) 193 | { 194 | const auto date_of_github_release_class = DateTime::ParseExact(date_of_github_release, xor_clrstr_w(L"dd.MM.yyyy HH:00"), CultureInfo::InvariantCulture); 195 | const auto date_of_current_release_class = DateTime::ParseExact(date_of_current_release, xor_clrstr_w(L"dd.MM.yyyy HH:00"), CultureInfo::InvariantCulture); 196 | if (date_of_current_release_class > date_of_github_release_class) 197 | { 198 | return; 199 | } 200 | 201 | const auto result = MessageBox::Show(xor_clrstr_w(L"New version is available on GitHub\nWould you like to download it now?"), xor_clrstr_w(L"R3nzSkin"), MessageBoxButtons::YesNo, MessageBoxIcon::Information); 202 | if (result == DialogResult::Yes) 203 | { 204 | if (std::smatch urlMatch; std::regex_search(json, urlMatch, urlRegex)) 205 | { 206 | auto url = gcnew String(urlMatch[1].str().c_str()); 207 | auto file = String::Format(xor_clrstr_w(L"R3nzSkin_{0}.zip"), version); 208 | client->DownloadFile(url, file); 209 | 210 | System::IO::Compression::ZipFile::ExtractToDirectory(file, xor_clrstr_w(L"R3nzSkin")); 211 | System::IO::File::Delete(file); 212 | System::IO::File::Delete(xor_clrstr_w(L"R3nzSkin.dll")); 213 | System::IO::File::Move(xor_clrstr_w(L"R3nzSkin\\R3nzSkin_Injector.exe"), String::Format(xor_clrstr_w(L"R3nzSkin_Injector_{0}.exe"), version)); 214 | System::IO::File::Move(xor_clrstr_w(L"R3nzSkin\\R3nzSkin.dll"), xor_clrstr_w(L"R3nzSkin.dll")); 215 | System::IO::Directory::Delete(xor_clrstr_w(L"R3nzSkin")); 216 | 217 | auto process_info = gcnew System::Diagnostics::ProcessStartInfo(); 218 | process_info->Arguments = xor_clrstr_w(L"/C choice /C Y /N /D Y /T 1 & del \"") + System::Diagnostics::Process::GetCurrentProcess()->MainModule->FileName + xor_clrstr_w(L"\""); 219 | process_info->CreateNoWindow = true; 220 | process_info->FileName = xor_clrstr_w(L"cmd.exe"); 221 | process_info->WindowStyle = System::Diagnostics::ProcessWindowStyle::Hidden; 222 | System::Diagnostics::Process::Start(process_info); 223 | System::Diagnostics::Process::Start(String::Format(xor_clrstr_w(L"R3nzSkin_Injector_{0}.exe"), version)); 224 | 225 | Environment::Exit(0); 226 | } 227 | } 228 | } 229 | } 230 | } 231 | } 232 | catch (Exception^ e) 233 | { 234 | MessageBox::Show(String::Format(xor_clrstr_w(L"{0} - {1}"), e->Message, e->StackTrace->Substring(5)), xor_clrstr_w(L"R3nzSkin"), MessageBoxButtons::OK, MessageBoxIcon::Error); 235 | Environment::Exit(0); 236 | } 237 | } 238 | 239 | void Injector::run() noexcept 240 | { 241 | enableDebugPrivilege(); 242 | while (true) { 243 | const auto& league_client_processes{ Injector::findProcesses(_XorStrW(L"LeagueClient.exe")) }; 244 | const auto& league_processes{ Injector::findProcesses(_XorStrW(L"League of Legends.exe")) }; 245 | 246 | R3nzSkinInjector::gameState = (league_processes.size() > 0) ? true : false; 247 | R3nzSkinInjector::clientState = (league_client_processes.size() > 0) ? true : false; 248 | 249 | // antiviruses don't like endless loops, show them that this loop is a breaking point. (technically still an infinite loop :D) 250 | if (league_processes.size() > 0xff) 251 | break; 252 | 253 | for (auto& pid : league_processes) { 254 | if (!Injector::isInjected(pid)) { 255 | R3nzSkinInjector::cheatState = false; 256 | if (R3nzSkinInjector::btnState) { 257 | std::this_thread::sleep_for(1.5s); 258 | if (Injector::inject(pid)) 259 | R3nzSkinInjector::cheatState = true; 260 | else 261 | R3nzSkinInjector::cheatState = false; 262 | } 263 | std::this_thread::sleep_for(1s); 264 | } else { 265 | R3nzSkinInjector::cheatState = true; 266 | } 267 | } 268 | std::this_thread::sleep_for(1s); 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /R3nzSkin_Injector/Injector.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace std::chrono_literals; 10 | using proclist_t = std::vector; 11 | 12 | NTSTATUS NTAPI NtCreateThreadEx(PHANDLE, ACCESS_MASK, LPVOID, HANDLE, LPTHREAD_START_ROUTINE, LPVOID, BOOL, SIZE_T, SIZE_T, SIZE_T, LPVOID); 13 | 14 | class Injector { 15 | public: 16 | static proclist_t WINAPI findProcesses(const std::wstring& name) noexcept; 17 | static bool WINAPI isInjected(const std::uint32_t pid) noexcept; 18 | static bool WINAPI inject(const std::uint32_t pid) noexcept; 19 | static void WINAPI enableDebugPrivilege() noexcept; 20 | static void autoUpdate(); 21 | static void run() noexcept; 22 | }; 23 | -------------------------------------------------------------------------------- /R3nzSkin_Injector/R3nzSkin_Injector.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFHJavaer/R3Archive/021a1c88e18b237e78e50ec8cbd6868a66eef3a4/R3nzSkin_Injector/R3nzSkin_Injector.rc -------------------------------------------------------------------------------- /R3nzSkin_Injector/R3nzSkin_Injector.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ChinaServer 6 | x64 7 | 8 | 9 | RiotGamesServers 10 | Win32 11 | 12 | 13 | ChinaServer 14 | Win32 15 | 16 | 17 | RiotGamesServers 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {40f6875e-c1e5-4c10-a129-6e84ce034801} 25 | R3nzSkinInjector 26 | 10.0 27 | R3nzSkin_Injector 28 | v4.8 29 | 30 | 31 | 32 | Application 33 | false 34 | v143 35 | true 36 | Unicode 37 | true 38 | x86 39 | 40 | 41 | Application 42 | false 43 | v143 44 | false 45 | Unicode 46 | true 47 | x64 48 | 49 | 50 | v143 51 | Unicode 52 | true 53 | true 54 | 55 | 56 | v143 57 | Unicode 58 | true 59 | true 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | false 75 | false 76 | $(SolutionDir)Release\$(Configuration)\ 77 | 78 | 79 | false 80 | false 81 | $(SolutionDir)Release\$(Configuration)\ 82 | 83 | 84 | false 85 | false 86 | $(SolutionDir)Release\$(Configuration)\ 87 | 88 | 89 | false 90 | false 91 | $(SolutionDir)Release\$(Configuration)\ 92 | 93 | 94 | 95 | Level3 96 | true 97 | true 98 | WIN32;_RIOT;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 99 | stdcpp17 100 | StreamingSIMDExtensions2 101 | 102 | Speed 103 | false 104 | MultiThreadedDLL 105 | false 106 | false 107 | true 108 | false 109 | false 110 | true 111 | true 112 | 113 | 114 | Windows 115 | true 116 | true 117 | false 118 | RequireAdministrator 119 | main 120 | false 121 | 122 | 123 | 124 | 125 | Level2 126 | true 127 | false 128 | WIN32;_RIOT;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 129 | stdcpp17 130 | StreamingSIMDExtensions2 131 | 132 | 133 | Speed 134 | false 135 | MultiThreadedDLL 136 | false 137 | false 138 | true 139 | false 140 | false 141 | true 142 | true 143 | true 144 | true 145 | 146 | 147 | Windows 148 | true 149 | true 150 | false 151 | RequireAdministrator 152 | main 153 | false 154 | true 155 | STAThreadingAttribute 156 | 157 | 158 | 159 | 160 | stdcpp17 161 | Level3 162 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 163 | Default 164 | true 165 | true 166 | 167 | StreamingSIMDExtensions2 168 | 169 | 170 | RequireAdministrator 171 | false 172 | Windows 173 | true 174 | true 175 | main 176 | 177 | 178 | 179 | 180 | stdcpp17 181 | Level3 182 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 183 | Default 184 | true 185 | true 186 | 187 | 188 | StreamingSIMDExtensions2 189 | 190 | 191 | RequireAdministrator 192 | false 193 | Windows 194 | true 195 | true 196 | main 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | CppForm 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | R3nzUI.hpp 229 | 230 | 231 | 232 | 233 | 234 | -------------------------------------------------------------------------------- /R3nzSkin_Injector/R3nzSkin_Injector.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {cce4a7dd-5d8f-4859-9bee-14137797694a} 10 | 11 | 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files 18 | 19 | 20 | 21 | 22 | Resource 23 | 24 | 25 | 26 | 27 | Resource 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | 43 | 44 | Resource 45 | 46 | 47 | -------------------------------------------------------------------------------- /R3nzSkin_Injector/R3nzUI.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "xorstr.hpp" 4 | 5 | namespace R3nzSkinInjector { 6 | 7 | using namespace System; 8 | using namespace System::ComponentModel; 9 | using namespace System::Collections; 10 | using namespace System::Windows::Forms; 11 | using namespace System::Data; 12 | using namespace System::Drawing; 13 | using namespace System::Threading; 14 | using namespace System::IO; 15 | 16 | static auto btnState{ false }; 17 | static auto gameState{ false }; 18 | static auto cheatState{ false }; 19 | static auto clientState{ false }; 20 | 21 | delegate String^ MyDelegate(); 22 | ref class LambdaWrapper sealed 23 | { 24 | public: 25 | String^ InvokeLambda() 26 | { 27 | return lambdaFunction(); 28 | } 29 | private: 30 | MyDelegate^ lambdaFunction; 31 | public: 32 | LambdaWrapper() 33 | { 34 | lambdaFunction = gcnew MyDelegate(this, &LambdaWrapper::LambdaMethod); 35 | } 36 | String^ LambdaMethod() 37 | { 38 | auto characters = gcnew String("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); 39 | auto random = gcnew Random(static_cast(DateTime::Now.Ticks)); 40 | 41 | auto buffer = gcnew array(8); 42 | for (int i = 0; i < 8; i++) 43 | { 44 | buffer[i] = characters[random->Next(characters->Length)]; 45 | } 46 | 47 | return gcnew String(buffer); 48 | } 49 | }; 50 | 51 | public ref class R3nzUI sealed : public Form 52 | { 53 | public: 54 | R3nzUI() 55 | { 56 | InitializeComponent(); loadSettings(); renameProgram(); 57 | } 58 | 59 | void updateScreen() 60 | { 61 | while (true) { 62 | if (clientState) { 63 | this->clientStatusLabel->Text = L"Found"; 64 | this->clientStatusLabel->ForeColor = Color::FromArgb(255, 252, 220, 107); 65 | } 66 | else { 67 | this->clientStatusLabel->Text = L"Not Found"; 68 | this->clientStatusLabel->ForeColor = Color::FromArgb(255, 245, 8, 83); 69 | } 70 | 71 | if (gameState) { 72 | this->gameStatusLabel->Text = L"Found"; 73 | this->gameStatusLabel->ForeColor = Color::FromArgb(255, 252, 220, 107); 74 | if (cheatState) { 75 | this->dllStatusLabel->Text = L"Injected"; 76 | this->dllStatusLabel->ForeColor = Color::FromArgb(255, 252, 220, 107); 77 | } 78 | else { 79 | this->dllStatusLabel->Text = L"Not Injected"; 80 | this->dllStatusLabel->ForeColor = Color::FromArgb(255, 245, 8, 83); 81 | } 82 | } 83 | else { 84 | this->gameStatusLabel->Text = L"Not Found"; 85 | this->gameStatusLabel->ForeColor = Color::FromArgb(255, 245, 8, 83); 86 | this->dllStatusLabel->Text = L"Not Injected"; 87 | this->dllStatusLabel->ForeColor = Color::FromArgb(255, 245, 8, 83); 88 | } 89 | Thread::Sleep(1000); 90 | } 91 | } 92 | 93 | void saveSettings() 94 | { 95 | auto appDataPath = Environment::GetFolderPath(Environment::SpecialFolder::MyDocuments); 96 | auto settingsFolder = Path::Combine(appDataPath, L"R3nzSkin"); 97 | auto settingsFilePath = Path::Combine(settingsFolder, L"R3nzSkinInjector"); 98 | 99 | if (!Directory::Exists(settingsFolder)) { 100 | Directory::CreateDirectory(settingsFolder); 101 | } 102 | 103 | File::WriteAllText(settingsFilePath, Convert::ToString(this->toolstripmenuItem2->Checked)); 104 | } 105 | 106 | void loadSettings() 107 | { 108 | auto appDataPath = Environment::GetFolderPath(Environment::SpecialFolder::MyDocuments); 109 | auto settingsFolder = Path::Combine(appDataPath, L"R3nzSkin"); 110 | auto settingsFilePath = Path::Combine(settingsFolder, L"R3nzSkinInjector"); 111 | 112 | if (!Directory::Exists(settingsFolder)) { 113 | Directory::CreateDirectory(settingsFolder); 114 | } 115 | 116 | if (File::Exists(settingsFilePath)) { 117 | this->toolstripmenuItem2->Checked = Boolean::Parse(File::ReadAllText(settingsFilePath)); 118 | } 119 | } 120 | 121 | void renameProgram() 122 | { 123 | auto wrapper = gcnew LambdaWrapper(); 124 | 125 | // Executable 126 | File::Move(Application::ExecutablePath, String::Format("{0}\\{1}.exe", Application::StartupPath, wrapper->InvokeLambda())); 127 | 128 | // Title 129 | this->Text = wrapper->InvokeLambda(); 130 | } 131 | protected: 132 | ~R3nzUI() { if (components) delete components; } 133 | private: 134 | Button^ startButton; 135 | Label^ injectorStatusLabel; 136 | Label^ dllStatusLabel; 137 | Label^ gameStatusLabel; 138 | Label^ clientStatusLabel; 139 | GroupBox^ injectorStatusGroupBox; 140 | GroupBox^ leagueClientStatusGroupBox; 141 | GroupBox^ leagueGameStatusGroupBox; 142 | GroupBox^ dllStatusGroupBox; 143 | LinkLabel^ copyrightLabel; 144 | System::ComponentModel::Container^ components; 145 | NotifyIcon^ notifyIcon; 146 | Windows::Forms::ContextMenu^ contextMenu; 147 | MenuItem^ menuItem; 148 | MenuItem^ menuItem2; 149 | MenuStrip^ menuStrip; 150 | ToolStripMenuItem^ toolstripmenuItem; 151 | ToolStripMenuItem^ toolstripmenuItem2; 152 | #pragma region Windows Form Designer generated code 153 | void InitializeComponent() 154 | { 155 | auto resources = gcnew ComponentResourceManager(R3nzUI::typeid); 156 | this->startButton = gcnew Button(); 157 | this->injectorStatusLabel = gcnew Label(); 158 | this->dllStatusLabel = gcnew Label(); 159 | this->gameStatusLabel = gcnew Label(); 160 | this->injectorStatusGroupBox = gcnew GroupBox(); 161 | this->leagueClientStatusGroupBox = gcnew GroupBox(); 162 | this->clientStatusLabel = gcnew Label(); 163 | this->leagueGameStatusGroupBox = gcnew GroupBox(); 164 | this->dllStatusGroupBox = gcnew GroupBox(); 165 | this->copyrightLabel = gcnew LinkLabel(); 166 | this->notifyIcon = gcnew NotifyIcon(); 167 | this->contextMenu = gcnew Windows::Forms::ContextMenu(); 168 | this->menuItem = gcnew MenuItem(); 169 | this->menuItem2 = gcnew MenuItem(); 170 | this->menuStrip = gcnew MenuStrip(); 171 | this->toolstripmenuItem = gcnew ToolStripMenuItem(); 172 | this->toolstripmenuItem2 = gcnew ToolStripMenuItem(); 173 | this->injectorStatusGroupBox->SuspendLayout(); 174 | this->leagueClientStatusGroupBox->SuspendLayout(); 175 | this->leagueGameStatusGroupBox->SuspendLayout(); 176 | this->dllStatusGroupBox->SuspendLayout(); 177 | this->SuspendLayout(); 178 | // 179 | // startButton 180 | // 181 | this->startButton->BackColor = Color::FromArgb(245, 8, 83); 182 | this->startButton->Cursor = Cursors::Hand; 183 | this->startButton->FlatStyle = FlatStyle::Flat; 184 | this->startButton->Font = gcnew Drawing::Font(L"Arial", 12, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 185 | this->startButton->Location = Point(12, 28); 186 | this->startButton->Name = L"startButton"; 187 | this->startButton->Size = Drawing::Size(250, 50); 188 | this->startButton->TabIndex = 0; 189 | this->startButton->Text = L"Start"; 190 | this->startButton->UseVisualStyleBackColor = false; 191 | this->startButton->Click += gcnew EventHandler(this, &R3nzUI::startButton_Click); 192 | // 193 | // injectorStatusLabel 194 | // 195 | this->injectorStatusLabel->AutoSize = true; 196 | this->injectorStatusLabel->FlatStyle = FlatStyle::Flat; 197 | this->injectorStatusLabel->Font = gcnew Drawing::Font(L"Arial", 11.25F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 198 | this->injectorStatusLabel->ForeColor = Color::FromArgb(245, 8, 83); 199 | this->injectorStatusLabel->Location = Point(6, 16); 200 | this->injectorStatusLabel->Name = L"injectorStatusLabel"; 201 | this->injectorStatusLabel->Size = Drawing::Size(68, 18); 202 | this->injectorStatusLabel->TabIndex = 1; 203 | this->injectorStatusLabel->Text = L"Stopped"; 204 | // 205 | // dllStatusLabel 206 | // 207 | this->dllStatusLabel->AutoSize = true; 208 | this->dllStatusLabel->FlatStyle = FlatStyle::Flat; 209 | this->dllStatusLabel->Font = gcnew Drawing::Font(L"Arial", 11.25F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 210 | this->dllStatusLabel->ForeColor = Color::FromArgb(245, 8, 83); 211 | this->dllStatusLabel->Location = Point(6, 16); 212 | this->dllStatusLabel->Name = L"dllStatusLabel"; 213 | this->dllStatusLabel->Size = Drawing::Size(94, 18); 214 | this->dllStatusLabel->TabIndex = 2; 215 | this->dllStatusLabel->Text = L"Not Injected"; 216 | // 217 | // gameStatusLabel 218 | // 219 | this->gameStatusLabel->AutoSize = true; 220 | this->gameStatusLabel->FlatStyle = FlatStyle::Flat; 221 | this->gameStatusLabel->Font = gcnew Drawing::Font(L"Arial", 11.25F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 222 | this->gameStatusLabel->ForeColor = Color::FromArgb(245, 8, 83); 223 | this->gameStatusLabel->Location = Point(6, 16); 224 | this->gameStatusLabel->Name = L"gameStatusLabel"; 225 | this->gameStatusLabel->Size = Drawing::Size(82, 18); 226 | this->gameStatusLabel->TabIndex = 3; 227 | this->gameStatusLabel->Text = L"Not Found"; 228 | // 229 | // gameStatusLabel 230 | // 231 | this->injectorStatusGroupBox->Controls->Add(this->injectorStatusLabel); 232 | this->injectorStatusGroupBox->FlatStyle = FlatStyle::Flat; 233 | this->injectorStatusGroupBox->Font = gcnew Drawing::Font(L"Arial", 6.75F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 234 | this->injectorStatusGroupBox->ForeColor = Color::White; 235 | this->injectorStatusGroupBox->Location = Point(12, 79); 236 | this->injectorStatusGroupBox->Name = L"gameStatusLabel"; 237 | this->injectorStatusGroupBox->Size = Drawing::Size(250, 45); 238 | this->injectorStatusGroupBox->TabIndex = 5; 239 | this->injectorStatusGroupBox->TabStop = false; 240 | this->injectorStatusGroupBox->Text = L"Injector Status"; 241 | // 242 | // leagueClientStatusGroupBox 243 | // 244 | this->leagueClientStatusGroupBox->Controls->Add(this->clientStatusLabel); 245 | this->leagueClientStatusGroupBox->FlatStyle = FlatStyle::Flat; 246 | this->leagueClientStatusGroupBox->Font = gcnew Drawing::Font(L"Arial", 6.75F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 247 | this->leagueClientStatusGroupBox->ForeColor = Color::White; 248 | this->leagueClientStatusGroupBox->Location = Point(12, 130); 249 | this->leagueClientStatusGroupBox->Name = L"leagueClientStatusGroupBox"; 250 | this->leagueClientStatusGroupBox->Size = Drawing::Size(250, 45); 251 | this->leagueClientStatusGroupBox->TabIndex = 7; 252 | this->leagueClientStatusGroupBox->TabStop = false; 253 | this->leagueClientStatusGroupBox->Text = L"LeagueClient Status"; 254 | // 255 | // leagueGameStatusGroupBox 256 | // 257 | this->leagueGameStatusGroupBox->Controls->Add(this->gameStatusLabel); 258 | this->leagueGameStatusGroupBox->FlatStyle = FlatStyle::Flat; 259 | this->leagueGameStatusGroupBox->Font = gcnew Drawing::Font(L"Arial", 6.75F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 260 | this->leagueGameStatusGroupBox->ForeColor = Color::White; 261 | this->leagueGameStatusGroupBox->Location = Point(12, 181); 262 | this->leagueGameStatusGroupBox->Name = L"leagueGameStatusGroupBox"; 263 | this->leagueGameStatusGroupBox->Size = Drawing::Size(250, 45); 264 | this->leagueGameStatusGroupBox->TabIndex = 8; 265 | this->leagueGameStatusGroupBox->TabStop = false; 266 | this->leagueGameStatusGroupBox->Text = L"LeagueGame Status"; 267 | // 268 | // dllStatusGroupBox 269 | // 270 | this->dllStatusGroupBox->Controls->Add(this->dllStatusLabel); 271 | this->dllStatusGroupBox->FlatStyle = FlatStyle::Flat; 272 | this->dllStatusGroupBox->Font = gcnew Drawing::Font(L"Arial", 6.75F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 273 | this->dllStatusGroupBox->ForeColor = Color::White; 274 | this->dllStatusGroupBox->Location = Point(12, 232); 275 | this->dllStatusGroupBox->Name = L"dllStatusGroupBox"; 276 | this->dllStatusGroupBox->Size = Drawing::Size(250, 45); 277 | this->dllStatusGroupBox->TabIndex = 9; 278 | this->dllStatusGroupBox->TabStop = false; 279 | this->dllStatusGroupBox->Text = L"R3nzSkin Status"; 280 | // 281 | // clientStatusLabel 282 | // 283 | this->clientStatusLabel->AutoSize = true; 284 | this->clientStatusLabel->FlatStyle = FlatStyle::Flat; 285 | this->clientStatusLabel->Font = gcnew Drawing::Font(L"Arial", 11.25F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 286 | this->clientStatusLabel->ForeColor = Color::FromArgb(245, 8, 83); 287 | this->clientStatusLabel->Location = Point(6, 16); 288 | this->clientStatusLabel->Name = L"clientStatusLabel"; 289 | this->clientStatusLabel->Size = Drawing::Size(82, 18); 290 | this->clientStatusLabel->TabIndex = 0; 291 | this->clientStatusLabel->Text = L"Not Found"; 292 | // 293 | // copyrightLabel 294 | // 295 | this->copyrightLabel->AutoSize = true; 296 | this->copyrightLabel->Cursor = Cursors::Hand; 297 | this->copyrightLabel->LinkBehavior = LinkBehavior::NeverUnderline; 298 | this->copyrightLabel->LinkColor = Color::Silver; 299 | this->copyrightLabel->Location = Point(20, 284); 300 | this->copyrightLabel->Name = L"copyrightLabel"; 301 | this->copyrightLabel->Size = Drawing::Size(207, 14); 302 | this->copyrightLabel->TabIndex = 11; 303 | this->copyrightLabel->TabStop = true; 304 | this->copyrightLabel->Text = L"Copyright (c) 2021-2024 R3nzTheCodeGOD"; 305 | this->copyrightLabel->TextAlign = ContentAlignment::MiddleCenter; 306 | this->copyrightLabel->LinkClicked += gcnew LinkLabelLinkClickedEventHandler(this, &R3nzUI::copyrightLabel_LinkClicked); 307 | // 308 | // contextMenu 309 | // 310 | this->contextMenu->MenuItems->AddRange(gcnew array { this->menuItem, this->menuItem2 }); 311 | // 312 | // menuItem 313 | // 314 | this->menuItem2->Index = 0; 315 | this->menuItem2->Text = L"Start"; 316 | this->menuItem2->Click += gcnew EventHandler(this, &R3nzUI::menuItem2_OnClick); 317 | this->menuItem->Index = 1; 318 | this->menuItem->Text = L"Exit"; 319 | this->menuItem->Click += gcnew EventHandler(this, &R3nzUI::menuItem_OnClick); 320 | // 321 | // notifyIcon 322 | // 323 | this->notifyIcon->Text = L"R3nzSkin"; 324 | this->notifyIcon->Icon = cli::safe_cast(resources->GetObject(L"$this.Icon")); 325 | this->notifyIcon->Visible = false; 326 | this->notifyIcon->ContextMenu = this->contextMenu; 327 | this->notifyIcon->MouseDoubleClick += gcnew MouseEventHandler(this, &R3nzUI::notifyIcon_MouseDoubleClick); 328 | // 329 | // menuStrip 330 | // 331 | this->toolstripmenuItem->Text = L"Preferences"; 332 | this->toolstripmenuItem2->Text = L"Hide to tray"; 333 | this->toolstripmenuItem2->Click += gcnew EventHandler(this, &R3nzUI::toolstripmenuItem2_OnClick); 334 | this->toolstripmenuItem->DropDownItems->Add(this->toolstripmenuItem2); 335 | this->menuStrip->Items->Add(this->toolstripmenuItem); 336 | // 337 | // R3nzUI 338 | // 339 | this->AutoScaleDimensions = SizeF(7, 14); 340 | this->AutoScaleMode = Windows::Forms::AutoScaleMode::Font; 341 | this->BackColor = Color::FromArgb(32, 30, 30); 342 | this->ClientSize = Drawing::Size(273, 307); 343 | this->Controls->Add(this->menuStrip); 344 | this->Controls->Add(this->copyrightLabel); 345 | this->Controls->Add(this->dllStatusGroupBox); 346 | this->Controls->Add(this->leagueGameStatusGroupBox); 347 | this->Controls->Add(this->leagueClientStatusGroupBox); 348 | this->Controls->Add(this->injectorStatusGroupBox); 349 | this->Controls->Add(this->startButton); 350 | this->Cursor = Cursors::Arrow; 351 | this->Font = gcnew Drawing::Font(L"Arial", 8.25F, FontStyle::Bold, GraphicsUnit::Point, static_cast(162)); 352 | this->FormBorderStyle = Windows::Forms::FormBorderStyle::Fixed3D; 353 | this->Icon = cli::safe_cast(resources->GetObject(L"$this.Icon")); 354 | this->MaximizeBox = false; 355 | this->Name = L"R3nzUI"; 356 | this->RightToLeft = Windows::Forms::RightToLeft::No; 357 | this->Text = L""; 358 | this->Load += gcnew EventHandler(this, &R3nzUI::R3nzUI_Load); 359 | this->Resize += gcnew EventHandler(this, &R3nzUI::R3nzUI_Resize); 360 | this->injectorStatusGroupBox->ResumeLayout(false); 361 | this->injectorStatusGroupBox->PerformLayout(); 362 | this->leagueClientStatusGroupBox->ResumeLayout(false); 363 | this->leagueClientStatusGroupBox->PerformLayout(); 364 | this->leagueGameStatusGroupBox->ResumeLayout(false); 365 | this->leagueGameStatusGroupBox->PerformLayout(); 366 | this->dllStatusGroupBox->ResumeLayout(false); 367 | this->dllStatusGroupBox->PerformLayout(); 368 | this->menuStrip->ResumeLayout(false); 369 | this->menuStrip->PerformLayout(); 370 | this->ResumeLayout(false); 371 | this->PerformLayout(); 372 | } 373 | #pragma endregion 374 | private: 375 | Void R3nzUI_Load(Object^ sender, EventArgs^ e) 376 | { 377 | AppDomain::CurrentDomain->UnhandledException += gcnew UnhandledExceptionEventHandler(this, &R3nzUI::R3nzUI_ExceptionHandler); 378 | } 379 | private: 380 | Void R3nzUI_ExceptionHandler(Object^ sender, UnhandledExceptionEventArgs^ e) 381 | { 382 | const auto exception = dynamic_cast(e->ExceptionObject)->Message; 383 | MessageBox::Show(exception); 384 | } 385 | private: 386 | Void startButton_Click(Object^ sender, EventArgs^ e) 387 | { 388 | btnState = !btnState; 389 | if (btnState) 390 | { 391 | this->startButton->BackColor = Color::FromArgb(255, 252, 220, 107); 392 | this->injectorStatusLabel->ForeColor = Color::FromArgb(255, 252, 220, 107); 393 | this->startButton->Text = L"Stop"; 394 | this->injectorStatusLabel->Text = L"Working"; 395 | this->menuItem2->Text = L"Stop"; 396 | } 397 | else 398 | { 399 | this->startButton->BackColor = Color::FromArgb(255, 245, 8, 83); 400 | this->injectorStatusLabel->ForeColor = Color::FromArgb(255, 245, 8, 83); 401 | this->startButton->Text = L"Start"; 402 | this->injectorStatusLabel->Text = L"Stopped"; 403 | this->menuItem2->Text = L"Start"; 404 | } 405 | } 406 | private: 407 | Void copyrightLabel_LinkClicked(Object^ sender, LinkLabelLinkClickedEventArgs^ e) 408 | { 409 | Diagnostics::Process::Start(L"https://github.com/R3nzTheCodeGOD/R3nzSkin"); 410 | } 411 | private: 412 | Void R3nzUI_Resize(Object^ sender, EventArgs^ e) 413 | { 414 | if (this->WindowState == FormWindowState::Minimized) 415 | { 416 | if (this->toolstripmenuItem2->Checked) 417 | { 418 | this->Hide(); 419 | this->notifyIcon->Visible = true; 420 | } 421 | } 422 | } 423 | private: 424 | Void notifyIcon_MouseDoubleClick(Object^ sender, MouseEventArgs^ e) 425 | { 426 | if (this->toolstripmenuItem2->Checked) 427 | { 428 | this->Show(); 429 | this->WindowState = FormWindowState::Normal; 430 | this->notifyIcon->Visible = false; 431 | } 432 | } 433 | private: 434 | Void menuItem_OnClick(Object^ sender, EventArgs^ e) 435 | { 436 | this->Close(); 437 | } 438 | private: 439 | Void menuItem2_OnClick(Object^ sender, EventArgs^ e) 440 | { 441 | this->startButton_Click(nullptr, nullptr); 442 | } 443 | private: 444 | Void toolstripmenuItem2_OnClick(Object^ sender, EventArgs^ e) 445 | { 446 | this->toolstripmenuItem2->Checked = !this->toolstripmenuItem2->Checked; 447 | this->saveSettings(); 448 | } 449 | }; 450 | } 451 | -------------------------------------------------------------------------------- /R3nzSkin_Injector/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFHJavaer/R3Archive/021a1c88e18b237e78e50ec8cbd6868a66eef3a4/R3nzSkin_Injector/icon.ico -------------------------------------------------------------------------------- /R3nzSkin_Injector/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "R3nzUI.hpp" 9 | #include "Injector.hpp" 10 | 11 | using namespace System; 12 | using namespace System::Windows::Forms; 13 | using namespace System::Threading; 14 | using namespace System::Globalization; 15 | using namespace System::Net; 16 | 17 | int main([[maybe_unused]] array^ args) 18 | { 19 | std::srand(static_cast(std::time(nullptr))); 20 | Injector::autoUpdate(); 21 | 22 | Application::EnableVisualStyles(); 23 | Application::SetCompatibleTextRenderingDefault(false); 24 | R3nzSkinInjector::R3nzUI form; 25 | 26 | auto thread{ std::thread(Injector::run) }; 27 | auto screenThread{ gcnew Thread(gcnew ThreadStart(%form, &R3nzSkinInjector::R3nzUI::updateScreen)) }; 28 | screenThread->Start(); 29 | 30 | Application::Run(%form); 31 | 32 | thread.detach(); 33 | screenThread->Abort(); 34 | 35 | return EXIT_SUCCESS; 36 | } 37 | -------------------------------------------------------------------------------- /R3nzSkin_Injector/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SFHJavaer/R3Archive/021a1c88e18b237e78e50ec8cbd6868a66eef3a4/R3nzSkin_Injector/resource.h -------------------------------------------------------------------------------- /R3nzSkin_Injector/xorstr.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace XorCompileTime 5 | { 6 | constexpr auto time = __TIME__; 7 | constexpr auto seed = static_cast(time[7]) + static_cast(time[6]) * 10 + static_cast(time[4]) * 60 + static_cast(time[3]) * 600 + static_cast(time[1]) * 3600 + static_cast(time[0]) * 36000; 8 | 9 | template 10 | struct RandomGenerator 11 | { 12 | private: 13 | static constexpr unsigned a = 0x41a7; // 7^5 14 | static constexpr unsigned m = 0x7fffffff; // 2^31 - 1 15 | 16 | static constexpr unsigned s = RandomGenerator< N - 1 >::value; 17 | static constexpr unsigned lo = a * (s & 0xFFFF); // Multiply lower 16 bits by 16807 18 | static constexpr unsigned hi = a * (s >> 16); // Multiply higher 16 bits by 16807 19 | static constexpr unsigned lo2 = lo + ((hi & 0x7FFF) << 16); // Combine lower 15 bits of hi with lo's upper bits 20 | static constexpr unsigned hi2 = hi >> 15; // Discard lower 15 bits of hi 21 | static constexpr unsigned lo3 = lo2 + hi; 22 | 23 | public: 24 | static constexpr unsigned max = m; 25 | static constexpr unsigned value = lo3 > m ? lo3 - m : lo3; 26 | }; 27 | 28 | template<> 29 | struct RandomGenerator<0> 30 | { 31 | static constexpr unsigned value = seed; 32 | }; 33 | 34 | template 35 | struct RandomInt 36 | { 37 | static constexpr auto value = RandomGenerator::value % M; 38 | }; 39 | 40 | template 41 | struct RandomChar 42 | { 43 | static const char value = static_cast(1 + RandomInt::value); 44 | }; 45 | 46 | template 47 | struct XorString 48 | { 49 | private: 50 | const char _key; 51 | std::array _encrypted; 52 | 53 | constexpr Char enc(Char c) const 54 | { 55 | return c ^ _key; 56 | } 57 | 58 | Char dec(Char c) const 59 | { 60 | return c ^ _key; 61 | } 62 | 63 | public: 64 | template 65 | constexpr __forceinline XorString(const Char* str, std::index_sequence< Is... >) : _key(RandomChar::value), _encrypted{ enc(str[Is])... } {} 66 | 67 | __forceinline decltype(auto) decrypt() 68 | { 69 | for (size_t i = 0; i < N; ++i) { 70 | _encrypted[i] = dec(_encrypted[i]); 71 | } 72 | _encrypted[N] = '\0'; 73 | return _encrypted.data(); 74 | } 75 | }; 76 | #define _XorStr(s) []{ constexpr XorCompileTime::XorString expr(s, std::make_index_sequence()); return expr; }().decrypt() 77 | #define _XorStrW(s) []{ constexpr XorCompileTime::XorString expr(s, std::make_index_sequence()); return expr; }().decrypt() 78 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 
2 | 3 | 4 | # **R3nzSkin** 5 | 6 | 7 | 国服出现一定数量封禁,本仓库暂时存档,继续使用旧版本请风险自负。 8 | 9 | 10 |
11 | --------------------------------------------------------------------------------