windbg调试sandboxie driver

串口方式

2026-05-25

Written by: tdtc

Windows Version Build Number Supported Visual Studio SDK WDK Comments
Windows 11 25H2 (Ge) 26100.6584 VS 2022 SDK WDK This version is the default supported kit for Windows driver development in VS2022.
Windows 10 2004 (VB) 19041.5738 VS 2019 SDK WDK Supported for Windows 7/Windows 8/Windows 8.1 driver development only.

Enterprise WDK (EWDK)

Instead of downloading Visual Studio, the SDK, and the WDK separately, you can download the EWDK. The EWDK is a standalone, self-contained command-line environment for building drivers. It includes Visual Studio Build Tools, the SDK, and the WDK.

Prepare

VM setting - serial port

vmware or vbox

\\.\pipe\com_1

vmware

i/o mode:

yield CPU on poll

vbox

Port 2:
uncheck:

Connect to existing pipe/socket

windbg

about version:
The operating system needs to match the same or higher version of windbg.
Otherwise the OS version will not be recognized!!

home path

C:\WinDDK\7600.16385.1\Debuggers\
C:\Program Files (x86)\Windows Kits\10\Debuggers\x86
C:\Program Files (x86)\Windows Kits\10\Debuggers\x64

ShortCute

If you use a shortcut, you don’t need to set the download path in the command.

<home path> -y "srv*c:\symbols*https://msdl.microsoft.com/download/symbols"

guest os

display os list

Add an OS to display the OS list:

bcdedit /copy {current} /d "Sandboxie Usage"

debug settings

bcdedit /debug on
bcdedit /dbgsettings serial debugport:2 baudrate:115200

Disable Driver Signature Enforcement

  1. Settings -> Update and recovery → Recovery

  2. Troubleshoot and then Advanced options.

  3. Go to “Advanced options” and click Start-up Settings.

  4. Under “Start-up Settings” click Restart.

install application

setup “SandboxieInstall32.exe”

start working

kernel debug

com:

\\.\pipe\com_1

path

config:

.sympath SRV*c:\symbols*http://msdl.microsoft.com/download/symbols

details:

!sym noisy

把需要调试的pdb放入指定的文件夹。
注意每次调试新os的时候,文件夹位置会不同!!!
For example, the first time:

C:\symbols\SbieDrv.pdb\BF241AE76B2D4145B6A1B57B13335E8C1

the second time:

C:\symbols\SbieDrv.pdb\33C23FFE03A8402BA6E16961BA2880CE1

command

Enable Debugger Markup Language (DML) with .prefer_dml

.prefer_dml 1

Reload Module

load all modules:

.reload /f

Specified module:

.reload /f /i SbieDrv.sys

List Loaded Modules

show specified module:

lm m SbieDrv v

Break point

Unresolved Breakpoint

Sets a breakpoint that is unresolved when the module is unloaded and re-enables when the module reloads.

bu SbieDrv!Api_CopySidStringFromUser
bu SbieDrv!Api_Init
bu SbieDrv!Api_CopyBoxNameFromUser
bu SbieDrv!Api_CopyStringToUser
bu SbieDrv!Api_GetHomePath
bu SbieDrv!Api_GetVersion
bu SbieDrv!Api_Irp_CLEANUP
bu SbieDrv!Api_LogMessage
bu SbieDrv!Api_SetFunction
bu SbieDrv!Api_SendServiceMessage
bu SbieDrv!Api_GetWork
bu SbieDrv!Api_FastIo_DEVICE_CONTROL
bu SbieDrv!Api_SetServicePort
bu SbieDrv!Api_AddWork
bu SbieDrv!Api_DelWork
bu SbieDrv!Api_Irp_CREATE
bu SbieDrv!Api_Disable
bu SbieDrv!Api_ResetServiceProcess
bu SbieDrv!Api_Unload

Activate the above debugging:
“Create a new sandbox”,
“Run web Browser”;
right click web link, “Save target as”.

Breakepoint List

List the current breakpoints to confirm that the breakpoint was set by typing the bl command.

bl

run and quit

go:

g

break:

Debug -> Break

quit debug:

qd

Ref