├── .gitattributes ├── .gitignore ├── Hunt DMA.sln ├── HuntDMA ├── Aimbot │ ├── Aimbot.cpp │ └── Aimbot.h ├── Config │ ├── AimbotConfig.h │ ├── BloodBondsConfig.h │ ├── BossesConfig.h │ ├── ConfigInstance.h │ ├── ConfigUtilities.cpp │ ├── ConfigUtilities.h │ ├── GeneralConfig.h │ ├── OverlayConfig.h │ ├── POIConfig.h │ ├── PlayerConfig.h │ ├── SupplyConfig.h │ ├── TraitConfig.h │ └── TrapConfig.h ├── Esp │ ├── OtherEsp.cpp │ ├── OtherEsp.h │ ├── Overlay.cpp │ ├── Overlay.h │ ├── PlayerEsp.cpp │ ├── PlayerEsp.h │ ├── SpectatorAlarm.cpp │ └── SpectatorAlarm.h ├── Globals.h ├── Graphics │ ├── ESPRenderer.cpp │ ├── ESPRenderer.h │ ├── ImGuiMenu.cpp │ ├── ImGuiMenu.h │ ├── Start Up │ │ ├── Init.cpp │ │ └── Init.h │ └── Utility │ │ ├── Kmbox.cpp │ │ └── Kmbox.h ├── HuntDMA.filters ├── HuntDMA.manifest ├── HuntDMA.rc ├── HuntDMA.vcxproj ├── Libs │ └── ImGui │ │ ├── imconfig.h │ │ ├── imgui.cpp │ │ ├── imgui.h │ │ ├── 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 ├── Localization │ ├── Localization.cpp │ ├── Localization.h │ ├── LocalizationData.h │ ├── en.h │ └── ru.h ├── Logger │ ├── Logger.cpp │ ├── Logger.h │ ├── SystemInfo.cpp │ └── SystemInfo.h ├── Main.cpp ├── Memory │ ├── CacheManager.cpp │ ├── CacheManager.h │ ├── InputManager.cpp │ ├── InputManager.h │ ├── Memory.cpp │ ├── Memory.h │ ├── Registry.cpp │ └── Registry.h ├── Misc │ ├── CheatFunction.cpp │ ├── CheatFunction.h │ ├── Fonts.h │ ├── Input.cpp │ ├── Input.h │ ├── Pch │ │ ├── Pch.cpp │ │ └── Pch.h │ ├── Vector.cpp │ └── Vector.h ├── SDK │ ├── Camera.cpp │ ├── Camera.h │ ├── Environment.cpp │ ├── Environment.h │ ├── WorldEntity.cpp │ └── WorldEntity.h ├── Security │ └── XorStr.h ├── cryengine.wav ├── icon.ico └── resource.h ├── Images ├── 2.png ├── 4.png ├── 5.png └── 6.png ├── Include ├── json.hpp ├── leechcore.h └── vmmdll.h ├── Instructions.md ├── LICENSE ├── Lib ├── FTD3XX.lib ├── leechcore.lib └── vmm.lib └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 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 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd 364 | /Dumps 365 | HuntDMA/Config.json 366 | HuntDMA/DefaultConfig.json 367 | HuntDMA/imgui.ini 368 | /HuntDMA/lang 369 | HuntDMA/classes-dump.txt 370 | -------------------------------------------------------------------------------- /Hunt DMA.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.7.34003.232 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HuntDMA", "HuntDMA\HuntDMA.vcxproj", "{8CBA9E6C-73A9-49D7-AAFD-AD74FF639CAD}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {8CBA9E6C-73A9-49D7-AAFD-AD74FF639CAD}.Debug|x64.ActiveCfg = Debug|x64 15 | {8CBA9E6C-73A9-49D7-AAFD-AD74FF639CAD}.Debug|x64.Build.0 = Debug|x64 16 | {8CBA9E6C-73A9-49D7-AAFD-AD74FF639CAD}.Release|x64.ActiveCfg = Release|x64 17 | {8CBA9E6C-73A9-49D7-AAFD-AD74FF639CAD}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {1DB9EA1C-37A1-43E7-970A-B78020A9EE4C} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /HuntDMA/Aimbot/Aimbot.cpp: -------------------------------------------------------------------------------- 1 | #include "Pch.h" 2 | #include "Aimbot.h" 3 | #include "PlayerEsp.h" 4 | #include "Globals.h" 5 | #include "CheatFunction.h" 6 | #include "ConfigInstance.h" 7 | #include "WorldEntity.h" 8 | #include "ConfigUtilities.h" 9 | #include "Kmbox.h" 10 | #include "InputManager.h" 11 | #include "ESPRenderer.h" 12 | 13 | static Vector2 GetCenterOfScreen() 14 | { 15 | if (Configs.General.CrosshairLowerPosition) 16 | return Vector2(ESPRenderer::GetScreenWidth() * 0.5f, ESPRenderer::GetScreenHeight() * 0.6f); 17 | else 18 | return Vector2(ESPRenderer::GetScreenWidth() * 0.5f, ESPRenderer::GetScreenHeight() * 0.5f); 19 | } 20 | 21 | int ConditionalSwapPlayer(std::vector>& entities, int low, int high) 22 | { 23 | std::shared_ptr pivot = entities[high]; 24 | int i = low - 1; 25 | Vector2 Centerofscreen = GetCenterOfScreen(); 26 | for (int j = low; j < high; ++j) 27 | { 28 | if (Configs.Aimbot.Priority == 2) 29 | { 30 | if (Vector2::Distance(Centerofscreen, CameraInstance->WorldToScreen(entities[j]->GetPosition())) < Vector2::Distance(Centerofscreen, CameraInstance->WorldToScreen(pivot->GetPosition()))) 31 | { 32 | ++i; 33 | std::swap(entities[i], entities[j]); 34 | continue; 35 | } 36 | if (Vector3::Distance(CameraInstance->GetPosition(), entities[j]->GetPosition()) < Vector3::Distance(CameraInstance->GetPosition(), pivot->GetPosition())) 37 | { 38 | ++i; 39 | std::swap(entities[i], entities[j]); 40 | } 41 | } 42 | if (Configs.Aimbot.Priority == 0) 43 | { 44 | if (Vector3::Distance(CameraInstance->GetPosition(), entities[j]->GetPosition()) < Vector3::Distance(CameraInstance->GetPosition(), pivot->GetPosition())) 45 | { 46 | ++i; 47 | std::swap(entities[i], entities[j]); 48 | } 49 | } 50 | if (Configs.Aimbot.Priority == 1) 51 | { 52 | if (Vector2::Distance(Centerofscreen, CameraInstance->WorldToScreen(entities[j]->GetPosition())) < Vector2::Distance(Centerofscreen, CameraInstance->WorldToScreen(pivot->GetPosition()))) 53 | { 54 | ++i; 55 | std::swap(entities[i], entities[j]); 56 | } 57 | } 58 | } 59 | std::swap(entities[i + 1], entities[high]); 60 | return i + 1; 61 | } 62 | 63 | void QuickSortPlayers(std::vector>& entities, int low, int high) 64 | { 65 | if (low < high) 66 | { 67 | int pi = ConditionalSwapPlayer(entities, low, high); 68 | QuickSortPlayers(entities, low, pi - 1); 69 | QuickSortPlayers(entities, pi + 1, high); 70 | } 71 | } 72 | 73 | std::shared_ptr AimbotTarget; 74 | 75 | bool StickTarget() 76 | { 77 | Vector2 Centerofscreen = GetCenterOfScreen(); 78 | if (CameraInstance == nullptr) 79 | return false; 80 | if (EnvironmentInstance == nullptr) 81 | return false; 82 | if (AimbotTarget== nullptr) 83 | return false; 84 | if (!AimbotTarget->GetValid()) 85 | return false; 86 | if (Vector3::Distance(CameraInstance->GetPosition(), AimbotTarget->GetPosition()) > Configs.Aimbot.MaxDistance) 87 | return false; 88 | if (CameraInstance->WorldToScreen(AimbotTarget->GetPosition()) == Vector2::Zero()) 89 | return false; 90 | if (AimbotTarget->GetType() == EntityType::EnemyPlayer && !Configs.Aimbot.TargetPlayers) 91 | return false; 92 | if (Vector2::Distance(CameraInstance->WorldToScreen(AimbotTarget->GetPosition()), Centerofscreen) > Configs.Aimbot.FOV) 93 | return false; 94 | return true; 95 | } 96 | 97 | void GetAimbotTarget() 98 | { 99 | if (CameraInstance == nullptr) 100 | return; 101 | if (EnvironmentInstance == nullptr) 102 | return; 103 | if (!Configs.Aimbot.Enable) 104 | return; 105 | if(StickTarget()) 106 | return; 107 | Vector2 Centerofscreen = GetCenterOfScreen(); 108 | 109 | std::vector> templist; 110 | Vector3 localpos = CameraInstance->GetPosition(); 111 | templist = EnvironmentInstance->GetPlayerList(); 112 | if (templist.size() == 0) 113 | { 114 | return; 115 | } 116 | 117 | QuickSortPlayers(templist, 0, templist.size() - 1); 118 | 119 | for (std::shared_ptr player : templist) 120 | { 121 | if(player == nullptr) 122 | continue; 123 | if (!Configs.Aimbot.TargetPlayers) 124 | continue; 125 | if (!player->GetValid()) 126 | continue; 127 | if (player->GetType() == EntityType::FriendlyPlayer) 128 | continue; 129 | if (player->GetType() == EntityType::LocalPlayer) 130 | continue; 131 | if (Vector3::Distance(CameraInstance->GetPosition(), player->GetPosition()) > Configs.Aimbot.MaxDistance) 132 | continue; 133 | if (CameraInstance->WorldToScreen(player->GetPosition()) == Vector2::Zero()) 134 | continue; 135 | if (Vector2::Distance(CameraInstance->WorldToScreen(player->GetPosition()), Centerofscreen) >Configs.Aimbot.FOV) 136 | continue; 137 | AimbotTarget = player; 138 | return; 139 | } 140 | AimbotTarget = nullptr; 141 | } 142 | 143 | bool AimKeyDown = false; 144 | 145 | std::shared_ptr UpdateAimKey = std::make_shared(50, [] { 146 | if (EnvironmentInstance == nullptr) 147 | return; 148 | if (EnvironmentInstance->GetObjectCount() < 10) 149 | return; 150 | if (Keyboard::IsKeyDown(Configs.Aimbot.Aimkey)) 151 | { 152 | AimKeyDown = true; 153 | } 154 | else 155 | { 156 | AimKeyDown = false; 157 | } 158 | }); 159 | 160 | std::chrono::system_clock::time_point KmboxStart; 161 | 162 | void Aimbot() 163 | { 164 | UpdateAimKey->Execute(); 165 | if (!kmbox::connected || !AimKeyDown) 166 | { 167 | AimbotTarget = nullptr; 168 | return; 169 | } 170 | GetAimbotTarget(); 171 | if (AimbotTarget == nullptr) 172 | return; 173 | 174 | if (AimbotTarget->GetPosition() == Vector3::Zero()) 175 | { 176 | AimbotTarget = nullptr; 177 | return; 178 | } 179 | Vector2 screenpos = CameraInstance->WorldToScreen(AimbotTarget->GetPosition()); 180 | Vector2 Centerofscreen = GetCenterOfScreen(); 181 | if (Vector2::Distance(screenpos, Centerofscreen) > Configs.Aimbot.FOV) 182 | return; 183 | if (screenpos == Vector2::Zero()) 184 | { 185 | AimbotTarget = nullptr; 186 | return; 187 | } 188 | 189 | float x = screenpos.x - Centerofscreen.x; 190 | 191 | if (KmboxStart + std::chrono::milliseconds(55) < std::chrono::system_clock::now()) 192 | { 193 | kmbox::move(x,0); 194 | KmboxStart = std::chrono::system_clock::now(); 195 | } 196 | 197 | } -------------------------------------------------------------------------------- /HuntDMA/Aimbot/Aimbot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | void Aimbot(); -------------------------------------------------------------------------------- /HuntDMA/Config/AimbotConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class AimbotConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | AimbotConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool Enable = false; 13 | int MaxDistance = 250; 14 | bool TargetPlayers = false; 15 | int Priority = 0; 16 | int FOV = 200; 17 | int Aimkey = 5; 18 | bool DrawFOV = false; 19 | ImVec4 FOVColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); 20 | 21 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 22 | { 23 | (*j)[ConfigName][name][LIT("r")] = color->x; 24 | (*j)[ConfigName][name][LIT("g")] = color->y; 25 | (*j)[ConfigName][name][LIT("b")] = color->z; 26 | (*j)[ConfigName][name][LIT("a")] = color->w; 27 | } 28 | 29 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 30 | { 31 | if (j[ConfigName].contains(name)) 32 | { 33 | color->x = j[ConfigName][name][LIT("r")]; 34 | color->y = j[ConfigName][name][LIT("g")]; 35 | color->z = j[ConfigName][name][LIT("b")]; 36 | color->w = j[ConfigName][name][LIT("a")]; 37 | } 38 | } 39 | 40 | json ToJson() 41 | { 42 | json j; 43 | j[ConfigName][LIT("Enable")] = Enable; 44 | j[ConfigName][LIT("MaxDistance")] = MaxDistance; 45 | j[ConfigName][LIT("TargetPlayers")] = TargetPlayers; 46 | j[ConfigName][LIT("Priority")] = Priority; 47 | j[ConfigName][LIT("FOV")] = FOV; 48 | j[ConfigName][LIT("Aimkey")] = Aimkey; 49 | j[ConfigName][LIT("DrawFOV")] = DrawFOV; 50 | ToJsonColor(&j, LIT("FOVColor"), &FOVColor); 51 | 52 | 53 | 54 | return j; 55 | } 56 | void FromJson(const json& j) 57 | { 58 | if (!j.contains(ConfigName)) 59 | return; 60 | if (j[ConfigName].contains(LIT("Enable"))) 61 | Enable = j[ConfigName][LIT("Enable")]; 62 | if (j[ConfigName].contains(LIT("MaxDistance"))) 63 | MaxDistance = j[ConfigName][LIT("MaxDistance")]; 64 | if (j[ConfigName].contains(LIT("TargetPlayers"))) 65 | TargetPlayers = j[ConfigName][LIT("TargetPlayers")]; 66 | if (j[ConfigName].contains(LIT("Priority"))) 67 | Priority = j[ConfigName][LIT("Priority")]; 68 | if (j[ConfigName].contains(LIT("FOV"))) 69 | FOV = j[ConfigName][LIT("FOV")]; 70 | if (j[ConfigName].contains(LIT("Aimkey"))) 71 | Aimkey = j[ConfigName][LIT("Aimkey")]; 72 | if (j[ConfigName].contains(LIT("DrawFOV"))) 73 | DrawFOV = j[ConfigName][LIT("DrawFOV")]; 74 | FromJsonColor(j, LIT("FOVColor"), &FOVColor); 75 | } 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /HuntDMA/Config/BloodBondsConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class BloodBondsConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | BloodBondsConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool Enable = true; 13 | bool Name = true; 14 | bool Distance = true; 15 | int MaxDistance = 1500; 16 | ImVec4 TextColor = ImVec4(1.0f, 0.647058f, 0.0f, 1.0f); 17 | int FontSize = 16; 18 | 19 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 20 | { 21 | (*j)[ConfigName][name][LIT("r")] = color->x; 22 | (*j)[ConfigName][name][LIT("g")] = color->y; 23 | (*j)[ConfigName][name][LIT("b")] = color->z; 24 | (*j)[ConfigName][name][LIT("a")] = color->w; 25 | } 26 | 27 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 28 | { 29 | if (j[ConfigName].contains(name)) 30 | { 31 | color->x = j[ConfigName][name][LIT("r")]; 32 | color->y = j[ConfigName][name][LIT("g")]; 33 | color->z = j[ConfigName][name][LIT("b")]; 34 | color->w = j[ConfigName][name][LIT("a")]; 35 | } 36 | } 37 | 38 | json ToJson() 39 | { 40 | json j; 41 | j[ConfigName][LIT("Enable")] = Enable; 42 | j[ConfigName][LIT("Name")] = Name; 43 | j[ConfigName][LIT("Distance")] = Distance; 44 | j[ConfigName][LIT("MaxDistance")] = MaxDistance; 45 | j[ConfigName][LIT("FontSize")] = FontSize; 46 | ToJsonColor(&j, LIT("TextColor"), &TextColor); 47 | 48 | return j; 49 | } 50 | void FromJson(const json& j) 51 | { 52 | if (!j.contains(ConfigName)) 53 | return; 54 | if (j[ConfigName].contains(LIT("Enable"))) 55 | Enable = j[ConfigName][LIT("Enable")]; 56 | if (j[ConfigName].contains(LIT("Name"))) 57 | Name = j[ConfigName][LIT("Name")]; 58 | if (j[ConfigName].contains(LIT("Distance"))) 59 | Distance = j[ConfigName][LIT("Distance")]; 60 | if (j[ConfigName].contains(LIT("FontSize"))) 61 | FontSize = j[ConfigName][LIT("FontSize")]; 62 | if (j[ConfigName].contains(LIT("MaxDistance"))) 63 | MaxDistance = j[ConfigName][LIT("MaxDistance")]; 64 | FromJsonColor(j, LIT("TextColor"), &TextColor); 65 | } 66 | }; 67 | 68 | -------------------------------------------------------------------------------- /HuntDMA/Config/BossesConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class BossesConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | BossesConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool Enable = true; 13 | bool Name = true; 14 | bool Distance = true; 15 | int MaxDistance = 1500; 16 | ImVec4 TextColor = ImVec4(1.0f, 1.0f, 0.0f, 1.0f); 17 | int FontSize = 13; 18 | 19 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 20 | { 21 | (*j)[ConfigName][name][LIT("r")] = color->x; 22 | (*j)[ConfigName][name][LIT("g")] = color->y; 23 | (*j)[ConfigName][name][LIT("b")] = color->z; 24 | (*j)[ConfigName][name][LIT("a")] = color->w; 25 | } 26 | 27 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 28 | { 29 | if (j[ConfigName].contains(name)) 30 | { 31 | color->x = j[ConfigName][name][LIT("r")]; 32 | color->y = j[ConfigName][name][LIT("g")]; 33 | color->z = j[ConfigName][name][LIT("b")]; 34 | color->w = j[ConfigName][name][LIT("a")]; 35 | } 36 | } 37 | 38 | json ToJson() 39 | { 40 | json j; 41 | j[ConfigName][LIT("Enable")] = Enable; 42 | j[ConfigName][LIT("Name")] = Name; 43 | j[ConfigName][LIT("Distance")] = Distance; 44 | j[ConfigName][LIT("MaxDistance")] = MaxDistance; 45 | j[ConfigName][LIT("FontSize")] = FontSize; 46 | ToJsonColor(&j, LIT("TextColor"), &TextColor); 47 | 48 | return j; 49 | } 50 | void FromJson(const json& j) 51 | { 52 | if (!j.contains(ConfigName)) 53 | return; 54 | if (j[ConfigName].contains(LIT("Enable"))) 55 | Enable = j[ConfigName][LIT("Enable")]; 56 | if (j[ConfigName].contains(LIT("Name"))) 57 | Name = j[ConfigName][LIT("Name")]; 58 | if (j[ConfigName].contains(LIT("Distance"))) 59 | Distance = j[ConfigName][LIT("Distance")]; 60 | if (j[ConfigName].contains(LIT("FontSize"))) 61 | FontSize = j[ConfigName][LIT("FontSize")]; 62 | if (j[ConfigName].contains(LIT("MaxDistance"))) 63 | MaxDistance = j[ConfigName][LIT("MaxDistance")]; 64 | FromJsonColor(j, LIT("TextColor"), &TextColor); 65 | } 66 | }; 67 | 68 | -------------------------------------------------------------------------------- /HuntDMA/Config/ConfigInstance.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Pch.h" 3 | #include "PlayerConfig.h" 4 | #include "BossesConfig.h" 5 | #include "SupplyConfig.h" 6 | #include "BloodBondsConfig.h" 7 | #include "TrapConfig.h" 8 | #include "POIConfig.h" 9 | #include "OverlayConfig.h" 10 | #include "AimbotConfig.h" 11 | #include "GeneralConfig.h" 12 | #include "TraitConfig.h" 13 | class ConfigInstances 14 | { 15 | public: 16 | GeneralConfig General = GeneralConfig(LIT("General")); 17 | PlayerConfig Player = PlayerConfig(LIT("Player")); 18 | BossesConfig Bosses = BossesConfig(LIT("Bosses")); 19 | SupplyConfig Supply = SupplyConfig(LIT("Supply")); 20 | BloodBondsConfig BloodBonds = BloodBondsConfig(LIT("BloodBouds")); 21 | TrapConfig Trap = TrapConfig(LIT("Trap")); 22 | POIConfig POI = POIConfig(LIT("POI")); 23 | TraitConfig Traits = TraitConfig(LIT("Traits")); 24 | OverlayConfig Overlay = OverlayConfig(LIT("Overlay")); 25 | AimbotConfig Aimbot = AimbotConfig(LIT("Aimbot")); 26 | 27 | json ToJson() 28 | { 29 | json jsoned; 30 | jsoned.merge_patch(General.ToJson()); 31 | jsoned.merge_patch(Player.ToJson()); 32 | jsoned.merge_patch(Bosses.ToJson()); 33 | jsoned.merge_patch(Supply.ToJson()); 34 | jsoned.merge_patch(BloodBonds.ToJson()); 35 | jsoned.merge_patch(Trap.ToJson()); 36 | jsoned.merge_patch(POI.ToJson()); 37 | jsoned.merge_patch(Traits.ToJson()); 38 | jsoned.merge_patch(Overlay.ToJson()); 39 | jsoned.merge_patch(Aimbot.ToJson()); 40 | return jsoned; 41 | } 42 | 43 | void FromJson(json jsoned) 44 | { 45 | General.FromJson(jsoned); 46 | Player.FromJson(jsoned); 47 | Bosses.FromJson(jsoned); 48 | Supply.FromJson(jsoned); 49 | BloodBonds.FromJson(jsoned); 50 | Trap.FromJson(jsoned); 51 | POI.FromJson(jsoned); 52 | Traits.FromJson(jsoned); 53 | Overlay.FromJson(jsoned); 54 | Aimbot.FromJson(jsoned); 55 | } 56 | }; -------------------------------------------------------------------------------- /HuntDMA/Config/ConfigUtilities.cpp: -------------------------------------------------------------------------------- 1 | #include "Pch.h" 2 | #include "ConfigUtilities.h" 3 | #include "ConfigInstance.h" 4 | 5 | json Config; 6 | ConfigInstances Configs; 7 | std::filesystem::path DefaultConfigPath = std::filesystem::path(LIT("DefaultConfig.json")); 8 | std::filesystem::path ConfigPath = std::filesystem::path(LIT("Config.json")); 9 | 10 | void SetUpConfig() 11 | { 12 | SaveConfig(DefaultConfigPath); 13 | std::filesystem::exists(ConfigPath) ? LoadConfig(ConfigPath) : SaveConfig(ConfigPath); 14 | } 15 | void SaveConfig(const std::filesystem::path& filePath) 16 | { 17 | Config = json::array(); 18 | Config = Configs.ToJson(); 19 | std::string jsonstring = Config.dump() + "\n"; 20 | 21 | std::ofstream file(filePath); 22 | if (file.is_open()) { 23 | file << jsonstring; 24 | file.close(); 25 | } 26 | 27 | } 28 | 29 | void LoadConfig(const std::filesystem::path& filePath) 30 | { 31 | if (!std::filesystem::exists(filePath)) { 32 | return; 33 | } 34 | 35 | std::ifstream file(filePath); 36 | if (file.is_open()) { 37 | std::stringstream buffer; 38 | buffer << file.rdbuf(); 39 | std::string jsonstring = buffer.str(); 40 | 41 | if (json::accept(jsonstring)) { 42 | Config = json::parse(jsonstring); 43 | Configs.FromJson(Config); 44 | 45 | } 46 | file.close(); 47 | } 48 | } -------------------------------------------------------------------------------- /HuntDMA/Config/ConfigUtilities.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ConfigInstance.h" 3 | 4 | extern std::filesystem::path DefaultConfigPath; 5 | extern std::filesystem::path ConfigPath; 6 | extern ConfigInstances Configs; 7 | extern void SetUpConfig(); 8 | 9 | void SaveConfig(const std::filesystem::path& filePath); 10 | void LoadConfig(const std::filesystem::path& filePath); -------------------------------------------------------------------------------- /HuntDMA/Config/GeneralConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class GeneralConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | GeneralConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool OverrideResolution = false; 13 | int Width = (int)static_cast(GetSystemMetrics(SM_CXSCREEN)); 14 | int Height = (int)static_cast(GetSystemMetrics(SM_CYSCREEN)); 15 | bool OverlayMode = false; 16 | bool PreventRecording = false; 17 | bool CrosshairLowerPosition = false; 18 | float UIScale = (float)GetDpiForSystem() / (float)USER_DEFAULT_SCREEN_DPI; 19 | int OpenMenuKey = 36; 20 | bool CloseMenuOnEsc = true; 21 | std::string Language = "en"; 22 | 23 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 24 | { 25 | (*j)[ConfigName][name][LIT("r")] = color->x; 26 | (*j)[ConfigName][name][LIT("g")] = color->y; 27 | (*j)[ConfigName][name][LIT("b")] = color->z; 28 | (*j)[ConfigName][name][LIT("a")] = color->w; 29 | } 30 | 31 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 32 | { 33 | if (j[ConfigName].contains(name)) 34 | { 35 | color->x = j[ConfigName][name][LIT("r")]; 36 | color->y = j[ConfigName][name][LIT("g")]; 37 | color->z = j[ConfigName][name][LIT("b")]; 38 | color->w = j[ConfigName][name][LIT("a")]; 39 | } 40 | } 41 | 42 | json ToJson() 43 | { 44 | json j; 45 | j[ConfigName][LIT("OverrideResolution")] = OverrideResolution; 46 | j[ConfigName][LIT("Width")] = Width; 47 | j[ConfigName][LIT("Height")] = Height; 48 | j[ConfigName][LIT("OverlayMode")] = OverlayMode; 49 | j[ConfigName][LIT("PreventRecording")] = PreventRecording; 50 | j[ConfigName][LIT("CrosshairLowerPosition")] = CrosshairLowerPosition; 51 | j[ConfigName][LIT("UIScale")] = UIScale; 52 | j[ConfigName][LIT("OpenMenuKey")] = OpenMenuKey; 53 | j[ConfigName][LIT("CloseMenuOnEsc")] = CloseMenuOnEsc; 54 | j[ConfigName][LIT("Language")] = Language; 55 | 56 | return j; 57 | } 58 | 59 | void FromJson(const json& j) 60 | { 61 | if (!j.contains(ConfigName)) 62 | return; 63 | if (j[ConfigName].contains(LIT("OverrideResolution"))) 64 | OverrideResolution = j[ConfigName][LIT("OverrideResolution")]; 65 | if (j[ConfigName].contains(LIT("Width"))) 66 | Width = j[ConfigName][LIT("Width")]; 67 | if (j[ConfigName].contains(LIT("Height"))) 68 | Height = j[ConfigName][LIT("Height")]; 69 | if (j[ConfigName].contains(LIT("OverlayMode"))) 70 | OverlayMode = j[ConfigName][LIT("OverlayMode")]; 71 | if (j[ConfigName].contains(LIT("PreventRecording"))) 72 | PreventRecording = j[ConfigName][LIT("PreventRecording")]; 73 | if (j[ConfigName].contains(LIT("CrosshairLowerPosition"))) 74 | CrosshairLowerPosition = j[ConfigName][LIT("CrosshairLowerPosition")]; 75 | if (j[ConfigName].contains(LIT("UIScale"))) 76 | UIScale = j[ConfigName][LIT("UIScale")]; 77 | if (j[ConfigName].contains(LIT("OpenMenuKey"))) 78 | OpenMenuKey = j[ConfigName][LIT("OpenMenuKey")]; 79 | if (j[ConfigName].contains(LIT("CloseMenuOnEsc"))) 80 | CloseMenuOnEsc = j[ConfigName][LIT("CloseMenuOnEsc")]; 81 | if (j[ConfigName].contains(LIT("Language"))) 82 | Language = j[ConfigName][LIT("Language")]; 83 | } 84 | }; 85 | 86 | -------------------------------------------------------------------------------- /HuntDMA/Config/OverlayConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class OverlayConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | OverlayConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool DrawRadar = true; 13 | bool RadarDrawSelf = false; 14 | ImVec4 PlayerRadarColor = ImVec4(0.0f, 1.0f, 0.0f, 1.0f); 15 | ImVec4 EnemyRadarColor = ImVec4(1.0f, 0.0f, 0.0f, 1.0f); 16 | bool ShowFPS = true; 17 | int FpsFontSize = 17; 18 | ImVec4 FpsColor = ImVec4(0.564705f, 0.564705f, 0.564705f, 1.0f); 19 | bool ShowObjectCount = true; 20 | int ObjectCountFontSize = 15; 21 | ImVec4 ObjectCountColor = ImVec4(0.564705f, 0.564705f, 0.564705f, 1.0f); 22 | int CrosshairType = 1; 23 | int CrosshairSize = 2; 24 | ImVec4 CrosshairColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); 25 | 26 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 27 | { 28 | (*j)[ConfigName][name][LIT("r")] = color->x; 29 | (*j)[ConfigName][name][LIT("g")] = color->y; 30 | (*j)[ConfigName][name][LIT("b")] = color->z; 31 | (*j)[ConfigName][name][LIT("a")] = color->w; 32 | } 33 | 34 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 35 | { 36 | if (j[ConfigName].contains(name)) 37 | { 38 | color->x = j[ConfigName][name][LIT("r")]; 39 | color->y = j[ConfigName][name][LIT("g")]; 40 | color->z = j[ConfigName][name][LIT("b")]; 41 | color->w = j[ConfigName][name][LIT("a")]; 42 | } 43 | } 44 | 45 | json ToJson() 46 | { 47 | json j; 48 | j[ConfigName][LIT("DrawRadar")] = DrawRadar; 49 | j[ConfigName][LIT("RadarDrawSelf")] = RadarDrawSelf; 50 | j[ConfigName][LIT("ShowFPS")] = ShowFPS; 51 | j[ConfigName][LIT("FpsFontSize")] = FpsFontSize; 52 | j[ConfigName][LIT("ShowObjectCount")] = ShowObjectCount; 53 | j[ConfigName][LIT("ObjectCountFontSize")] = ObjectCountFontSize; 54 | j[ConfigName][LIT("CrosshairType")] = CrosshairType; 55 | j[ConfigName][LIT("CrosshairSize")] = CrosshairSize; 56 | ToJsonColor(&j, LIT("PlayerRadarColor"), &PlayerRadarColor); 57 | ToJsonColor(&j, LIT("EnemyRadarColor"), &EnemyRadarColor); 58 | ToJsonColor(&j, LIT("CrosshairColor"), &CrosshairColor); 59 | ToJsonColor(&j, LIT("FpsColor"), &FpsColor); 60 | ToJsonColor(&j, LIT("ObjectCountColor"), &ObjectCountColor); 61 | 62 | return j; 63 | } 64 | 65 | void FromJson(const json& j) 66 | { 67 | if (!j.contains(ConfigName)) 68 | return; 69 | if (j[ConfigName].contains(LIT("DrawRadar"))) 70 | DrawRadar = j[ConfigName][LIT("DrawRadar")]; 71 | if (j[ConfigName].contains(LIT("RadarDrawSelf"))) 72 | RadarDrawSelf = j[ConfigName][LIT("RadarDrawSelf")]; 73 | if (j[ConfigName].contains(LIT("ShowFPS"))) 74 | ShowFPS = j[ConfigName][LIT("ShowFPS")]; 75 | if (j[ConfigName].contains(LIT("FpsFontSize"))) 76 | FpsFontSize = j[ConfigName][LIT("FpsFontSize")]; 77 | if (j[ConfigName].contains(LIT("ShowObjectCount"))) 78 | ShowObjectCount = j[ConfigName][LIT("ShowObjectCount")]; 79 | if (j[ConfigName].contains(LIT("ObjectCountFontSize"))) 80 | ObjectCountFontSize = j[ConfigName][LIT("ObjectCountFontSize")]; 81 | if (j[ConfigName].contains(LIT("CrosshairType"))) 82 | CrosshairType = j[ConfigName][LIT("CrosshairType")]; 83 | if (j[ConfigName].contains(LIT("CrosshairSize"))) 84 | CrosshairSize = j[ConfigName][LIT("CrosshairSize")]; 85 | FromJsonColor(j, LIT("PlayerRadarColor"), &PlayerRadarColor); 86 | FromJsonColor(j, LIT("EnemyRadarColor"), &EnemyRadarColor); 87 | FromJsonColor(j, LIT("CrosshairColor"), &CrosshairColor); 88 | FromJsonColor(j, LIT("FpsColor"), &FpsColor); 89 | FromJsonColor(j, LIT("ObjectCountColor"), &ObjectCountColor); 90 | } 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /HuntDMA/Config/POIConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class POIConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | POIConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool Enable = true; 13 | bool Name = true; 14 | bool Distance = true; 15 | int MaxDistance = 900; 16 | bool ShowResupplyStation = true; 17 | bool ShowExtraction = true; 18 | bool ShowCashRegisters = false; 19 | bool ShowPouches = false; 20 | bool ShowPosters = false; 21 | bool ShowBlueprints = false; 22 | bool ShowGunOil = false; 23 | bool ShowClues = false; 24 | bool ShowSeasonalDestructibles = false; 25 | ImVec4 TextColor = ImVec4(0.0f, 1.0f, 0.866666f, 1.0f); 26 | int FontSize = 12; 27 | 28 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 29 | { 30 | (*j)[ConfigName][name][LIT("r")] = color->x; 31 | (*j)[ConfigName][name][LIT("g")] = color->y; 32 | (*j)[ConfigName][name][LIT("b")] = color->z; 33 | (*j)[ConfigName][name][LIT("a")] = color->w; 34 | } 35 | 36 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 37 | { 38 | if (j[ConfigName].contains(name)) 39 | { 40 | color->x = j[ConfigName][name][LIT("r")]; 41 | color->y = j[ConfigName][name][LIT("g")]; 42 | color->z = j[ConfigName][name][LIT("b")]; 43 | color->w = j[ConfigName][name][LIT("a")]; 44 | } 45 | } 46 | 47 | json ToJson() 48 | { 49 | json j; 50 | j[ConfigName][LIT("Enable")] = Enable; 51 | j[ConfigName][LIT("Name")] = Name; 52 | j[ConfigName][LIT("Distance")] = Distance; 53 | j[ConfigName][LIT("MaxDistance")] = MaxDistance; 54 | j[ConfigName][LIT("FontSize")] = FontSize; 55 | j[ConfigName][LIT("ShowResupplyStation")] = ShowResupplyStation; 56 | j[ConfigName][LIT("ShowExtraction")] = ShowExtraction; 57 | j[ConfigName][LIT("ShowCashRegisters")] = ShowCashRegisters; 58 | j[ConfigName][LIT("ShowPouches")] = ShowPouches; 59 | j[ConfigName][LIT("ShowPosters")] = ShowPosters; 60 | j[ConfigName][LIT("ShowBlueprints")] = ShowBlueprints; 61 | j[ConfigName][LIT("ShowGunOil")] = ShowGunOil; 62 | j[ConfigName][LIT("ShowClues")] = ShowClues; 63 | j[ConfigName][LIT("ShowSeasonalDestructibles")] = ShowSeasonalDestructibles; 64 | ToJsonColor(&j, LIT("TextColor"), &TextColor); 65 | 66 | return j; 67 | } 68 | void FromJson(const json& j) 69 | { 70 | if (!j.contains(ConfigName)) 71 | return; 72 | if (j[ConfigName].contains(LIT("Enable"))) 73 | Enable = j[ConfigName][LIT("Enable")]; 74 | if (j[ConfigName].contains(LIT("Name"))) 75 | Name = j[ConfigName][LIT("Name")]; 76 | if (j[ConfigName].contains(LIT("Distance"))) 77 | Distance = j[ConfigName][LIT("Distance")]; 78 | if (j[ConfigName].contains(LIT("FontSize"))) 79 | FontSize = j[ConfigName][LIT("FontSize")]; 80 | if (j[ConfigName].contains(LIT("MaxDistance"))) 81 | MaxDistance = j[ConfigName][LIT("MaxDistance")]; 82 | if (j[ConfigName].contains(LIT("ShowResupplyStation"))) 83 | ShowResupplyStation = j[ConfigName][LIT("ShowResupplyStation")]; 84 | if (j[ConfigName].contains(LIT("ShowExtraction"))) 85 | ShowExtraction = j[ConfigName][LIT("ShowExtraction")]; 86 | if (j[ConfigName].contains(LIT("ShowCashRegisters"))) 87 | ShowCashRegisters = j[ConfigName][LIT("ShowCashRegisters")]; 88 | if (j[ConfigName].contains(LIT("ShowPouches"))) 89 | ShowPouches = j[ConfigName][LIT("ShowPouches")]; 90 | if (j[ConfigName].contains(LIT("ShowPosters"))) 91 | ShowPosters = j[ConfigName][LIT("ShowPosters")]; 92 | if (j[ConfigName].contains(LIT("ShowBlueprints"))) 93 | ShowBlueprints = j[ConfigName][LIT("ShowBlueprints")]; 94 | if (j[ConfigName].contains(LIT("ShowGunOil"))) 95 | ShowGunOil = j[ConfigName][LIT("ShowGunOil")]; 96 | if (j[ConfigName].contains(LIT("ShowClues"))) 97 | ShowClues = j[ConfigName][LIT("ShowClues")]; 98 | if (j[ConfigName].contains(LIT("ShowSeasonalDestructibles"))) 99 | ShowSeasonalDestructibles = j[ConfigName][LIT("ShowSeasonalDestructibles")]; 100 | FromJsonColor(j, LIT("TextColor"), &TextColor); 101 | } 102 | }; 103 | 104 | -------------------------------------------------------------------------------- /HuntDMA/Config/PlayerConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class PlayerConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | PlayerConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool Enable = true; 13 | bool Name = true; 14 | bool Distance = true; 15 | int MaxDistance = 1500; 16 | int DeadMaxDistance = 500; 17 | ImVec4 TextColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); 18 | int FontSize = 13; 19 | bool Chams = false; 20 | int ChamMode = 5; 21 | bool HP = true; 22 | bool DrawFriendsHP = false; 23 | bool ShowDead = false; 24 | bool DrawFrames = true; 25 | bool DrawHeadInFrames = true; 26 | bool DrawHealthBars = true; 27 | ImVec4 FramesColor = ImVec4(0.988235f, 0.949019f, 0.019607f, 1.0f); 28 | ImVec4 FriendColor = ImVec4(0.0f, 1.0f, 0.0f, 1.0f); 29 | bool ShowPlayerList = true; 30 | int PlayerListFontSize = 15; 31 | ImVec4 PlayerListColor = ImVec4(0.807843f, 0.807843f, 0.807843f, 1.0f); 32 | 33 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 34 | { 35 | (*j)[ConfigName][name][LIT("r")] = color->x; 36 | (*j)[ConfigName][name][LIT("g")] = color->y; 37 | (*j)[ConfigName][name][LIT("b")] = color->z; 38 | (*j)[ConfigName][name][LIT("a")] = color->w; 39 | } 40 | 41 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 42 | { 43 | if (j[ConfigName].contains(name)) 44 | { 45 | color->x = j[ConfigName][name][LIT("r")]; 46 | color->y = j[ConfigName][name][LIT("g")]; 47 | color->z = j[ConfigName][name][LIT("b")]; 48 | color->w = j[ConfigName][name][LIT("a")]; 49 | } 50 | } 51 | 52 | json ToJson() 53 | { 54 | json j; 55 | j[ConfigName][LIT("Enable")] = Enable; 56 | j[ConfigName][LIT("Name")] = Name; 57 | j[ConfigName][LIT("Distance")] = Distance; 58 | j[ConfigName][LIT("MaxDistance")] = MaxDistance; 59 | j[ConfigName][LIT("DeadMaxDistance")] = DeadMaxDistance; 60 | j[ConfigName][LIT("FontSize")] = FontSize; 61 | j[ConfigName][LIT("Chams")] = Chams; 62 | j[ConfigName][LIT("ChamMode")] = ChamMode; 63 | j[ConfigName][LIT("HP")] = HP; 64 | j[ConfigName][LIT("DrawFriends")] = DrawFriendsHP; 65 | j[ConfigName][LIT("ShowDead")] = ShowDead; 66 | j[ConfigName][LIT("DrawFrames")] = DrawFrames; 67 | j[ConfigName][LIT("DrawHeadInFrames")] = DrawHeadInFrames; 68 | j[ConfigName][LIT("DrawHealthBars")] = DrawHealthBars; 69 | j[ConfigName][LIT("ShowPlayerList")] = ShowPlayerList; 70 | j[ConfigName][LIT("PlayerListFontSize")] = PlayerListFontSize; 71 | ToJsonColor(&j, LIT("TextColor"), &TextColor); 72 | ToJsonColor(&j, LIT("FramesColor"), &FramesColor); 73 | ToJsonColor(&j, LIT("FriendColor"), &FriendColor); 74 | ToJsonColor(&j, LIT("PlayerListColor"), &PlayerListColor); 75 | 76 | return j; 77 | } 78 | void FromJson(const json& j) 79 | { 80 | if (!j.contains(ConfigName)) 81 | return; 82 | if (j[ConfigName].contains(LIT("Enable"))) 83 | Enable = j[ConfigName][LIT("Enable")]; 84 | if (j[ConfigName].contains(LIT("Name"))) 85 | Name = j[ConfigName][LIT("Name")]; 86 | if (j[ConfigName].contains(LIT("Distance"))) 87 | Distance = j[ConfigName][LIT("Distance")]; 88 | if (j[ConfigName].contains(LIT("FontSize"))) 89 | FontSize = j[ConfigName][LIT("FontSize")]; 90 | if (j[ConfigName].contains(LIT("MaxDistance"))) 91 | MaxDistance = j[ConfigName][LIT("MaxDistance")]; 92 | if (j[ConfigName].contains(LIT("DeadMaxDistance"))) 93 | DeadMaxDistance = j[ConfigName][LIT("DeadMaxDistance")]; 94 | if (j[ConfigName].contains(LIT("DrawFrames"))) 95 | DrawFrames = j[ConfigName][LIT("DrawFrames")]; 96 | if (j[ConfigName].contains(LIT("Chams"))) 97 | Chams = j[ConfigName][LIT("Chams")]; 98 | if (j[ConfigName].contains(LIT("ChamMode"))) 99 | ChamMode = j[ConfigName][LIT("ChamMode")]; 100 | if (j[ConfigName].contains(LIT("HP"))) 101 | HP = j[ConfigName][LIT("HP")]; 102 | if (j[ConfigName].contains(LIT("DrawFriends"))) 103 | DrawFriendsHP = j[ConfigName][LIT("DrawFriends")]; 104 | if (j[ConfigName].contains(LIT("ShowDead"))) 105 | ShowDead = j[ConfigName][LIT("ShowDead")]; 106 | if (j[ConfigName].contains(LIT("DrawHeadInFrames"))) 107 | DrawHeadInFrames = j[ConfigName][LIT("DrawHeadInFrames")]; 108 | if (j[ConfigName].contains(LIT("DrawHealthBars"))) 109 | DrawHealthBars = j[ConfigName][LIT("DrawHealthBars")]; 110 | if (j[ConfigName].contains(LIT("ShowPlayerList"))) 111 | ShowPlayerList = j[ConfigName][LIT("ShowPlayerList")]; 112 | if (j[ConfigName].contains(LIT("PlayerListFontSize"))) 113 | PlayerListFontSize = j[ConfigName][LIT("PlayerListFontSize")]; 114 | FromJsonColor(j, LIT("FriendColor"), &FriendColor); 115 | FromJsonColor(j, LIT("FramesColor"), &FramesColor); 116 | FromJsonColor(j, LIT("TextColor"), &TextColor); 117 | FromJsonColor(j, LIT("PlayerListColor"), &PlayerListColor); 118 | } 119 | }; 120 | 121 | -------------------------------------------------------------------------------- /HuntDMA/Config/SupplyConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class SupplyConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | SupplyConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool Enable = true; 13 | bool Name = true; 14 | bool Distance = true; 15 | bool ShowAmmoSwapBox = false; 16 | bool ShowCompactAmmo = false; 17 | bool ShowMediumAmmo = false; 18 | bool ShowLongAmmo = false; 19 | bool ShowShortgunAmmo = false; 20 | bool ShowSpecialAmmo = false; 21 | bool ShowMedkit = false; 22 | bool ShowSupplyBox = false; 23 | int MaxDistance = 100; 24 | ImVec4 TextColor = ImVec4(0.0f, 1.0f, 0.0f, 1.0f); 25 | int FontSize = 12; 26 | 27 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 28 | { 29 | (*j)[ConfigName][name][LIT("r")] = color->x; 30 | (*j)[ConfigName][name][LIT("g")] = color->y; 31 | (*j)[ConfigName][name][LIT("b")] = color->z; 32 | (*j)[ConfigName][name][LIT("a")] = color->w; 33 | } 34 | 35 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 36 | { 37 | if (j[ConfigName].contains(name)) 38 | { 39 | color->x = j[ConfigName][name][LIT("r")]; 40 | color->y = j[ConfigName][name][LIT("g")]; 41 | color->z = j[ConfigName][name][LIT("b")]; 42 | color->w = j[ConfigName][name][LIT("a")]; 43 | } 44 | } 45 | 46 | json ToJson() 47 | { 48 | json j; 49 | j[ConfigName][LIT("Enable")] = Enable; 50 | j[ConfigName][LIT("Name")] = Name; 51 | j[ConfigName][LIT("Distance")] = Distance; 52 | j[ConfigName][LIT("ShowAmmoSwapBox")] = ShowAmmoSwapBox; 53 | j[ConfigName][LIT("ShowCompactAmmo")] = ShowCompactAmmo; 54 | j[ConfigName][LIT("ShowMediumAmmo")] = ShowMediumAmmo; 55 | j[ConfigName][LIT("ShowLongAmmo")] = ShowLongAmmo; 56 | j[ConfigName][LIT("ShowShortgunAmmo")] = ShowShortgunAmmo; 57 | j[ConfigName][LIT("ShowSpecialAmmo")] = ShowSpecialAmmo; 58 | j[ConfigName][LIT("ShowMedkit")] = ShowMedkit; 59 | j[ConfigName][LIT("ShowSupplyBox")] = ShowSupplyBox; 60 | j[ConfigName][LIT("MaxDistance")] = MaxDistance; 61 | j[ConfigName][LIT("FontSize")] = FontSize; 62 | ToJsonColor(&j, LIT("TextColor"), &TextColor); 63 | 64 | return j; 65 | } 66 | void FromJson(const json& j) 67 | { 68 | if (!j.contains(ConfigName)) 69 | return; 70 | if (j[ConfigName].contains(LIT("Enable"))) 71 | Enable = j[ConfigName][LIT("Enable")]; 72 | if (j[ConfigName].contains(LIT("Name"))) 73 | Name = j[ConfigName][LIT("Name")]; 74 | if (j[ConfigName].contains(LIT("Distance"))) 75 | Distance = j[ConfigName][LIT("Distance")]; 76 | if (j[ConfigName].contains(LIT("ShowAmmoSwapBox"))) 77 | ShowAmmoSwapBox = j[ConfigName][LIT("ShowAmmoSwapBox")]; 78 | if (j[ConfigName].contains(LIT("ShowCompactAmmo"))) 79 | ShowCompactAmmo = j[ConfigName][LIT("ShowCompactAmmo")]; 80 | if (j[ConfigName].contains(LIT("ShowMediumAmmo"))) 81 | ShowMediumAmmo = j[ConfigName][LIT("ShowMediumAmmo")]; 82 | if (j[ConfigName].contains(LIT("ShowLongAmmo"))) 83 | ShowLongAmmo = j[ConfigName][LIT("ShowLongAmmo")]; 84 | if (j[ConfigName].contains(LIT("ShowShortgunAmmo"))) 85 | ShowShortgunAmmo = j[ConfigName][LIT("ShowShortgunAmmo")]; 86 | if (j[ConfigName].contains(LIT("ShowSpecialAmmo"))) 87 | ShowSpecialAmmo = j[ConfigName][LIT("ShowSpecialAmmo")]; 88 | if (j[ConfigName].contains(LIT("ShowMedkit"))) 89 | ShowMedkit = j[ConfigName][LIT("ShowMedkit")]; 90 | if (j[ConfigName].contains(LIT("ShowSupplyBox"))) 91 | ShowSupplyBox = j[ConfigName][LIT("ShowSupplyBox")]; 92 | if (j[ConfigName].contains(LIT("FontSize"))) 93 | FontSize = j[ConfigName][LIT("FontSize")]; 94 | if (j[ConfigName].contains(LIT("MaxDistance"))) 95 | MaxDistance = j[ConfigName][LIT("MaxDistance")]; 96 | FromJsonColor(j, LIT("TextColor"), &TextColor); 97 | } 98 | }; 99 | 100 | -------------------------------------------------------------------------------- /HuntDMA/Config/TrapConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | class TrapConfig 4 | { 5 | std::string ConfigName; 6 | 7 | public: 8 | TrapConfig(const std::string& name) 9 | { 10 | ConfigName = name; 11 | } 12 | bool Enable = true; 13 | bool Name = true; 14 | bool Distance = true; 15 | int MaxDistance = 75; 16 | bool ShowBeartrap = true; 17 | bool ShowTripmines = true; 18 | bool ShowDarksightDynamite = true; 19 | bool ShowGunpowderBurrels = false; 20 | bool ShowOilBurrels = false; 21 | bool ShowBioBurrels = false; 22 | ImVec4 TrapColor = ImVec4(1.0f, 0.0f, 0.0f, 1.0f); 23 | ImVec4 BarrelColor = ImVec4(0.960784f, 0.235294f, 0.0f, 1.0f); 24 | int FontSize = 13; 25 | 26 | void ToJsonColor(json* j, const std::string& name, ImVec4* color) 27 | { 28 | (*j)[ConfigName][name][LIT("r")] = color->x; 29 | (*j)[ConfigName][name][LIT("g")] = color->y; 30 | (*j)[ConfigName][name][LIT("b")] = color->z; 31 | (*j)[ConfigName][name][LIT("a")] = color->w; 32 | } 33 | 34 | void FromJsonColor(json j, const std::string& name, ImVec4* color) 35 | { 36 | if (j[ConfigName].contains(name)) 37 | { 38 | color->x = j[ConfigName][name][LIT("r")]; 39 | color->y = j[ConfigName][name][LIT("g")]; 40 | color->z = j[ConfigName][name][LIT("b")]; 41 | color->w = j[ConfigName][name][LIT("a")]; 42 | } 43 | } 44 | 45 | json ToJson() 46 | { 47 | json j; 48 | j[ConfigName][LIT("Enable")] = Enable; 49 | j[ConfigName][LIT("Name")] = Name; 50 | j[ConfigName][LIT("Distance")] = Distance; 51 | j[ConfigName][LIT("MaxDistance")] = MaxDistance; 52 | j[ConfigName][LIT("FontSize")] = FontSize; 53 | j[ConfigName][LIT("ShowBeartrap")] = ShowBeartrap; 54 | j[ConfigName][LIT("ShowTripmines")] = ShowTripmines; 55 | j[ConfigName][LIT("ShowDarksightDynamite")] = ShowDarksightDynamite; 56 | j[ConfigName][LIT("ShowGunpowderBurrels")] = ShowGunpowderBurrels; 57 | j[ConfigName][LIT("ShowOilBurrels")] = ShowOilBurrels; 58 | j[ConfigName][LIT("ShowBioBurrels")] = ShowBioBurrels; 59 | ToJsonColor(&j, LIT("TrapColor"), &TrapColor); 60 | ToJsonColor(&j, LIT("BarrelColor"), &BarrelColor); 61 | 62 | return j; 63 | } 64 | void FromJson(const json& j) 65 | { 66 | if (!j.contains(ConfigName)) 67 | return; 68 | if (j[ConfigName].contains(LIT("Enable"))) 69 | Enable = j[ConfigName][LIT("Enable")]; 70 | if (j[ConfigName].contains(LIT("Name"))) 71 | Name = j[ConfigName][LIT("Name")]; 72 | if (j[ConfigName].contains(LIT("Distance"))) 73 | Distance = j[ConfigName][LIT("Distance")]; 74 | if (j[ConfigName].contains(LIT("FontSize"))) 75 | FontSize = j[ConfigName][LIT("FontSize")]; 76 | if (j[ConfigName].contains(LIT("MaxDistance"))) 77 | MaxDistance = j[ConfigName][LIT("MaxDistance")]; 78 | if (j[ConfigName].contains(LIT("ShowBeartrap"))) 79 | ShowBeartrap = j[ConfigName][LIT("ShowBeartrap")]; 80 | if (j[ConfigName].contains(LIT("ShowTripmines"))) 81 | ShowTripmines = j[ConfigName][LIT("ShowTripmines")]; 82 | if (j[ConfigName].contains(LIT("ShowDarksightDynamite"))) 83 | ShowDarksightDynamite = j[ConfigName][LIT("ShowDarksightDynamite")]; 84 | if (j[ConfigName].contains(LIT("ShowGunpowderBurrels"))) 85 | ShowGunpowderBurrels = j[ConfigName][LIT("ShowGunpowderBurrels")]; 86 | if (j[ConfigName].contains(LIT("ShowOilBurrels"))) 87 | ShowOilBurrels = j[ConfigName][LIT("ShowOilBurrels")]; 88 | if (j[ConfigName].contains(LIT("ShowBioBurrels"))) 89 | ShowBioBurrels = j[ConfigName][LIT("ShowBioBurrels")]; 90 | FromJsonColor(j, LIT("TrapColor"), &TrapColor); 91 | FromJsonColor(j, LIT("BarrelColor"), &BarrelColor); 92 | } 93 | }; 94 | 95 | -------------------------------------------------------------------------------- /HuntDMA/Esp/OtherEsp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | extern void DrawOtherEsp(); -------------------------------------------------------------------------------- /HuntDMA/Esp/Overlay.cpp: -------------------------------------------------------------------------------- 1 | #include "Pch.h" 2 | #include "globals.h" 3 | #include "ConfigInstance.h" 4 | #include "ConfigUtilities.h" 5 | #include "Init.h" 6 | #include "PlayerEsp.h" 7 | #include "ESPRenderer.h" 8 | #include "Localization/Localization.h" 9 | #include "ImGuiMenu.h" 10 | #include 11 | 12 | static void DrawFPS() 13 | { 14 | ESPRenderer::DrawText( 15 | ImVec2(25, 25), 16 | "Overlay FPS: " + std::to_string(FrameRate()), 17 | Configs.Overlay.FpsColor, 18 | Configs.Overlay.FpsFontSize 19 | ); 20 | } 21 | 22 | static void DrawObjectCount() 23 | { 24 | ESPRenderer::DrawText( 25 | ImVec2(25, 25 + Configs.Overlay.FpsFontSize), 26 | "Objects: " + std::to_string(EnvironmentInstance->GetObjectCount()), 27 | Configs.Overlay.ObjectCountColor, 28 | Configs.Overlay.ObjectCountFontSize 29 | ); 30 | } 31 | 32 | static void DrawPlayerList() 33 | { 34 | int y = ESPRenderer::GetScreenHeight() / 2; 35 | 36 | std::vector> templist = EnvironmentInstance->GetPlayerList(); 37 | 38 | if (templist.empty()) 39 | return; 40 | 41 | std::vector> playerInfoList; 42 | 43 | for (std::shared_ptr ent : templist) 44 | { 45 | if (!ent || ent->GetType() == EntityType::FriendlyPlayer) 46 | continue; 47 | 48 | int distance = (int)Vector3::Distance(ent->GetPosition(), CameraInstance->GetPosition()); 49 | if (ent->GetType() == EntityType::LocalPlayer || !ent->GetValid() || ent->IsHidden()) 50 | continue; 51 | 52 | if (!IsValidHP(ent->GetHealth().current_hp) || 53 | !IsValidHP(ent->GetHealth().current_max_hp) || 54 | !IsValidHP(ent->GetHealth().regenerable_max_hp)) 55 | continue; 56 | 57 | std::string wname = Configs.Player.Name ? LOC("entity", ent->GetTypeAsString()) : ""; 58 | std::string wdistance = Configs.Player.Distance ? "[" + std::to_string(distance) + "m]" : ""; 59 | std::string whealth = std::to_string(ent->GetHealth().current_hp) + "/" + std::to_string(ent->GetHealth().current_max_hp) + "[" + std::to_string(ent->GetHealth().regenerable_max_hp) + "]"; 60 | 61 | std::string playerInfo = wname + " " + whealth + " " + wdistance; 62 | 63 | playerInfoList.push_back({ distance, playerInfo }); 64 | } 65 | 66 | std::sort(playerInfoList.begin(), playerInfoList.end(), [](const auto& a, const auto& b) { 67 | return a.first < b.first; 68 | }); 69 | 70 | std::stringstream result; 71 | result << "[" + std::to_string(playerInfoList.size()) + "]\n"; 72 | for (size_t i = 0; i < playerInfoList.size(); ++i) 73 | { 74 | result << playerInfoList[i].second; 75 | if (i != playerInfoList.size() - 1) 76 | result << "\n"; 77 | } 78 | 79 | ESPRenderer::DrawText( 80 | ImVec2(25, y), 81 | result.str(), 82 | Configs.Player.PlayerListColor, 83 | Configs.Player.PlayerListFontSize, 84 | MiddleLeft 85 | ); 86 | } 87 | 88 | static ImVec2 GetCrosshairPosition() 89 | { 90 | if (Configs.General.CrosshairLowerPosition) 91 | return ImVec2(ESPRenderer::GetScreenWidth() * 0.5f, ESPRenderer::GetScreenHeight() * 0.6f); 92 | else 93 | return ImVec2(ESPRenderer::GetScreenWidth() * 0.5f, ESPRenderer::GetScreenHeight() * 0.5f); 94 | } 95 | 96 | static void DrawCrosshair() 97 | { 98 | ImVec2 center = GetCrosshairPosition(); 99 | 100 | if (Configs.Overlay.CrosshairType == 1) 101 | { 102 | ESPRenderer::DrawCircle( 103 | center, 104 | Configs.Overlay.CrosshairSize, 105 | Configs.Overlay.CrosshairColor, 106 | 1, 107 | true 108 | ); 109 | } 110 | if (Configs.Overlay.CrosshairType == 2) 111 | { 112 | ESPRenderer::DrawCircle( 113 | center, 114 | Configs.Overlay.CrosshairSize, 115 | Configs.Overlay.CrosshairColor, 116 | 1, 117 | false 118 | ); 119 | } 120 | if (Configs.Overlay.CrosshairType == 3) 121 | { 122 | ESPRenderer::DrawRect( 123 | ImVec2(center.x - (Configs.Overlay.CrosshairSize * 0.5f), center.y - (Configs.Overlay.CrosshairSize * 0.5f)), 124 | ImVec2(center.x + (Configs.Overlay.CrosshairSize * 0.5f), center.y + (Configs.Overlay.CrosshairSize * 0.5f)), 125 | Configs.Overlay.CrosshairColor, 126 | 1, 127 | true 128 | ); 129 | } 130 | if (Configs.Overlay.CrosshairType == 4) 131 | { 132 | ESPRenderer::DrawRect( 133 | ImVec2(center.x - (Configs.Overlay.CrosshairSize / 2), center.y - (Configs.Overlay.CrosshairSize / 2)), 134 | ImVec2(center.x + (Configs.Overlay.CrosshairSize / 2), center.y + (Configs.Overlay.CrosshairSize / 2)), 135 | Configs.Overlay.CrosshairColor, 136 | 1, 137 | false 138 | ); 139 | } 140 | } 141 | 142 | static void DrawAimbotFOV() 143 | { 144 | ImVec2 center = GetCrosshairPosition(); 145 | 146 | ESPRenderer::DrawCircle( 147 | center, 148 | Configs.Aimbot.FOV, 149 | Configs.Aimbot.FOVColor, 150 | 2, 151 | false 152 | ); 153 | } 154 | 155 | void DrawRadar() 156 | { 157 | //RYANS RADAR 158 | 159 | //MAP BOUNDS FOR DEBUGGING 1024X1024 IS CENTER SO MAP IS 2048X2048 160 | //BOTTOM RIGHT VOID IS 0,0 161 | //BOTTOM RIGHT MAP IS 512,512 162 | 163 | std::vector> tempPlayerList = EnvironmentInstance->GetPlayerList(); 164 | 165 | std::shared_ptr LocalPlayer = NULL; 166 | for (size_t index = 0; index < tempPlayerList.size(); ++index) 167 | { 168 | std::shared_ptr ent = tempPlayerList[index]; 169 | if (ent == nullptr) 170 | continue; 171 | if (ent->GetType() == EntityType::LocalPlayer) 172 | { 173 | LocalPlayer = ent; 174 | break; 175 | } 176 | } 177 | 178 | if (LocalPlayer == NULL) 179 | return; 180 | 181 | if (Configs.Overlay.DrawRadar) { 182 | if (ImGuiUtils::IsKeyPressed(VK_TAB)) { 183 | 184 | // Screen dimensions 185 | float screenWidth; 186 | float screenHeight; 187 | 188 | if (Configs.General.OverrideResolution) { 189 | screenWidth = static_cast(Configs.General.Width); 190 | screenHeight = static_cast(Configs.General.Height); 191 | } 192 | else { 193 | screenWidth = static_cast(GetSystemMetrics(SM_CXSCREEN)); 194 | screenHeight = static_cast(GetSystemMetrics(SM_CYSCREEN)); 195 | } 196 | 197 | // MiniMap Size 198 | float MapSizeMagicalNumber = 0.6493056f; 199 | float MapSize = MapSizeMagicalNumber * screenHeight; 200 | 201 | // Radar center on the screen 202 | float mapCenterX = screenWidth / 2.0f; 203 | float mapCenterY = screenHeight / 2.0f; 204 | 205 | // World Bounds 206 | float worldMinX = 512.0f, worldMaxX = 1535.0f; 207 | float worldMinY = 512.0f, worldMaxY = 1535.0f; 208 | 209 | // Offset for map 210 | float horizontaloffset = (screenWidth * 0.001171875) * -1.0; //This gets the offset through screenspace of the monitor and * -1 to get negative offset using standard 16:9 211 | float verticaloffset = screenHeight * 0.0090277; //This gets the offset through screenspace height using standard 16:9 aspect ratio 212 | 213 | // Draw MiniMap Background (Rectangle Outline) 214 | ESPRenderer::DrawRect( 215 | ImVec2(mapCenterX - MapSize / 2 + horizontaloffset, mapCenterY - MapSize / 2 + verticaloffset), 216 | ImVec2(mapCenterX + MapSize / 2 + horizontaloffset, mapCenterY + MapSize / 2 + verticaloffset), 217 | ImVec4(1.0f, 1.0f, 1.0f, 1.0f), 218 | 1.0f, false 219 | ); 220 | 221 | // Local Player Position 222 | float playerWorldX = LocalPlayer->GetPosition().x; 223 | float playerWorldY = LocalPlayer->GetPosition().y; 224 | 225 | // Normalize Local Player Position to MiniMap Space 226 | float playerMapX = ((playerWorldX - worldMinX) / (worldMaxX - worldMinX)) * MapSize; 227 | float playerMapY = ((worldMaxY - playerWorldY) / (worldMaxY - worldMinY)) * MapSize; 228 | 229 | // Convert MiniMap Position to Screen Space 230 | float playerScreenX = mapCenterX - (MapSize / 2) + playerMapX + horizontaloffset; 231 | float playerScreenY = mapCenterY - (MapSize / 2) + playerMapY + verticaloffset; 232 | 233 | // Draw Local Player 234 | if (Configs.Overlay.RadarDrawSelf) { 235 | 236 | ESPRenderer::DrawCircle(ImVec2(playerScreenX, playerScreenY), 5.0f, Configs.Overlay.PlayerRadarColor, 1.0f, true); 237 | } 238 | 239 | // Draw Enemies 240 | if (tempPlayerList.size() == 0) 241 | return; 242 | for (std::shared_ptr ent : tempPlayerList) 243 | { 244 | if (ent == nullptr || ent->GetType() == EntityType::LocalPlayer) 245 | continue; 246 | 247 | auto playerPos = ent->GetPosition(); 248 | 249 | if (ent->GetType() == EntityType::FriendlyPlayer) 250 | continue; 251 | 252 | if (!ent->GetValid() || ent->IsHidden()) // Has extracted 253 | continue; 254 | 255 | auto isDead = false; 256 | if (ent->GetType() != EntityType::FriendlyPlayer && 257 | (!IsValidHP(ent->GetHealth().current_hp) || 258 | !IsValidHP(ent->GetHealth().current_max_hp) || 259 | !IsValidHP(ent->GetHealth().regenerable_max_hp))) 260 | { 261 | ent->SetType(EntityType::DeadPlayer); 262 | isDead = true; 263 | } 264 | else 265 | ent->SetType(EntityType::EnemyPlayer); 266 | 267 | if (isDead) 268 | continue; 269 | 270 | float enemyWorldX = playerPos.x; 271 | float enemyWorldY = playerPos.y; 272 | 273 | // Normalize enemy position 274 | float enemyMapX = ((enemyWorldX - worldMinX) / (worldMaxX - worldMinX)) * MapSize; 275 | float enemyMapY = ((worldMaxY - enemyWorldY) / (worldMaxY - worldMinY)) * MapSize; 276 | 277 | // Convert MiniMap Position to Screen Space 278 | float enemyScreenX = mapCenterX - (MapSize / 2) + enemyMapX + horizontaloffset; 279 | float enemyScreenY = mapCenterY - (MapSize / 2) + enemyMapY + verticaloffset; 280 | 281 | ESPRenderer::DrawCircle(ImVec2(enemyScreenX, enemyScreenY), 5.0f, Configs.Overlay.EnemyRadarColor, 1.0f, true); 282 | } 283 | } 284 | } 285 | } 286 | 287 | void DrawOverlay() 288 | { 289 | if (Configs.Overlay.ShowObjectCount) 290 | DrawObjectCount(); 291 | 292 | if (Configs.Overlay.ShowFPS) 293 | DrawFPS(); 294 | 295 | if (Configs.Player.ShowPlayerList) 296 | DrawPlayerList(); 297 | 298 | if (enableAimBot && Configs.Aimbot.DrawFOV) 299 | DrawAimbotFOV(); 300 | 301 | if (Configs.Overlay.CrosshairType != 0) // Lastly draw crosshair to draw it on top of everything 302 | DrawCrosshair(); 303 | } -------------------------------------------------------------------------------- /HuntDMA/Esp/Overlay.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | extern void DrawOverlay(); 3 | extern void DrawRadar(); -------------------------------------------------------------------------------- /HuntDMA/Esp/PlayerEsp.cpp: -------------------------------------------------------------------------------- 1 | #include "Pch.h" 2 | #include "PlayerEsp.h" 3 | #include "globals.h" 4 | #include "CheatFunction.h" 5 | #include "ESPRenderer.h" 6 | #include "ConfigInstance.h" 7 | #include "WorldEntity.h" 8 | #include "ConfigUtilities.h" 9 | #include "Localization/Localization.h" 10 | 11 | std::shared_ptr UpdatePlayers = std::make_shared(1, [] { 12 | EnvironmentInstance->UpdatePlayerList(); 13 | }); 14 | std::shared_ptr UpdateBosses = std::make_shared(5, [] { 15 | EnvironmentInstance->UpdateBossesList(); 16 | }); 17 | 18 | void DrawBossesEsp() 19 | { 20 | if (EnvironmentInstance == nullptr) 21 | return; 22 | 23 | if (EnvironmentInstance->GetObjectCount() < 10) 24 | return; 25 | 26 | if (Configs.Bosses.Enable) 27 | { 28 | std::vector> templist = EnvironmentInstance->GetBossesList(); 29 | if (templist.size() != 0) 30 | { 31 | for (std::shared_ptr ent : templist) 32 | { 33 | if (ent == nullptr) 34 | continue; 35 | int distance = (int)Vector3::Distance(ent->GetPosition(), CameraInstance->GetPosition()); 36 | if (distance <= 0 || distance > Configs.Bosses.MaxDistance) 37 | continue; 38 | 39 | if (!ent->GetValid()) 40 | continue; 41 | Vector2 pos = CameraInstance->WorldToScreen(ent->GetPosition()); 42 | if (pos.x <= 0 || pos.y <= 0) 43 | continue; 44 | std::string wname = Configs.Bosses.Name ? LOC("entity", ent->GetTypeAsString()) : ""; 45 | std::string wdistance = Configs.Bosses.Distance ? std::vformat(LOC("menu", "esp.Meters"), std::make_format_args(distance)) : ""; 46 | ESPRenderer::DrawText( 47 | ImVec2(pos.x, pos.y), 48 | wname + wdistance, 49 | Configs.Bosses.TextColor, 50 | Configs.Bosses.FontSize, 51 | Center 52 | ); 53 | } 54 | } 55 | } 56 | } 57 | 58 | void DrawPlayersEsp() 59 | { 60 | if (EnvironmentInstance == nullptr) 61 | return; 62 | 63 | if (EnvironmentInstance->GetObjectCount() < 10) 64 | return; 65 | 66 | if (Configs.Player.Enable || Configs.Player.DrawFrames) 67 | { 68 | std::vector> templist = EnvironmentInstance->GetPlayerList(); 69 | if (templist.size() == 0) 70 | return; 71 | for (std::shared_ptr ent : templist) 72 | { 73 | if (ent == nullptr || ent->GetType() == EntityType::LocalPlayer) 74 | continue; 75 | 76 | auto playerPos = ent->GetPosition(); 77 | 78 | if (!Configs.Player.DrawFriendsHP && ent->GetType() == EntityType::FriendlyPlayer) 79 | continue; 80 | 81 | if (!ent->GetValid() || ent->IsHidden()) // Has extracted 82 | continue; 83 | 84 | auto isDead = false; 85 | if (ent->GetType() != EntityType::FriendlyPlayer && 86 | (!IsValidHP(ent->GetHealth().current_hp) || 87 | !IsValidHP(ent->GetHealth().current_max_hp) || 88 | !IsValidHP(ent->GetHealth().regenerable_max_hp))) 89 | { 90 | ent->SetType(EntityType::DeadPlayer); 91 | isDead = true; 92 | } 93 | else 94 | { 95 | if (ent->GetRenderNode().silhouettes_param == 0x8CD2FF || ent->GetRenderNode().silhouettes_param == 0x3322eeff) 96 | { 97 | ent->SetType(EntityType::FriendlyPlayer); 98 | } 99 | else ent->SetType(EntityType::EnemyPlayer); 100 | } 101 | 102 | if (!Configs.Player.ShowDead && isDead) 103 | continue; 104 | 105 | int distance = (int)Vector3::Distance(playerPos, CameraInstance->GetPosition()); 106 | if (distance <= 0 || distance > (isDead ? Configs.Player.DeadMaxDistance : Configs.Player.MaxDistance)) 107 | continue; 108 | 109 | auto tempPos = playerPos; 110 | Vector2 feetPos = CameraInstance->WorldToScreen(playerPos, false); 111 | if (feetPos.IsZero()) 112 | continue; 113 | 114 | tempPos.z = playerPos.z + 1.7f; 115 | Vector2 headPos; 116 | if (Configs.Player.DrawHeadInFrames && !isDead) 117 | { 118 | headPos = CameraInstance->WorldToScreen(tempPos, false); 119 | if (headPos.IsZero()) 120 | continue; 121 | } 122 | 123 | tempPos.z = playerPos.z + 2.0f; 124 | Vector2 uppderFramePos; 125 | if ((Configs.Player.DrawFrames || Configs.Player.DrawHealthBars) && !isDead) 126 | { 127 | uppderFramePos = CameraInstance->WorldToScreen(tempPos, false); 128 | if (uppderFramePos.IsZero()) 129 | continue; 130 | } 131 | 132 | tempPos.z = playerPos.z + 2.1f; 133 | Vector2 healthBarPos; 134 | if (Configs.Player.DrawHealthBars && !isDead) 135 | { 136 | healthBarPos = CameraInstance->WorldToScreen(tempPos, false); 137 | if (healthBarPos.IsZero()) 138 | continue; 139 | } 140 | 141 | Vector2 offset, normal; 142 | if ((Configs.Player.DrawFrames || Configs.Player.DrawHealthBars) && !isDead) 143 | { 144 | Vector2 v = uppderFramePos - feetPos; 145 | float segmentLength = Vector2::Length(v); 146 | normal = Vector2(-v.y, v.x); 147 | offset = normal / (2.0f * 2); 148 | } 149 | 150 | if (Configs.Player.DrawFrames && !isDead && ent->GetType() != EntityType::FriendlyPlayer) 151 | { 152 | Vector2 A1 = feetPos + offset; 153 | Vector2 A2 = feetPos - offset; 154 | Vector2 B1 = uppderFramePos + offset; 155 | Vector2 B2 = uppderFramePos - offset; 156 | 157 | auto colour = ent->GetType() == EntityType::FriendlyPlayer ? Configs.Player.FriendColor : Configs.Player.FramesColor; 158 | 159 | ESPRenderer::DrawLine( 160 | ImVec2(A1.x, A1.y), 161 | ImVec2(A2.x, A2.y), 162 | colour, 163 | 1 164 | ); 165 | ESPRenderer::DrawLine( 166 | ImVec2(A2.x, A2.y), 167 | ImVec2(B2.x, B2.y), 168 | colour, 169 | 1 170 | ); 171 | ESPRenderer::DrawLine( 172 | ImVec2(B2.x, B2.y), 173 | ImVec2(B1.x, B1.y), 174 | colour, 175 | 1 176 | ); 177 | ESPRenderer::DrawLine( 178 | ImVec2(B1.x, B1.y), 179 | ImVec2(A1.x, A1.y), 180 | colour, 181 | 1 182 | ); 183 | 184 | if (Configs.Player.DrawHeadInFrames) 185 | { 186 | Vector2 headoffset = normal / (6.0f * 2); 187 | Vector2 Head1 = headPos + offset; 188 | Vector2 Head2 = headPos + headoffset; 189 | Vector2 Head3 = headPos - headoffset; 190 | Vector2 Head4 = headPos - offset; 191 | 192 | ESPRenderer::DrawLine( 193 | ImVec2(Head1.x, Head1.y), 194 | ImVec2(Head2.x, Head2.y), 195 | colour, 196 | 1 197 | ); 198 | ESPRenderer::DrawLine( 199 | ImVec2(Head3.x, Head3.y), 200 | ImVec2(Head4.x, Head4.y), 201 | colour, 202 | 1 203 | ); 204 | } 205 | } 206 | 207 | if (Configs.Player.DrawHealthBars && !isDead) 208 | { 209 | auto health = ent->GetHealth(); 210 | Vector2 Health1 = healthBarPos - offset; 211 | Vector2 Health2 = healthBarPos + offset; 212 | auto lineHeight = std::max(2.0f, Vector2::Distance(Health1, Health2) / 10.0f); 213 | float currentHp = health.current_hp / 150.0f; 214 | float currentMaxHp = health.current_max_hp / 150.0f; 215 | float potentialMaxHp = health.regenerable_max_hp / 150.0f; 216 | Vector2 currentHpPos = Vector2(currentHp * Health2.x + (1 - currentHp) * Health1.x, currentHp * Health2.y + (1 - currentHp) * Health1.y); 217 | Vector2 currentMaxHpPos = Vector2(currentMaxHp * Health2.x + (1 - currentMaxHp) * Health1.x, currentMaxHp * Health2.y + (1 - currentMaxHp) * Health1.y); 218 | Vector2 potentialMaxHpPos = Vector2(potentialMaxHp * Health2.x + (1 - potentialMaxHp) * Health1.x, potentialMaxHp * Health2.y + (1 - potentialMaxHp) * Health1.y); 219 | 220 | ESPRenderer::DrawLine( // current health 221 | ImVec2(Health1.x, Health1.y), 222 | ImVec2(currentHpPos.x, currentHpPos.y), 223 | ent->GetType() == EntityType::FriendlyPlayer ? ImVec4(0.058823f, 0.407843f, 0.909803f, 1.0f) : ImVec4(0.784313f, 0.039215f, 0.039215f, 1.0f), 224 | lineHeight 225 | ); 226 | ESPRenderer::DrawLine( // regenerable black health 227 | ImVec2(currentHpPos.x, currentHpPos.y), 228 | ImVec2(currentMaxHpPos.x, currentMaxHpPos.y), 229 | ImVec4(0.039215f, 0.039215f, 0.039215f, 1.0f), 230 | lineHeight 231 | ); 232 | ESPRenderer::DrawLine( // burning health 233 | ImVec2(currentMaxHpPos.x, currentMaxHpPos.y), 234 | ImVec2(potentialMaxHpPos.x, potentialMaxHpPos.y), 235 | ImVec4(0.784313f, 0.392156f, 0.039215f, 1.0f), 236 | lineHeight 237 | ); 238 | ESPRenderer::DrawLine( // lost health 239 | ImVec2(potentialMaxHpPos.x, potentialMaxHpPos.y), 240 | ImVec2(Health2.x, Health2.y), 241 | ImVec4(0.784313f, 0.784313f, 0.784313f, 1.0f), 242 | lineHeight 243 | ); 244 | } 245 | 246 | if (!Configs.Player.Enable || ent->GetType() == EntityType::FriendlyPlayer) 247 | continue; 248 | 249 | std::string wname = (Configs.Player.Name || isDead) ? LOC("entity", ent->GetTypeAsString()) : ""; 250 | std::string wdistance = Configs.Player.Distance ? std::vformat(LOC("menu", "esp.Meters"), std::make_format_args(distance)) : ""; 251 | std::string whealth = Configs.Player.HP ? std::to_string(ent->GetHealth().current_hp) + "/" + std::to_string(ent->GetHealth().current_max_hp) + "[" + std::to_string(ent->GetHealth().regenerable_max_hp) + "]" : ""; 252 | ESPRenderer::DrawText( 253 | ImVec2(feetPos.x, feetPos.y), 254 | wname + wdistance + "\n" + whealth, 255 | ent->GetType() == EntityType::FriendlyPlayer ? Configs.Player.FriendColor : Configs.Player.TextColor, 256 | Configs.Player.FontSize, 257 | TopCenter 258 | ); 259 | } 260 | } 261 | } 262 | 263 | bool IsValidHP(int hp) 264 | { 265 | return hp > 0 && hp <= 150; 266 | } -------------------------------------------------------------------------------- /HuntDMA/Esp/PlayerEsp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | extern std::shared_ptr UpdatePlayers; 3 | extern std::shared_ptr UpdateBosses; 4 | extern void DrawPlayersEsp(); 5 | extern void DrawBossesEsp(); 6 | extern bool IsValidHP(int hp); -------------------------------------------------------------------------------- /HuntDMA/Esp/SpectatorAlarm.cpp: -------------------------------------------------------------------------------- 1 | #include "Pch.h" 2 | #include "globals.h" 3 | #include "ESPRenderer.h" 4 | #include "ConfigInstance.h" 5 | #include "ConfigUtilities.h" 6 | 7 | void DrawSpectators() 8 | { 9 | int spectatorCount = EnvironmentInstance->GetSpectatorCount(); 10 | 11 | if (spectatorCount <= 0 || spectatorCount > 11) return; 12 | 13 | // Get screen dimensions 14 | float screenWidth = ESPRenderer::GetScreenWidth(); 15 | float screenHeight = ESPRenderer::GetScreenHeight(); 16 | 17 | // Draw red frame around the screen 18 | int lineWidth = 50; 19 | ESPRenderer::DrawRect( 20 | ImVec2(0, 0), 21 | ImVec2(screenWidth, screenHeight), 22 | ImVec4(1.0f, 0.0f, 0.0f, Configs.General.OverlayMode ? 0.7f : 1.0f), 23 | static_cast(lineWidth) 24 | ); 25 | 26 | // Draw spectator count 27 | ESPRenderer::DrawText( 28 | ImVec2(0, 55), 29 | std::to_string(spectatorCount), 30 | ImVec4(0.0f, 1.0f, 0.0f, Configs.General.OverlayMode ? 0.7f : 1.0f), 31 | 40 32 | ); 33 | } -------------------------------------------------------------------------------- /HuntDMA/Esp/SpectatorAlarm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | extern void DrawSpectators(); -------------------------------------------------------------------------------- /HuntDMA/Globals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Environment.h" 3 | #include "Camera.h" 4 | 5 | extern std::shared_ptr EnvironmentInstance; 6 | extern std::shared_ptr CameraInstance; -------------------------------------------------------------------------------- /HuntDMA/Graphics/ESPRenderer.cpp: -------------------------------------------------------------------------------- 1 | #include "Pch.h" 2 | #include "ESPRenderer.h" 3 | #include "XorStr.h" 4 | #include "Fonts.h" 5 | 6 | // Static member initialization 7 | ImDrawList* ESPRenderer::s_drawList = nullptr; 8 | std::map ESPRenderer::s_fonts; 9 | ImFont* ESPRenderer::s_defaultFont = nullptr; 10 | float ESPRenderer::s_screenWidth = 0.0f; 11 | float ESPRenderer::s_screenHeight = 0.0f; 12 | ImVec2 ESPRenderer::s_screenCenter = ImVec2(0.0f, 0.0f); 13 | 14 | //const char* fontPath = "C:\\Windows\\Fonts\\verdana.ttf"; // Verdana 15 | const std::vector ESPRenderer::FONT_SIZES = { 16 | 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 40, 50, 60, 70, 80, 90, 100 17 | }; 18 | 19 | bool ESPRenderer::Initialize() 20 | { 21 | static const ImWchar glyphRanges[] = { 22 | 0x0020, 0x00FF, // Basic Latin + Latin Supplement 23 | 0x0400, 0x052F, // Cyrillic + Cyrillic Supplement 24 | 0x2DE0, 0x2DFF, // Cyrillic Extended-A 25 | 0xA640, 0xA69F, // Cyrillic Extended-B 26 | 0x4E00, 0x9FFF, // CJK Unified Ideographs (main chinese chars) 27 | 0x3000, 0x30FF, // CJK Symbols and Punctuation, Hiragana, Katakana 28 | 0xFF00, 0xFFEF, // Half-width/Full-width Forms 29 | 0, 30 | }; 31 | 32 | ImGuiIO& io = ImGui::GetIO(); 33 | 34 | // Init default font 35 | s_defaultFont = io.Fonts->AddFontFromMemoryTTF(fontRobotoMedium, sizeof(fontRobotoMedium), 14.0f * Configs.General.UIScale, nullptr, glyphRanges); 36 | if (!s_defaultFont) { 37 | LOG_ERROR("[ESPRenderer] Failed to load default font"); 38 | return false; 39 | } 40 | 41 | // Load all font sizes 42 | //if (!std::filesystem::exists(fontPath)) { 43 | // LOG_ERROR("[ESPRenderer] Font file not found at: %s", fontPath); 44 | // return false; 45 | //} 46 | 47 | for (int size : FONT_SIZES) { 48 | ImFontConfig config; 49 | config.SizePixels = static_cast(size); 50 | config.GlyphRanges = glyphRanges; 51 | 52 | ImFont* font = io.Fonts->AddFontFromMemoryTTF(fontRobotoRegular, 53 | sizeof(fontRobotoRegular), 54 | static_cast(size), 55 | &config); 56 | 57 | if (font) { 58 | s_fonts[size] = font; 59 | //LOG_INFO("[ESPRenderer] Loaded font size: %d", size); 60 | } 61 | else { 62 | LOG_ERROR("[ESPRenderer] Failed to load font size: %d", size); 63 | } 64 | } 65 | 66 | // Atlas build 67 | bool buildSuccess = io.Fonts->Build(); 68 | if (!buildSuccess) { 69 | LOG_ERROR("[ESPRenderer] Failed to build font atlas"); 70 | return false; 71 | } 72 | 73 | LOG_INFO("[ESPRenderer] Successfully initialized with %zu fonts", s_fonts.size()); 74 | return true; 75 | } 76 | 77 | void ESPRenderer::BeginFrame() 78 | { 79 | s_drawList = ImGui::GetBackgroundDrawList(); 80 | 81 | // Update screen dimensions if needed 82 | if (Configs.General.OverrideResolution) { 83 | s_screenWidth = static_cast(Configs.General.Width); 84 | s_screenHeight = static_cast(Configs.General.Height); 85 | } 86 | else { 87 | s_screenWidth = static_cast(GetSystemMetrics(SM_CXSCREEN)); 88 | s_screenHeight = static_cast(GetSystemMetrics(SM_CYSCREEN)); 89 | } 90 | 91 | s_screenCenter = ImVec2(s_screenWidth * 0.5f, s_screenHeight * 0.5f); 92 | } 93 | 94 | void ESPRenderer::DrawText(const ImVec2& pos, const std::string& text, const ImVec4& color, int fontSize, FontAlignment alignment, float outline) 95 | { 96 | if (!s_drawList) return; 97 | 98 | const ImU32 outlineColor = ImGui::ColorConvertFloat4ToU32(ImVec4(0.05f, 0.05f, 0.05f, color.w)); 99 | ImFont* font = GetFont(fontSize); 100 | 101 | ImVec2 newPos; 102 | if (alignment == TopLeft) 103 | newPos = pos; 104 | else 105 | { 106 | ImVec2 textSize = font->CalcTextSizeA(static_cast(fontSize), FLT_MAX, 0.0f, text.c_str()); 107 | switch (alignment) 108 | { 109 | case TopLeft: 110 | newPos = ImVec2(pos.x, pos.y); 111 | break; 112 | case TopCenter: 113 | newPos = ImVec2(pos.x - textSize.x * 0.5f, pos.y); 114 | break; 115 | case TopRight: 116 | newPos = ImVec2(pos.x - textSize.x, pos.y); 117 | break; 118 | case MiddleLeft: 119 | newPos = ImVec2(pos.x, pos.y - textSize.y * 0.5f); 120 | break; 121 | case Center: 122 | newPos = ImVec2(pos.x - textSize.x * 0.5f, pos.y - textSize.y * 0.5f); 123 | break; 124 | case MiddleRight: 125 | newPos = ImVec2(pos.x - textSize.x, pos.y - textSize.y * 0.5f); 126 | break; 127 | case BottomLeft: 128 | newPos = ImVec2(pos.x, pos.y - textSize.y); 129 | break; 130 | case BottomCenter: 131 | newPos = ImVec2(pos.x - textSize.x * 0.5f, pos.y - textSize.y); 132 | break; 133 | case BottomRight: 134 | newPos = ImVec2(pos.x - textSize.x, pos.y - textSize.y); 135 | break; 136 | default: 137 | break; 138 | } 139 | } 140 | 141 | if (outline > 0.01f) 142 | { 143 | for (int dx = -1; dx <= 1; dx += 1) { 144 | for (int dy = -1; dy <= 1; dy += 1) { 145 | if (dx == 0 && dy == 0) continue; 146 | s_drawList->AddText(font, 147 | static_cast(fontSize), 148 | ImVec2(newPos.x + (dx * outline), newPos.y + (dy * outline)), 149 | outlineColor, 150 | text.c_str()); 151 | } 152 | } 153 | } 154 | 155 | s_drawList->AddText(font, 156 | static_cast(fontSize), 157 | newPos, 158 | ImGui::ColorConvertFloat4ToU32(color), 159 | text.c_str()); 160 | } 161 | 162 | void ESPRenderer::DrawLine(const ImVec2& from, const ImVec2& to, const ImVec4& color, float thickness) 163 | { 164 | if (!s_drawList) return; 165 | s_drawList->AddLine(from, to, ImGui::ColorConvertFloat4ToU32(color), thickness); 166 | } 167 | 168 | void ESPRenderer::DrawCircle(const ImVec2& center, float radius, const ImVec4& color, float thickness, bool filled) 169 | { 170 | if (!s_drawList) return; 171 | if (filled) { 172 | s_drawList->AddCircleFilled(center, radius, ImGui::ColorConvertFloat4ToU32(color)); 173 | } 174 | else { 175 | s_drawList->AddCircle(center, radius, ImGui::ColorConvertFloat4ToU32(color), 0, thickness); 176 | } 177 | } 178 | 179 | void ESPRenderer::DrawRect(const ImVec2& min, const ImVec2& max, const ImVec4& color, float thickness, bool filled) 180 | { 181 | if (!s_drawList) return; 182 | if (filled) { 183 | s_drawList->AddRectFilled(min, max, ImGui::ColorConvertFloat4ToU32(color)); 184 | } 185 | else { 186 | s_drawList->AddRect(min, max, ImGui::ColorConvertFloat4ToU32(color), 0.0f, ImDrawFlags_None, thickness); 187 | } 188 | } 189 | 190 | ImFont* ESPRenderer::GetFont(int size) 191 | { 192 | if (s_fonts.contains(size)) 193 | return s_fonts[size]; 194 | 195 | // Fallback font if load failed 196 | return s_defaultFont; 197 | } -------------------------------------------------------------------------------- /HuntDMA/Graphics/ESPRenderer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "imgui.h" 3 | #include "ConfigUtilities.h" 4 | 5 | enum FontAlignment 6 | { 7 | TopLeft = 0, 8 | TopCenter = 1, 9 | TopRight = 2, 10 | MiddleLeft = 3, 11 | Center = 4, 12 | MiddleRight = 5, 13 | BottomLeft = 6, 14 | BottomCenter = 7, 15 | BottomRight = 8, 16 | }; 17 | 18 | class ESPRenderer { 19 | private: 20 | static ImDrawList* s_drawList; 21 | static const std::vector FONT_SIZES; 22 | static std::map s_fonts; 23 | static ImFont* s_defaultFont; 24 | static float s_screenWidth; 25 | static float s_screenHeight; 26 | static ImVec2 s_screenCenter; 27 | 28 | public: 29 | static bool Initialize(); 30 | static void BeginFrame(); 31 | 32 | static void DrawText(const ImVec2& pos, const std::string& text, const ImVec4& color, int fontSize = 13, FontAlignment alignment = TopLeft, float outline = 1.0f); 33 | static void DrawLine(const ImVec2& from, const ImVec2& to, const ImVec4& color, float thickness = 1.0f); 34 | static void DrawCircle(const ImVec2& center, float radius, const ImVec4& color, float thickness = 1.0f, bool filled = false); 35 | static void DrawRect(const ImVec2& min, const ImVec2& max, const ImVec4& color, float thickness = 1.0f, bool filled = false); 36 | 37 | static const std::vector& GetFontSizes() {return FONT_SIZES;} 38 | 39 | static const ImVec2& GetScreenCenter() { return s_screenCenter; } 40 | static float GetScreenWidth() { return s_screenWidth; } 41 | static float GetScreenHeight() { return s_screenHeight; } 42 | 43 | private: 44 | static ImFont* GetFont(int size); 45 | }; -------------------------------------------------------------------------------- /HuntDMA/Graphics/ImGuiMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "imgui.h" 3 | #include "imgui_impl_win32.h" 4 | #include "imgui_impl_dx11.h" 5 | #include 6 | #include "ConfigInstance.h" 7 | #include "ConfigUtilities.h" 8 | 9 | class ImGuiMenu { 10 | private: 11 | // D3D11 Device Objects 12 | ID3D11Device* d3dDevice = nullptr; 13 | ID3D11DeviceContext* d3dDeviceContext = nullptr; 14 | IDXGISwapChain* swapChain = nullptr; 15 | ID3D11RenderTargetView* mainRenderTargetView = nullptr; 16 | bool initialized = false; 17 | 18 | // Window state 19 | float lastKeyPressTime = 0.0f; 20 | static constexpr float KEY_PRESS_DELAY = 0.2f; 21 | 22 | // Helper methods for device management 23 | bool CreateDeviceD3D(HWND hWnd); 24 | void CleanupDeviceD3D(); 25 | void CreateRenderTarget(); 26 | void CleanupRenderTarget(); 27 | 28 | // Menu rendering methods 29 | void RenderPlayerESPTab(); 30 | void RenderBossesESPTab(); 31 | void RenderSupplyESPTab(); 32 | void RenderBloodBondsESPTab(); 33 | void RenderTrapESPTab(); 34 | void RenderPOIESPTab(); 35 | void RenderTraitESPTab(); 36 | void RenderOverlayTab(); 37 | void RenderAimbotTab(); 38 | void RenderSettingsTab(); 39 | 40 | bool RenderFontSizeSlider(const char* label, int& configValue); 41 | 42 | // Theme & Style 43 | void SetupTheme(); 44 | 45 | // Helper methods for UI 46 | void ColorPickerWithText(const char* label, ImVec4* color); 47 | void HelpMarker(const char* desc); 48 | bool HotKey(const char* label, int* key); 49 | 50 | public: 51 | ImGuiMenu() = default; 52 | ~ImGuiMenu(); 53 | 54 | bool Init(HWND hWnd); 55 | void Shutdown(); 56 | 57 | void BeginFrame(); 58 | void RenderMenu(); 59 | void EndFrame(); 60 | 61 | void HandleInput(); 62 | bool IsInitialized() const { return initialized; } 63 | }; 64 | 65 | // Global instance 66 | extern ImGuiMenu g_ImGuiMenu; 67 | extern bool MenuOpen; 68 | 69 | // Helper functions 70 | namespace ImGuiUtils { 71 | bool IsKeyPressed(int vKey); 72 | float GetTime(); 73 | ImGuiKey VirtualKeyToImGuiKey(int vk); 74 | int ImGuiKeyToVirtualKey(ImGuiKey key); 75 | const char* GetKeyName(int vk); 76 | } -------------------------------------------------------------------------------- /HuntDMA/Graphics/Start Up/Init.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Globals.h" 3 | #include "PlayerEsp.h" 4 | #include "OtherEsp.h" 5 | #include "ConfigUtilities.h" 6 | #include "Aimbot.h" 7 | #include "InputManager.h" 8 | #include "Kmbox.h" 9 | #include "Overlay.h" 10 | #include 11 | #include "SpectatorAlarm.h" 12 | #include "Init.h" 13 | #include "CacheManager.h" 14 | 15 | ID2D1Factory* Factory; 16 | IDWriteFactory* FontFactory; 17 | ID2D1HwndRenderTarget* RenderTarget; 18 | ID2D1SolidColorBrush* Brush; 19 | 20 | 21 | std::shared_ptr EnvironmentInstance; 22 | std::shared_ptr CameraInstance; 23 | 24 | bool cacheThreadCreated = false; 25 | 26 | void InitialiseClasses() 27 | { 28 | EnvironmentInstance = std::make_shared(); 29 | CameraInstance = std::make_shared(); 30 | } 31 | 32 | std::shared_ptr UpdateCam = std::make_shared(1, [] { 33 | if (EnvironmentInstance == nullptr) 34 | return; 35 | if (EnvironmentInstance->GetObjectCount() < 10) 36 | return; 37 | auto handle = TargetProcess.CreateScatterHandle(); 38 | CameraInstance->UpdateCamera(handle); 39 | TargetProcess.ExecuteReadScatter(handle); 40 | TargetProcess.CloseScatterHandle(handle); 41 | }); 42 | 43 | void InitializeESP() 44 | { 45 | g_CacheManager.Start(); 46 | if (enableAimBot) 47 | { 48 | Keyboard::InitKeyboard(); 49 | kmbox::KmboxInitialize(""); 50 | } 51 | } 52 | 53 | int FrameRate() 54 | { 55 | static int fps = 0; 56 | static int lastfps = 0; 57 | static auto lasttime = std::chrono::steady_clock::now(); 58 | 59 | auto currenttime = std::chrono::steady_clock::now(); 60 | std::chrono::duration elapsed = currenttime - lasttime; 61 | fps++; 62 | 63 | if (elapsed.count() >= 1.0f) 64 | { 65 | lasttime = currenttime; 66 | lastfps = fps; 67 | fps = 0; 68 | } 69 | 70 | return lastfps; 71 | } -------------------------------------------------------------------------------- /HuntDMA/Graphics/Start Up/Init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #pragma comment(lib, "d2d1.lib") 3 | #pragma comment(lib, "Dwrite") 4 | #pragma comment(lib, "windowscodecs.lib") 5 | 6 | const bool enableAimBot = false; 7 | 8 | extern std::shared_ptr UpdateCam; 9 | 10 | void InitialiseClasses(); 11 | void InitializeESP(); 12 | 13 | extern int FrameRate(); -------------------------------------------------------------------------------- /HuntDMA/Graphics/Utility/Kmbox.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "kmbox.h" 3 | #include 4 | 5 | namespace kmbox 6 | { 7 | HANDLE serial_handle = nullptr; 8 | 9 | bool connected = false; 10 | 11 | int clamp(int i) 12 | { 13 | if (i > 127) 14 | i = 127; 15 | if (i < -128) 16 | i = -128; 17 | 18 | return i; 19 | } 20 | 21 | std::string find_port(const std::string& targetDescription) 22 | { 23 | HDEVINFO hDevInfo = SetupDiGetClassDevsA(&GUID_DEVCLASS_PORTS, 0, 0, DIGCF_PRESENT); 24 | if (hDevInfo == INVALID_HANDLE_VALUE) return ""; 25 | 26 | SP_DEVINFO_DATA deviceInfoData; 27 | deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); 28 | 29 | for (DWORD i = 0; SetupDiEnumDeviceInfo(hDevInfo, i, &deviceInfoData); ++i) 30 | { 31 | char buf[512]; 32 | DWORD nSize = 0; 33 | 34 | if (SetupDiGetDeviceRegistryPropertyA(hDevInfo, &deviceInfoData, SPDRP_FRIENDLYNAME, NULL, (PBYTE)buf, sizeof(buf), &nSize) && nSize > 0) 35 | { 36 | buf[nSize] = '\0'; 37 | std::string deviceDescription = buf; 38 | 39 | size_t comPos = deviceDescription.find("COM"); 40 | size_t endPos = deviceDescription.find(")", comPos); 41 | 42 | if (comPos != std::string::npos && endPos != std::string::npos && deviceDescription.find(targetDescription) != std::string::npos) 43 | { 44 | SetupDiDestroyDeviceInfoList(hDevInfo); 45 | return deviceDescription.substr(comPos, endPos - comPos); 46 | } 47 | } 48 | } 49 | SetupDiDestroyDeviceInfoList(hDevInfo); 50 | return ""; 51 | } 52 | 53 | void KmboxInitialize(std::string port) 54 | { 55 | 56 | connected = false; 57 | if (serial_handle) 58 | { 59 | CloseHandle(serial_handle); 60 | serial_handle = NULL; 61 | } 62 | //wprintf(L"Connecting to KMBOX on port %ls\n",port.c_str()); 63 | //std::string str = std::string(port.begin(), port.end()); 64 | port = "\\\\.\\" + find_port("USB-SERIAL CH340"); 65 | LOG_INFO("Connecting to KMBOX on port %s", port.c_str()); 66 | 67 | serial_handle = CreateFileA(port.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); 68 | 69 | if (serial_handle == INVALID_HANDLE_VALUE) 70 | { 71 | // print the serialhandle 72 | LOG_ERROR("Serial handle: %d", serial_handle); 73 | LOG_ERROR("Failed to open serial port!"); 74 | return; 75 | 76 | } 77 | 78 | if (!SetupComm(serial_handle, 8192, 8192)) 79 | { 80 | LOG_ERROR("Failed to setup serial port!"); 81 | CloseHandle(serial_handle); 82 | return; 83 | } 84 | 85 | COMMTIMEOUTS timeouts = { 0 }; 86 | if (!GetCommTimeouts(serial_handle, &timeouts)) 87 | { 88 | CloseHandle(serial_handle); 89 | return; 90 | } 91 | timeouts.ReadIntervalTimeout = 0xFFFFFFFF; 92 | timeouts.ReadTotalTimeoutMultiplier = 0; 93 | timeouts.ReadTotalTimeoutConstant = 0; 94 | timeouts.WriteTotalTimeoutMultiplier = 0; 95 | timeouts.WriteTotalTimeoutConstant = 2000; 96 | 97 | if (!SetCommTimeouts(serial_handle, &timeouts)) 98 | { 99 | 100 | CloseHandle(serial_handle); 101 | return; 102 | } 103 | 104 | PurgeComm(serial_handle, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR); 105 | 106 | DCB dcbSerialParams = { 0 }; 107 | dcbSerialParams.DCBlength = sizeof(dcbSerialParams); 108 | 109 | if (!GetCommState(serial_handle, &dcbSerialParams)) 110 | { 111 | LOG_ERROR("Failed to get serial state!"); 112 | CloseHandle(serial_handle); 113 | return; 114 | } 115 | 116 | int baud = 115200; 117 | dcbSerialParams.BaudRate = baud; 118 | dcbSerialParams.ByteSize = 8; 119 | dcbSerialParams.StopBits = ONESTOPBIT; 120 | dcbSerialParams.Parity = NOPARITY; 121 | 122 | if (!SetCommState(serial_handle, &dcbSerialParams)) 123 | { 124 | LOG_ERROR("Failed to set serial parameters!"); 125 | CloseHandle(serial_handle); 126 | return; 127 | } 128 | 129 | LOG_INFO("Connected to KMBOX on port %s", std::string(port).c_str()); 130 | connected = true; 131 | } 132 | 133 | void SendCommand(const std::string& command) 134 | { 135 | DWORD bytesWritten; 136 | if (!WriteFile(serial_handle, command.c_str(), command.length(), &bytesWritten, NULL)) 137 | { 138 | //LOG_ERROR("Failed to write to serial port!"); 139 | } 140 | } 141 | 142 | void move(int x, int y) 143 | { 144 | if (!connected) 145 | { 146 | //LOG_ERROR("not connected?"); 147 | return; 148 | } 149 | x = clamp(x); 150 | y = clamp(y); 151 | std::string command = "km.move(" + std::to_string(x) + "," + std::to_string(y) + ")\r\n"; 152 | SendCommand(command.c_str()); 153 | } 154 | 155 | void left_click() 156 | { 157 | if (!connected) 158 | { 159 | //LOG_ERROR("not connected?"); 160 | return; 161 | } 162 | std::string command = "km.left(1)\r\n"; 163 | SendCommand(command.c_str()); 164 | } 165 | 166 | void left_click_release() 167 | { 168 | if (!connected) 169 | { 170 | //LOG_ERROR("not connected?"); 171 | return; 172 | } 173 | std::string command = "km.left(0)\r\n"; 174 | SendCommand(command.c_str()); 175 | } 176 | 177 | bool IsDown(int virtual_key) 178 | { 179 | if (!connected) 180 | return false; 181 | return false; 182 | std::string command = virtual_key == 3 ? "km.middle()\r\n" : "km.side" + std::to_string(virtual_key) + std::string("()\r\n"); 183 | SendCommand(command); 184 | char readBuffer[256]; 185 | DWORD bytesRead; 186 | if (!ReadFile(serial_handle, readBuffer, sizeof(readBuffer) - 1, &bytesRead, NULL)) 187 | { 188 | std::cerr << "Failed to read from serial port!" << std::endl; 189 | return false; 190 | } 191 | 192 | if (bytesRead > 0) 193 | { 194 | readBuffer[bytesRead] = '\0'; 195 | std::string command2 = virtual_key == 3 ? "km.middle()\r\n1" : "km.side" + std::to_string(virtual_key) + std::string("()\r\n1"); 196 | if (strstr(readBuffer, command2.c_str())) 197 | return true; 198 | } 199 | return false; 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /HuntDMA/Graphics/Utility/Kmbox.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #pragma comment(lib, "setupapi.lib") 10 | namespace kmbox 11 | { 12 | extern bool connected; 13 | extern std::string find_port(const std::string& targetDescription); 14 | extern void KmboxInitialize(std::string port); 15 | 16 | extern void move(int x, int y); 17 | extern void left_click(); 18 | extern void left_click_release(); 19 | extern bool IsDown(int virtual_key); 20 | } 21 | -------------------------------------------------------------------------------- /HuntDMA/HuntDMA.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | Source Files 74 | 75 | 76 | Source Files 77 | 78 | 79 | Source Files 80 | 81 | 82 | Source Files 83 | 84 | 85 | Source Files 86 | 87 | 88 | Source Files 89 | 90 | 91 | Source Files 92 | 93 | 94 | Source Files 95 | 96 | 97 | Source Files 98 | 99 | 100 | Source Files 101 | 102 | 103 | Source Files 104 | 105 | 106 | 107 | 108 | Header Files 109 | 110 | 111 | Header Files 112 | 113 | 114 | Header Files 115 | 116 | 117 | Header Files 118 | 119 | 120 | Header Files 121 | 122 | 123 | Header Files 124 | 125 | 126 | Header Files 127 | 128 | 129 | Header Files 130 | 131 | 132 | Header Files 133 | 134 | 135 | Header Files 136 | 137 | 138 | Header Files 139 | 140 | 141 | Header Files 142 | 143 | 144 | Header Files 145 | 146 | 147 | Header Files 148 | 149 | 150 | Header Files 151 | 152 | 153 | Header Files 154 | 155 | 156 | Header Files 157 | 158 | 159 | Header Files 160 | 161 | 162 | Header Files 163 | 164 | 165 | Header Files 166 | 167 | 168 | Header Files 169 | 170 | 171 | Header Files 172 | 173 | 174 | Header Files 175 | 176 | 177 | Header Files 178 | 179 | 180 | Header Files 181 | 182 | 183 | Header Files 184 | 185 | 186 | Header Files 187 | 188 | 189 | Header Files 190 | 191 | 192 | Header Files 193 | 194 | 195 | Header Files 196 | 197 | 198 | Header Files 199 | 200 | 201 | Header Files 202 | 203 | 204 | -------------------------------------------------------------------------------- /HuntDMA/HuntDMA.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /HuntDMA/HuntDMA.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/HuntDMA/HuntDMA.rc -------------------------------------------------------------------------------- /HuntDMA/Libs/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: Large meshes support (64k+ vertices) with 16-bit indices. 7 | // [X] Renderer: Expose selected render state for draw callbacks to use. Access in '(ImGui_ImplXXXX_RenderState*)GetPlatformIO().Renderer_RenderState'. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // Learn about Dear ImGui: 12 | // - FAQ https://dearimgui.com/faq 13 | // - Getting Started https://dearimgui.com/getting-started 14 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 15 | // - Introduction, links and more at the top of imgui.cpp 16 | 17 | #pragma once 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | #ifndef IMGUI_DISABLE 20 | 21 | struct ID3D11Device; 22 | struct ID3D11DeviceContext; 23 | struct ID3D11SamplerState; 24 | 25 | // Follow "Getting Started" link and check examples/ folder to learn about using backends! 26 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 27 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 28 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 29 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 30 | 31 | // Use if you want to reset your rendering device without losing Dear ImGui state. 32 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 33 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 34 | 35 | // [BETA] Selected render state data shared with callbacks. 36 | // This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplDX11_RenderDrawData() call. 37 | // (Please open an issue if you feel you need access to more data) 38 | struct ImGui_ImplDX11_RenderState 39 | { 40 | ID3D11Device* Device; 41 | ID3D11DeviceContext* DeviceContext; 42 | ID3D11SamplerState* SamplerDefault; 43 | }; 44 | 45 | #endif // #ifndef IMGUI_DISABLE 46 | -------------------------------------------------------------------------------- /HuntDMA/Libs/ImGui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for Windows (standard windows API for 32-bits 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 support. Can discriminate Mouse/TouchScreen/Pen. 7 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy VK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 10 | 11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 13 | // Learn about Dear ImGui: 14 | // - FAQ https://dearimgui.com/faq 15 | // - Getting Started https://dearimgui.com/getting-started 16 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 17 | // - Introduction, links and more at the top of imgui.cpp 18 | 19 | #pragma once 20 | #include "imgui.h" // IMGUI_IMPL_API 21 | #ifndef IMGUI_DISABLE 22 | 23 | // Follow "Getting Started" link and check examples/ folder to learn about using backends! 24 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 25 | IMGUI_IMPL_API bool ImGui_ImplWin32_InitForOpenGL(void* hwnd); 26 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 27 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 28 | 29 | // Win32 message handler your application need to call. 30 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. 31 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. 32 | // - Call from your application's message handler. Keep calling your message handler unless this function returns TRUE. 33 | 34 | #if 0 35 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 36 | #endif 37 | 38 | // DPI-related helpers (optional) 39 | // - Use to enable DPI awareness without having to create an application manifest. 40 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 41 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 42 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 43 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 44 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 45 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 46 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 47 | 48 | // Transparency related helpers (optional) [experimental] 49 | // - Use to enable alpha compositing transparency with the desktop. 50 | // - Use together with e.g. clearing your framebuffer with zero-alpha. 51 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd 52 | 53 | #endif // #ifndef IMGUI_DISABLE 54 | -------------------------------------------------------------------------------- /HuntDMA/Localization/Localization.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Localization.h" 3 | #include "ConfigUtilities.h" 4 | #include "Localization/en.h" 5 | #include "Localization/ru.h" 6 | 7 | void Localization::Initialize() { 8 | LOG_INFO("Initializing localization system..."); 9 | 10 | if (!std::filesystem::exists(localizationPath)) { 11 | std::filesystem::create_directory(localizationPath); 12 | } 13 | CreateDefaultLocalizationFiles(); 14 | 15 | LoadLanguageFile(Configs.General.Language); 16 | } 17 | 18 | void Localization::CreateDefaultLocalizationFiles() { 19 | for (const auto& [lang, data] : Languages) { 20 | std::string filePath = localizationPath + lang + ".json"; 21 | 22 | json jsonData; 23 | jsonData["version"] = data.version; 24 | 25 | for (const auto& [category, translations] : data.translations) { 26 | jsonData[category] = translations; 27 | } 28 | 29 | if (std::filesystem::exists(filePath)) { 30 | try { 31 | std::ifstream existingFile(filePath); 32 | json existingData = json::parse(existingFile); 33 | 34 | if (!existingData.contains("version") || 35 | existingData["version"].get() < data.version) { 36 | 37 | std::ofstream outFile(filePath, std::ios::out | std::ios::binary); 38 | if (outFile.is_open()) { 39 | unsigned char bom[] = { 0xEF, 0xBB, 0xBF }; 40 | outFile.write(reinterpret_cast(bom), sizeof(bom)); 41 | 42 | outFile << jsonData.dump(4, ' ', false, json::error_handler_t::replace); 43 | LOG_INFO("Updated outdated localization file: %s", filePath.c_str()); 44 | } 45 | } 46 | } 47 | catch (const std::exception& e) { 48 | LOG_ERROR("Error checking existing localization file %s: %s", 49 | filePath.c_str(), e.what()); 50 | } 51 | } 52 | else { 53 | std::ofstream outFile(filePath, std::ios::out | std::ios::binary); 54 | if (outFile.is_open()) { 55 | unsigned char bom[] = { 0xEF, 0xBB, 0xBF }; 56 | outFile.write(reinterpret_cast(bom), sizeof(bom)); 57 | 58 | outFile << jsonData.dump(4, ' ', false, json::error_handler_t::replace); 59 | LOG_INFO("Created new localization file: %s", filePath.c_str()); 60 | } 61 | } 62 | } 63 | } 64 | 65 | void Localization::LoadLanguageFile(const std::string& language) { 66 | std::string filePath = localizationPath + language + ".json"; 67 | 68 | if (!std::filesystem::exists(localizationPath)) { 69 | std::filesystem::create_directory(localizationPath); 70 | } 71 | 72 | LocalizationData defaultData = GetDefaultLocalization(); 73 | translations = defaultData.translations; 74 | 75 | if (!std::filesystem::exists(filePath)) { 76 | LOG_ERROR("Language file not found: %s, using default language", filePath.c_str()); 77 | return; 78 | } 79 | 80 | if (!std::filesystem::exists(filePath)) { 81 | LOG_WARNING("Language file not found: %s, creating new one...", filePath.c_str()); 82 | 83 | LocalizationData data = Languages[language]; 84 | 85 | json jsonData; 86 | jsonData["version"] = data.version; 87 | for (const auto& [category, temp_translations] : data.translations) { 88 | jsonData[category] = temp_translations; 89 | } 90 | 91 | std::ofstream outFile(filePath, std::ios::out | std::ios::binary); 92 | if (outFile.is_open()) { 93 | unsigned char bom[] = { 0xEF, 0xBB, 0xBF }; 94 | outFile.write(reinterpret_cast(bom), sizeof(bom)); 95 | 96 | outFile << jsonData.dump(4, ' ', false, json::error_handler_t::replace); 97 | LOG_INFO("Created new localization file: %s", filePath.c_str()); 98 | } 99 | } 100 | 101 | try { 102 | std::ifstream file(filePath, std::ios::binary); 103 | 104 | // Skip BOM if present 105 | unsigned char bom[3]; 106 | file.read(reinterpret_cast(bom), 3); 107 | if (!(bom[0] == 0xEF && bom[1] == 0xBB && bom[2] == 0xBF)) { 108 | file.seekg(0); 109 | } 110 | 111 | json langData = json::parse(file); 112 | 113 | if (!langData.contains("version") || 114 | langData["version"].get() < LocalizationData::LOCALIZATION_VERSION) { 115 | 116 | LOG_WARNING("Localization file %s is outdated, recreating...", filePath.c_str()); 117 | CreateDefaultLocalizationFiles(); 118 | 119 | file = std::ifstream(filePath); 120 | langData = json::parse(file); 121 | } 122 | 123 | for (const auto& [category, items] : langData.items()) { 124 | if (category == "version") continue; 125 | 126 | for (const auto& [key, value] : items.items()) { 127 | translations[category][key] = value.get(); 128 | } 129 | } 130 | 131 | LOG_INFO("Loaded language file: %s", filePath.c_str()); 132 | } 133 | catch (const std::exception& e) { 134 | LOG_ERROR("Failed to load language file %s: %s", filePath.c_str(), e.what()); 135 | } 136 | } 137 | 138 | LocalizationData Localization::GetDefaultLocalization() { 139 | return Localizations::GetLocalization_EN(); 140 | } 141 | 142 | std::string Localization::GetLocalizedString(const std::string& category, const std::string& key) { 143 | if (translations.count(category) && translations[category].count(key)) { 144 | return translations[category][key]; 145 | } 146 | return category + "." + key; // Return category.key as fallback 147 | } -------------------------------------------------------------------------------- /HuntDMA/Localization/Localization.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "WorldEntity.h" 4 | #include "LocalizationData.h" 5 | #include "en.h" 6 | #include "ru.h" 7 | 8 | class Localization { 9 | private: 10 | static inline std::unordered_map> translations; 11 | static inline std::string localizationPath = "lang/"; 12 | 13 | static void LoadLanguageFile(const std::string& language); 14 | static LocalizationData GetDefaultLocalization(); 15 | 16 | public: 17 | static inline std::map Languages = { 18 | {"en", Localizations::GetLocalization_EN()}, 19 | {"ru", Localizations::GetLocalization_RU()} 20 | }; 21 | 22 | static void Initialize(); 23 | static std::string GetLocalizedString(const std::string& category, const std::string& key); 24 | static void CreateDefaultLocalizationFiles(); 25 | 26 | #define LOC(category, key) Localization::GetLocalizedString(category, key) 27 | }; -------------------------------------------------------------------------------- /HuntDMA/Localization/LocalizationData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | struct LocalizationData { 5 | static const int LOCALIZATION_VERSION = 6; 6 | int version; 7 | std::unordered_map> translations; 8 | }; -------------------------------------------------------------------------------- /HuntDMA/Logger/Logger.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Logger.h" 3 | #include 4 | #pragma comment(lib, "dbghelp.lib") 5 | 6 | Logger::~Logger() { 7 | if (logFile.is_open()) { 8 | logFile.close(); 9 | } 10 | } 11 | 12 | void Logger::Init(const std::string& logFileName) { 13 | std::lock_guard lock(logMutex); 14 | 15 | if (isInitialized) { 16 | return; 17 | } 18 | 19 | currentLogFileName = logFileName; 20 | logFile.open(logFileName, std::ios::out | std::ios::trunc); 21 | 22 | if (!logFile.is_open()) { 23 | MessageBoxA(NULL, "Failed to open log file", "Logger Error", MB_OK | MB_ICONERROR); 24 | return; 25 | } 26 | 27 | isInitialized = true; 28 | SetupCrashHandler(); 29 | 30 | LOG_INFO("Logger initialized successfully"); 31 | } 32 | 33 | void Logger::Log(LogLevel level, const char* format, ...) { 34 | if (!isInitialized) return; 35 | std::lock_guard lock(logMutex); 36 | 37 | char buffer[4096]; 38 | va_list args; 39 | va_start(args, format); 40 | if (level != LogLevel::Debug) 41 | { 42 | vprintf(format, args); 43 | puts(""); 44 | } 45 | vsnprintf(buffer, sizeof(buffer), format, args); 46 | va_end(args); 47 | 48 | std::string message = GetTimeStamp() + " [" + LogLevelToString(level) + "] " + buffer + "\n"; 49 | WriteToFile(message); 50 | } 51 | 52 | void Logger::LogDebug(const char* format, ...) { 53 | if (!isInitialized) return; 54 | va_list args; 55 | va_start(args, format); 56 | char buffer[4096]; 57 | vsnprintf(buffer, sizeof(buffer), format, args); 58 | va_end(args); 59 | Log(LogLevel::Debug, buffer); 60 | } 61 | 62 | void Logger::LogInfo(const char* format, ...) { 63 | if (!isInitialized) return; 64 | va_list args; 65 | va_start(args, format); 66 | char buffer[4096]; 67 | vsnprintf(buffer, sizeof(buffer), format, args); 68 | va_end(args); 69 | Log(LogLevel::Info, buffer); 70 | } 71 | 72 | void Logger::LogWarning(const char* format, ...) { 73 | if (!isInitialized) return; 74 | va_list args; 75 | va_start(args, format); 76 | char buffer[4096]; 77 | vsnprintf(buffer, sizeof(buffer), format, args); 78 | va_end(args); 79 | Log(LogLevel::Warning, buffer); 80 | } 81 | 82 | void Logger::LogError(const char* format, ...) { 83 | if (!isInitialized) return; 84 | va_list args; 85 | va_start(args, format); 86 | char buffer[4096]; 87 | vsnprintf(buffer, sizeof(buffer), format, args); 88 | va_end(args); 89 | Log(LogLevel::Error, buffer); 90 | } 91 | 92 | void Logger::LogCritical(const char* format, ...) { 93 | va_list args; 94 | va_start(args, format); 95 | char buffer[4096]; 96 | vsnprintf(buffer, sizeof(buffer), format, args); 97 | va_end(args); 98 | Log(LogLevel::Critical, buffer); 99 | } 100 | 101 | const char* Logger::LogLevelToString(LogLevel level) { 102 | switch (level) { 103 | case LogLevel::Debug: return "DEBUG"; 104 | case LogLevel::Info: return "INFO"; 105 | case LogLevel::Warning: return "WARNING"; 106 | case LogLevel::Error: return "ERROR"; 107 | case LogLevel::Critical: return "CRITICAL"; 108 | default: return "UNKNOWN"; 109 | } 110 | } 111 | 112 | std::string Logger::GetTimeStamp() { 113 | auto now = std::chrono::system_clock::now(); 114 | auto timer = std::chrono::system_clock::to_time_t(now); 115 | struct tm timeinfo; 116 | localtime_s(&timeinfo, &timer); 117 | char buffer[80]; 118 | strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", &timeinfo); 119 | return std::string(buffer); 120 | } 121 | 122 | void Logger::WriteToFile(const std::string& message) { 123 | if (logFile.is_open()) { 124 | logFile << message; 125 | logFile.flush(); 126 | } 127 | } 128 | 129 | void Logger::SetupCrashHandler() { 130 | SetUnhandledExceptionFilter(UnhandledExceptionFilter); 131 | LOG_INFO("Crash handler initialized"); 132 | } 133 | 134 | LONG WINAPI Logger::UnhandledExceptionFilter(EXCEPTION_POINTERS* exceptionPointers) { 135 | Logger& logger = Logger::GetInstance(); 136 | 137 | logger.LogCritical("Application crashed!"); 138 | logger.LogCritical("Exception code: 0x%08X", exceptionPointers->ExceptionRecord->ExceptionCode); 139 | logger.LogCritical("Exception address: 0x%p", exceptionPointers->ExceptionRecord->ExceptionAddress); 140 | 141 | std::string dumpPath = "crash_" + std::to_string(std::time(nullptr)) + ".dmp"; 142 | WriteMiniDump(dumpPath, exceptionPointers); 143 | 144 | logger.LogCritical("Minidump written to: %s", dumpPath.c_str()); 145 | 146 | // Show error message to user 147 | std::string errorMsg = "The application has crashed. Please check the log file and crash dump for more information.\n"; 148 | errorMsg += "Log: " + logger.currentLogFileName + "\n"; 149 | errorMsg += "Dump: " + dumpPath; 150 | 151 | MessageBoxA(NULL, errorMsg.c_str(), "Hunt DMA Crash", MB_OK | MB_ICONERROR); 152 | 153 | return EXCEPTION_EXECUTE_HANDLER; 154 | } 155 | 156 | void Logger::WriteMiniDump(const std::string& path, EXCEPTION_POINTERS* exceptionPointers) { 157 | HANDLE hFile = CreateFileA(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 158 | 159 | if (hFile == INVALID_HANDLE_VALUE) { 160 | LOG_ERROR("Failed to create dump file"); 161 | return; 162 | } 163 | 164 | MINIDUMP_EXCEPTION_INFORMATION mei; 165 | mei.ThreadId = GetCurrentThreadId(); 166 | mei.ExceptionPointers = exceptionPointers; 167 | mei.ClientPointers = TRUE; 168 | 169 | MiniDumpWriteDump( 170 | GetCurrentProcess(), 171 | GetCurrentProcessId(), 172 | hFile, 173 | MiniDumpNormal, 174 | &mei, 175 | NULL, 176 | NULL 177 | ); 178 | 179 | CloseHandle(hFile); 180 | } -------------------------------------------------------------------------------- /HuntDMA/Logger/Logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | class Logger { 5 | public: 6 | enum class LogLevel { 7 | Debug, 8 | Info, 9 | Warning, 10 | Error, 11 | Critical 12 | }; 13 | 14 | static Logger& GetInstance() { 15 | static Logger instance; 16 | return instance; 17 | } 18 | 19 | void Init(const std::string& logFileName = "logs_huntdma.log"); 20 | void Log(LogLevel level, const char* format, ...); 21 | void LogDebug(const char* format, ...); 22 | void LogInfo(const char* format, ...); 23 | void LogWarning(const char* format, ...); 24 | void LogError(const char* format, ...); 25 | void LogCritical(const char* format, ...); 26 | 27 | // Crash handling 28 | void SetupCrashHandler(); 29 | static void WriteMiniDump(const std::string& path, EXCEPTION_POINTERS* exceptionPointers); 30 | static LONG WINAPI UnhandledExceptionFilter(EXCEPTION_POINTERS* exceptionPointers); 31 | 32 | private: 33 | Logger() = default; 34 | ~Logger(); 35 | Logger(const Logger&) = delete; 36 | Logger& operator=(const Logger&) = delete; 37 | 38 | std::recursive_mutex logMutex; 39 | std::ofstream logFile; 40 | std::string currentLogFileName; 41 | bool isInitialized = false; 42 | 43 | const char* LogLevelToString(LogLevel level); 44 | std::string GetTimeStamp(); 45 | void WriteToFile(const std::string& message); 46 | }; -------------------------------------------------------------------------------- /HuntDMA/Logger/SystemInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "SystemInfo.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #pragma comment(lib, "wbemuuid.lib") 9 | 10 | std::string SystemInfo::GetOSVersion() { 11 | std::string result; 12 | 13 | // Get version using RtlGetVersion to bypass Windows version lying 14 | typedef NTSTATUS(WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW); 15 | HMODULE ntdll = GetModuleHandleW(L"ntdll"); 16 | if (!ntdll) { 17 | LOG_ERROR("Failed to get ntdll handle"); 18 | return "Unknown Windows Version"; 19 | } 20 | 21 | auto RtlGetVersion = (RtlGetVersionPtr)GetProcAddress(ntdll, "RtlGetVersion"); 22 | if (!RtlGetVersion) { 23 | LOG_ERROR("Failed to get RtlGetVersion address"); 24 | return "Unknown Windows Version"; 25 | } 26 | 27 | RTL_OSVERSIONINFOW osvi = { 0 }; 28 | osvi.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOW); 29 | RtlGetVersion(&osvi); 30 | 31 | // Windows 11 is actually Windows 10 version 22000 or higher 32 | if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0) { 33 | // Read DisplayVersion from registry for more accurate info 34 | std::string displayVersion = RegGetString(HKEY_LOCAL_MACHINE, 35 | "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 36 | "DisplayVersion"); 37 | 38 | std::string buildNumberStr = RegGetString(HKEY_LOCAL_MACHINE, 39 | "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 40 | "CurrentBuildNumber"); 41 | 42 | int buildNumber = 0; 43 | try { 44 | buildNumber = std::stoi(buildNumberStr); 45 | } 46 | catch (const std::exception& e) { 47 | LOG_ERROR("Failed to convert build number: %s", e.what()); 48 | buildNumber = 0; 49 | } 50 | 51 | if (buildNumber >= 22000) { 52 | result = "Windows 11"; 53 | if (!displayVersion.empty()) { 54 | result += " " + displayVersion; 55 | } 56 | } else { 57 | result = "Windows 10"; 58 | if (!displayVersion.empty()) { 59 | result += " " + displayVersion; 60 | } 61 | } 62 | } 63 | // Older Windows versions 64 | else if (osvi.dwMajorVersion == 6) { 65 | switch (osvi.dwMinorVersion) { 66 | case 3: result = "Windows 8.1"; break; 67 | case 2: result = "Windows 8"; break; 68 | case 1: result = "Windows 7"; break; 69 | case 0: result = "Windows Vista"; break; 70 | default: result = "Unknown Windows Version"; break; 71 | } 72 | } 73 | else { 74 | result = "Unknown Windows Version"; 75 | } 76 | 77 | // Add build number 78 | result += " (Build " + std::to_string(osvi.dwBuildNumber) + ")"; 79 | 80 | // Add architecture 81 | SYSTEM_INFO si; 82 | GetNativeSystemInfo(&si); 83 | result += (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || 84 | si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64) ? " 64-bit" : " 32-bit"; 85 | 86 | return result; 87 | } 88 | 89 | std::string SystemInfo::GetCPUName() { 90 | int cpuInfo[4] = { -1 }; 91 | char cpuBrandString[0x40]; 92 | __cpuid(cpuInfo, 0x80000002); 93 | memcpy(cpuBrandString, cpuInfo, sizeof(cpuInfo)); 94 | __cpuid(cpuInfo, 0x80000003); 95 | memcpy(cpuBrandString + 16, cpuInfo, sizeof(cpuInfo)); 96 | __cpuid(cpuInfo, 0x80000004); 97 | memcpy(cpuBrandString + 32, cpuInfo, sizeof(cpuInfo)); 98 | return cpuBrandString; 99 | } 100 | 101 | uint32_t SystemInfo::GetCPUCoreCount() { 102 | SYSTEM_INFO sysInfo; 103 | GetSystemInfo(&sysInfo); 104 | return sysInfo.dwNumberOfProcessors; 105 | } 106 | 107 | std::vector SystemInfo::GetGPUInfo() { 108 | std::vector gpus; 109 | 110 | HRESULT hr = CoInitializeEx(0, COINIT_MULTITHREADED); 111 | if (FAILED(hr)) return gpus; 112 | 113 | IWbemLocator* pLoc = nullptr; 114 | hr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID*)&pLoc); 115 | 116 | if (SUCCEEDED(hr)) { 117 | IWbemServices* pSvc = nullptr; 118 | hr = pLoc->ConnectServer(_bstr_t(L"ROOT\\CIMV2"), NULL, NULL, 0, NULL, 0, 0, &pSvc); 119 | 120 | if (SUCCEEDED(hr)) { 121 | hr = CoSetProxyBlanket(pSvc, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, 122 | RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE); 123 | 124 | if (SUCCEEDED(hr)) { 125 | IEnumWbemClassObject* pEnumerator = nullptr; 126 | hr = pSvc->ExecQuery(bstr_t("WQL"), 127 | bstr_t("SELECT * FROM Win32_VideoController"), 128 | WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, 129 | NULL, 130 | &pEnumerator); 131 | 132 | if (SUCCEEDED(hr)) { 133 | IWbemClassObject* pclsObj = nullptr; 134 | ULONG uReturn = 0; 135 | 136 | while (pEnumerator) { 137 | hr = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj, &uReturn); 138 | if (uReturn == 0) break; 139 | 140 | GPUInfo gpu; 141 | VARIANT vtProp; 142 | 143 | // Get GPU Name 144 | hr = pclsObj->Get(L"Name", 0, &vtProp, 0, 0); 145 | if (SUCCEEDED(hr)) { 146 | gpu.name = _bstr_t(vtProp.bstrVal); 147 | VariantClear(&vtProp); 148 | } 149 | 150 | // Get Driver Version 151 | hr = pclsObj->Get(L"DriverVersion", 0, &vtProp, 0, 0); 152 | if (SUCCEEDED(hr)) { 153 | gpu.driver_version = _bstr_t(vtProp.bstrVal); 154 | VariantClear(&vtProp); 155 | } 156 | 157 | gpus.push_back(gpu); 158 | pclsObj->Release(); 159 | } 160 | pEnumerator->Release(); 161 | } 162 | } 163 | pSvc->Release(); 164 | } 165 | pLoc->Release(); 166 | } 167 | 168 | CoUninitialize(); 169 | return gpus; 170 | } 171 | 172 | // Helper method for getting registry DWORD values 173 | DWORD SystemInfo::RegGetDWORD(HKEY hKey, const std::string& subKey, const std::string& value) { 174 | DWORD data = 0; 175 | DWORD dataSize = sizeof(DWORD); 176 | HKEY hSubKey; 177 | 178 | if (RegOpenKeyExA(hKey, subKey.c_str(), 0, KEY_READ, &hSubKey) == ERROR_SUCCESS) { 179 | RegQueryValueExA(hSubKey, value.c_str(), nullptr, nullptr, reinterpret_cast(&data), &dataSize); 180 | RegCloseKey(hSubKey); 181 | } 182 | 183 | return data; 184 | } 185 | 186 | // Helper method for getting registry string values 187 | std::string SystemInfo::RegGetString(HKEY hKey, const std::string& subKey, const std::string& value) { 188 | char data[1024]; 189 | DWORD dataSize = sizeof(data); 190 | HKEY hSubKey; 191 | 192 | if (RegOpenKeyExA(hKey, subKey.c_str(), 0, KEY_READ, &hSubKey) == ERROR_SUCCESS) { 193 | if (RegQueryValueExA(hSubKey, value.c_str(), nullptr, nullptr, 194 | reinterpret_cast(data), &dataSize) == ERROR_SUCCESS) { 195 | RegCloseKey(hSubKey); 196 | return std::string(data); 197 | } 198 | RegCloseKey(hSubKey); 199 | } 200 | 201 | return ""; 202 | } 203 | 204 | bool SystemInfo::IsRunningAsAdmin() { 205 | BOOL isAdmin = FALSE; 206 | PSID adminGroup = NULL; 207 | SID_IDENTIFIER_AUTHORITY ntAuthority = SECURITY_NT_AUTHORITY; 208 | 209 | if (AllocateAndInitializeSid(&ntAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, 210 | DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &adminGroup)) { 211 | CheckTokenMembership(NULL, adminGroup, &isAdmin); 212 | FreeSid(adminGroup); 213 | } 214 | 215 | return isAdmin != FALSE; 216 | } 217 | 218 | std::string SystemInfo::GetWindowsUsername() { 219 | char username[UNLEN + 1]; 220 | DWORD username_len = UNLEN + 1; 221 | if (GetUserNameA(username, &username_len)) { 222 | return std::string(username); 223 | } 224 | return "Unknown"; 225 | } 226 | 227 | std::string SystemInfo::GetProcessPath() { 228 | char path[MAX_PATH]; 229 | if (GetModuleFileNameA(NULL, path, MAX_PATH) != 0) { 230 | return std::string(path); 231 | } 232 | return "Unknown"; 233 | } 234 | 235 | SystemInfo::SystemData SystemInfo::CollectSystemInfo() { 236 | SystemData data; 237 | 238 | data.os_version = GetOSVersion(); 239 | data.os_build = RegGetString(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "BuildLabEx"); 240 | data.cpu_name = GetCPUName(); 241 | data.cpu_cores = GetCPUCoreCount(); 242 | data.cpu_threads = std::thread::hardware_concurrency(); 243 | 244 | MEMORYSTATUSEX memInfo; 245 | memInfo.dwLength = sizeof(MEMORYSTATUSEX); 246 | if (GlobalMemoryStatusEx(&memInfo)) { 247 | data.total_memory = memInfo.ullTotalPhys; 248 | data.available_memory = memInfo.ullAvailPhys; 249 | } 250 | 251 | data.gpu_info = GetGPUInfo(); 252 | data.process_path = GetProcessPath(); 253 | data.is_admin = IsRunningAsAdmin(); 254 | data.windows_username = GetWindowsUsername(); 255 | 256 | return data; 257 | } 258 | 259 | void SystemInfo::LogSystemInfo() { 260 | LOG_DEBUG("=== System Information ==="); 261 | 262 | SystemData sysInfo = CollectSystemInfo(); 263 | 264 | LOG_DEBUG("OS: %s", sysInfo.os_version.c_str()); 265 | LOG_DEBUG("Build: %s", sysInfo.os_build.c_str()); 266 | LOG_DEBUG("CPU: %s", sysInfo.cpu_name.c_str()); 267 | LOG_DEBUG("CPU Cores: %d", sysInfo.cpu_cores); 268 | LOG_DEBUG("CPU Threads: %d", sysInfo.cpu_threads); 269 | LOG_DEBUG("Total Memory: %.2f GB", sysInfo.total_memory / (1024.0 * 1024.0 * 1024.0)); 270 | LOG_DEBUG("Available Memory: %.2f GB", sysInfo.available_memory / (1024.0 * 1024.0 * 1024.0)); 271 | 272 | LOG_DEBUG("GPUs:"); 273 | for (const auto& gpu : sysInfo.gpu_info) { 274 | LOG_DEBUG(" Name: %s", gpu.name.c_str()); 275 | LOG_DEBUG(" Vendor ID: %s", gpu.vendor_id.c_str()); 276 | LOG_DEBUG(" Dedicated memory: %zu MB", gpu.dedicated_memory); 277 | LOG_DEBUG(" Driver Version: %s", gpu.driver_version.c_str()); 278 | } 279 | 280 | LOG_DEBUG("Process Path: %s", sysInfo.process_path.c_str()); 281 | LOG_DEBUG("Admin Rights: %s", sysInfo.is_admin ? "Yes" : "No"); 282 | 283 | LOG_DEBUG("========================"); 284 | } -------------------------------------------------------------------------------- /HuntDMA/Logger/SystemInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | // Forward declarations to avoid including heavy Windows headers 5 | typedef BOOL(WINAPI* LPFN_GLPI)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, PDWORD); 6 | 7 | class SystemInfo { 8 | public: 9 | struct GPUInfo { 10 | std::string name; 11 | std::string driver_version; 12 | size_t dedicated_memory; 13 | std::string vendor_id; 14 | }; 15 | 16 | struct SystemData { 17 | std::string os_version; 18 | std::string os_build; 19 | std::string cpu_name; 20 | uint32_t cpu_cores; 21 | uint32_t cpu_threads; 22 | uint64_t total_memory; 23 | uint64_t available_memory; 24 | std::vector gpu_info; 25 | std::string process_path; 26 | bool is_admin; 27 | std::string windows_username; 28 | }; 29 | 30 | static SystemData CollectSystemInfo(); 31 | static void LogSystemInfo(); 32 | 33 | private: 34 | static std::string GetOSVersion(); 35 | static std::string GetCPUName(); 36 | static uint32_t GetCPUCoreCount(); 37 | static std::vector GetGPUInfo(); 38 | static bool IsRunningAsAdmin(); 39 | static std::string GetWindowsUsername(); 40 | static std::string GetProcessPath(); 41 | 42 | // Helper methods 43 | static std::string RegGetString(HKEY hKey, const std::string& subKey, const std::string& value); 44 | static DWORD RegGetDWORD(HKEY hKey, const std::string& subKey, const std::string& value); 45 | static std::string WMIQuery(const std::string& wmiClass, const std::string& property); 46 | }; -------------------------------------------------------------------------------- /HuntDMA/Memory/CacheManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "CacheManager.h" 3 | #include "Globals.h" 4 | #include "CheatFunction.h" 5 | 6 | void UpdateLocalPlayer() 7 | { 8 | if (EnvironmentInstance == nullptr) 9 | return; 10 | if (EnvironmentInstance->GetObjectCount() < 10) 11 | return; 12 | EnvironmentInstance->UpdateLocalPlayer(); 13 | } 14 | 15 | void Cache() 16 | { 17 | if (EnvironmentInstance == nullptr) 18 | return; 19 | if (EnvironmentInstance->GetObjectCount() < 10) 20 | return; 21 | EnvironmentInstance->CacheEntities(); 22 | } 23 | 24 | // Initialize global instance 25 | CacheManager g_CacheManager; 26 | 27 | void CacheManager::CacheThreadFunction() 28 | { 29 | while (should_run) 30 | { 31 | if (EnvironmentInstance && EnvironmentInstance->GetObjectCount() > 10) 32 | { 33 | Cache(); 34 | UpdateLocalPlayer(); 35 | 36 | auto sleep_time = std::chrono::milliseconds(8000); 37 | 38 | std::this_thread::sleep_for(sleep_time); 39 | } 40 | else { 41 | // If no work, sleep a bit to prevent CPU spinning 42 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); 43 | } 44 | } 45 | } 46 | 47 | void CacheManager::Start() 48 | { 49 | if (!cache_thread) { 50 | cache_thread = std::make_unique(&CacheManager::CacheThreadFunction, this); 51 | LOG_INFO("Cache thread started"); 52 | } 53 | } 54 | 55 | void CacheManager::Stop() 56 | { 57 | should_run = false; 58 | if (cache_thread && cache_thread->joinable()) { 59 | cache_thread->join(); 60 | LOG_INFO("Cache thread stopped"); 61 | } 62 | } 63 | 64 | CacheManager::~CacheManager() 65 | { 66 | Stop(); 67 | } -------------------------------------------------------------------------------- /HuntDMA/Memory/CacheManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | class CacheManager { 5 | private: 6 | std::atomic should_run{ true }; 7 | std::unique_ptr cache_thread; 8 | 9 | void CacheThreadFunction(); 10 | 11 | public: 12 | CacheManager() = default; 13 | ~CacheManager(); 14 | 15 | void Start(); 16 | void Stop(); 17 | }; 18 | 19 | // Global instance 20 | extern CacheManager g_CacheManager; -------------------------------------------------------------------------------- /HuntDMA/Memory/InputManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "InputManager.h" 3 | #include "Registry.h" 4 | #include "Memory/Memory.h" 5 | 6 | namespace Keyboard 7 | { 8 | uint64_t gafAsyncKeyStateExport = 0; 9 | uint8_t state_bitmap[64]{ }; 10 | uint8_t previous_state_bitmap[256 / 8]{ }; 11 | uint64_t win32kbase = 0; 12 | int win_logon_pid = 0; 13 | } 14 | 15 | bool Keyboard::InitKeyboard() 16 | { 17 | c_registry registry; 18 | std::string win = registry.QueryValue("HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\CurrentBuild", e_registry_type::sz); 19 | if (win == "") 20 | return false; 21 | int Winver = 0; 22 | if (!win.empty()) 23 | Winver = std::stoi(win); 24 | else 25 | return false; 26 | 27 | win_logon_pid = TargetProcess.GetPidFromName("winlogon.exe"); 28 | if (Winver > 22000) 29 | { 30 | auto pids = TargetProcess.GetPidListFromName("csrss.exe"); 31 | for (size_t i = 0; i < pids.size(); i++) 32 | { 33 | auto pid = pids[i]; 34 | uintptr_t tmp = VMMDLL_ProcessGetModuleBaseU(TargetProcess.vHandle, pid, (LPSTR)"win32ksgd.sys"); 35 | uintptr_t g_session_global_slots = tmp + 0x3110; 36 | uintptr_t user_session_state = TargetProcess.Read(TargetProcess.Read(TargetProcess.Read(g_session_global_slots, pid), pid), pid); 37 | gafAsyncKeyStateExport = user_session_state + 0x3690; 38 | if (gafAsyncKeyStateExport > 0x7FFFFFFFFFFF) 39 | break; 40 | } 41 | if (gafAsyncKeyStateExport > 0x7FFFFFFFFFFF) 42 | return true; 43 | return false; 44 | } 45 | else 46 | { 47 | printf("win10\n"); 48 | PVMMDLL_MAP_EAT eat_map = NULL; 49 | PVMMDLL_MAP_EATENTRY eat_map_entry; 50 | bool result = VMMDLL_Map_GetEATU(TargetProcess.vHandle, TargetProcess.GetPidFromName("winlogon.exe") | VMMDLL_PID_PROCESS_WITH_KERNELMEMORY, (LPSTR)"win32kbase.sys", &eat_map); 51 | if (!result) 52 | return false; 53 | 54 | if (eat_map->dwVersion != VMMDLL_MAP_EAT_VERSION) 55 | { 56 | VMMDLL_MemFree(eat_map); 57 | eat_map_entry = NULL; 58 | return false; 59 | } 60 | printf("eat_map->cMap: %d\n", eat_map->cMap); 61 | for (int i = 0; i < eat_map->cMap; i++) 62 | { 63 | eat_map_entry = eat_map->pMap + i; 64 | if (strcmp(eat_map_entry->uszFunction, "gafAsyncKeyState") == 0) 65 | { 66 | gafAsyncKeyStateExport = eat_map_entry->vaFunction; 67 | 68 | break; 69 | } 70 | } 71 | 72 | VMMDLL_MemFree(eat_map); 73 | eat_map = NULL; 74 | if (gafAsyncKeyStateExport > 0x7FFFFFFFFFFF) 75 | return true; 76 | return false; 77 | } 78 | } 79 | 80 | void Keyboard::UpdateKeys() 81 | { 82 | uint8_t previous_key_state_bitmap[64] = { 0 }; 83 | memcpy(previous_key_state_bitmap, state_bitmap, 64); 84 | 85 | VMMDLL_MemReadEx(TargetProcess.vHandle, win_logon_pid | VMMDLL_PID_PROCESS_WITH_KERNELMEMORY, gafAsyncKeyStateExport, (PBYTE)&state_bitmap, 64, NULL, VMMDLL_FLAG_NOCACHE); 86 | for (int vk = 0; vk < 256; ++vk) 87 | if ((state_bitmap[(vk * 2 / 8)] & 1 << vk % 4 * 2) && !(previous_key_state_bitmap[(vk * 2 / 8)] & 1 << vk % 4 * 2)) 88 | previous_state_bitmap[vk / 8] |= 1 << vk % 8; 89 | } 90 | 91 | auto start = std::chrono::system_clock::now(); 92 | 93 | bool Keyboard::IsKeyDown(uint32_t virtual_key_code) 94 | { 95 | if (gafAsyncKeyStateExport < 0x7FFFFFFFFFFF) 96 | return false; 97 | if (std::chrono::system_clock::now() - start > std::chrono::milliseconds(1)) 98 | { 99 | UpdateKeys(); 100 | start = std::chrono::system_clock::now(); 101 | } 102 | return state_bitmap[(virtual_key_code * 2 / 8)] & 1 << virtual_key_code % 4 * 2; 103 | } 104 | -------------------------------------------------------------------------------- /HuntDMA/Memory/InputManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "Registry.h" 4 | 5 | namespace Keyboard 6 | { 7 | bool InitKeyboard(); 8 | 9 | void UpdateKeys(); 10 | bool IsKeyDown(uint32_t virtual_key_code); 11 | }; 12 | -------------------------------------------------------------------------------- /HuntDMA/Memory/Memory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "InputManager.h" 4 | 5 | class Memory 6 | { 7 | private: 8 | struct LibModules 9 | { 10 | HMODULE VMM = nullptr; 11 | HMODULE FTD3XX = nullptr; 12 | HMODULE LEECHCORE = nullptr; 13 | }; 14 | 15 | static inline LibModules modules{ }; 16 | 17 | struct CurrentProcessInformation 18 | { 19 | int PID = 0; 20 | size_t base_address = 0; 21 | size_t base_size = 0; 22 | std::string process_name = ""; 23 | }; 24 | std::unordered_map Modules; 25 | 26 | 27 | static inline BOOLEAN DMA_INITIALIZED = FALSE; 28 | static inline BOOLEAN PROCESS_INITIALIZED = FALSE; 29 | /** 30 | *Dumps the systems Current physical memory pages 31 | *To a file so we can use it in our DMA (: 32 | *This file it created to %temp% folder 33 | *@return true if successful, false if not. 34 | */ 35 | bool DumpMemoryMap(bool debug = false); 36 | 37 | /** 38 | * brief Removes basic information related to the FPGA device 39 | * This is required before any DMA operations can be done. 40 | * To ensure the optimal safety in game cheating. 41 | * @return true if successful, false if not. 42 | */ 43 | bool SetFPGA(); 44 | 45 | /*this->registry_ptr = std::make_shared(*this); 46 | this->key_ptr = std::make_shared(*this);*/ 47 | 48 | public: 49 | static inline CurrentProcessInformation current_process{ }; 50 | 51 | /** 52 | * brief Constructor takes a wide string of the process. 53 | * Expects that all the libraries are in the root dir 54 | */ 55 | Memory(); 56 | ~Memory(); 57 | 58 | /** 59 | * brief Initializes the DMA 60 | * This is required before any DMA operations can be done. 61 | * @param process_name the name of the process 62 | * @param memMap if true, will dump the memory map to a file & make the DMA use it. 63 | * @return true if successful, false if not. 64 | */ 65 | bool Init(std::string process_name, bool memMap = true, bool debug = false); 66 | 67 | /*This part here is things related to the process information such as Base daddy, Size ect.*/ 68 | 69 | /** 70 | * brief Gets the process id of the process 71 | * @param process_name the name of the process 72 | * @return the process id of the process 73 | */ 74 | DWORD GetPidFromName(std::string process_name); 75 | 76 | /** 77 | * brief Gets all the processes id(s) of the process 78 | * @param process_name the name of the process 79 | * @returns all the processes id(s) of the process 80 | */ 81 | std::vector GetPidListFromName(std::string process_name); 82 | 83 | /** 84 | * \brief Gets the module list of the process 85 | * \param process_name the name of the process 86 | * \return all the module names of the process 87 | */ 88 | std::vector GetModuleList(std::string process_name); 89 | 90 | /** 91 | * \brief Gets the process information 92 | * \return the process information 93 | */ 94 | VMMDLL_PROCESS_INFORMATION GetProcessInformation(); 95 | 96 | 97 | /** 98 | * brief Gets the base address of the process 99 | * @param module_name the name of the module 100 | * @return the base address of the process 101 | */ 102 | size_t GetBaseAddress(std::string module_name); 103 | 104 | /** 105 | * brief Gets the base size of the process 106 | * @param module_name the name of the module 107 | * @return the base size of the process 108 | */ 109 | size_t GetBaseSize(std::string module_name); 110 | 111 | /** 112 | * brief Gets the export table address of the process 113 | * @param import the name of the export 114 | * @param process the name of the process 115 | * @param module the name of the module that you wanna find the export in 116 | * @return the export table address of the export 117 | */ 118 | uintptr_t GetExportTableAddress(std::string import, std::string process, std::string module); 119 | 120 | /** 121 | * brief Gets the import table address of the process 122 | * @param import the name of the import 123 | * @param process the name of the process 124 | * @param module the name of the module that you wanna find the import in 125 | * @return the import table address of the import 126 | */ 127 | uintptr_t GetImportTableAddress(std::string import, std::string process, std::string module); 128 | 129 | /** 130 | * \brief This fixes the CR3 fuckery that EAC does. 131 | * It fixes it by iterating over all DTB's that exist within your system and looks for specific ones 132 | * that nolonger have a PID assigned to them, aka their pid is 0 133 | * it then puts it in a vector to later try each possible DTB to find the DTB of the process. 134 | * NOTE: Using FixCR3 requires you to have symsrv.dll, dbghelp.dll and info.db 135 | */ 136 | bool FixCr3(); 137 | 138 | /** 139 | * \brief Dumps the process memory at address (requires to be a valid PE Header) to the path 140 | * \param address the address to the PE Header(BaseAddress) 141 | * \param path the path where you wanna save dump to 142 | */ 143 | bool DumpMemory(uintptr_t address, std::string path); 144 | 145 | /*This part is where all memory operations are done, such as read, write.*/ 146 | 147 | /** 148 | * \brief Scans the process for the signature. 149 | * \param signature the signature example "48 ? ? ?" 150 | * \param range_start Region to start scan from 151 | * \param range_end Region up to where it should scan 152 | * \param PID (OPTIONAL) where to read to? 153 | * \return address of signature 154 | */ 155 | uint64_t FindSignature(const char* signature, uint64_t range_start, uint64_t range_end, int PID = 0); 156 | 157 | /** 158 | * \brief Writes memory to the process 159 | * \param address The address to write to 160 | * \param buffer The buffer to writeze of the buffer 161 | * \return 162 | * \param size The si 163 | */ 164 | bool Write(uintptr_t address, void* buffer, size_t size) const; 165 | bool Write(uintptr_t address, void* buffer, size_t size, int pid) const; 166 | 167 | /** 168 | * \brief Writes memory to the process using a template 169 | * \param address to write to 170 | * \param value the value you'll write to the address 171 | */ 172 | template 173 | bool Write(void* address, T value) 174 | { 175 | return Write(address, &value, sizeof(T)); 176 | } 177 | 178 | template 179 | bool Write(uintptr_t address, T value) 180 | { 181 | return Write(address, &value, sizeof(T)); 182 | } 183 | 184 | /** 185 | * brief Reads memory from the process 186 | * @param address The address to read from 187 | * @param buffer The buffer to read to 188 | * @param size The size of the buffer 189 | * @return true if successful, false if not. 190 | */ 191 | bool Read(uintptr_t address, void* buffer, size_t size) const; 192 | bool Read(uintptr_t address, void* buffer, size_t size, int pid) const; 193 | 194 | /** 195 | * brief Reads memory from the process using a template 196 | * @param address The address to read from 197 | * @return the value read from the process 198 | */ 199 | template 200 | T Read(void* address) 201 | { 202 | T buffer{ }; 203 | memset(&buffer, 0, sizeof(T)); 204 | Read(reinterpret_cast(address), reinterpret_cast(&buffer), sizeof(T)); 205 | 206 | return buffer; 207 | } 208 | 209 | template 210 | T Read(uint64_t address) 211 | { 212 | return Read(reinterpret_cast(address)); 213 | } 214 | 215 | /** 216 | * brief Reads memory from the process using a template and pid 217 | * @param address The address to read from 218 | * @param pid The process id of the process 219 | * @return the value read from the process 220 | */ 221 | template 222 | T Read(void* address, int pid) 223 | { 224 | T buffer{ }; 225 | memset(&buffer, 0, sizeof(T)); 226 | Read(reinterpret_cast(address), reinterpret_cast(&buffer), sizeof(T), pid); 227 | 228 | return buffer; 229 | } 230 | 231 | template 232 | T Read(uint64_t address, int pid) 233 | { 234 | return Read(reinterpret_cast(address), pid); 235 | } 236 | 237 | /** 238 | * \brief Create a scatter handle, this is used for scatter read/write requests 239 | * \return Scatter handle 240 | */ 241 | VMMDLL_SCATTER_HANDLE CreateScatterHandle(); 242 | VMMDLL_SCATTER_HANDLE CreateScatterHandle(int pid); 243 | 244 | /** 245 | * \brief Closes the scatter handle 246 | * \param handle 247 | */ 248 | void CloseScatterHandle(VMMDLL_SCATTER_HANDLE handle); 249 | 250 | /** 251 | * \brief Adds a scatter read/write request to the handle 252 | * \param handle the handle 253 | * \param address the address to read/write to 254 | * \param buffer the buffer to read/write to 255 | * \param size the size of buffer 256 | */ 257 | bool AddScatterReadRequest(VMMDLL_SCATTER_HANDLE handle, uint64_t address, void* buffer, size_t size); 258 | void AddScatterWriteRequest(VMMDLL_SCATTER_HANDLE handle, uint64_t address, void* buffer, size_t size); 259 | template 260 | bool AddScatterWriteRequest(VMMDLL_SCATTER_HANDLE handle, uint64_t addr, T value) const 261 | { 262 | if (!(addr > 0x2000000 && addr < 0x7FFFFFFFFFFF)) 263 | return false; 264 | bool ret = !VMMDLL_Scatter_PrepareWrite(handle, addr, reinterpret_cast(&value), sizeof(value)); 265 | if (!ret) 266 | { 267 | LOG_ERROR("failed to prepare scatter write at 0x%p", addr); 268 | } 269 | return ret; 270 | } 271 | 272 | /** 273 | * \brief Executes all prepared scatter requests, note if you created a scatter handle with a pid 274 | * you'll need to specify the pid in the execute function. so we can clear the scatters from the handle. 275 | * \param handle 276 | * \param pid 277 | */ 278 | void ExecuteReadScatter(VMMDLL_SCATTER_HANDLE handle, int pid = 0); 279 | void ExecuteWriteScatter(VMMDLL_SCATTER_HANDLE handle, int pid = 0); 280 | 281 | /*the FPGA handle*/ 282 | VMM_HANDLE vHandle; 283 | }; 284 | 285 | inline Memory TargetProcess; 286 | -------------------------------------------------------------------------------- /HuntDMA/Memory/Registry.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Registry.h" 3 | #include "Memory.h" 4 | 5 | std::string c_registry::QueryValue(const char* path, e_registry_type type) 6 | { 7 | BYTE buffer[0x128]; 8 | DWORD _type = (DWORD)type; 9 | DWORD size = sizeof(buffer); 10 | bool result = VMMDLL_WinReg_QueryValueExU(TargetProcess.vHandle, CC_TO_LPSTR(path), &_type, buffer, &size); 11 | if (!result) 12 | { 13 | LOG_ERROR("[!] failed QueryValueExU call"); 14 | return ""; 15 | } 16 | std::wstring wstr = std::wstring((wchar_t*)buffer); 17 | return std::string(wstr.begin(), wstr.end()); 18 | } 19 | -------------------------------------------------------------------------------- /HuntDMA/Memory/Registry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | 4 | enum class e_registry_type 5 | { 6 | none = REG_NONE, 7 | sz = REG_SZ, 8 | expand_sz = REG_EXPAND_SZ, 9 | binary = REG_BINARY, 10 | dword = REG_DWORD, 11 | dword_little_endian = REG_DWORD_LITTLE_ENDIAN, 12 | dword_big_endian = REG_DWORD_BIG_ENDIAN, 13 | link = REG_LINK, 14 | multi_sz = REG_MULTI_SZ, 15 | resource_list = REG_RESOURCE_LIST, 16 | full_resource_descriptor = REG_FULL_RESOURCE_DESCRIPTOR, 17 | resource_requirements_list = REG_RESOURCE_REQUIREMENTS_LIST, 18 | qword = REG_QWORD, 19 | qword_little_endian = REG_QWORD_LITTLE_ENDIAN 20 | }; 21 | 22 | inline const char* LPWSTR_TO_CC(LPWSTR in) 23 | { 24 | char buffer[500]; 25 | wcstombs(buffer, in, 500); 26 | 27 | return buffer; 28 | } 29 | 30 | inline LPSTR CC_TO_LPSTR(const char* in) 31 | { 32 | LPSTR out = new char[strlen(in) + 1]; 33 | strcpy_s(out, strlen(in) + 1, in); 34 | 35 | return out; 36 | } 37 | 38 | class c_registry 39 | { 40 | private: 41 | public: 42 | c_registry() 43 | { 44 | } 45 | 46 | ~c_registry() 47 | { 48 | } 49 | 50 | std::string QueryValue(const char* path, e_registry_type type); 51 | }; 52 | -------------------------------------------------------------------------------- /HuntDMA/Misc/CheatFunction.cpp: -------------------------------------------------------------------------------- 1 | #include "Pch.h" 2 | #include "CheatFunction.h" 3 | #include 4 | 5 | CheatFunction::CheatFunction(int msTimer, std::function func) 6 | { 7 | MsSleep = msTimer; 8 | Function = func; 9 | } 10 | 11 | void CheatFunction::Execute() 12 | { 13 | auto now = std::chrono::high_resolution_clock::now(); 14 | if (std::chrono::duration_cast(now - LastExecution).count() > MsSleep) 15 | { 16 | LastExecution = now; 17 | Function(); 18 | } 19 | } -------------------------------------------------------------------------------- /HuntDMA/Misc/CheatFunction.h: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma once 3 | class CheatFunction 4 | { 5 | int MsSleep = 0; 6 | std::function Function; 7 | std::chrono::time_point LastExecution; 8 | public: 9 | CheatFunction(int time, std::functionfunc); 10 | void Execute(); 11 | }; -------------------------------------------------------------------------------- /HuntDMA/Misc/Input.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "Input.h" 3 | #include "Init.h" 4 | #include "ConfigUtilities.h" 5 | #include "ImGuiMenu.h" 6 | 7 | // local scope enum 8 | enum class KeyState 9 | { 10 | KeyDormant = 0, 11 | KeyInvoked = 1, 12 | KeyActive = 2 13 | }; 14 | 15 | // could do dictionaries but we only want to handle ascii 16 | std::map KeyHeld; 17 | std::map KeyStates; 18 | std::map KeyTimes; 19 | 20 | Vector2 MousePos; 21 | WPARAM Char = NULL; 22 | HCURSOR CurrentCursor; 23 | std::map Cursors; 24 | 25 | bool isFocused = false; 26 | 27 | void CreateCursor(std::string name, HCURSOR cursor) 28 | { 29 | Cursors[name] = cursor; 30 | } 31 | 32 | void SetCurrentCursor(std::string name) 33 | { 34 | CurrentCursor = Cursors[name]; 35 | } 36 | 37 | HCURSOR GetCurrentCursor() 38 | { 39 | return CurrentCursor; 40 | } 41 | 42 | void UpdateKeyState(int key, bool down) 43 | { 44 | if (key < 0 || key > 255) // assuming you are only dealing with ASCII values 45 | return; 46 | KeyTimes[key] = clock() * 0.001f; 47 | if (KeyHeld[key] && !down) 48 | KeyStates[key] = KeyState::KeyDormant; 49 | 50 | if (KeyHeld[key] && down) 51 | KeyStates[key] = KeyState::KeyActive; 52 | 53 | if (!KeyHeld[key] && down) 54 | KeyStates[key] = KeyState::KeyInvoked; 55 | 56 | KeyHeld[key] = down; 57 | } 58 | 59 | /// 60 | /// If mouse is on the edge of the screen, or on the other monitor - close menu. 61 | /// If mouse is in focus of this window, show menu 62 | /// 63 | void CheckAdaptiveMenuOpenState(bool focus) 64 | { 65 | if (Configs.General.OverlayMode) return; // No need in overlay mode 66 | 67 | bool prevFocus = isFocused; 68 | 69 | if (!focus) 70 | { 71 | isFocused = false; 72 | } 73 | else 74 | { 75 | bool isMouseOnWindowEdge = 76 | MousePos.x <= 0 || 77 | MousePos.y <= 0 || 78 | MousePos.x >= ((Configs.General.OverrideResolution ? Configs.General.Width : GetSystemMetrics(SM_CXSCREEN)) - 1) || 79 | MousePos.y >= ((Configs.General.OverrideResolution ? Configs.General.Height : GetSystemMetrics(SM_CYSCREEN)) - 1); 80 | 81 | isFocused = !isMouseOnWindowEdge; 82 | } 83 | 84 | if (prevFocus != isFocused) // if focus changed 85 | MenuOpen = isFocused; 86 | } 87 | 88 | LRESULT CALLBACK InputWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 89 | { 90 | switch (message) 91 | { 92 | case WM_MOVE: 93 | SetWindowPos(hWnd, NULL, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), SWP_NOZORDER | SWP_NOACTIVATE); 94 | InitializeESP(); 95 | break; 96 | case WM_CHAR: 97 | Char = wParam; 98 | break; // Added missing break statement 99 | case WM_KEYUP: 100 | case WM_SYSKEYUP: 101 | UpdateKeyState(wParam & 0xFF, false); 102 | break; 103 | case WM_KEYDOWN: 104 | case WM_SYSKEYDOWN: 105 | UpdateKeyState(wParam & 0xFF, true); 106 | break; 107 | case WM_LBUTTONUP: 108 | UpdateKeyState(VK_LBUTTON, false); 109 | break; 110 | case WM_MBUTTONUP: 111 | UpdateKeyState(VK_MBUTTON, false); 112 | break; 113 | case WM_RBUTTONUP: 114 | UpdateKeyState(VK_RBUTTON, false); 115 | break; 116 | case WM_MOUSEMOVE: 117 | MousePos.x = static_cast(GET_X_LPARAM(lParam)); 118 | MousePos.y = static_cast(GET_Y_LPARAM(lParam)); 119 | CheckAdaptiveMenuOpenState(true); 120 | break; 121 | case WM_MOUSELEAVE: 122 | case WM_KILLFOCUS: 123 | CheckAdaptiveMenuOpenState(false); 124 | break; 125 | case WM_XBUTTONUP: 126 | { 127 | const auto releasedkey = (wParam >> 16) & 0xFFFF; 128 | if (releasedkey == XBUTTON1) 129 | UpdateKeyState(VK_XBUTTON1, false); 130 | else if (releasedkey == XBUTTON2) 131 | UpdateKeyState(VK_XBUTTON2, false); 132 | break; 133 | } 134 | case WM_XBUTTONDOWN: 135 | { 136 | const auto releasedkey = (wParam >> 16) & 0xFFFF; 137 | if (releasedkey == XBUTTON1) 138 | UpdateKeyState(VK_XBUTTON1, true); 139 | else if (releasedkey == XBUTTON2) 140 | UpdateKeyState(VK_XBUTTON2, true); 141 | break; 142 | } 143 | case WM_LBUTTONDOWN: 144 | UpdateKeyState(VK_LBUTTON, true); 145 | break; 146 | case WM_MBUTTONDOWN: 147 | UpdateKeyState(VK_MBUTTON, true); 148 | break; 149 | case WM_RBUTTONDOWN: 150 | UpdateKeyState(VK_RBUTTON, true); 151 | break; 152 | default: 153 | return DefWindowProc(hWnd, message, wParam, lParam); 154 | } 155 | return 0; 156 | } 157 | 158 | // check for a held key 159 | bool IsKeyDown(int key) 160 | { 161 | if (key < 0 || key > 255) // assuming you are only dealing with ASCII values 162 | return false; 163 | return KeyHeld[key]; 164 | } 165 | 166 | // check for a clicked key 167 | bool IsKeyClicked(int key) 168 | { 169 | if (key < 0 || key > 255) // assuming you are only dealing with ASCII values 170 | return false; 171 | if (KeyStates[key] == KeyState::KeyInvoked && (KeyTimes[key]) >= (clock() * 0.001f) - 0.05f) 172 | return true; 173 | return false; 174 | } 175 | 176 | // just fill the dictionaries 177 | void SetInput() 178 | { 179 | for (int i = 0; i <= 255; i++) // 255 is for the ASCII character set, expand it for UTF8 Unicode 180 | { 181 | KeyStates[i] = KeyState::KeyDormant; 182 | KeyHeld[i] = false; 183 | KeyTimes[i] = 0.0f; 184 | } 185 | } 186 | 187 | bool IsMouseInRectangle(int x, int y, int width, int height) 188 | { 189 | return ( 190 | MousePos.x > x && 191 | MousePos.y > y && 192 | MousePos.x < x + width && 193 | MousePos.y < y + height 194 | ); 195 | } 196 | 197 | bool IsMouseInRectangle(Vector2 pos, Vector2 Dimensions) 198 | { 199 | return ( 200 | MousePos.x > pos.x && 201 | MousePos.y > pos.y && 202 | MousePos.x < pos.x + Dimensions.x && 203 | MousePos.y < pos.y + Dimensions.y 204 | ); 205 | } 206 | 207 | float TriangleArea(Vector2 point1, Vector2 point2, Vector2 point3) 208 | { 209 | return (point1.x - point3.x) * (point2.y - point3.y) - (point2.x - point3.x) * (point1.y - point3.y); 210 | } 211 | 212 | bool IsMouseInTriangle(Vector2 point1, Vector2 point2, Vector2 point3) 213 | { 214 | float d1; 215 | float d2; 216 | float d3; 217 | bool neg; 218 | bool pos; 219 | 220 | d1 = TriangleArea(MousePos, point1, point2); 221 | d2 = TriangleArea(MousePos, point2, point3); 222 | d3 = TriangleArea(MousePos, point3, point1); 223 | 224 | neg = (d1 < 0) || (d2 < 0) || (d3 < 0); 225 | pos = (d1 > 0) || (d2 > 0) || (d3 > 0); 226 | 227 | return !(neg && pos); 228 | } -------------------------------------------------------------------------------- /HuntDMA/Misc/Input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern bool isFocused; 4 | extern Vector2 MousePos; 5 | extern std::map Cursors; 6 | extern WPARAM Char; 7 | LRESULT CALLBACK InputWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); 8 | 9 | bool IsKeyDown(int key); 10 | bool IsKeyClicked(int key); 11 | void SetInput(); 12 | bool IsMouseInRectangle(int x, int y, int width, int height); 13 | bool IsMouseInRectangle(Vector2 pos, Vector2 Dimensions); 14 | bool IsMouseInTriangle(Vector2 point1, Vector2 point2, Vector2 point3); 15 | 16 | void SetCurrentCursor(std::string name); 17 | void CreateCursor(std::string name, HCURSOR cursor); 18 | HCURSOR GetCurrentCursor(); 19 | -------------------------------------------------------------------------------- /HuntDMA/Misc/Pch/Pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" -------------------------------------------------------------------------------- /HuntDMA/Misc/Pch/Pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define _CRT_SECURE_NO_WARNINGS 3 | #define NOMINMAX 4 | #define _WINSOCK_DEPRECATED_NO_WARNINGS 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #pragma comment(lib, "d3d11.lib") 31 | #pragma comment(lib, "dxgi.lib") 32 | #include 33 | #pragma comment(lib, "dwmapi.lib") 34 | 35 | #ifdef DrawText 36 | #undef DrawText 37 | #endif 38 | #ifdef GetCurrentTime 39 | #undef GetCurrentTime 40 | #endif 41 | #ifdef GetObject 42 | #undef GetObject 43 | #endif 44 | #ifdef SendMessage 45 | #undef SendMessage 46 | #endif 47 | #ifdef GetUserName 48 | #undef GetUserName 49 | #endif 50 | #ifdef CreateFont 51 | #undef CreateFont 52 | #endif 53 | #ifdef Button 54 | #undef Button 55 | #endif 56 | #ifdef max 57 | #undef max 58 | #endif 59 | #ifdef min 60 | #undef min 61 | #endif 62 | #include 63 | #define DEBUG_INFO 64 | #ifdef DEBUG_INFO 65 | #include "Logger.h" 66 | #define LOG_DEBUG(...) Logger::GetInstance().LogDebug(__VA_ARGS__) 67 | #define LOG_INFO(...) Logger::GetInstance().LogInfo(__VA_ARGS__) 68 | #define LOG_WARNING(...) Logger::GetInstance().LogWarning(__VA_ARGS__) 69 | #define LOG_ERROR(...) Logger::GetInstance().LogError(__VA_ARGS__) 70 | #define LOG_CRITICAL(...) Logger::GetInstance().LogCritical(__VA_ARGS__) 71 | #else 72 | #define LOG 73 | #define LOGW 74 | #endif 75 | #include "json.hpp" 76 | using json = nlohmann::json; 77 | #pragma comment(lib, "ws2_32.lib") 78 | #pragma comment(lib, "vmm.lib") 79 | #pragma comment(lib, "leechcore.lib") 80 | #pragma comment(lib, "FTD3XX.lib") 81 | #pragma comment(lib, "d2d1.lib") 82 | #pragma comment(lib, "Dwrite") 83 | #pragma comment(lib, "windowscodecs.lib") 84 | #include "Vector.h" 85 | #include "Input.h" 86 | #include "XorStr.h" 87 | #include "Memory.h" 88 | #include "CheatFunction.h" 89 | #include "imgui.h" 90 | #include "imgui_impl_win32.h" 91 | #include "imgui_impl_dx11.h" -------------------------------------------------------------------------------- /HuntDMA/Misc/Vector.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "vector.h" 3 | 4 | #include 5 | #include 6 | 7 | Vector2::Vector2() : x(0), y(0) { } 8 | 9 | Vector2::Vector2(float _x, float _y) : x(_x), y(_y) { } 10 | 11 | Vector2::~Vector2() { } 12 | 13 | Vector2 Vector2::operator*(Vector2 a) 14 | { 15 | return Vector2(x * a.x, y * a.y); 16 | } 17 | 18 | Vector2 Vector2::operator*(float value) 19 | { 20 | return Vector2(x * value, y * value); 21 | } 22 | 23 | Vector2 Vector2::operator/(Vector2 a) 24 | { 25 | return Vector2(x / a.x, y / a.y); 26 | } 27 | 28 | Vector2 Vector2::operator/(float value) 29 | { 30 | return Vector2(x / value, y / value); 31 | } 32 | 33 | Vector2 Vector2::operator+(Vector2 a) 34 | { 35 | return Vector2(x + a.x, y + a.y); 36 | } 37 | 38 | Vector2 Vector2::operator-(Vector2 a) 39 | { 40 | return Vector2(x - a.x, y - a.y); 41 | } 42 | 43 | bool Vector2::operator==(Vector2 a) 44 | { 45 | return x == a.x && y == a.y; 46 | } 47 | 48 | bool Vector2::operator!=(Vector2 a) 49 | { 50 | return x != a.x || y != a.y; 51 | } 52 | 53 | bool Vector2::IsZero() const 54 | { 55 | return !x && !y; 56 | } 57 | 58 | Vector2 Vector2::Zero() 59 | { 60 | return Vector2(); 61 | } 62 | 63 | float Vector2::Distance(Vector2 a, Vector2 b) 64 | { 65 | const auto difference = Vector2( 66 | a.x - b.x, 67 | a.y - b.y); 68 | 69 | return sqrt( 70 | powf(difference.x, 2.0f) + 71 | powf(difference.y, 2.0f)); 72 | } 73 | 74 | float Vector2::Length(Vector2 a) 75 | { 76 | return std::sqrt(a.x * a.x + a.y * a.y); 77 | } 78 | 79 | Vector3::Vector3() : x(0), y(0), z(0) { } 80 | 81 | Vector3::Vector3(float _x, float _y, float _z) : x(_x), y(_y), z(_z) { } 82 | 83 | Vector3::~Vector3() { } 84 | 85 | Vector3 Vector3::operator*(Vector3 a) 86 | { 87 | return Vector3(x * a.x, y * a.y, z * a.z); 88 | } 89 | 90 | Vector3 Vector3::operator*(float f) 91 | { 92 | return Vector3(x * f, y * f, z * f); 93 | } 94 | 95 | Vector3 Vector3::operator/(Vector3 a) 96 | { 97 | return Vector3(x / a.x, y / a.y, z / a.z); 98 | } 99 | 100 | Vector3 Vector3::operator/(float f) 101 | { 102 | return Vector3(x / f, y / f, z / f); 103 | } 104 | 105 | Vector3 Vector3::operator+(Vector3 a) 106 | { 107 | return Vector3(x + a.x, y + a.y, z + a.z); 108 | } 109 | 110 | Vector3 Vector3::operator-(Vector3 a) 111 | { 112 | return Vector3(x - a.x, y - a.y, z - a.z); 113 | } 114 | 115 | bool Vector3::operator==(Vector3 a) 116 | { 117 | return x == a.x && y == a.y && z == a.z; 118 | } 119 | 120 | bool Vector3::operator!=(Vector3 a) 121 | { 122 | return x != a.x || y != a.y || z != a.z; 123 | } 124 | 125 | bool Vector3::IsZero() const 126 | { 127 | return !x && !y && !z; 128 | } 129 | 130 | float Vector3::Dot(Vector3 left, Vector3 right) 131 | { 132 | return (left.x * right.x) + (left.y * right.y) + (left.z * right.z); 133 | } 134 | 135 | float Vector3::Distance(Vector3 a, Vector3 b) 136 | { 137 | const auto difference = Vector3( 138 | a.x - b.x, 139 | a.y - b.y, 140 | a.z - b.z); 141 | 142 | return sqrt( 143 | powf(difference.x, 2.0f) + 144 | powf(difference.y, 2.0f) + 145 | powf(difference.z, 2.0f) 146 | ); 147 | 148 | } 149 | 150 | int Vector3::FormattedDistance(Vector3 a, Vector3 b) 151 | { 152 | const auto difference = Vector3( 153 | a.x - b.x, 154 | a.y - b.y, 155 | a.z - b.z); 156 | 157 | int distance = sqrt( 158 | powf(difference.x, 2.0f) + 159 | powf(difference.y, 2.0f) + 160 | powf(difference.z, 2.0f) 161 | ); 162 | return (int)(5 * round(distance / 5.0)); 163 | } 164 | 165 | Vector3 Vector3::Zero() 166 | { 167 | return Vector3(); 168 | } 169 | 170 | float Vector3::Length() const 171 | { 172 | return sqrt((x * x) + (y * y) + (z * z)); 173 | } 174 | 175 | float Vector3::LengthSqr() const 176 | { 177 | return (x * x) + (y * y) + (z * z); 178 | } 179 | 180 | Vector3 Vector3::Clamp() const 181 | { 182 | Vector3 angles = *this; 183 | 184 | if (angles.x > 89.f) 185 | angles.x -= 360.f; 186 | else if (angles.x < -89.f) 187 | angles.x += 360.f; 188 | 189 | if (angles.y > 180.f) 190 | angles.y -= 360.f; 191 | else if (angles.y < -180.f) 192 | angles.y += 360.f; 193 | 194 | angles.z = 0.f; 195 | return angles; 196 | } 197 | 198 | Vector3 Vector3::Lerp(Vector3 a, Vector3 b, float t) 199 | { 200 | return a * (1.f - t) + b * t; 201 | } 202 | 203 | 204 | Vector3 ViewMatrix::Transform(const Vector3 vector) const 205 | { 206 | Vector3 transformed; 207 | 208 | transformed.x = vector.y * matrix[0][1] + vector.x * matrix[0][0] + vector.z * matrix[0][2] + matrix[0][3]; 209 | transformed.y = vector.y * matrix[1][1] + vector.x * matrix[1][0] + vector.z * matrix[1][2] + matrix[1][3]; 210 | transformed.z = vector.y * matrix[3][1] + vector.x * matrix[3][0] + vector.z * matrix[3][2] + matrix[3][3]; 211 | 212 | return transformed; 213 | } 214 | 215 | Vector4::Vector4() : x(0), y(0), z(0), w(0) 216 | { 217 | } 218 | 219 | Vector4::Vector4(float _x, float _y, float _z, float _w) : x(_x), y(_y), z(_z), w(_w) 220 | { 221 | } 222 | 223 | Vector4::~Vector4() 224 | { 225 | } 226 | 227 | Vector4 Vector4::operator*(const Vector4& a) const 228 | { 229 | return Vector4(x * a.x, y * a.y, z * a.z, w * a.w); 230 | } 231 | 232 | Vector3 Vector4::Mult(const Vector4& rotation, const Vector3& point) 233 | { 234 | float num = rotation.x * 2.0f; 235 | float num2 = rotation.y * 2.f; 236 | float num3 = rotation.z * 2.f; 237 | float num4 = rotation.x * num; 238 | float num5 = rotation.y * num2; 239 | float num6 = rotation.z * num3; 240 | float num7 = rotation.x * num2; 241 | float num8 = rotation.x * num3; 242 | float num9 = rotation.y * num3; 243 | float num10 = rotation.w * num; 244 | float num11 = rotation.w * num2; 245 | float num12 = rotation.w * num3; 246 | Vector3 result; 247 | result.x = (1.f - (num5 + num6)) * point.x + (num7 - num12) * point.y + (num8 + num11) * point.z; 248 | result.y = (num7 + num12) * point.x + (1.0f - (num4 + num6)) * point.y + (num9 - num10) * point.z; 249 | result.z = (num8 - num11) * point.x + (num9 + num10) * point.y + (1.f - (num4 + num5)) * point.z; 250 | return result; 251 | 252 | } 253 | 254 | 255 | Vector4 Vector4::operator*(float f) const 256 | { 257 | return Vector4(x * f, y * f, z * f, w * f); 258 | } 259 | 260 | Vector4 Vector4::operator/(const Vector4& a) const 261 | { 262 | return Vector4(x / a.x, y / a.y, z / a.z, w / a.w); 263 | } 264 | 265 | Vector4 Vector4::operator/(float f) const 266 | { 267 | return Vector4(x / f, y / f, z / f, w / f); 268 | } 269 | 270 | Vector4 Vector4::operator+(const Vector4& a) const 271 | { 272 | return Vector4(x + a.x, y + a.y, z + a.z, w + a.w); 273 | } 274 | 275 | Vector4 Vector4::operator-(const Vector4& a) const 276 | { 277 | return Vector4(x - a.x, y - a.y, z - a.z, w - a.w); 278 | } 279 | 280 | bool Vector4::operator==(const Vector4& a) const 281 | { 282 | return x == a.x && y == a.y && z == a.z && w == a.w; 283 | } 284 | 285 | bool Vector4::operator!=(const Vector4& a) const 286 | { 287 | return x != a.x || y != a.y || z != a.z || w != a.w; 288 | } 289 | 290 | bool Vector4::IsZero() const 291 | { 292 | return !x && !y && !z && !w; 293 | } 294 | 295 | float Vector4::Dot(const Vector4& left, const Vector4& right) 296 | { 297 | return (left.x * right.x) + (left.y * right.y) + (left.z * right.z) + (left.w * right.w); 298 | } 299 | 300 | float Vector4::Distance(const Vector4& a, const Vector4& b) 301 | { 302 | const Vector4 difference = Vector4( 303 | a.x - b.x, 304 | a.y - b.y, 305 | a.z - b.z, 306 | a.w - b.w); 307 | 308 | return sqrtf( 309 | powf(difference.x, 2.0f) + 310 | powf(difference.y, 2.0f) + 311 | powf(difference.z, 2.0f) + 312 | powf(difference.w, 2.0f) 313 | ); 314 | } 315 | 316 | int Vector4::FormattedDistance(const Vector4& a, const Vector4& b) 317 | { 318 | const auto difference = Vector4( 319 | a.x - b.x, 320 | a.y - b.y, 321 | a.z - b.z, 322 | a.w - b.w); 323 | 324 | int distance = sqrt( 325 | powf(difference.x, 2.0f) + 326 | powf(difference.y, 2.0f) + 327 | powf(difference.z, 2.0f) + 328 | powf(difference.w, 2.0f) 329 | ); 330 | return (int)(5 * round(distance / 5.0)); 331 | } 332 | 333 | Vector4 Vector4::Zero() 334 | { 335 | return Vector4(); 336 | } 337 | 338 | float Vector4::Length() const 339 | { 340 | return sqrt((x * x) + (y * y) + (z * z) + (w * w)); 341 | } 342 | 343 | float Vector4::LengthSqr() const 344 | { 345 | return (x * x) + (y * y) + (z * z) + (w * w); 346 | } 347 | 348 | Vector4 Vector4::Clamp() const 349 | { 350 | Vector4 angles = *this; 351 | 352 | if (angles.x > 89.f) 353 | angles.x -= 360.f; 354 | else if (angles.x < -89.f) 355 | angles.x += 360.f; 356 | 357 | if (angles.y > 180.f) 358 | angles.y -= 360.f; 359 | else if (angles.y < -180.f) 360 | angles.y += 360.f; 361 | 362 | angles.z = 0.f; 363 | angles.w = 0.f; 364 | return angles; 365 | } 366 | 367 | Vector4 Vector4::ToQuaternion(const Vector2& euler) 368 | { 369 | const auto to_radians = [](float degree) -> float 370 | { 371 | constexpr float pi = 3.14159265358979323846f; 372 | return degree * (pi / 180.f); 373 | }; 374 | 375 | float heading = to_radians(euler.x); 376 | float attitude = to_radians(euler.y); 377 | float bank = to_radians(0); 378 | 379 | float c1 = cos(heading * 0.5f); 380 | float s1 = sin(heading * 0.5f); 381 | float c2 = cos(attitude * 0.5f); 382 | float s2 = sin(attitude * 0.5f); 383 | float c3 = cos(bank * 0.5f); 384 | float s3 = sin(bank * 0.5f); 385 | 386 | float c1c2 = c1 * c2; 387 | float s1s2 = s1 * s2; 388 | 389 | Vector4 quat{ 390 | c1c2 * s3 + s1s2 * c3, 391 | s1 * c2 * c3 + c1 * s2 * s3, 392 | c1 * s2 * c3 - s1 * c2 * s3, 393 | c1c2 * c3 - s1s2 * s3 394 | }; 395 | 396 | return { quat.y, quat.z, (quat.x * -1.f), quat.w }; 397 | } 398 | -------------------------------------------------------------------------------- /HuntDMA/Misc/Vector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class Vector2 3 | { 4 | public: 5 | Vector2(); 6 | Vector2(float _x, float _y); 7 | ~Vector2(); 8 | 9 | float x, y; 10 | 11 | Vector2 operator *(Vector2 a); 12 | Vector2 operator *(float value); 13 | Vector2 operator /(Vector2 a); 14 | Vector2 operator /(float value); 15 | Vector2 operator +(Vector2 a); 16 | Vector2 operator -(Vector2 a); 17 | bool operator ==(Vector2 a); 18 | bool operator !=(Vector2 a); 19 | 20 | bool IsZero() const; 21 | 22 | static Vector2 Zero(); 23 | 24 | static float Distance(Vector2 a, Vector2 b); 25 | static float Length(Vector2 a); 26 | }; 27 | 28 | class Vector3 29 | { 30 | public: 31 | Vector3(); 32 | Vector3(float _x, float _y, float _z); 33 | ~Vector3(); 34 | 35 | float x, y, z; 36 | 37 | Vector3 operator *(Vector3 a); 38 | Vector3 operator *(float f); 39 | Vector3 operator /(Vector3 a); 40 | Vector3 operator /(float f); 41 | Vector3 operator +(Vector3 a); 42 | Vector3 operator -(Vector3 a); 43 | bool operator ==(Vector3 a); 44 | bool operator !=(Vector3 a); 45 | 46 | bool IsZero() const; 47 | 48 | static float Dot(Vector3 left, Vector3 right); 49 | static float Distance(Vector3 a, Vector3 b); 50 | static int FormattedDistance(Vector3 a, Vector3 b); 51 | static Vector3 Zero(); 52 | static Vector3 Lerp(Vector3 a, Vector3 b, float t); 53 | 54 | float Length() const; 55 | float LengthSqr() const; 56 | 57 | Vector3 Clamp() const; 58 | }; 59 | 60 | struct ViewMatrix 61 | { 62 | public: 63 | float matrix[4][4]; 64 | 65 | Vector3 Transform(const Vector3 vector) const; 66 | }; 67 | 68 | class Vector4 69 | { 70 | public: 71 | Vector4(); 72 | Vector4(float _x, float _y, float _z, float _w); 73 | ~Vector4(); 74 | 75 | float x, y, z, w; 76 | 77 | Vector4 operator*(const Vector4& a) const; 78 | Vector4 operator*(float f) const; 79 | 80 | Vector4 operator/(const Vector4& a) const; 81 | Vector4 operator/(float f) const; 82 | Vector4 operator+(const Vector4& a) const; 83 | Vector4 operator-(const Vector4& a) const; 84 | 85 | bool operator==(const Vector4& a) const; 86 | bool operator!=(const Vector4& a) const; 87 | 88 | bool IsZero() const; 89 | static Vector4 ToQuaternion(const Vector2& euler); 90 | static float Dot(const Vector4& left, const Vector4& right); 91 | static float Distance(const Vector4& a, const Vector4& b); 92 | static int FormattedDistance(const Vector4& a, const Vector4& b); 93 | static Vector4 Zero(); 94 | static Vector4 Lerp(const Vector4& a, const Vector4& b, float t); 95 | static Vector3 Mult(const Vector4& rotation, const Vector3& point); 96 | float Length() const; 97 | float LengthSqr() const; 98 | 99 | Vector4 Clamp() const; 100 | }; 101 | -------------------------------------------------------------------------------- /HuntDMA/SDK/Camera.cpp: -------------------------------------------------------------------------------- 1 | #include "Pch.h" 2 | #include "Camera.h" 3 | #include "Globals.h" 4 | #include "ConfigUtilities.h" 5 | #include "ESPRenderer.h" 6 | 7 | void Camera::UpdateCamera(VMMDLL_SCATTER_HANDLE handle) 8 | { 9 | uint64_t CameraBase = TargetProcess.Read(EnvironmentInstance->GetpSystem() + CameraBaseOffset); 10 | TargetProcess.AddScatterReadRequest(handle, CameraBase + CameraPosOffset, &Position, sizeof(Vector3)); 11 | TargetProcess.AddScatterReadRequest(handle, CameraBase + ViewMatrixOffset, &RenderMatrix, sizeof(ViewMatrix)); 12 | TargetProcess.AddScatterReadRequest(handle, CameraBase + ProjectionMatrixOffset, &ProjectionMatrix, sizeof(ViewMatrix)); 13 | } 14 | 15 | Vector2 Camera::WorldToScreen(Vector3 pos, bool clamp) 16 | { 17 | if (Position == Vector3::Zero()) 18 | return Vector2::Zero(); 19 | 20 | // Precompute matrix operations 21 | Vector4 transformed = { 22 | pos.x * RenderMatrix.matrix[0][0] + pos.y * RenderMatrix.matrix[1][0] + pos.z * RenderMatrix.matrix[2][0] + RenderMatrix.matrix[3][0], 23 | pos.x * RenderMatrix.matrix[0][1] + pos.y * RenderMatrix.matrix[1][1] + pos.z * RenderMatrix.matrix[2][1] + RenderMatrix.matrix[3][1], 24 | pos.x * RenderMatrix.matrix[0][2] + pos.y * RenderMatrix.matrix[1][2] + pos.z * RenderMatrix.matrix[2][2] + RenderMatrix.matrix[3][2], 25 | pos.x * RenderMatrix.matrix[0][3] + pos.y * RenderMatrix.matrix[1][3] + pos.z * RenderMatrix.matrix[2][3] + RenderMatrix.matrix[3][3] 26 | }; 27 | 28 | // Check visibility 29 | if (transformed.z >= 0.0f) 30 | return Vector2::Zero(); 31 | 32 | // Projection 33 | Vector4 projected = { 34 | transformed.x * ProjectionMatrix.matrix[0][0] + transformed.y * ProjectionMatrix.matrix[1][0] + transformed.z * ProjectionMatrix.matrix[2][0] + transformed.w * ProjectionMatrix.matrix[3][0], 35 | transformed.x * ProjectionMatrix.matrix[0][1] + transformed.y * ProjectionMatrix.matrix[1][1] + transformed.z * ProjectionMatrix.matrix[2][1] + transformed.w * ProjectionMatrix.matrix[3][1], 36 | transformed.x * ProjectionMatrix.matrix[0][2] + transformed.y * ProjectionMatrix.matrix[1][2] + transformed.z * ProjectionMatrix.matrix[2][2] + transformed.w * ProjectionMatrix.matrix[3][2], 37 | transformed.x * ProjectionMatrix.matrix[0][3] + transformed.y * ProjectionMatrix.matrix[1][3] + transformed.z * ProjectionMatrix.matrix[2][3] + transformed.w * ProjectionMatrix.matrix[3][3] 38 | }; 39 | 40 | if (projected.w == 0.0f) 41 | return Vector2::Zero(); 42 | 43 | // Divide by w 44 | projected.x /= projected.w; 45 | projected.y /= projected.w; 46 | 47 | if (abs(projected.x) > (clamp ? 1.0f : 1.5f) || 48 | abs(projected.y) > (clamp ? 1.0f : 1.5f)) 49 | return Vector2::Zero(); 50 | 51 | // Get screen coordinates 52 | int width = ESPRenderer::GetScreenWidth(); 53 | int height = ESPRenderer::GetScreenHeight(); 54 | 55 | return Vector2{ 56 | (1.0f + projected.x) * width * 0.5f, 57 | (1.0f - projected.y) * height * 0.5f 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /HuntDMA/SDK/Camera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class Camera 3 | { 4 | private: 5 | uint64_t CameraBaseOffset = 0x838; 6 | uint64_t ViewMatrixOffset = 0x230; 7 | uint64_t CameraPosOffset = 0x2F0; 8 | uint64_t ProjectionMatrixOffset = 0x270; 9 | 10 | Vector3 Position; 11 | ViewMatrix RenderMatrix; 12 | ViewMatrix ProjectionMatrix; 13 | 14 | public: 15 | void UpdateCamera(VMMDLL_SCATTER_HANDLE handle); 16 | Vector3 GetPosition() { return Position;} 17 | Vector2 WorldToScreen(Vector3 pos, bool clamp = true); 18 | 19 | }; -------------------------------------------------------------------------------- /HuntDMA/SDK/Environment.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WorldEntity.h" 3 | enum class MapType : int 4 | { 5 | None, 6 | Unknown, 7 | StillwaterBayou, 8 | LawsonDelta, 9 | LawsonDeltaShootingRange, 10 | DeSalle, 11 | MammonsGulch, 12 | }; 13 | class Environment 14 | { 15 | private: 16 | uint64_t SystemGlobalEnvironment = 0x0; 17 | const uint64_t SystemGlobalEnvironmentOffset = 0x0; // You can manually overwrite offset, if signature find is not working https://www.unknowncheats.me/forum/other-fps-games/350352-hunt-showdown-27.html someone would post it here. 18 | const char* SystemGlobalEnvironmentSignature = "48 8B 05 ? ? ? ? 48 8B 88 B0"; 19 | void FindSystemGlobalEnvironment(); 20 | 21 | uint64_t EntitySystem = 0x0; 22 | const uint64_t EntitySystemOffset = 0xC0; 23 | 24 | uint64_t pSystem = 0x0; 25 | const uint64_t pSystemOffset = 0x90; 26 | 27 | uint16_t ObjectCount = 0x0; 28 | const uint64_t ObjectCountOffset = 0x40092; 29 | 30 | uint64_t EntityList = 0x0; 31 | const uint64_t EntityListOffset = 0x40098; 32 | 33 | uint64_t IGameFramework = 0x0; 34 | const uint64_t IGameFrameworkOffset = 0xD8; 35 | 36 | uint64_t pGame = 0x0; 37 | const uint64_t pGameOffset = 0x700; 38 | 39 | uint64_t pGameClientNub = 0x0; 40 | const uint64_t pGameClientNubOffset = 0x48; 41 | 42 | uint64_t pGameClientChannel = 0x0; 43 | const uint64_t pGameClientChannelOffset = 0x20; 44 | 45 | uint64_t localPlayerIdx = 0x0; 46 | const uint64_t localPlayerIdxOffset = 0x24; 47 | 48 | uint64_t LocalPlayer = 0x0; 49 | 50 | int SpectatorCount = 0; 51 | 52 | std::vector> PlayerList; 53 | std::vector> BossesList; 54 | std::vector> SupplyList; 55 | std::vector> BloodBondsList; 56 | std::vector> TrapList; 57 | std::vector> POIList; 58 | std::vector> TraitList; 59 | public: 60 | uint64_t GetSystemGlobalEnvironment() { return SystemGlobalEnvironment; } 61 | uint64_t GetEntitySystem() { return EntitySystem; } 62 | uint64_t GetpSystem() { return pSystem; } 63 | uint16_t GetObjectCount() { return ObjectCount; } 64 | uint64_t GetEntityList() { return EntityList; } 65 | uint64_t GetLocalPlayerPointer() { return LocalPlayer; } 66 | void UpdateLocalPlayer(); 67 | void LogTrait(); 68 | void GetEntities(); 69 | void UpdatePlayerList(); 70 | void UpdateBossesList(); 71 | void CacheEntities(); 72 | void AssignMapType(char* name); 73 | Environment(); 74 | void ClearConsole(); 75 | std::vector> GetPlayerList() { return PlayerList; } 76 | std::vector> GetBossesList() { return BossesList; } 77 | std::vector> GetSupplyList() { return SupplyList; } 78 | std::vector> GetBloodBondsList() { return BloodBondsList; } 79 | std::vector> GetTrapList() { return TrapList; } 80 | std::vector> GetPOIList() { return POIList; } 81 | std::vector> GetTraitList() { return TraitList; } 82 | int GetSpectatorCount() { return SpectatorCount; } 83 | MapType mapType = MapType::None; 84 | }; 85 | extern bool createEntitiesDump; -------------------------------------------------------------------------------- /HuntDMA/SDK/WorldEntity.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "WorldEntity.h" 3 | #include "Globals.h" 4 | 5 | WorldEntity::WorldEntity( uint64_t entity) 6 | { 7 | this->Class = entity; 8 | this->ClassAddress = entity; 9 | 10 | } 11 | void WorldEntity::SetUp(VMMDLL_SCATTER_HANDLE handle) 12 | { 13 | TargetProcess.AddScatterReadRequest(handle, this->Class + SpecCountOffset1, &SpecCountPointer1, sizeof(uint64_t)); 14 | TargetProcess.AddScatterReadRequest(handle, this->Class + HpOffset1, &HpPointer1, sizeof(uint64_t)); 15 | TargetProcess.AddScatterReadRequest(handle, this->Class + PosOffset, &Position, sizeof(Vector3)); 16 | TargetProcess.AddScatterReadRequest(handle, this->Class + StringBufferOffset, &EntityNamePointer, sizeof(uint64_t)); 17 | TargetProcess.AddScatterReadRequest(handle, this->Class + ClassPointerOffset, &ClassPointer, sizeof(uint64_t)); 18 | TargetProcess.AddScatterReadRequest(handle, this->Class + TypeNameOffset1, &TypeNamePointer1, sizeof(uint64_t)); 19 | if (Class != 0) 20 | TargetProcess.AddScatterReadRequest(handle, this->Class + SlotsPointerOffset, &SlotsPointer, sizeof(uint64_t)); 21 | else 22 | SlotsPointer = 0; 23 | } 24 | void WorldEntity::SetUp1(VMMDLL_SCATTER_HANDLE handle) 25 | { 26 | TargetProcess.AddScatterReadRequest(handle, this->SpecCountPointer1 + SpecCountOffset2, &SpecCountPointer2, sizeof(uint64_t)); 27 | TargetProcess.AddScatterReadRequest(handle, this->HpPointer1 + HpOffset2, &HpPointer2, sizeof(uint64_t)); 28 | TargetProcess.AddScatterReadRequest(handle,this->EntityNamePointer, &EntityName, sizeof(EntityNameStruct)); 29 | TargetProcess.AddScatterReadRequest(handle, this->ClassPointer + StringBufferOffset, &ClassNamePointer, sizeof(uint64_t)); 30 | TargetProcess.AddScatterReadRequest(handle, this->TypeNamePointer1 + TypeNameOffset2, &TypeNamePointer2, sizeof(uint64_t)); 31 | if (SlotsPointer != 0) 32 | TargetProcess.AddScatterReadRequest(handle, this->SlotsPointer, &Slot, sizeof(uint64_t)); 33 | else 34 | Slot = 0; 35 | } 36 | void WorldEntity::SetUp2(VMMDLL_SCATTER_HANDLE handle) 37 | { 38 | TargetProcess.AddScatterReadRequest(handle, this->SpecCountPointer2 + SpecCountOffset3, &SpecCountPointer3, sizeof(uint64_t)); 39 | TargetProcess.AddScatterReadRequest(handle, this->HpPointer2 + HpOffset3, &HpPointer3, sizeof(uint64_t)); 40 | TargetProcess.AddScatterReadRequest(handle, this->TypeNamePointer2, &TypeName, sizeof(EntityNameStruct)); 41 | if (Slot != 0) 42 | TargetProcess.AddScatterReadRequest(handle, this->Slot + RenderNodePointerOffset, &RenderNodePointer, sizeof(uint64_t)); 43 | else 44 | RenderNodePointer = 0; 45 | TargetProcess.AddScatterReadRequest( handle, this->ClassNamePointer,&ClassName, sizeof(EntityNameStruct)); 46 | 47 | } 48 | void WorldEntity::SetUp3(VMMDLL_SCATTER_HANDLE handle) 49 | { 50 | TargetProcess.AddScatterReadRequest(handle, this->SpecCountPointer3 + SpecCountOffset4, &SpecCountPointer4, sizeof(uint64_t)); 51 | TargetProcess.AddScatterReadRequest(handle, this->HpPointer3 + HpOffset4, &HpPointer4, sizeof(uint64_t)); 52 | ClassName.name[99] = '\0'; 53 | EntityName.name[99] = '\0'; 54 | TypeName.name[99] = '\0'; 55 | std::string typeName(TypeName.name); 56 | if (typeName != "") 57 | CompactTypeName = typeName.substr(typeName.find_last_of("./") + 1); 58 | 59 | TargetProcess.AddScatterReadRequest(handle, RenderNodePointer, &Node, sizeof(RenderNode)); 60 | } 61 | void WorldEntity::SetUp4(VMMDLL_SCATTER_HANDLE handle) 62 | { 63 | TargetProcess.AddScatterReadRequest(handle, this->HpPointer4 + HpOffset5, &HpPointer5, sizeof(uint64_t)); 64 | } 65 | 66 | void WorldEntity::WriteNode(VMMDLL_SCATTER_HANDLE handle, int colour, bool show) 67 | { 68 | uint32_t convertedcolour = 0; 69 | if(colour == 0) 70 | convertedcolour = 0xFF0000FF; // Outline Red 71 | else if (colour == 1) 72 | convertedcolour = 0x0000FFFF; // Outline Blue 73 | else if (colour == 2) 74 | convertedcolour = 0xFFFF00FF; // Outline Yellow 75 | else if (colour == 3) 76 | convertedcolour = 0xFFA500FF; // Outline Orange 77 | else if (colour == 4) 78 | convertedcolour = 0x00FFFFFF; // Outline Cyan 79 | else if (colour == 5) 80 | convertedcolour = 0xFF00FFFF; // Outline Magenta 81 | else if (colour == 6) 82 | convertedcolour = 0xFFFFFFFF; // Outline White 83 | else if (colour == 7) 84 | convertedcolour = 0xFF000000; // Filled Red 85 | else if (colour == 8) 86 | convertedcolour = 0x0000FF00; // Filled Blue 87 | else if (colour == 9) 88 | convertedcolour = 0xFFFF0000; // Filled Yellow 89 | else if (colour == 10) 90 | convertedcolour = 0xFFA50000; // Filled Orange 91 | else if (colour == 11) 92 | convertedcolour = 0x00FFFF00; // Filled Cyan 93 | else if (colour == 12) 94 | convertedcolour = 0xFF00FF00; // Filled Magenta 95 | else if (colour == 13) 96 | convertedcolour = 0xFFFFFF00; // Filled White 97 | if (RenderNodePointer != 0) 98 | { 99 | // if(Node.rnd_flags == 284558360584 || Node.rnd_flags == 9680453640) 100 | uint64_t none = 0x200000008; 101 | uint64_t allmap = 0x80018; 102 | uint64_t limit_distance = 0x80008; 103 | float maxdistance = 5000; 104 | if (!show) 105 | { 106 | TargetProcess.AddScatterWriteRequest(handle, RenderNodePointer + 0x10, &none, sizeof(uint64_t)); 107 | return; 108 | } 109 | TargetProcess.AddScatterWriteRequest(handle, RenderNodePointer + 0x10, &allmap, sizeof(uint64_t)); // change render flag to max distance, allows us to use chams at further distances as long as the model isn't culled. 110 | TargetProcess.AddScatterWriteRequest(handle, RenderNodePointer + 0x2C, &convertedcolour, sizeof(uint32_t)); 111 | TargetProcess.AddScatterWriteRequest(handle, RenderNodePointer + 0x38, &maxdistance, sizeof(float)); 112 | } 113 | } 114 | 115 | void WorldEntity::UpdatePosition(VMMDLL_SCATTER_HANDLE handle) 116 | { 117 | TargetProcess.AddScatterReadRequest(handle, this->Class + PosOffset, &Position, sizeof(Vector3)); 118 | } 119 | 120 | void WorldEntity::UpdateNode(VMMDLL_SCATTER_HANDLE handle) 121 | { 122 | TargetProcess.AddScatterReadRequest(handle, RenderNodePointer, &Node, sizeof(RenderNode)); 123 | } 124 | 125 | void WorldEntity::UpdateHealth(VMMDLL_SCATTER_HANDLE handle) 126 | { 127 | TargetProcess.AddScatterReadRequest(handle, HpPointer5, &Health, sizeof(HealthBar)); 128 | } 129 | 130 | void WorldEntity::UpdateBones() // Currently doesn't work 131 | { 132 | // Get character instance pointer and bones 133 | uint64_t charInstancePointer = TargetProcess.Read(Slot + CharacterInstanceOffset); 134 | if (!charInstancePointer) return; 135 | 136 | uint64_t bonePtr0 = TargetProcess.Read(charInstancePointer + BoneArrayOffset + 0x20); 137 | uint64_t bonePtr1 = TargetProcess.Read(charInstancePointer + BoneArrayOffset + 0x38); 138 | if (!bonePtr0 || !bonePtr1) return; 139 | 140 | uint64_t boneArray = bonePtr0 + ((bonePtr1 + 3) & 0xFFFFFFFFFFFFFFFC); 141 | uint64_t skeletonPose = TargetProcess.Read(charInstancePointer + SkeletonPoseOffset); // problem here is a bit that it seems not all hunter skins have default skeleton pose anymore 142 | if (!skeletonPose) return; 143 | 144 | // Read bone mapping 145 | std::map boneMap; 146 | uint64_t modelJoints = TargetProcess.Read(skeletonPose + ModelJointsOffset); 147 | uint32_t boneArraySize = TargetProcess.Read(skeletonPose + BoneArraySizeOffset); 148 | BoneCount = boneArraySize; 149 | 150 | // Cache all bone names and indices 151 | for (uint32_t i = 0; i < boneArraySize; i++) 152 | { 153 | auto boneName = TargetProcess.Read(modelJoints + (i * 0x38)); 154 | boneMap[std::string(boneName.name)] = i; 155 | } 156 | 157 | if (!boneMap.empty()) 158 | { 159 | // Map bone indices 160 | const char* boneNames[] = { 161 | "head", "neck", "pelvis", "R_upperarm", "R_forearm", "R_hand", "R_thigh", "R_calf", "R_foot", "L_upperarm", "L_forearm", "L_hand", "L_thigh", "L_calf", "L_foot" 162 | }; 163 | 164 | for (int i = 0; i < MAX_BONES; i++) { 165 | auto it = boneMap.find(boneNames[i]); 166 | if (it != boneMap.end()) { 167 | BoneIndex[i] = it->second; 168 | } 169 | } 170 | 171 | // Read head bone position if available 172 | if (BoneIndex[0] != 0) { 173 | // Read bone transform 174 | Vector4 boneRotation; 175 | Vector3 bonePosition; 176 | 177 | // Read bone quaternion and position 178 | boneRotation = TargetProcess.Read(boneArray + (BoneIndex[0] * BoneStructSize)); 179 | 180 | // Read world matrix 181 | Matrix4x4 worldMatrix; 182 | worldMatrix = TargetProcess.Read(Class + WorldMatrixOffset); 183 | 184 | // Calculate head position after scatter read completes 185 | // Note: The actual calculation will be done after ExecuteReadScatter 186 | Vector3 localHeadPos = Vector4::Mult(boneRotation, Vector3(0, 0, 0)); 187 | HeadPosition = worldMatrix.TransformPoint(localHeadPos); 188 | LOG_INFO("Headpos:[%f,%f,%f]", HeadPosition.x, HeadPosition.y, HeadPosition.z); 189 | HeadPosition = Position; 190 | HeadPosition.z = HeadPosition.z + 1.7f; 191 | LOG_INFO("FIXED Headpos:[%f,%f,%f]", HeadPosition.x, HeadPosition.y, HeadPosition.z); 192 | LOG_INFO("================"); 193 | } 194 | } 195 | } 196 | 197 | void WorldEntity::UpdateExtraction(VMMDLL_SCATTER_HANDLE handle) 198 | { 199 | TargetProcess.AddScatterReadRequest(handle, Class + InternalFlagsOffset, &InternalFlags, sizeof(uint32_t)); 200 | } 201 | 202 | void WorldEntity::UpdateClass(VMMDLL_SCATTER_HANDLE handle) 203 | { 204 | TargetProcess.AddScatterReadRequest(handle, Class, &ClassAddress, sizeof(uint64_t)); 205 | } 206 | 207 | bool WorldEntity::IsLocalPlayer() 208 | { 209 | return EnvironmentInstance->GetLocalPlayerPointer() == GetClass(); 210 | } -------------------------------------------------------------------------------- /HuntDMA/SDK/WorldEntity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Memory.h" 3 | struct RenderNode { 4 | char pad_01[0x10]; // 0x00(0x10) 5 | unsigned __int64 rnd_flags; // 0x10(0x08) 6 | char pad_02[0x14]; // 0x18(0x14) 7 | unsigned int silhouettes_param; // 0x2C(0x04) 8 | char pad_03[0x8]; // 0x30(0x8) 9 | float m_fWSMaxViewDist; //0x38(0x4) 10 | }; 11 | struct HealthBar { 12 | char pad_01[0x10]; // 0x00(0x10) 13 | unsigned int current_hp; // 0x10(0x04) 14 | unsigned int regenerable_max_hp; // 0x14(0x04) 15 | unsigned int current_max_hp; // 0x18(0x04) 16 | }; 17 | struct EntityNameStruct { 18 | char name[100]; 19 | }; 20 | enum class EntityType : int 21 | { 22 | Unknown, 23 | 24 | LocalPlayer, 25 | EnemyPlayer, 26 | FriendlyPlayer, 27 | DeadPlayer, 28 | 29 | Butcher, 30 | Spider, 31 | Assassin, 32 | Scrapbeak, 33 | Rotjaw, 34 | Hellborn, 35 | 36 | CashRegister, 37 | GoldCashRegister, 38 | 39 | Pouch, 40 | Poster, 41 | WorkbenchUpgrade, 42 | WorkbenchOil, 43 | Trait, 44 | SealedTrait, 45 | 46 | ResupplyStation, 47 | ExtractionPoint, 48 | Clue, 49 | 50 | BearTrap, 51 | TripMine, 52 | DarksightDynamite, 53 | 54 | OilBarrel, 55 | GunpowderBarrel, 56 | BioBarrel, 57 | 58 | AmmoSwapBox, 59 | SpitzerBullets, 60 | PoisonBullets, 61 | HighVelocityBullets, 62 | IncendiaryBullets, 63 | DumDumBullets, 64 | ExplosiveBullets, 65 | FMJBullets, 66 | PoisonBolts, 67 | ExplosiveBolts, 68 | IncendiaryShells, 69 | PennyShotShells, 70 | FlechetteShells, 71 | SlugShells, 72 | 73 | SupplyBox, 74 | AmmoCrate, 75 | SpecialAmmoCrate, 76 | CompactAmmoPackage, 77 | MediumAmmoPackage, 78 | LongAmmoPackage, 79 | ShotgunAmmoPackage, 80 | Medkit, 81 | 82 | Event, 83 | }; 84 | struct Matrix4x4 { 85 | float m[4][4]; 86 | 87 | Matrix4x4() { 88 | memset(m, 0, sizeof(m)); 89 | m[0][0] = m[1][1] = m[2][2] = m[3][3] = 1.0f; 90 | } 91 | 92 | Vector3 TransformPoint(const Vector3& point) const { 93 | Vector3 result; 94 | result.x = point.x * m[0][0] + point.y * m[1][0] + point.z * m[2][0] + m[3][0]; 95 | result.y = point.x * m[0][1] + point.y * m[1][1] + point.z * m[2][1] + m[3][1]; 96 | result.z = point.x * m[0][2] + point.y * m[1][2] + point.z * m[2][2] + m[3][2]; 97 | return result; 98 | } 99 | }; 100 | 101 | class WorldEntity 102 | { 103 | private: 104 | uint64_t Class = 0x0; 105 | uint64_t ClassAddress = 0x0; 106 | const uint64_t PosOffset = 0x134; 107 | const uint64_t StringBufferOffset = 0x10; 108 | const uint64_t ClassPointerOffset = 0x18; 109 | const uint64_t SlotsPointerOffset = 0xA8; 110 | const uint64_t SlotOffset = 0x0; 111 | const uint64_t RenderNodePointerOffset = 0xA0; 112 | RenderNode Node; 113 | EntityNameStruct EntityName; 114 | EntityNameStruct ClassName; 115 | 116 | uint64_t EntityNamePointer = 0x0; 117 | uint64_t ClassNamePointer = 0x0; 118 | uint64_t ClassPointer = 0x0; 119 | uint64_t SlotsPointer = 0x0; 120 | uint64_t Slot = 0x0; 121 | uint64_t RenderNodePointer = 0x0; 122 | Vector3 Position; 123 | EntityType Type; 124 | 125 | const uint64_t TypeNameOffset1 = 0x20; 126 | const uint64_t TypeNameOffset2 = 0x8; 127 | uint64_t TypeNamePointer1 = 0x0; 128 | uint64_t TypeNamePointer2 = 0x0; 129 | EntityNameStruct TypeName; 130 | 131 | const uint64_t HpOffset1 = 0x198; 132 | const uint64_t HpOffset2 = 0x20; 133 | const uint64_t HpOffset3 = 0xD0; 134 | const uint64_t HpOffset4 = 0x78; 135 | const uint64_t HpOffset5 = 0x58; 136 | uint64_t HpPointer1 = 0x0; 137 | uint64_t HpPointer2 = 0x0; 138 | uint64_t HpPointer3 = 0x0; 139 | uint64_t HpPointer4 = 0x0; 140 | uint64_t HpPointer5 = 0x0; 141 | HealthBar Health; 142 | 143 | const uint64_t CharacterInstanceOffset = 0x88; 144 | const uint64_t BoneArrayOffset = 0xD00; 145 | const uint64_t SkeletonPoseOffset = 0x1260; 146 | const uint64_t ModelJointsOffset = 0x8; 147 | const uint64_t BoneArraySizeOffset = 0xA0; 148 | const uint64_t BoneStructSize = 0x1C; 149 | const uint64_t WorldMatrixOffset = 0x160; 150 | static const int MAX_BONES = 15; 151 | uint32_t BoneCount = 0; 152 | int BoneIndex[MAX_BONES] = { 0 }; 153 | Vector3 HeadPosition; 154 | 155 | const uint64_t InternalFlagsOffset = 0x8; 156 | uint32_t InternalFlags = 0x0; 157 | bool Hidden = false; 158 | 159 | bool Valid = true; 160 | 161 | std::unordered_map Names = { 162 | {EntityType::Unknown, "Unknown"}, 163 | 164 | {EntityType::LocalPlayer, "LocalPlayer"}, 165 | {EntityType::EnemyPlayer, "EnemyPlayer"}, 166 | {EntityType::FriendlyPlayer, "FriendlyPlayer"}, 167 | {EntityType::DeadPlayer, "DeadPlayer"}, 168 | 169 | {EntityType::Butcher, "Butcher"}, 170 | {EntityType::Assassin, "Assassin"}, 171 | {EntityType::Scrapbeak, "Scrapbeak"}, 172 | {EntityType::Spider, "Spider"}, 173 | {EntityType::Rotjaw, "Rotjaw"}, 174 | {EntityType::Hellborn, "Hellborn"}, 175 | 176 | {EntityType::CashRegister, "CashRegister"}, 177 | {EntityType::GoldCashRegister, "GoldCashRegister"}, 178 | 179 | {EntityType::Pouch, "Pouch"}, 180 | {EntityType::Poster, "Poster"}, 181 | {EntityType::WorkbenchUpgrade, "WorkbenchUpgrade"}, 182 | {EntityType::WorkbenchOil, "WorkbenchOil"}, 183 | {EntityType::Trait, "Trait"}, 184 | {EntityType::SealedTrait, "Sealed Trait"}, 185 | 186 | {EntityType::ResupplyStation, "ResupplyStation"}, 187 | {EntityType::ExtractionPoint, "ExtractionPoint"}, 188 | {EntityType::Clue, "Clue"}, 189 | 190 | {EntityType::BearTrap, "BearTrap"}, 191 | {EntityType::TripMine, "TripMine"}, 192 | {EntityType::DarksightDynamite, "DarksightDynamite"}, 193 | 194 | {EntityType::OilBarrel, "OilBarrel"}, 195 | {EntityType::GunpowderBarrel, "GunpowderBarrel"}, 196 | {EntityType::BioBarrel, "BioBarrel"}, 197 | 198 | {EntityType::AmmoSwapBox, "AmmoSwapBox"}, 199 | {EntityType::SpitzerBullets, "SpitzerBullets"}, 200 | {EntityType::PoisonBullets, "PoisonBullets"}, 201 | {EntityType::HighVelocityBullets, "HighVelocityBullets"}, 202 | {EntityType::IncendiaryBullets, "IncendiaryBullets"}, 203 | {EntityType::DumDumBullets, "DumDumBullets"}, 204 | {EntityType::ExplosiveBullets, "ExplosiveBullets"}, 205 | {EntityType::FMJBullets, "FMJBullets"}, 206 | {EntityType::PoisonBolts, "PoisonBolts"}, 207 | {EntityType::ExplosiveBolts, "ExplosiveBolts"}, 208 | {EntityType::IncendiaryShells, "IncendiaryShells"}, 209 | {EntityType::PennyShotShells, "PennyShotShells"}, 210 | {EntityType::FlechetteShells, "FlechetteShells"}, 211 | {EntityType::SlugShells, "SlugShells"}, 212 | 213 | {EntityType::SupplyBox, "SupplyBox"}, 214 | {EntityType::AmmoCrate, "AmmoCrate"}, 215 | {EntityType::SpecialAmmoCrate, "SpecialAmmoCrate"}, 216 | {EntityType::CompactAmmoPackage, "CompactAmmoPackage"}, 217 | {EntityType::MediumAmmoPackage, "MediumAmmoPackage"}, 218 | {EntityType::LongAmmoPackage, "LongAmmoPackage"}, 219 | {EntityType::ShotgunAmmoPackage, "ShotgunAmmoPackage"}, 220 | {EntityType::Medkit, "Medkit"}, 221 | 222 | {EntityType::Event, "Event"}, 223 | }; 224 | public: 225 | WorldEntity( uint64_t classptr); 226 | void SetUp(VMMDLL_SCATTER_HANDLE handle); 227 | void SetUp1(VMMDLL_SCATTER_HANDLE handle); 228 | void SetUp2(VMMDLL_SCATTER_HANDLE handle); 229 | void SetUp3(VMMDLL_SCATTER_HANDLE handle); 230 | void SetUp4(VMMDLL_SCATTER_HANDLE handle); 231 | EntityNameStruct GetEntityName() { return EntityName; } 232 | EntityNameStruct GetEntityClassName() { return ClassName; } 233 | EntityNameStruct GetTypeName() { return TypeName; } 234 | std::string CompactTypeName = ""; 235 | Vector3 GetPosition() { return Position; } 236 | RenderNode GetRenderNode() { return Node; } 237 | HealthBar GetHealth() { return Health; } 238 | uint32_t GetInternalFlags() { return InternalFlags; } 239 | void SetType(EntityType type) { Type = type; } 240 | EntityType GetType() { return Type; } 241 | void WriteNode(VMMDLL_SCATTER_HANDLE handle, int colour, bool show); 242 | void UpdatePosition(VMMDLL_SCATTER_HANDLE handle); 243 | void UpdateNode(VMMDLL_SCATTER_HANDLE handle); 244 | void UpdateHealth(VMMDLL_SCATTER_HANDLE handle); 245 | void UpdateBones(); 246 | void UpdateExtraction(VMMDLL_SCATTER_HANDLE handle); 247 | void UpdateClass(VMMDLL_SCATTER_HANDLE handle); 248 | uint64_t GetClass() { return ClassAddress; } 249 | bool IsHidden() { return Hidden; } 250 | void SetHidden(bool isHidden) { Hidden = isHidden; } 251 | bool GetValid() { return Valid; } 252 | void SetValid(bool valid) { Valid = valid; } 253 | std::string GetTypeAsString() { return Names[Type]; }; 254 | bool IsLocalPlayer(); 255 | Vector3 GetHeadPosition() const { return HeadPosition; } 256 | 257 | uint64_t SpecCountOffset1 = 0x198; 258 | uint64_t SpecCountOffset2 = 0x20; 259 | uint64_t SpecCountOffset3 = 0xd0; 260 | uint64_t SpecCountOffset4 = 0x100; 261 | uint64_t SpecCountOffset5 = 0x10; 262 | uint64_t SpecCountPointer1 = 0x0; 263 | uint64_t SpecCountPointer2 = 0x0; 264 | uint64_t SpecCountPointer3 = 0x0; 265 | uint64_t SpecCountPointer4 = 0x0; 266 | int SpecCount = 0; 267 | 268 | static const uint32_t HIDDEN_FLAG = 0x8; 269 | }; 270 | -------------------------------------------------------------------------------- /HuntDMA/Security/XorStr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 - 2018 Justas Masiulis 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef JM_LITHPP 18 | #define JM_LITHPP 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #define MAKE_STRING(str) \ 26 | ::jm::make_xorstr( \ 27 | []() { return str; }, \ 28 | std::make_index_sequence{}, \ 29 | std::make_index_sequence<::jm::detail::_buffer_size()>{}) 30 | 31 | #define LIT(str) MAKE_STRING(str).crypt_get() 32 | 33 | #ifdef _MSC_VER 34 | #define LITFORCEINLINE __forceinline 35 | #else 36 | #define LITFORCEINLINE __attribute__((always_inline)) 37 | #endif 38 | 39 | // you can define this macro to get possibly faster code on gcc/clang 40 | // at the expense of constants being put into data section. 41 | #if !defined(LITALLOW_DATA) 42 | // MSVC - no volatile 43 | // GCC and clang - volatile everywhere 44 | #if defined(__clang__) || defined(__GNUC__) 45 | #define LITVOLATILE volatile 46 | #endif 47 | 48 | #endif 49 | #ifndef LITVOLATILE 50 | #define LITVOLATILE 51 | #endif 52 | 53 | namespace jm 54 | { 55 | 56 | namespace detail 57 | { 58 | 59 | template 60 | struct unsigned_; 61 | 62 | template<> 63 | struct unsigned_<1> 64 | { 65 | using type = std::uint8_t; 66 | }; 67 | template<> 68 | struct unsigned_<2> 69 | { 70 | using type = std::uint16_t; 71 | }; 72 | template<> 73 | struct unsigned_<4> 74 | { 75 | using type = std::uint32_t; 76 | }; 77 | 78 | template 79 | struct pack_value_type 80 | { 81 | using type = decltype(C); 82 | }; 83 | 84 | template 85 | constexpr std::size_t _buffer_size() 86 | { 87 | return ((Size / 16) + (Size % 16 != 0)) * 2; 88 | } 89 | 90 | template 91 | struct tstring_ 92 | { 93 | using value_type = typename pack_value_type::type; 94 | constexpr static std::size_t size = sizeof...(Cs); 95 | constexpr static value_type str[size] = { Cs... }; 96 | 97 | constexpr static std::size_t buffer_size = _buffer_size(); 98 | constexpr static std::size_t buffer_align = 99 | #ifndef JM_LITDISABLE_AVX_INTRINSICS 100 | ((sizeof(str) > 16) ? 32 : 16); 101 | #else 102 | 16; 103 | #endif 104 | }; 105 | 106 | template 107 | struct _ki 108 | { 109 | constexpr static std::size_t idx = I; 110 | constexpr static std::uint64_t key = K; 111 | }; 112 | 113 | template 114 | constexpr std::uint32_t key4() noexcept 115 | { 116 | std::uint32_t value = Seed; 117 | for (char c : __TIME__) 118 | value = static_cast((value ^ c) * 16777619ull); 119 | return value; 120 | } 121 | 122 | template 123 | constexpr std::uint64_t key8() 124 | { 125 | constexpr auto first_part = key4<2166136261 + S>(); 126 | constexpr auto second_part = key4(); 127 | return (static_cast(first_part) << 32) | second_part; 128 | } 129 | 130 | // clang and gcc try really hard to place the constants in data 131 | // sections. to counter that there was a need to create an intermediate 132 | // constexpr string and then copy it into a non constexpr container with 133 | // volatile storage so that the constants would be placed directly into 134 | // code. 135 | template 136 | struct string_storage 137 | { 138 | std::uint64_t storage[T::buffer_size]; 139 | 140 | LITFORCEINLINE constexpr string_storage() noexcept : storage{ Keys... } 141 | { 142 | using cast_type = 143 | typename unsigned_::type; 144 | constexpr auto value_size = sizeof(typename T::value_type); 145 | // puts the string into 64 bit integer blocks in a constexpr 146 | // fashion 147 | for (std::size_t i = 0; i < T::size; ++i) 148 | storage[i / (8 / value_size)] ^= 149 | (std::uint64_t{ static_cast(T::str[i]) } 150 | << ((i % (8 / value_size)) * 8 * value_size)); 151 | } 152 | }; 153 | 154 | } // namespace detail 155 | 156 | template 157 | class xor_string 158 | { 159 | alignas(T::buffer_align) std::uint64_t _storage[T::buffer_size]; 160 | 161 | // _single functions needed because MSVC crashes without them 162 | LITFORCEINLINE void _crypt_256_single(const std::uint64_t* keys, 163 | std::uint64_t* storage) noexcept 164 | 165 | { 166 | _mm256_store_si256( 167 | reinterpret_cast<__m256i*>(storage), 168 | _mm256_xor_si256( 169 | _mm256_load_si256(reinterpret_cast(storage)), 170 | _mm256_load_si256(reinterpret_cast(keys)))); 171 | } 172 | 173 | template 174 | LITFORCEINLINE void _crypt_256(const std::uint64_t* keys, 175 | std::index_sequence) noexcept 176 | { 177 | (_crypt_256_single(keys + Idxs * 4, _storage + Idxs * 4), ...); 178 | } 179 | 180 | LITFORCEINLINE void _crypt_128_single(const std::uint64_t* keys, 181 | std::uint64_t* storage) noexcept 182 | { 183 | _mm_store_si128( 184 | reinterpret_cast<__m128i*>(storage), 185 | _mm_xor_si128(_mm_load_si128(reinterpret_cast(storage)), 186 | _mm_load_si128(reinterpret_cast(keys)))); 187 | } 188 | 189 | template 190 | LITFORCEINLINE void _crypt_128(const std::uint64_t* keys, 191 | std::index_sequence) noexcept 192 | { 193 | (_crypt_128_single(keys + Idxs * 2, _storage + Idxs * 2), ...); 194 | } 195 | 196 | // loop generates vectorized code which places constants in data dir 197 | LITFORCEINLINE constexpr void _copy() noexcept 198 | { 199 | constexpr detail::string_storage storage; 200 | static_cast(std::initializer_list{ 201 | (const_cast(_storage))[Keys::idx] = 202 | storage.storage[Keys::idx]... }); 203 | } 204 | 205 | public: 206 | using value_type = typename T::value_type; 207 | using size_type = std::size_t; 208 | using pointer = value_type*; 209 | using const_pointer = const pointer; 210 | 211 | LITFORCEINLINE xor_string() noexcept { _copy(); } 212 | 213 | LITFORCEINLINE constexpr size_type size() const noexcept 214 | { 215 | return T::size - 1; 216 | } 217 | 218 | LITFORCEINLINE void crypt() noexcept 219 | { 220 | alignas(T::buffer_align) std::uint64_t keys[T::buffer_size]; 221 | static_cast(std::initializer_list{ 222 | (const_cast(keys))[Keys::idx] = 223 | Keys::key... }); 224 | 225 | _copy(); 226 | 227 | #define JM_LITDISABLE_AVX_INTRINSICS 228 | #ifndef JM_LITDISABLE_AVX_INTRINSICS 229 | _crypt_256(keys, std::make_index_sequence{}); 230 | if constexpr (T::buffer_size % 4 != 0) 231 | _crypt_128(keys, std::index_sequence{}); 232 | #else 233 | _crypt_128(keys, std::make_index_sequence{}); 234 | #endif 235 | } 236 | 237 | LITFORCEINLINE const_pointer get() const noexcept 238 | { 239 | return reinterpret_cast(_storage); 240 | } 241 | 242 | LITFORCEINLINE const_pointer crypt_get() noexcept 243 | { 244 | crypt(); 245 | return reinterpret_cast(_storage); 246 | } 247 | }; 248 | 249 | template 250 | LITFORCEINLINE constexpr auto 251 | make_xorstr(Tstr str_lambda, 252 | std::index_sequence, 253 | std::index_sequence) noexcept 254 | { 255 | return xor_string, 256 | detail::_ki()>...>{}; 257 | } 258 | 259 | } // namespace jm 260 | 261 | #endif // include guard -------------------------------------------------------------------------------- /HuntDMA/cryengine.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/HuntDMA/cryengine.wav -------------------------------------------------------------------------------- /HuntDMA/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/HuntDMA/icon.ico -------------------------------------------------------------------------------- /HuntDMA/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by HuntDMA.rc 4 | // 5 | #define IDI_ICON1 101 6 | #define IDR_WAVE1 101 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 102 13 | #define _APS_NEXT_COMMAND_VALUE 40001 14 | #define _APS_NEXT_CONTROL_VALUE 1001 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/Images/2.png -------------------------------------------------------------------------------- /Images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/Images/4.png -------------------------------------------------------------------------------- /Images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/Images/5.png -------------------------------------------------------------------------------- /Images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/Images/6.png -------------------------------------------------------------------------------- /Instructions.md: -------------------------------------------------------------------------------- 1 | # Build Guide 2 | 3 | https://youtu.be/qIy4P3Xe6nA 4 | 5 | # Install Guide 6 | 7 | ## Visual C++ Redistributable 8 | 9 | Download and install (if not already): 10 | [Visual C++ Redistributable 2015-2022](https://aka.ms/vs/17/release/vc_redist.x64.exe) 11 | 12 | ## Download DLL dependencies 13 | 14 | 1. Download The Latest [PCILeech Release](https://github.com/ufrisk/pcileech/releases/latest). Download The win_x64 File. 15 | ![image](https://github.com/user-attachments/assets/4c209401-446c-48a1-af47-19d9be983b37) 16 | **Unzip it in safe location.** 17 | 18 | 3. Download the [FTD3xx Dlls](https://ftdichip.com/wp-content/uploads/2024/06/FTD3XXLibrary_1.3.0.10.zip). 19 | 20 |

21 | 23 |

24 | Unzip it in safe location.

25 | 26 | ## Add Environment Variables 27 | 28 | You need to add absolute path to this two extracted folders to system's `PATH` environment variable, so cheat can find .dlls it need: 29 | 30 | Open Environment Variables: 31 |

32 | 34 |

35 |

36 | 38 |

39 | 40 | Select in lower half of the window `PATH` variable, click edit and add your absolute path to unzipped folders (then click ok on all windows): 41 | 42 | ![image](https://github.com/user-attachments/assets/30dd6d23-abb5-46b4-8da1-4a479796cfeb) 43 | 44 | ![image](https://github.com/user-attachments/assets/52429063-2f98-4420-9632-36e0d6cea333) 45 | 46 | > [!CAUTION] 47 | > **Be careful, in FTD3XXLibrary you only need subfolder: /x64/DLL** 48 | 49 | ## Test you DMA card 50 | 51 | Run `pcileech benchmark -device fpga` in CMD. 52 | 53 | For best experience you should have 54 | 4000+ reads/s on 8 B 55 | 150+ MB/s on 16 MB. 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Personal Use License 2 | 3 | Copyright © 2025 Whitebrim 4 | 5 | This software is licensed, not sold. By using this software, you agree to the following terms: 6 | 7 | 1. Personal Use Only 8 | - You may use, compile, and run this software solely for your personal, non-commercial purposes. 9 | 10 | 2. No Distribution 11 | - You may not distribute, share, sublicense, rent, lease, or sell this software or its source code, in whole or in part, to any third party. 12 | 13 | 3. No Commercial Use 14 | - You may not use this software for any commercial purposes, including but not limited to monetized content, services, or products. 15 | 16 | 4. Open Access for Educational Purposes 17 | - This software is provided as open-access for educational purposes. 18 | - Any derivative works based on this software must retain this license. 19 | 20 | 5. Disclaimer of Warranty 21 | - This software is provided "as is", without warranty of any kind, express or implied. The author is not liable for any damage or issues resulting from the use of this software. 22 | 23 | 6. Termination 24 | - Any violation of these terms will result in the immediate termination of this license. 25 | 26 | By downloading, compiling, or using this software, you acknowledge and agree to these terms. 27 | 28 | ------------------------------- 29 | 30 | The files: Memory.сpp, Memory.h, Registry.cpp, Registry.h, Kmbox.cpp, Kmbox.h, Aimbot.cpp, Aimbot.h — are licensed under the MIT License: 31 | 32 | Copyright © 2024 SDM 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining a copy 35 | of this software and associated documentation files (the "Software"), to deal 36 | in the Software without restriction, including without limitation the rights 37 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 38 | copies of the Software, and to permit persons to whom the Software is 39 | furnished to do so, subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all 42 | copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 45 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 46 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 47 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 48 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 49 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 50 | SOFTWARE. 51 | -------------------------------------------------------------------------------- /Lib/FTD3XX.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/Lib/FTD3XX.lib -------------------------------------------------------------------------------- /Lib/leechcore.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/Lib/leechcore.lib -------------------------------------------------------------------------------- /Lib/vmm.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Whitebrim/HuntDMA/a426a99cdee90efcb33bd7d96b6704b0f7c977aa/Lib/vmm.lib -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hunt DMA Cheat 2 | Fully Featured Hunt DMA Cheat With Chams, Fuser ESP, Overlay mode. 3 | 4 | > [!NOTE] 5 | Currently needs update 6 | 7 | ## Showcase 8 |

9 | Play Video 10 |

11 |

12 | Play Video 13 |

14 |

15 | 17 |

18 |

19 | 21 |

22 | 23 | 24 | > [!IMPORTANT] 25 | > * You need to build this project first. I suggest using Visual Studio and building in **Release** configuration. 26 | > * [Installation Guide](./Instructions.md) 27 | > * Open/close menu key - **Insert** or **Home** 28 | > * Close menu - **Escape** or click outside the menu 29 | > * Exit app - **Home + End** 30 | 31 | ## Fixed and Supported Features 32 | * Player ESP 33 | * Name 34 | * Distance 35 | * Health 36 | * Chams 37 | * Friendly Color 38 | * Cham Color 39 | * Player list 40 | * Hold TAB for radar 41 | * Boss ESP 42 | * Name 43 | * Distance 44 | * Supply ESP 45 | * Name 46 | * Distance 47 | * Toggalable types 48 | * BloodBound ESP 49 | * Name 50 | * Distance 51 | * Trap ESP 52 | * Name 53 | * Distance 54 | * Toggalable types 55 | * Points of Interest ESP 56 | * Name 57 | * Distance 58 | * Toggalable types 59 | * Config 60 | * Load 61 | * Save 62 | * Spectating alarm 63 | * FPS 64 | * Auto SystemGlobalEnvironment offset detection (thanks [@Spookyisnice](https://github.com/spookyisnice)) 65 | * Crosshair rendering 66 | * Overlay mode 67 | * Prevent recording 68 | 69 | ### Overlay mode 70 | If you have single pc setup, you should enable this mode in the settings. Cheat will draw on top of everything. 71 | Also, only in this mode transparency is supported (with fuser transparency is impossible). 72 | Also works in fullscreen mode, tho it will switch to desctop if clicked in the menu (because it's different window). 73 | 74 | ### Player ESP 75 | Chams are recommended to write after teammates are no longer tagged as enemy players or after raid starts. 76 | HP is: **current**/**current max(is not potential max if hunter is burning)**[**potential max hp after after all burns are healed**] 77 | 78 | ### Supply ESP 79 | You can choose only your type of ammo, esp will show only nessesary items. 80 | 81 | ### Trap ESP 82 | Also all types of barrels and darksight dynamite. Toggalable. 83 | 84 | ### Points of Interest ESP 85 | - extraction points 86 | - normal cash registers 87 | - pouches 88 | - clues 89 | - posters 90 | - blueprints 91 | - gun oil 92 | - **traits** 93 | - Halloween's pumpkins 94 | 95 | ### Spectating alarm 96 | Can't be turned off. Shows you red frame and in big green number how many players are spectating you. Your teammates counts! 97 | 98 | ### Mouse-only controls supported 99 | Now can be controlled only via mouse: if you stick your cursor to the edge of the window, or move to the other screen, menu will close. Menu will open again when you move mouse back. And "app exit" button in the settings. 100 | 101 | # Known Issues 102 | - Teammates are shown as enemies 103 | - Chams don't work 104 | - Dummy's hp in shooting range is incorrect 105 | 106 | # Todo 107 | - [ ] Beetle ESP 108 | - [ ] Auto medkit esp turn on when low hp 109 | - [ ] Teams 110 | - [ ] View what is in player's hands 111 | - [ ] Add Icons to ESP 112 | - [x] Overlay mode 113 | - [x] Dark Sight Dynamite ESP 114 | - [x] Perks ESP/chams 115 | - [x] Draw player list like in Mr Smile's cheat 116 | - [x] Draw ObjectCount 117 | - [x] Add close button for the menu 118 | - [x] Fix spider not showing 119 | - [x] Don't show players if their hp is <= 0 or > 150 120 | - [x] Fix "Draw friendly" 121 | - [x] Fix all "Enable" buttons 122 | - [x] Spectator count 123 | - [x] Expand Supply ESP with different tags 124 | - [x] Add Golden Cash Register ESP 125 | - [x] Add POI ESP 126 | - [x] Draw players HP 127 | - [x] Perks ESP/chams 128 | - [x] Move configs to the same folder as HuntDMA.exe (previously at User/Documents/Hunt/Default.json.json) 129 | 130 | ## Credits 131 | * [PCILeech](https://github.com/ufrisk/pcileech) 132 | * [MemProcFS](https://github.com/ufrisk/MemProcFS) 133 | * [insanefury](https://www.unknowncheats.me/forum/3809820-post343.html) 134 | * [DMALibrary](https://github.com/Metick/DMALibrary/tree/Master) 135 | * [Original HuntDMA by InterSDM](https://github.com/IntelSDM/HuntDMA) 136 | * All amazing folks on [UnknownCheats](https://www.unknowncheats.me/forum/other-fps-games/350352-hunt-showdown.html) 137 | --------------------------------------------------------------------------------