├── README.md ├── search ├── dpc.c ├── ipi.c ├── nmi.c ├── entry.c ├── page.c ├── phys.c ├── pool.c ├── search.c ├── thread.c ├── timer.c ├── utils.c ├── pool.h ├── timer.h ├── ipi.h ├── nmi.h ├── page.h ├── phys.h ├── search.h ├── dpc.h ├── thread.h ├── utils.h ├── search.vcxproj.filters ├── search.vcxproj └── import.h ├── search.sln ├── .gitattributes └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | Credits: https://github.com/ia32-doc/ia32-doc 2 | -------------------------------------------------------------------------------- /search/dpc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/dpc.c -------------------------------------------------------------------------------- /search/ipi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/ipi.c -------------------------------------------------------------------------------- /search/nmi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/nmi.c -------------------------------------------------------------------------------- /search/entry.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/entry.c -------------------------------------------------------------------------------- /search/page.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/page.c -------------------------------------------------------------------------------- /search/phys.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/phys.c -------------------------------------------------------------------------------- /search/pool.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/pool.c -------------------------------------------------------------------------------- /search/search.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/search.c -------------------------------------------------------------------------------- /search/thread.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/thread.c -------------------------------------------------------------------------------- /search/timer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/timer.c -------------------------------------------------------------------------------- /search/utils.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogxo/search/HEAD/search/utils.c -------------------------------------------------------------------------------- /search/pool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS ScanBigPool(); -------------------------------------------------------------------------------- /search/timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS CheckByTimer(); -------------------------------------------------------------------------------- /search/ipi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS CheckByIpi(); 5 | -------------------------------------------------------------------------------- /search/nmi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS CheckByNmi(); 5 | -------------------------------------------------------------------------------- /search/page.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS ScanPageTable(); 5 | -------------------------------------------------------------------------------- /search/phys.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS ScanPhysicalMemory(); -------------------------------------------------------------------------------- /search/search.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS StartSearch(); 5 | 6 | NTSTATUS StopSearch(); 7 | -------------------------------------------------------------------------------- /search/dpc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS CheckByAsynchronousDpc(); 5 | 6 | NTSTATUS CheckBySynchronousDpc(); -------------------------------------------------------------------------------- /search/thread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | NTSTATUS CheckThreadCallstackByApc(PETHREAD Thread); 5 | 6 | NTSTATUS CheckThreadCallstackByDpcApc(PETHREAD Thread); 7 | 8 | NTSTATUS CheckThreadRip(PETHREAD Thread); 9 | 10 | NTSTATUS CheckAllThread(); 11 | -------------------------------------------------------------------------------- /search/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "import.h" 4 | 5 | #define STACK_CAPTURE_SIZE 32 6 | 7 | PKLDR_DATA_TABLE_ENTRY GetKernelModuleForAddress(PVOID Address); 8 | 9 | PVOID GetThreadStartAddress(PETHREAD Thread); 10 | 11 | VOID StackWalk(); 12 | 13 | VOID Sleep(ULONG Milliseconds); 14 | 15 | ULONG_PTR FindPattern(PVOID Base, SIZE_T Size, PCHAR Pattern); 16 | 17 | PVOID GetVirtualForPhysical(ULONG_PTR PhysicalAddress); 18 | 19 | PVOID GetProcAddressW(PCWSTR SourceString); 20 | -------------------------------------------------------------------------------- /search.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.34407.143 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "search", "search\search.vcxproj", "{B798EDB4-D91B-4022-A8C8-0EED009E4F42}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B798EDB4-D91B-4022-A8C8-0EED009E4F42}.Debug|x64.ActiveCfg = Debug|x64 15 | {B798EDB4-D91B-4022-A8C8-0EED009E4F42}.Debug|x64.Build.0 = Debug|x64 16 | {B798EDB4-D91B-4022-A8C8-0EED009E4F42}.Debug|x64.Deploy.0 = Debug|x64 17 | {B798EDB4-D91B-4022-A8C8-0EED009E4F42}.Release|x64.ActiveCfg = Release|x64 18 | {B798EDB4-D91B-4022-A8C8-0EED009E4F42}.Release|x64.Build.0 = Release|x64 19 | {B798EDB4-D91B-4022-A8C8-0EED009E4F42}.Release|x64.Deploy.0 = Release|x64 20 | EndGlobalSection 21 | GlobalSection(SolutionProperties) = preSolution 22 | HideSolutionNode = FALSE 23 | EndGlobalSection 24 | GlobalSection(ExtensibilityGlobals) = postSolution 25 | SolutionGuid = {60988F3F-9020-4A22-8AD7-2450705A5ABE} 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /search/search.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 | Source Files 24 | 25 | 26 | Source Files 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Source Files 48 | 49 | 50 | Source Files 51 | 52 | 53 | Source Files 54 | 55 | 56 | 57 | 58 | Header Files 59 | 60 | 61 | Header Files 62 | 63 | 64 | Header Files 65 | 66 | 67 | Header Files 68 | 69 | 70 | Header Files 71 | 72 | 73 | Header Files 74 | 75 | 76 | Header Files 77 | 78 | 79 | Header Files 80 | 81 | 82 | Header Files 83 | 84 | 85 | Header Files 86 | 87 | 88 | Header Files 89 | 90 | 91 | Header Files 92 | 93 | 94 | -------------------------------------------------------------------------------- /search/search.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | {B798EDB4-D91B-4022-A8C8-0EED009E4F42} 15 | {dd38f7fc-d7bd-488b-9242-7d8754cde80d} 16 | v4.5 17 | 12.0 18 | Debug 19 | Win32 20 | search 21 | 22 | 23 | 24 | Windows10 25 | true 26 | WindowsKernelModeDriver10.0 27 | Driver 28 | WDM 29 | false 30 | 31 | 32 | Windows10 33 | false 34 | WindowsKernelModeDriver10.0 35 | Driver 36 | WDM 37 | false 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | DbgengKernelDebugger 49 | false 50 | 51 | 52 | DbgengKernelDebugger 53 | false 54 | 55 | 56 | 57 | false 58 | 59 | 60 | 61 | 62 | false 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /.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 -------------------------------------------------------------------------------- /search/import.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | 5 | typedef enum _KAPC_ENVIRONMENT 6 | { 7 | OriginalApcEnvironment, 8 | AttachedApcEnvironment, 9 | CurrentApcEnvironment, 10 | InsertApcEnvironment 11 | } KAPC_ENVIRONMENT, *PKAPC_ENVIRONMENT; 12 | 13 | typedef VOID(NTAPI* PKNORMAL_ROUTINE)( 14 | PVOID NormalContext, 15 | PVOID SystemArgument1, 16 | PVOID SystemArgument2 17 | ); 18 | 19 | typedef VOID KKERNEL_ROUTINE( 20 | _In_ PRKAPC Apc, 21 | _Inout_opt_ PKNORMAL_ROUTINE* NormalRoutine, 22 | _Inout_opt_ PVOID* NormalContext, 23 | _Inout_ PVOID* SystemArgument1, 24 | _Inout_ PVOID* SystemArgument2 25 | ); 26 | 27 | typedef KKERNEL_ROUTINE(NTAPI* PKKERNEL_ROUTINE); 28 | 29 | typedef VOID(NTAPI* PKRUNDOWN_ROUTINE)(PRKAPC Apc); 30 | 31 | NTKERNELAPI 32 | VOID 33 | NTAPI 34 | KeInitializeApc( 35 | _Out_ PRKAPC Apc, 36 | _In_ PRKTHREAD Thread, 37 | _In_ KAPC_ENVIRONMENT Environment, 38 | _In_ PKKERNEL_ROUTINE KernelRoutine, 39 | _In_opt_ PKRUNDOWN_ROUTINE RundownRoutine, 40 | _In_opt_ PKNORMAL_ROUTINE NormalRoutine, 41 | _In_opt_ KPROCESSOR_MODE ProcessorMode, 42 | _In_opt_ PVOID NormalContext 43 | ); 44 | 45 | NTKERNELAPI 46 | BOOLEAN 47 | NTAPI 48 | KeInsertQueueApc( 49 | _Inout_ PRKAPC Apc, 50 | _In_opt_ PVOID SystemArgument1, 51 | _In_opt_ PVOID SystemArgument2, 52 | _In_ KPRIORITY Increment 53 | ); 54 | 55 | NTKERNELAPI 56 | VOID 57 | KeGenericCallDpc( 58 | __in PKDEFERRED_ROUTINE Routine, 59 | __in_opt PVOID Context 60 | ); 61 | 62 | NTKERNELAPI 63 | VOID 64 | KeSignalCallDpcDone( 65 | __in PVOID SystemArgument1 66 | ); 67 | 68 | typedef struct _LDR_DATA_TABLE_ENTRY 69 | { 70 | LIST_ENTRY InLoadOrderLinks; 71 | LIST_ENTRY InMemoryOrderLinks; 72 | LIST_ENTRY InInitializationOrderLinks; 73 | PVOID DllBase; 74 | PVOID EntryPoint; 75 | ULONG SizeOfImage; 76 | UNICODE_STRING FullDllName; 77 | UNICODE_STRING BaseDllName; 78 | ULONG Flags; 79 | USHORT LoadCount; 80 | USHORT TlsIndex; 81 | LIST_ENTRY HashLinks; 82 | ULONG TimeDateStamp; 83 | } LDR_DATA_TABLE_ENTRY, KLDR_DATA_TABLE_ENTRY, * PLDR_DATA_TABLE_ENTRY, * PKLDR_DATA_TABLE_ENTRY; 84 | 85 | DECLSPEC_IMPORT PLIST_ENTRY PsLoadedModuleList; 86 | 87 | DECLSPEC_IMPORT PERESOURCE PsLoadedModuleResource; 88 | 89 | NTSYSAPI 90 | NTSTATUS 91 | NTAPI 92 | ZwQueryInformationThread( 93 | IN HANDLE ThreadHandle, 94 | IN THREADINFOCLASS ThreadInformationClass, 95 | OUT PVOID ThreadInformation, 96 | IN ULONG ThreadInformationLength, 97 | OUT PULONG ReturnLength OPTIONAL 98 | ); 99 | 100 | //0xa8 bytes (sizeof) 101 | typedef struct _KAFFINITY_EX 102 | { 103 | USHORT Count; //0x0 104 | USHORT Size; //0x2 105 | ULONG Reserved; //0x4 106 | ULONGLONG Bitmap[20]; //0x8 107 | } KAFFINITY_EX, * PKAFFINITY_EX; 108 | 109 | EXTERN_C VOID KeInitializeAffinityEx(PKAFFINITY_EX affinity); 110 | 111 | EXTERN_C VOID KeAddProcessorAffinityEx(PKAFFINITY_EX affinity, INT num); 112 | 113 | EXTERN_C VOID HalSendNMI(PKAFFINITY_EX affinity); 114 | 115 | typedef struct _SYSTEM_BIGPOOL_ENTRY 116 | { 117 | PVOID VirtualAddress; 118 | SIZE_T SizeInBytes; 119 | ULONG TagUlong; 120 | } SYSTEM_BIGPOOL_ENTRY, * PSYSTEM_BIGPOOL_ENTRY; 121 | 122 | typedef struct _SYSTEM_BIGPOOL_INFORMATION 123 | { 124 | ULONG Count; 125 | SYSTEM_BIGPOOL_ENTRY AllocatedInfo[1]; 126 | } SYSTEM_BIGPOOL_INFORMATION, * PSYSTEM_BIGPOOL_INFORMATION; 127 | 128 | typedef struct _SYSTEM_POOL_ENTRY 129 | { 130 | BOOLEAN Allocated; 131 | BOOLEAN Spare0; 132 | USHORT AllocatorBackTraceIndex; 133 | ULONG Size; 134 | ULONG TagUlong; 135 | } SYSTEM_POOL_ENTRY, * PSYSTEM_POOL_ENTRY; 136 | 137 | typedef enum _SYSTEM_INFORMATION_CLASS 138 | { 139 | SystemBasicInformation, // q: SYSTEM_BASIC_INFORMATION 140 | SystemProcessorInformation, // q: SYSTEM_PROCESSOR_INFORMATION 141 | SystemPerformanceInformation, // q: SYSTEM_PERFORMANCE_INFORMATION 142 | SystemTimeOfDayInformation, // q: SYSTEM_TIMEOFDAY_INFORMATION 143 | SystemPathInformation, // not implemented 144 | SystemProcessInformation, // q: SYSTEM_PROCESS_INFORMATION 145 | SystemCallCountInformation, // q: SYSTEM_CALL_COUNT_INFORMATION 146 | SystemDeviceInformation, // q: SYSTEM_DEVICE_INFORMATION 147 | SystemProcessorPerformanceInformation, // q: SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION (EX in: USHORT ProcessorGroup) 148 | SystemFlagsInformation, // q: SYSTEM_FLAGS_INFORMATION 149 | SystemCallTimeInformation, // not implemented // SYSTEM_CALL_TIME_INFORMATION // 10 150 | SystemModuleInformation, // q: RTL_PROCESS_MODULES 151 | SystemLocksInformation, // q: RTL_PROCESS_LOCKS 152 | SystemStackTraceInformation, // q: RTL_PROCESS_BACKTRACES 153 | SystemPagedPoolInformation, // not implemented 154 | SystemNonPagedPoolInformation, // not implemented 155 | SystemHandleInformation, // q: SYSTEM_HANDLE_INFORMATION 156 | SystemObjectInformation, // q: SYSTEM_OBJECTTYPE_INFORMATION mixed with SYSTEM_OBJECT_INFORMATION 157 | SystemPageFileInformation, // q: SYSTEM_PAGEFILE_INFORMATION 158 | SystemVdmInstemulInformation, // q: SYSTEM_VDM_INSTEMUL_INFO 159 | SystemVdmBopInformation, // not implemented // 20 160 | SystemFileCacheInformation, // q: SYSTEM_FILECACHE_INFORMATION; s (requires SeIncreaseQuotaPrivilege) (info for WorkingSetTypeSystemCache) 161 | SystemPoolTagInformation, // q: SYSTEM_POOLTAG_INFORMATION 162 | SystemInterruptInformation, // q: SYSTEM_INTERRUPT_INFORMATION (EX in: USHORT ProcessorGroup) 163 | SystemDpcBehaviorInformation, // q: SYSTEM_DPC_BEHAVIOR_INFORMATION; s: SYSTEM_DPC_BEHAVIOR_INFORMATION (requires SeLoadDriverPrivilege) 164 | SystemFullMemoryInformation, // not implemented // SYSTEM_MEMORY_USAGE_INFORMATION 165 | SystemLoadGdiDriverInformation, // s (kernel-mode only) 166 | SystemUnloadGdiDriverInformation, // s (kernel-mode only) 167 | SystemTimeAdjustmentInformation, // q: SYSTEM_QUERY_TIME_ADJUST_INFORMATION; s: SYSTEM_SET_TIME_ADJUST_INFORMATION (requires SeSystemtimePrivilege) 168 | SystemSummaryMemoryInformation, // not implemented // SYSTEM_MEMORY_USAGE_INFORMATION 169 | SystemMirrorMemoryInformation, // s (requires license value "Kernel-MemoryMirroringSupported") (requires SeShutdownPrivilege) // 30 170 | SystemPerformanceTraceInformation, // q; s: (type depends on EVENT_TRACE_INFORMATION_CLASS) 171 | SystemObsolete0, // not implemented 172 | SystemExceptionInformation, // q: SYSTEM_EXCEPTION_INFORMATION 173 | SystemCrashDumpStateInformation, // s: SYSTEM_CRASH_DUMP_STATE_INFORMATION (requires SeDebugPrivilege) 174 | SystemKernelDebuggerInformation, // q: SYSTEM_KERNEL_DEBUGGER_INFORMATION 175 | SystemContextSwitchInformation, // q: SYSTEM_CONTEXT_SWITCH_INFORMATION 176 | SystemRegistryQuotaInformation, // q: SYSTEM_REGISTRY_QUOTA_INFORMATION; s (requires SeIncreaseQuotaPrivilege) 177 | SystemExtendServiceTableInformation, // s (requires SeLoadDriverPrivilege) // loads win32k only 178 | SystemPrioritySeperation, // s (requires SeTcbPrivilege) 179 | SystemVerifierAddDriverInformation, // s (requires SeDebugPrivilege) // 40 180 | SystemVerifierRemoveDriverInformation, // s (requires SeDebugPrivilege) 181 | SystemProcessorIdleInformation, // q: SYSTEM_PROCESSOR_IDLE_INFORMATION (EX in: USHORT ProcessorGroup) 182 | SystemLegacyDriverInformation, // q: SYSTEM_LEGACY_DRIVER_INFORMATION 183 | SystemCurrentTimeZoneInformation, // q; s: RTL_TIME_ZONE_INFORMATION 184 | SystemLookasideInformation, // q: SYSTEM_LOOKASIDE_INFORMATION 185 | SystemTimeSlipNotification, // s: HANDLE (NtCreateEvent) (requires SeSystemtimePrivilege) 186 | SystemSessionCreate, // not implemented 187 | SystemSessionDetach, // not implemented 188 | SystemSessionInformation, // not implemented (SYSTEM_SESSION_INFORMATION) 189 | SystemRangeStartInformation, // q: SYSTEM_RANGE_START_INFORMATION // 50 190 | SystemVerifierInformation, // q: SYSTEM_VERIFIER_INFORMATION; s (requires SeDebugPrivilege) 191 | SystemVerifierThunkExtend, // s (kernel-mode only) 192 | SystemSessionProcessInformation, // q: SYSTEM_SESSION_PROCESS_INFORMATION 193 | SystemLoadGdiDriverInSystemSpace, // s: SYSTEM_GDI_DRIVER_INFORMATION (kernel-mode only) (same as SystemLoadGdiDriverInformation) 194 | SystemNumaProcessorMap, // q: SYSTEM_NUMA_INFORMATION 195 | SystemPrefetcherInformation, // q; s: PREFETCHER_INFORMATION // PfSnQueryPrefetcherInformation 196 | SystemExtendedProcessInformation, // q: SYSTEM_PROCESS_INFORMATION 197 | SystemRecommendedSharedDataAlignment, // q: ULONG // KeGetRecommendedSharedDataAlignment 198 | SystemComPlusPackage, // q; s: ULONG 199 | SystemNumaAvailableMemory, // q: SYSTEM_NUMA_INFORMATION // 60 200 | SystemProcessorPowerInformation, // q: SYSTEM_PROCESSOR_POWER_INFORMATION (EX in: USHORT ProcessorGroup) 201 | SystemEmulationBasicInformation, // q: SYSTEM_BASIC_INFORMATION 202 | SystemEmulationProcessorInformation, // q: SYSTEM_PROCESSOR_INFORMATION 203 | SystemExtendedHandleInformation, // q: SYSTEM_HANDLE_INFORMATION_EX 204 | SystemLostDelayedWriteInformation, // q: ULONG 205 | SystemBigPoolInformation, // q: SYSTEM_BIGPOOL_INFORMATION 206 | SystemSessionPoolTagInformation, // q: SYSTEM_SESSION_POOLTAG_INFORMATION 207 | SystemSessionMappedViewInformation, // q: SYSTEM_SESSION_MAPPED_VIEW_INFORMATION 208 | SystemHotpatchInformation, // q; s: SYSTEM_HOTPATCH_CODE_INFORMATION 209 | SystemObjectSecurityMode, // q: ULONG // 70 210 | SystemWatchdogTimerHandler, // s: SYSTEM_WATCHDOG_HANDLER_INFORMATION // (kernel-mode only) 211 | SystemWatchdogTimerInformation, // q: SYSTEM_WATCHDOG_TIMER_INFORMATION // (kernel-mode only) 212 | SystemLogicalProcessorInformation, // q: SYSTEM_LOGICAL_PROCESSOR_INFORMATION (EX in: USHORT ProcessorGroup) 213 | SystemWow64SharedInformationObsolete, // not implemented 214 | SystemRegisterFirmwareTableInformationHandler, // s: SYSTEM_FIRMWARE_TABLE_HANDLER // (kernel-mode only) 215 | SystemFirmwareTableInformation, // SYSTEM_FIRMWARE_TABLE_INFORMATION 216 | SystemModuleInformationEx, // q: RTL_PROCESS_MODULE_INFORMATION_EX 217 | SystemVerifierTriageInformation, // not implemented 218 | SystemSuperfetchInformation, // q; s: SUPERFETCH_INFORMATION // PfQuerySuperfetchInformation 219 | SystemMemoryListInformation, // q: SYSTEM_MEMORY_LIST_INFORMATION; s: SYSTEM_MEMORY_LIST_COMMAND (requires SeProfileSingleProcessPrivilege) // 80 220 | SystemFileCacheInformationEx, // q: SYSTEM_FILECACHE_INFORMATION; s (requires SeIncreaseQuotaPrivilege) (same as SystemFileCacheInformation) 221 | SystemThreadPriorityClientIdInformation, // s: SYSTEM_THREAD_CID_PRIORITY_INFORMATION (requires SeIncreaseBasePriorityPrivilege) 222 | SystemProcessorIdleCycleTimeInformation, // q: SYSTEM_PROCESSOR_IDLE_CYCLE_TIME_INFORMATION[] (EX in: USHORT ProcessorGroup) 223 | SystemVerifierCancellationInformation, // SYSTEM_VERIFIER_CANCELLATION_INFORMATION // name:wow64:whNT32QuerySystemVerifierCancellationInformation 224 | SystemProcessorPowerInformationEx, // not implemented 225 | SystemRefTraceInformation, // q; s: SYSTEM_REF_TRACE_INFORMATION // ObQueryRefTraceInformation 226 | SystemSpecialPoolInformation, // q; s: SYSTEM_SPECIAL_POOL_INFORMATION (requires SeDebugPrivilege) // MmSpecialPoolTag, then MmSpecialPoolCatchOverruns != 0 227 | SystemProcessIdInformation, // q: SYSTEM_PROCESS_ID_INFORMATION 228 | SystemErrorPortInformation, // s (requires SeTcbPrivilege) 229 | SystemBootEnvironmentInformation, // q: SYSTEM_BOOT_ENVIRONMENT_INFORMATION // 90 230 | SystemHypervisorInformation, // q: SYSTEM_HYPERVISOR_QUERY_INFORMATION 231 | SystemVerifierInformationEx, // q; s: SYSTEM_VERIFIER_INFORMATION_EX 232 | SystemTimeZoneInformation, // q; s: RTL_TIME_ZONE_INFORMATION (requires SeTimeZonePrivilege) 233 | SystemImageFileExecutionOptionsInformation, // s: SYSTEM_IMAGE_FILE_EXECUTION_OPTIONS_INFORMATION (requires SeTcbPrivilege) 234 | SystemCoverageInformation, // q: COVERAGE_MODULES s: COVERAGE_MODULE_REQUEST // ExpCovQueryInformation (requires SeDebugPrivilege) 235 | SystemPrefetchPatchInformation, // SYSTEM_PREFETCH_PATCH_INFORMATION 236 | SystemVerifierFaultsInformation, // s: SYSTEM_VERIFIER_FAULTS_INFORMATION (requires SeDebugPrivilege) 237 | SystemSystemPartitionInformation, // q: SYSTEM_SYSTEM_PARTITION_INFORMATION 238 | SystemSystemDiskInformation, // q: SYSTEM_SYSTEM_DISK_INFORMATION 239 | SystemProcessorPerformanceDistribution, // q: SYSTEM_PROCESSOR_PERFORMANCE_DISTRIBUTION (EX in: USHORT ProcessorGroup) // 100 240 | SystemNumaProximityNodeInformation, // q; s: SYSTEM_NUMA_PROXIMITY_MAP 241 | SystemDynamicTimeZoneInformation, // q; s: RTL_DYNAMIC_TIME_ZONE_INFORMATION (requires SeTimeZonePrivilege) 242 | SystemCodeIntegrityInformation, // q: SYSTEM_CODEINTEGRITY_INFORMATION // SeCodeIntegrityQueryInformation 243 | SystemProcessorMicrocodeUpdateInformation, // s: SYSTEM_PROCESSOR_MICROCODE_UPDATE_INFORMATION 244 | SystemProcessorBrandString, // q: CHAR[] // HaliQuerySystemInformation -> HalpGetProcessorBrandString, info class 23 245 | SystemVirtualAddressInformation, // q: SYSTEM_VA_LIST_INFORMATION[]; s: SYSTEM_VA_LIST_INFORMATION[] (requires SeIncreaseQuotaPrivilege) // MmQuerySystemVaInformation 246 | SystemLogicalProcessorAndGroupInformation, // q: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX (EX in: LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType) // since WIN7 // KeQueryLogicalProcessorRelationship 247 | SystemProcessorCycleTimeInformation, // q: SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION[] (EX in: USHORT ProcessorGroup) 248 | SystemStoreInformation, // q; s: SYSTEM_STORE_INFORMATION (requires SeProfileSingleProcessPrivilege) // SmQueryStoreInformation 249 | SystemRegistryAppendString, // s: SYSTEM_REGISTRY_APPEND_STRING_PARAMETERS // 110 250 | SystemAitSamplingValue, // s: ULONG (requires SeProfileSingleProcessPrivilege) 251 | SystemVhdBootInformation, // q: SYSTEM_VHD_BOOT_INFORMATION 252 | SystemCpuQuotaInformation, // q; s: PS_CPU_QUOTA_QUERY_INFORMATION 253 | SystemNativeBasicInformation, // q: SYSTEM_BASIC_INFORMATION 254 | SystemErrorPortTimeouts, // SYSTEM_ERROR_PORT_TIMEOUTS 255 | SystemLowPriorityIoInformation, // q: SYSTEM_LOW_PRIORITY_IO_INFORMATION 256 | SystemTpmBootEntropyInformation, // q: TPM_BOOT_ENTROPY_NT_RESULT // ExQueryTpmBootEntropyInformation 257 | SystemVerifierCountersInformation, // q: SYSTEM_VERIFIER_COUNTERS_INFORMATION 258 | SystemPagedPoolInformationEx, // q: SYSTEM_FILECACHE_INFORMATION; s (requires SeIncreaseQuotaPrivilege) (info for WorkingSetTypePagedPool) 259 | SystemSystemPtesInformationEx, // q: SYSTEM_FILECACHE_INFORMATION; s (requires SeIncreaseQuotaPrivilege) (info for WorkingSetTypeSystemPtes) // 120 260 | SystemNodeDistanceInformation, // q: USHORT[4*NumaNodes] // (EX in: USHORT NodeNumber) 261 | SystemAcpiAuditInformation, // q: SYSTEM_ACPI_AUDIT_INFORMATION // HaliQuerySystemInformation -> HalpAuditQueryResults, info class 26 262 | SystemBasicPerformanceInformation, // q: SYSTEM_BASIC_PERFORMANCE_INFORMATION // name:wow64:whNtQuerySystemInformation_SystemBasicPerformanceInformation 263 | SystemQueryPerformanceCounterInformation, // q: SYSTEM_QUERY_PERFORMANCE_COUNTER_INFORMATION // since WIN7 SP1 264 | SystemSessionBigPoolInformation, // q: SYSTEM_SESSION_POOLTAG_INFORMATION // since WIN8 265 | SystemBootGraphicsInformation, // q; s: SYSTEM_BOOT_GRAPHICS_INFORMATION (kernel-mode only) 266 | SystemScrubPhysicalMemoryInformation, // q; s: MEMORY_SCRUB_INFORMATION 267 | SystemBadPageInformation, 268 | SystemProcessorProfileControlArea, // q; s: SYSTEM_PROCESSOR_PROFILE_CONTROL_AREA 269 | SystemCombinePhysicalMemoryInformation, // s: MEMORY_COMBINE_INFORMATION, MEMORY_COMBINE_INFORMATION_EX, MEMORY_COMBINE_INFORMATION_EX2 // 130 270 | SystemEntropyInterruptTimingInformation, // q; s: SYSTEM_ENTROPY_TIMING_INFORMATION 271 | SystemConsoleInformation, // q; s: SYSTEM_CONSOLE_INFORMATION 272 | SystemPlatformBinaryInformation, // q: SYSTEM_PLATFORM_BINARY_INFORMATION (requires SeTcbPrivilege) 273 | SystemPolicyInformation, // q: SYSTEM_POLICY_INFORMATION 274 | SystemHypervisorProcessorCountInformation, // q: SYSTEM_HYPERVISOR_PROCESSOR_COUNT_INFORMATION 275 | SystemDeviceDataInformation, // q: SYSTEM_DEVICE_DATA_INFORMATION 276 | SystemDeviceDataEnumerationInformation, // q: SYSTEM_DEVICE_DATA_INFORMATION 277 | SystemMemoryTopologyInformation, // q: SYSTEM_MEMORY_TOPOLOGY_INFORMATION 278 | SystemMemoryChannelInformation, // q: SYSTEM_MEMORY_CHANNEL_INFORMATION 279 | SystemBootLogoInformation, // q: SYSTEM_BOOT_LOGO_INFORMATION // 140 280 | SystemProcessorPerformanceInformationEx, // q: SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION_EX // (EX in: USHORT ProcessorGroup) // since WINBLUE 281 | SystemCriticalProcessErrorLogInformation, 282 | SystemSecureBootPolicyInformation, // q: SYSTEM_SECUREBOOT_POLICY_INFORMATION 283 | SystemPageFileInformationEx, // q: SYSTEM_PAGEFILE_INFORMATION_EX 284 | SystemSecureBootInformation, // q: SYSTEM_SECUREBOOT_INFORMATION 285 | SystemEntropyInterruptTimingRawInformation, 286 | SystemPortableWorkspaceEfiLauncherInformation, // q: SYSTEM_PORTABLE_WORKSPACE_EFI_LAUNCHER_INFORMATION 287 | SystemFullProcessInformation, // q: SYSTEM_PROCESS_INFORMATION with SYSTEM_PROCESS_INFORMATION_EXTENSION (requires admin) 288 | SystemKernelDebuggerInformationEx, // q: SYSTEM_KERNEL_DEBUGGER_INFORMATION_EX 289 | SystemBootMetadataInformation, // 150 290 | SystemSoftRebootInformation, // q: ULONG 291 | SystemElamCertificateInformation, // s: SYSTEM_ELAM_CERTIFICATE_INFORMATION 292 | SystemOfflineDumpConfigInformation, // q: OFFLINE_CRASHDUMP_CONFIGURATION_TABLE_V2 293 | SystemProcessorFeaturesInformation, // q: SYSTEM_PROCESSOR_FEATURES_INFORMATION 294 | SystemRegistryReconciliationInformation, // s: NULL (requires admin) (flushes registry hives) 295 | SystemEdidInformation, // q: SYSTEM_EDID_INFORMATION 296 | SystemManufacturingInformation, // q: SYSTEM_MANUFACTURING_INFORMATION // since THRESHOLD 297 | SystemEnergyEstimationConfigInformation, // q: SYSTEM_ENERGY_ESTIMATION_CONFIG_INFORMATION 298 | SystemHypervisorDetailInformation, // q: SYSTEM_HYPERVISOR_DETAIL_INFORMATION 299 | SystemProcessorCycleStatsInformation, // q: SYSTEM_PROCESSOR_CYCLE_STATS_INFORMATION (EX in: USHORT ProcessorGroup) // 160 300 | SystemVmGenerationCountInformation, 301 | SystemTrustedPlatformModuleInformation, // q: SYSTEM_TPM_INFORMATION 302 | SystemKernelDebuggerFlags, // SYSTEM_KERNEL_DEBUGGER_FLAGS 303 | SystemCodeIntegrityPolicyInformation, // q: SYSTEM_CODEINTEGRITYPOLICY_INFORMATION 304 | SystemIsolatedUserModeInformation, // q: SYSTEM_ISOLATED_USER_MODE_INFORMATION 305 | SystemHardwareSecurityTestInterfaceResultsInformation, 306 | SystemSingleModuleInformation, // q: SYSTEM_SINGLE_MODULE_INFORMATION 307 | SystemAllowedCpuSetsInformation, 308 | SystemVsmProtectionInformation, // q: SYSTEM_VSM_PROTECTION_INFORMATION (previously SystemDmaProtectionInformation) 309 | SystemInterruptCpuSetsInformation, // q: SYSTEM_INTERRUPT_CPU_SET_INFORMATION // 170 310 | SystemSecureBootPolicyFullInformation, // q: SYSTEM_SECUREBOOT_POLICY_FULL_INFORMATION 311 | SystemCodeIntegrityPolicyFullInformation, 312 | SystemAffinitizedInterruptProcessorInformation, // (requires SeIncreaseBasePriorityPrivilege) 313 | SystemRootSiloInformation, // q: SYSTEM_ROOT_SILO_INFORMATION 314 | SystemCpuSetInformation, // q: SYSTEM_CPU_SET_INFORMATION // since THRESHOLD2 315 | SystemCpuSetTagInformation, // q: SYSTEM_CPU_SET_TAG_INFORMATION 316 | SystemWin32WerStartCallout, 317 | SystemSecureKernelProfileInformation, // q: SYSTEM_SECURE_KERNEL_HYPERGUARD_PROFILE_INFORMATION 318 | SystemCodeIntegrityPlatformManifestInformation, // q: SYSTEM_SECUREBOOT_PLATFORM_MANIFEST_INFORMATION // since REDSTONE 319 | SystemInterruptSteeringInformation, // SYSTEM_INTERRUPT_STEERING_INFORMATION_INPUT // 180 320 | SystemSupportedProcessorArchitectures, // p: in opt: HANDLE, out: SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION[] // NtQuerySystemInformationEx 321 | SystemMemoryUsageInformation, // q: SYSTEM_MEMORY_USAGE_INFORMATION 322 | SystemCodeIntegrityCertificateInformation, // q: SYSTEM_CODEINTEGRITY_CERTIFICATE_INFORMATION 323 | SystemPhysicalMemoryInformation, // q: SYSTEM_PHYSICAL_MEMORY_INFORMATION // since REDSTONE2 324 | SystemControlFlowTransition, 325 | SystemKernelDebuggingAllowed, // s: ULONG 326 | SystemActivityModerationExeState, // SYSTEM_ACTIVITY_MODERATION_EXE_STATE 327 | SystemActivityModerationUserSettings, // SYSTEM_ACTIVITY_MODERATION_USER_SETTINGS 328 | SystemCodeIntegrityPoliciesFullInformation, 329 | SystemCodeIntegrityUnlockInformation, // SYSTEM_CODEINTEGRITY_UNLOCK_INFORMATION // 190 330 | SystemIntegrityQuotaInformation, 331 | SystemFlushInformation, // q: SYSTEM_FLUSH_INFORMATION 332 | SystemProcessorIdleMaskInformation, // q: ULONG_PTR[ActiveGroupCount] // since REDSTONE3 333 | SystemSecureDumpEncryptionInformation, 334 | SystemWriteConstraintInformation, // SYSTEM_WRITE_CONSTRAINT_INFORMATION 335 | SystemKernelVaShadowInformation, // SYSTEM_KERNEL_VA_SHADOW_INFORMATION 336 | SystemHypervisorSharedPageInformation, // SYSTEM_HYPERVISOR_SHARED_PAGE_INFORMATION // since REDSTONE4 337 | SystemFirmwareBootPerformanceInformation, 338 | SystemCodeIntegrityVerificationInformation, // SYSTEM_CODEINTEGRITYVERIFICATION_INFORMATION 339 | SystemFirmwarePartitionInformation, // SYSTEM_FIRMWARE_PARTITION_INFORMATION // 200 340 | SystemSpeculationControlInformation, // SYSTEM_SPECULATION_CONTROL_INFORMATION // (CVE-2017-5715) REDSTONE3 and above. 341 | SystemDmaGuardPolicyInformation, // SYSTEM_DMA_GUARD_POLICY_INFORMATION 342 | SystemEnclaveLaunchControlInformation, // SYSTEM_ENCLAVE_LAUNCH_CONTROL_INFORMATION 343 | SystemWorkloadAllowedCpuSetsInformation, // SYSTEM_WORKLOAD_ALLOWED_CPU_SET_INFORMATION // since REDSTONE5 344 | SystemCodeIntegrityUnlockModeInformation, 345 | SystemLeapSecondInformation, // SYSTEM_LEAP_SECOND_INFORMATION 346 | SystemFlags2Information, // q: SYSTEM_FLAGS_INFORMATION 347 | SystemSecurityModelInformation, // SYSTEM_SECURITY_MODEL_INFORMATION // since 19H1 348 | SystemCodeIntegritySyntheticCacheInformation, 349 | SystemFeatureConfigurationInformation, // SYSTEM_FEATURE_CONFIGURATION_INFORMATION // since 20H1 // 210 350 | SystemFeatureConfigurationSectionInformation, // SYSTEM_FEATURE_CONFIGURATION_SECTIONS_INFORMATION 351 | SystemFeatureUsageSubscriptionInformation, // SYSTEM_FEATURE_USAGE_SUBSCRIPTION_DETAILS 352 | SystemSecureSpeculationControlInformation, // SECURE_SPECULATION_CONTROL_INFORMATION 353 | SystemSpacesBootInformation, // since 20H2 354 | SystemFwRamdiskInformation, // SYSTEM_FIRMWARE_RAMDISK_INFORMATION 355 | SystemWheaIpmiHardwareInformation, 356 | SystemDifSetRuleClassInformation, 357 | SystemDifClearRuleClassInformation, 358 | SystemDifApplyPluginVerificationOnDriver, 359 | SystemDifRemovePluginVerificationOnDriver, // 220 360 | SystemShadowStackInformation, // SYSTEM_SHADOW_STACK_INFORMATION 361 | SystemBuildVersionInformation, // SYSTEM_BUILD_VERSION_INFORMATION 362 | SystemPoolLimitInformation, // SYSTEM_POOL_LIMIT_INFORMATION 363 | SystemCodeIntegrityAddDynamicStore, 364 | SystemCodeIntegrityClearDynamicStores, 365 | SystemDifPoolTrackingInformation, 366 | SystemPoolZeroingInformation, // SYSTEM_POOL_ZEROING_INFORMATION 367 | SystemDpcWatchdogInformation, 368 | SystemDpcWatchdogInformation2, 369 | SystemSupportedProcessorArchitectures2, // q: in opt: HANDLE, out: SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION[] // NtQuerySystemInformationEx // 230 370 | SystemSingleProcessorRelationshipInformation, // q: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX // (EX in: PROCESSOR_NUMBER Processor) 371 | SystemXfgCheckFailureInformation, 372 | SystemIommuStateInformation, // SYSTEM_IOMMU_STATE_INFORMATION // since 22H1 373 | SystemHypervisorMinrootInformation, // SYSTEM_HYPERVISOR_MINROOT_INFORMATION 374 | SystemHypervisorBootPagesInformation, // SYSTEM_HYPERVISOR_BOOT_PAGES_INFORMATION 375 | SystemPointerAuthInformation, // SYSTEM_POINTER_AUTH_INFORMATION 376 | SystemSecureKernelDebuggerInformation, 377 | SystemOriginalImageFeatureInformation, 378 | MaxSystemInfoClass 379 | } SYSTEM_INFORMATION_CLASS; 380 | 381 | NTSYSCALLAPI 382 | NTSTATUS 383 | NTAPI 384 | ZwQuerySystemInformation( 385 | _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, 386 | _Out_writes_bytes_opt_(SystemInformationLength) PVOID SystemInformation, 387 | _In_ ULONG SystemInformationLength, 388 | _Out_opt_ PULONG ReturnLength 389 | ); 390 | --------------------------------------------------------------------------------