Skip to content

Commit bee8ad1

Browse files
authored
Update LiveDebugging.md
1 parent 3b05fe9 commit bee8ad1

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

ExdiKdSample/LiveDebugging.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@
22

33
[Actual distributive](https://github.com/gerhart01/LiveCloudKd/releases/download/v1.0.22021109/LiveCloudKd.EXDi.debugger.v1.0.22021109.zip)
44

5-
LiveCloudKd EXDi debugger can be used for debugging Hyper-V guest OS without enable kernel debugging in bootloader.
5+
LiveCloudKd EXDi debugger can be used for debugging Hyper-V guest OS without enable kernel debugging in Windows bootloader.
66

7-
Can be useful for debug Hyper-V VM with enabled HVCI and securekernel.
7+
It can be useful for debug Hyper-V VM with VBS and HVCI enabled.
88

99
Working with guest Windows Server 2022 and Windows 11, including preview builds (on November 2022)
1010

1111
For debugging you need to use Windows Server 2019 (August 2020 updates - Windows image name en_windows_server_2019_updated_aug_2020_x64_dvd_f4bab427.iso).
12-
It is good to use VMware Workstation for it.
12+
It is good to use VMware Workstation for itm but you can try use Hyper-V with Windows Server 2019 as guest OS and Windows 11 as nested guest OS.
1313

1414
# VSM\VBS activating for securekernel debugging
1515

16-
Read official Microsoft document first [Enable virtualization-based protection or code integrity](https://docs.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity)
16+
First read official Microsoft document [Enable virtualization-based protection or code integrity](https://docs.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity)
1717

18-
It was enough for me to enable VBS in group policy editor.
18+
It was enough to enable VBS in group policy editor.
1919

20-
For guest VM don't forget enable SecureBoot option.
21-
Check Get-VMSecurity -VMName <VMName> output. VirtualizationBasedSecurityOptOut must be $false.
20+
For guest VM don't forget enable SecureBoot option with TPM support (for Windows 11).
21+
22+
Check
23+
```
24+
Get-VMSecurity -VMName <VMName>
25+
```
26+
output. VirtualizationBasedSecurityOptOut must be $false
2227

2328
Don't enable nested virtualization support for guest OS. VBS in guest Hyper-V VM works without guest hypervisor.
2429

@@ -28,10 +33,14 @@ EXDi is used for integration custom debugging engines with WinDBG.
2833

2934
LiveCloudKDExdi plugin in live debugging mode works with Hyper-V on Windows Server 2019 and Windows 10 20H1 (19041) as host OS. Guest OS can be various.
3035

31-
1. Extract all files to WinDBG x64 10.0.22621 install directory (installer can be found in Windows SDK 11 22H2)
36+
1. Extract all files to WinDBG x64 10.0.22621 install directory (installer can be found in Windows SDK 11 22H2) or WinDBG with modern UI (ex. Preview)
3237
2. Install Visual Studio 2022 runtime libraries - https://aka.ms/vs/17/release/vc_redist.x64.exe
33-
3. Register ExdiKdSample.dll using "regsvr32.exe ExdiKdSample.dll" command
34-
4. Don't forget configure symbols path for WinDBG as usual:
38+
3. Register ExdiKdSample.dll using
39+
```
40+
regsvr32.exe ExdiKdSample.dll
41+
```
42+
command
43+
5. Don't forget configure symbols path for WinDBG as usual:
3544

3645
```
3746
mkdir C:\Symbols
@@ -64,11 +73,15 @@ but before you need create HKEY_LOCAL_MACHINE\SOFTWARE\LiveCloudKd\Parameters\Vm
6473
You can use WinDBG Preview with EXDi plugin too. But WinDBG Preview has bug with automatically starting EXDi plugin from command line, therefore it must be start manually.
6574

6675
4. Create HKEY_LOCAL_MACHINE\SOFTWARE\LiveCloudKd\Parameters\VmId, type REG_DWORD and enter position number in LiveCloudKd list [0, 1, 2]. You can see that list, if you launch LiveCloudKd without parameters. If you launch 1 VM, that parameter will be 0.
67-
5. Start WinDBGX, go to File-Start debugging-Attach to Kernel, open EXDi tab and paste string
76+
5. You can start WinDBG with modern UI, go to File-Start debugging-Attach to Kernel, open EXDi tab and paste string
6877

6978
```
7079
CLSID={67030926-1754-4FDA-9788-7F731CBDAE42},Kd=Guess
7180
```
81+
or (on latest versions)
82+
```
83+
DbgX.Shell.exe -v -kx exdi:CLSID={67030926-1754-4FDA-9788-7F731CBDAE42},Kd=Guess
84+
```
7285

7386
to field.
7487

@@ -77,7 +90,7 @@ to field.
7790
# Live debugging usage
7891

7992
1 CPU for guest OS for live debugging is preferrable.
80-
Experimented multi-CPU debugging was added. For successfull debugging you need set Debug-Event Filters->Break instruction exception to Handle->Not Handle, and Execution->Output.
93+
Experimented multi-CPU debugging was added. For successfull debugging you need set Debug-Event Filters->Break instruction exception to Handle->Not Handle, and Execution->Output inside WinDBG.
8194

8295
Set breakpoint using "bp" command, press "Run", wait until breakpoint was triggered. You can set 0x1000 breakpoints now. It is software-like breakpoints, and not limited. You can use single step command.
8396
For debugging securekernel:
@@ -127,7 +140,6 @@ You can load standard address space modules using same commands even you inside
127140

128141
6. Script idt_securekernel_parse_pykd.py inside archive for demo.
129142

130-
131143
You can see demo video on youtube:
132144

133145
1. Debugging Hyper-V Windows Server 2019 guest OS using LiveCloudKd EXDI plugin - https://youtu.be/_8rQwB-ESlk

0 commit comments

Comments
 (0)