串口方式
2022-09-06
Written by: tdtc
Sandboxie builds under MS Visual Studio 2015.
可以升级到vs2017 & windows sdk8.1.
Host Env:
vmware or vbox
\\.\pipe\com_1
i/o mode:
yield CPU on poll
Port 2:
uncheck:
Connect to existing pipe/socket
about version:
The operating system needs to match the same or higher version of windbg.
Otherwise the OS version will not be recognized!!
C:\WinDDK\7600.16385.1\Debuggers\
C:\Program Files (x86)\Windows Kits\10\Debuggers\x86
C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
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"
Add an OS to display the OS list:
bcdedit /copy {current} /d "Sandboxie Usage"
bcdedit /debug on
bcdedit /dbgsettings serial debugport:2 baudrate:115200
Win7
After each startup, press F8 (laptop Fn+F8).
Win8+
Settings -> Update and recovery → Recovery
Troubleshoot and then Advanced options.
Go to “Advanced options” and click Start-up Settings.
Under “Start-up Settings” click Restart.
setup “SandboxieInstall32.exe”
com:
\\.\pipe\com_1
pipe checked
reconnect checked
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
Enable Debugger Markup Language (DML) with .prefer_dml
.prefer_dml 1
load all modules:
.reload /f
Specified module:
.reload /f /i SbieDrv.sys
show specified module:
lm m SbieDrv v
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”.
List the current breakpoints to confirm that the breakpoint was set by typing the bl command.
bl
go:
g
break:
Debug -> Break
quit debug:
qd