在内核和用户模式下,
10: kd> !envvar COMPUTERNAME
COMPUTERNAME = a-host-name
它需要
EXTS.dll
!envvar
将返回空
10: kd> !peb
PEB NULL...
当前上下文是一个空闲线程。
!process
仅列出位0-4,但我发现位5在与0和4一起使用时会转储整个环境。旗帜=
0b110001
!process 0 0x31 wininit.exe
将转储所有环境变量:
10: kd> !process 0 0x31 wininit.exe
PROCESS ffffc485c82655c0
SessionId: 0 Cid: 02d0 Peb: 8d04c6b000 ParentCid: 0258
DirBase: 40452f000 ObjectTable: ffffe30b1150fb40 HandleCount: 163.
Image: wininit.exe
VadRoot ffffc485c862b990 Vads 61 Clone 0 Private 326. Modified 12. Locked 2.
DeviceMap ffffe30b0a817880
Token ffffe30b1150f060
ElapsedTime 00:00:18.541
UserTime 00:00:00.000
KernelTime 00:00:00.015
QuotaPoolUsage[PagedPool] 121696
QuotaPoolUsage[NonPagedPool] 11448
Working Set Sizes (now,min,max) (1750, 50, 345) (7000KB, 200KB, 1380KB)
PeakWorkingSetSize 1697
VirtualSize 2097239 Mb
PeakVirtualSize 2097239 Mb
PageFaultCount 2104
MemoryPriority BACKGROUND
BasePriority 13
CommitCharge 470
PEB at 0000008d04c6b000
InheritedAddressSpace: No
ReadImageFileExecOptions: No
BeingDebugged: No
ImageBaseAddress: 00007ff7be3d0000
Ldr 00007ff8dff4f3a0
Ldr.Initialized: Yes
Ldr.InInitializationOrderModuleList: 000001be470e1c10 . 000001be47128d60
Ldr.InLoadOrderModuleList: 000001be470e1d80 . 000001be47128d40
Ldr.InMemoryOrderModuleList: 000001be470e1d90 . 000001be47128d50
Base TimeStamp Module
7ff7be3d0000 600d94df Jan 24 10:40:15 2021 C:\Windows\system32\wininit.exe
7ff8dfdf0000 493793ea Dec 04 03:25:14 2008 C:\Windows\SYSTEM32\ntdll.dll
...
SubSystemData: 0000000000000000
ProcessHeap: 000001be470e0000
ProcessParameters: 000001be470e1460
CurrentDirectory: 'C:\Windows\system32\'
WindowTitle: '< Name not readable >'
ImageFile: 'C:\Windows\system32\wininit.exe'
CommandLine: 'wininit.exe'
DllPath: '< Name not readable >'
Environment: 000001be47104460
ALLUSERSPROFILE=C:\ProgramData
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=a-host-name
ComSpec=C:\Windows\system32\cmd.exe
NUMBER_OF_PROCESSORS=16
OS=Windows_NT
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 1 Stepping 1, AuthenticAMD
PROCESSOR_LEVEL=23
PROCESSOR_REVISION=0101
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\temp
TMP=C:\temp
USERNAME=SYSTEM
USERPROFILE=C:\Windows\system32\config\systemprofile
windir=C:\Windows
您可以单击PEB dml链接,或通过
.process /p <PROCESS_ADDRESS>
然后
!envvar COMPUTERNAME