Permalink
Browse files

Moving from SVN

  • Loading branch information...
sysprogs committed Sep 28, 2015
0 parents commit bf7f65ffbbb8cdc6d9772f5f14c7fa67d1f7ae22
Showing with 72,192 additions and 0 deletions.
  1. +141 −0 BUNDLE/make.bat
  2. +190 −0 BUNDLE/readme.txt
  3. +11 −0 SDKIncludes.props
  4. +133 −0 VBoxDD/IOHandlers.cpp
  5. +50 −0 VBoxDD/IOHandlers.h
  6. +41 −0 VBoxDD/ReadMe.txt
  7. +80 −0 VBoxDD/VBoxDD.cpp
  8. +6 −0 VBoxDD/VBoxDD.def
  9. +106 −0 VBoxDD/VBoxDD.rc
  10. +59 −0 VBoxDD/VBoxDD.sln
  11. +825 −0 VBoxDD/VBoxDD.vcproj
  12. +370 −0 VBoxDD/VBoxDD.vcxproj
  13. +95 −0 VBoxDD/VBoxDD.vcxproj.filters
  14. BIN VBoxDD/VBoxKD.zip
  15. +24 −0 VBoxDD/dllmain.cpp
  16. +14 −0 VBoxDD/resource.h
  17. +54 −0 VBoxDD/selfreg.cpp
  18. +8 −0 VBoxDD/stdafx.cpp
  19. +14 −0 VBoxDD/stdafx.h
  20. +24 −0 VBoxDD/targetver.h
  21. +137 −0 VirtualKDSetup/BatchBuildForm.Designer.cs
  22. +90 −0 VirtualKDSetup/BatchBuildForm.cs
  23. +120 −0 VirtualKDSetup/BatchBuildForm.resx
  24. +114 −0 VirtualKDSetup/DownloadProgressForm.Designer.cs
  25. +237 −0 VirtualKDSetup/DownloadProgressForm.cs
  26. +120 −0 VirtualKDSetup/DownloadProgressForm.resx
  27. BIN VirtualKDSetup/ICSharpCode.SharpZipLib.dll
  28. +169 −0 VirtualKDSetup/MainForm.Designer.cs
  29. +134 −0 VirtualKDSetup/MainForm.cs
  30. +120 −0 VirtualKDSetup/MainForm.resx
  31. +36 −0 VirtualKDSetup/NewVBoxClient.cs
  32. +23 −0 VirtualKDSetup/Program.cs
  33. +36 −0 VirtualKDSetup/Properties/AssemblyInfo.cs
  34. +63 −0 VirtualKDSetup/Properties/Resources.Designer.cs
  35. +117 −0 VirtualKDSetup/Properties/Resources.resx
  36. +26 −0 VirtualKDSetup/Properties/Settings.Designer.cs
  37. +7 −0 VirtualKDSetup/Properties/Settings.settings
  38. +177 −0 VirtualKDSetup/VBoxBuildForm.Designer.cs
  39. +263 −0 VirtualKDSetup/VBoxBuildForm.cs
  40. +123 −0 VirtualKDSetup/VBoxBuildForm.resx
  41. +241 −0 VirtualKDSetup/VirtualBoxClient.cs
  42. +304 −0 VirtualKDSetup/VirtualBoxIntegrationForm.Designer.cs
  43. +118 −0 VirtualKDSetup/VirtualBoxIntegrationForm.cs
  44. +139 −0 VirtualKDSetup/VirtualBoxIntegrationForm.resx
  45. +142 −0 VirtualKDSetup/VirtualKDSetup.csproj
  46. +20 −0 VirtualKDSetup/VirtualKDSetup.sln
  47. +259 −0 _help.cfg
  48. +7 −0 database/47CDBA1A.vmpatch
  49. +7 −0 database/48F2576A.vmpatch
  50. +7 −0 database/4907CE46.vmpatch
  51. +9 −0 footer.html
  52. +13 −0 header.html
  53. +402 −0 kdclient/32to64.cpp
  54. +23 −0 kdclient/32to64.h
  55. +41 −0 kdclient/KDClient.h
  56. +41 −0 kdclient/ReadMe.txt
  57. +22 −0 kdclient/TerminationNotifier.h
  58. +128 −0 kdclient/VBoxCmdLine.cpp
  59. +7 −0 kdclient/VBoxCmdLine.h
  60. +157 −0 kdclient/VBoxSnapsnotRestorer.cpp
  61. +42,858 −0 kdclient/VMAPI/VirtualBox.h
  62. +804 −0 kdclient/VMAPI/VirtualBox_i.c
  63. +3,671 −0 kdclient/VMAPI/VixCOM.h
  64. +147 −0 kdclient/VMWareSnapshotRestorer.cpp
  65. +185 −0 kdclient/cmdline.cpp
  66. +24 −0 kdclient/cmdline.h
  67. +47 −0 kdclient/dllmain.cpp
  68. +100 −0 kdclient/findproc.cpp
  69. +14 −0 kdclient/findproc.h
  70. +171 −0 kdclient/hook64.cpp
  71. +10 −0 kdclient/hook64.h
  72. +301 −0 kdclient/kdclient.cpp
  73. +2 −0 kdclient/kdclient.def
  74. +109 −0 kdclient/kdclient.rc
  75. +56 −0 kdclient/kdclient.sln
  76. +345 −0 kdclient/kdclient.vcxproj
  77. +137 −0 kdclient/kdclient.vcxproj.filters
  78. +118 −0 kdclient/loader.h
  79. +475 −0 kdclient/patchapi.cpp
  80. +76 −0 kdclient/patchapi.h
  81. +15 −0 kdclient/resource.h
  82. +6 −0 kdclient/stdafx.cpp
  83. +18 −0 kdclient/stdafx.h
  84. +581 −0 kdclient/tablemgr.cpp
  85. +251 −0 kdclient/tablemgr.h
  86. +29 −0 kdclient/targetver.h
  87. +297 −0 kdpatch/kdpatch.cpp
  88. +105 −0 kdpatch/kdpatch.rc
  89. +6 −0 kdpatch/kdpatch.reg
  90. +66 −0 kdpatch/kdpatch.sln
  91. +440 −0 kdpatch/kdpatch.vcproj
  92. +271 −0 kdpatch/kdpatch.vcxproj
  93. +35 −0 kdpatch/kdpatch.vcxproj.filters
  94. +129 −0 kdpatch/moduleapi.h
  95. +15 −0 kdpatch/resource.h
  96. +6 −0 kdpatch/stdafx.cpp
  97. +6 −0 kdpatch/stdafx.h
  98. +25 −0 kdvm/emptyfunc.cpp
  99. +82 −0 kdvm/kdrpc.h
  100. +396 −0 kdvm/kdvm.cpp
  101. +14 −0 kdvm/kdvm.def
  102. +97 −0 kdvm/kdvm.h
  103. +105 −0 kdvm/kdvm.rc
  104. +446 −0 kdvm/kdvm.vcproj
  105. +275 −0 kdvm/kdvm.vcxproj
  106. +37 −0 kdvm/kdvm.vcxproj.filters
  107. +130 −0 kdvm/kdxxx.h
  108. +15 −0 kdvm/resource.h
  109. +6 −0 kdvm/stdafx.cpp
  110. +6 −0 kdvm/stdafx.h
  111. +153 −0 kdvm/vboxrpc.h
  112. +10 −0 kdvm/vboxrpc64.asm
  113. +609 −0 kdvm/vmwrpc.h
  114. +270 −0 kdvm/vmwrpc64.asm
  115. +29 −0 kdvmguestlib/VisualDDKHelpers.h
  116. +388 −0 kdvmguestlib/kdvmguestlib.vcproj
  117. +187 −0 kdvmguestlib/kdvmguestlib.vcxproj
  118. +56 −0 kdvmguestlib/kdvmguestlib.vcxproj.filters
  119. +2 −0 kdvmguestlib/stdafx.cpp
  120. +19 −0 kdvmguestlib/stdafx.h
  121. +362 −0 masm64.rules
  122. +33 −0 pipeproxy/ReadMe.txt
  123. +102 −0 pipeproxy/pipeproxy.cpp
  124. +40 −0 pipeproxy/pipeproxy.sln
  125. +257 −0 pipeproxy/pipeproxy.vcproj
  126. +125 −0 pipeproxy/pipeproxy.vcxproj
  127. +60 −0 pipeproxy/pipeproxy.vcxproj.filters
  128. +6 −0 pipeproxy/stdafx.cpp
  129. +16 −0 pipeproxy/stdafx.h
  130. +18 −0 pipeproxy/targetver.h
  131. +331 −0 rpcdispatch/PacketLog.cpp
  132. +39 −0 rpcdispatch/PacketLog.h
  133. +89 −0 rpcdispatch/ServiceCommandHandler.h
  134. +27 −0 rpcdispatch/ServiceCommandProtocol.h
  135. +722 −0 rpcdispatch/kdcomdisp.cpp
  136. +154 −0 rpcdispatch/kdcomdisp.h
  137. +37 −0 rpcdispatch/permdesc.h
  138. +277 −0 rpcdispatch/pipesrv.h
  139. +64 −0 rpcdispatch/reporter.cpp
  140. +48 −0 rpcdispatch/reporter.h
  141. +230 −0 rpcdispatch/rpcdisp.h
  142. +54 −0 rpcdispatch/status.h
  143. +89 −0 rpcdispatch/trassist.h
  144. +30 −0 vkdversion.h
  145. +293 −0 vminstall/MainDlg.cpp
  146. +48 −0 vminstall/MainDlg.h
  147. +890 −0 vminstall/bootedit.cpp
  148. +48 −0 vminstall/bootedit.h
  149. +106 −0 vminstall/install.cpp
  150. +9 −0 vminstall/install.h
  151. BIN vminstall/res/vminstall.ico
  152. +30 −0 vminstall/resource.h
  153. +14 −0 vminstall/resource1.h
  154. +17 −0 vminstall/resource2.h
  155. +9 −0 vminstall/stdafx.cpp
  156. +33 −0 vminstall/stdafx.h
  157. +83 −0 vminstall/vminst_vddk.rc
  158. +117 −0 vminstall/vminst_ver.rc
  159. +41 −0 vminstall/vminstall.cpp
  160. +1 −0 vminstall/vminstall.h
  161. +239 −0 vminstall/vminstall.rc
  162. +39 −0 vminstall/vminstall.sln
  163. +405 −0 vminstall/vminstall.vcproj
  164. +246 −0 vminstall/vminstall.vcxproj
  165. +77 −0 vminstall/vminstall.vcxproj.filters
  166. +1,060 −0 vmmon/MainDlg.cpp
  167. +154 −0 vmmon/MainDlg.h
  168. +110 −0 vmmon/PatchList.h
  169. BIN vmmon/green.ico
  170. BIN vmmon/grey.ico
  171. BIN vmmon/red.ico
  172. BIN vmmon/res/vmmon.ico
  173. +53 −0 vmmon/resource.h
  174. +14 −0 vmmon/resource1.h
  175. +10 −0 vmmon/stdafx.cpp
  176. +35 −0 vmmon/stdafx.h
  177. +85 −0 vmmon/trparams.h
  178. +47 −0 vmmon/vmmon.cpp
  179. +282 −0 vmmon/vmmon.rc
  180. +56 −0 vmmon/vmmon.sln
  181. +678 −0 vmmon/vmmon.vcproj
  182. +440 −0 vmmon/vmmon.vcxproj
  183. +82 −0 vmmon/vmmon.vcxproj.filters
  184. +42 −0 vmmon/vmmon_ver.h
  185. +105 −0 vmmon/vmmon_ver.rc
  186. +105 −0 vmmon/vmmon_ver.rc_bak
  187. BIN vmmon/windbg.ico
  188. BIN vmmon/yellow.ico
  189. +33 −0 vmxpatch/ReadMe.txt
  190. +19 −0 vmxpatch/resource.h
  191. +6 −0 vmxpatch/stdafx.cpp
  192. +15 −0 vmxpatch/stdafx.h
  193. +18 −0 vmxpatch/targetver.h
  194. +73 −0 vmxpatch/vmxpatch.cpp
  195. +105 −0 vmxpatch/vmxpatch.rc
  196. +561 −0 vmxpatch/vmxpatch.vcproj
  197. +278 −0 vmxpatch/vmxpatch.vcxproj
  198. +44 −0 vmxpatch/vmxpatch.vcxproj.filters
@@ -0,0 +1,141 @@
+REM @echo off
+
+set DEVENVPATH=%VS100COMNTOOLS%\..\IDE
+
+if a%1 == adebug goto debug
+if a%1 == anopdb goto nopdb
+goto release
+
+:debug
+set CONFIGNAME=Debug
+set TARGETSUBPATH=Debug\
+mkdir Debug
+goto build
+
+:nopdb
+set CONFIGNAME=Release
+set TARGETSUBPATH=nopdb\
+mkdir nopdb
+goto build
+
+:release
+echo Building RELEASE configuration. Use "make debug" to build DEBUG configuration
+set CONFIGNAME=Release
+set TARGETSUBPATH=
+
+:build
+
+mkdir %TARGETSUBPATH%target
+mkdir %TARGETSUBPATH%target\x86
+mkdir %TARGETSUBPATH%target\x64
+
+cd ..\kdclient
+"%DEVENVPATH%\devenv" kdclient.sln /Build "%CONFIGNAME%|Win32"
+if not exist %CONFIGNAME%\kdclient.dll goto error
+if not exist %CONFIGNAME%\vmxpatch.exe goto error
+"%DEVENVPATH%\devenv" kdclient.sln /Build "%CONFIGNAME%|x64"
+if not exist x64\%CONFIGNAME%\kdclient64.dll goto error
+if not exist x64\%CONFIGNAME%\vmxpatch64.exe goto error
+
+copy /y %CONFIGNAME%\kdclient.dll ..\bundle\%TARGETSUBPATH%
+copy /y %CONFIGNAME%\kdclient.pdb ..\bundle\%TARGETSUBPATH%
+copy /y %CONFIGNAME%\vmxpatch.exe ..\bundle\%TARGETSUBPATH%
+copy /y %CONFIGNAME%\vmxpatch.pdb ..\bundle\%TARGETSUBPATH%
+
+copy /y x64\%CONFIGNAME%\kdclient64.dll ..\bundle\%TARGETSUBPATH%
+copy /y x64\%CONFIGNAME%\kdclient64.pdb ..\bundle\%TARGETSUBPATH%
+copy /y x64\%CONFIGNAME%\vmxpatch64.exe ..\bundle\%TARGETSUBPATH%
+copy /y x64\%CONFIGNAME%\vmxpatch64.pdb ..\bundle\%TARGETSUBPATH%
+
+cd ..\vmmon
+
+"%DEVENVPATH%\devenv" vmmon.sln /Build "%CONFIGNAME%|Win32"
+if not exist %CONFIGNAME%\vmmon.exe goto error
+"%DEVENVPATH%\devenv" vmmon.sln /Build "%CONFIGNAME%|x64"
+if not exist x64\%CONFIGNAME%\vmmon64.exe goto error
+
+copy /y %CONFIGNAME%\vmmon.exe ..\bundle\%TARGETSUBPATH%
+copy /y %CONFIGNAME%\vmmon.pdb ..\bundle\%TARGETSUBPATH%
+copy /y x64\%CONFIGNAME%\vmmon64.exe ..\bundle\%TARGETSUBPATH%
+copy /y x64\%CONFIGNAME%\vmmon64.pdb ..\bundle\%TARGETSUBPATH%
+
+cd ..\kdpatch
+copy /y kdpatch.reg ..\bundle\%TARGETSUBPATH%target
+
+"%DEVENVPATH%\devenv" kdpatch.sln /Build "%CONFIGNAME%|Win32"
+if not exist %CONFIGNAME%\kdbazis.dll goto error
+if not exist %CONFIGNAME%\kdpatch.sys goto error
+
+copy /y %CONFIGNAME%\kdbazis.dll ..\bundle\%TARGETSUBPATH%target\x86
+copy /y %CONFIGNAME%\kdvm.pdb ..\bundle\%TARGETSUBPATH%target\x86
+copy /y %CONFIGNAME%\kdpatch.sys ..\bundle\%TARGETSUBPATH%target\x86
+copy /y %CONFIGNAME%\kdpatch.pdb ..\bundle\%TARGETSUBPATH%target\x86
+
+"%DEVENVPATH%\devenv" kdpatch.sln /Build "%CONFIGNAME%|x64"
+if not exist x64\%CONFIGNAME%\kdbazis.dll goto error
+if not exist x64\%CONFIGNAME%\kdpatch.sys goto error
+
+copy /y x64\%CONFIGNAME%\kdbazis.dll ..\bundle\%TARGETSUBPATH%target\x64
+copy /y x64\%CONFIGNAME%\kdvm.pdb ..\bundle\%TARGETSUBPATH%target\x64
+copy /y x64\%CONFIGNAME%\kdpatch.sys ..\bundle\%TARGETSUBPATH%target\x64
+copy /y x64\%CONFIGNAME%\kdpatch.pdb ..\bundle\%TARGETSUBPATH%target\x64
+
+REM cd ..\VBoxDD
+REM "%DEVENVPATH%\devenv" VBoxDD.sln /Build "%CONFIGNAME%|Win32"
+REM if not exist %CONFIGNAME%\VBoxKD.dll goto error
+REM "%DEVENVPATH%\devenv" VBoxDD.sln /Build "%CONFIGNAME%|x64"
+REM if not exist x64\%CONFIGNAME%\VBoxKD64.dll goto error
+
+copy /y %CONFIGNAME%\VBoxKD.dll ..\bundle\%TARGETSUBPATH%
+copy /y %CONFIGNAME%\VBoxKD.pdb ..\bundle\%TARGETSUBPATH%
+copy /y x64\%CONFIGNAME%\VBoxKD64.dll ..\bundle\%TARGETSUBPATH%
+copy /y x64\%CONFIGNAME%\VBoxKD64.pdb ..\bundle\%TARGETSUBPATH%
+
+cd ..\vminstall
+"%DEVENVPATH%\devenv" vminstall.sln /Build "%CONFIGNAME%|Win32"
+if not exist %CONFIGNAME%\vminstall.exe goto error
+
+copy /y %CONFIGNAME%\vminstall.exe ..\bundle\%TARGETSUBPATH%target
+
+cd ..\VirtualKDSetup
+"%DEVENVPATH%\devenv" VirtualKDSetup.sln /Build Release
+if not exist bin\Release\VirtualKDSetup.exe goto error
+
+copy /y bin\Release\VirtualKDSetup.exe ..\bundle\%TARGETSUBPATH%
+copy /y bin\Release\Interop.VirtualBox.dll ..\bundle\%TARGETSUBPATH%
+copy /y bin\Release\ICSharpCode.SharpZipLib.dll ..\bundle\%TARGETSUBPATH%
+
+cd ..\bundle
+call ..\..\..\utils\sign.bat %TARGETSUBPATH%target\x86\kdbazis.dll
+call ..\..\..\utils\sign.bat %TARGETSUBPATH%target\x86\kdpatch.sys
+call ..\..\..\utils\sign.bat %TARGETSUBPATH%target\x64\kdbazis.dll
+call ..\..\..\utils\sign.bat %TARGETSUBPATH%target\x64\kdpatch.sys
+
+call ..\..\..\utils\sign_r.bat %TARGETSUBPATH%target\vminstall.exe
+call ..\..\..\utils\sign_r.bat %TARGETSUBPATH%kdclient.dll
+call ..\..\..\utils\sign_r.bat %TARGETSUBPATH%kdclient64.dll
+
+
+REM copy ..\database\*.vmpatch ..\bundle\%TARGETSUBPATH%
+
+cd %TARGETSUBPATH%
+
+cipher /d /a /s:.
+if a%1 == adebug goto end
+if a%1 == anopdb goto nopdb
+
+goto end
+
+:nopdb
+del *.pdb
+del target\x86\*.pdb
+del target\x64\*.pdb
+del VirtualBox\x86\*.pdb
+del VirtualBox\x64\*.pdb
+goto end
+
+:error
+echo Build failed!
+pause
+
+:end
@@ -0,0 +1,190 @@
+VirtualKD - Kernel Debugger extension for VMWare and VirtualBox
+Version 2.8
+http://virtualkd.sysprogs.org/
+
+Copyright (c) Ivan Shcherbakov, 2009-2012 [ivan@sysprogs.org]
+
+-===============QUICKSTART===============-
+ 1. Run VirtualKDSetup.exe on host (only needed if VirtualBox is used)
+ 2. Run target\vminstall.exe on every virtual machine.
+ 3. Run vmmon.exe (or vmmon64.exe) to start.
+
+If you have problems with VirtualBox integration, re-register VBoxKD64.dll/VBoxKD.dll by running (non-elevated mode!)
+ regsvr32 VBoxKD64.dll
+
+Ensure that VirtualBox is closed and no VBoxSVC service is running in the background.
+
+-========================================-
+
+OVERVIEW
+VirtualKD allows debugging your Windows kernel running on VirtualBox and VMWare using very fast custom transport.
+It seamlessly integrates with WinDBG and VisualDDK providing a much faster debugging experience.
+
+COMPATIBILITY
+VirtualKD supports both x86 and x64 guest operating systems and was tested with the following OSes:
+ * Windows Vista 32bit
+ * Windows XP 32bit
+ * Windows XP 64bit
+ * Windows 7 32bit
+ * Windows 7 64bit
+ * Windows 8 64bit
+VMWare: all modern versions are supported. The following versions were tested:
+ * VMWare Server 1.0.5
+ * VMWare Server 2.0.0
+ * VMWare Workstation 6.5.1
+ * VMWare Workstation 8.0.4
+
+VirtualKD supports 64-bit host and 64-bit versions of VMWare.
+
+INSTALLATION
+
+When you normally debug Windows kernel inside a VM (without VirtualKD), a virtual COM port is created and mapped to a named pipe.
+Windows kernel interacts with the COM port via the KDCOM.DLL library and WinDbg connects to it using a named pipe
+specified in VirtualBox settings.
+
+VirtualKD provides an override to this scheme:
+1. The KDBAZIS.DLL debug transport is used instead of KDCOM.DLL. KDBAZIS.DLL directly communicates with VirtualBox/VMWare in a fast way.
+2. KDCLIENT.DLL loaded into VirtualBox/VMWare creates a named pipe similar to the virtual COM port one. However, it's much faster then the COM port.
+
+Installing VirtualKD requires installing both guest part (KDBAZIS.DLL) and host part (KDCLIENT64.DLL):
+
+If you are using VMWare, not special host-part installation is required. Just launch VMMON64.EXE or VMMON.EXE once the guest part is installed.
+If you are using VirtualBox, you need to register VBoxKD.DLL within VirtualBox by running the following command:
+ regsvr32 VBoxKD64.DLL (or VBoxKD.DLL for 32-bit VirtualBox).
+
+If this does not work, open the C:\Users\<USERNAME>\.VirtualBox\VirtualBox.xml file and manually insert the following lines inside <ExtraData>:
+ <ExtraDataItem name="VBoxInternal/Devices/VirtualKD/0/Name" value="Default"/>
+ <ExtraDataItem name="VBoxInternal/PDM/Devices/VirtualKD/Path" value="(path to VBoxKD or VBoxKD64 with '/' instead of '\')/VBoxKD64.dll"/>
+
+Note that you might need to close all instances of VirtualBox and VBoxSVC before doing it, otherwise VirtualBox.xml will be rolled back.
+
+Installing guest part is simple: just copy target\vminstall.exe to your VM and run it from there. If anything goes wrong, you can try installing it manually:
+
+A) Dynamic patching (not recommended).
+Copy both KDPATCH.SYS and KDBAZIS.DLL to SYSTEM32\DRIVERS directory of your virtual machine
+(yes, both DLL and SYS in the same place) and apply the KDPATCH.REG file (or manually create a legacy driver
+running KDPATCH.SYS). Then, perform the following sequence:
+1) Start the virtual machine
+2.VMWare) BEFORE OS starts to load, patch the VMWare process on host side using VMXPATCH.EXE or VMMON.EXE (see below)
+2.VirtualBox) Rename VBoxDD.dll in VirtualBox directory to VBoxDD0.dll. Copy VBoxDD.DLL from VirtualKD instead of original VBoxDD.dll
+3) Start your virtual Windows in a normal debug mode with a virtual COM port
+4) Ensure that WinDBG establishes connection (our driver is not involved now)
+5) Let the OS boot
+6) Wait for the KDPATCH.SYS driver to load (if you set it to manual mode, run
+ "net start kdpatch"). This will redirect all debugging activity from the COM
+ port simulated by VMWare to our fast debugging interface (VMWare needs to be
+ already patched at this moment).
+7) Start the WinDBG or KD debugger. The pipe name for the fast debugging is the following:
+ \\.\pipe\kd_<dirname>, when your VM is located at X:\something\<dirname>\filename.vmx
+8) You can close the first instance of WinDBG.
+Alternatively, you can stop the KDPATCH.SYS driver at any moment to direct debug activity
+back to the VMWare COM port.
+
+This method is useful if you want to play with the VirtualKD sources and to load different
+versions of KDBAZIS.DLL without rebooting the virtual machine. Just start the patcher
+service, and the KDBAZIS.DLL is used instead of KDCOM.DLL. Stop it and KDCOM.DLL gains
+control back.
+
+B) Static patching (recommended)
+1) Copy KDBAZIS.DLL to SYSTEM32 directory of your guest OS. There should already exist
+KDCOM.DLL and KD1394.DLL files.
+--- For XP ---
+2) Open your boot.ini file. If you are using the COM debugging, you should have a line like this:
+multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /DEBUG /DEBUGPORT=COM1
+3) Change it to this:
+multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /DEBUG /DEBUGPORT=VM
+--- For Vista/Win7 ---
+2,3) Run the following command line:
+ bcdedit /set dbgtransport kdbazis.dll
+---
+4) Reboot your virtual machine and wait for the OS selection dialog.
+5.VMWare) Patch VMWare executable using VMXPATCH.EXE or VMMON.EXE (see below).
+6) Start WinDBG or KD. Use \\.\pipe\kd_<dirname> as pipe name (see above).
+7) Start your guest OS
+
+The /DEBUGPORT=VM parameter in boot.ini instructs Windows to use the KDBAZIS.DLL file as
+the packet layer driver for kernel debugging. This is more flexible than patching KDCOM.DLL,
+as it does not require booting in COM debug mode.
+In Vista/Win7 this functionality is achieved by setting the "dbgtransport option via BCDEDIT.
+
+TWEAKING
+You can modify some parameters in registry under SOFTWARE\BazisSoft\VirtualKD\Patcher
+1) AllowPatchingAtTableStart. Set it to 0 if your VMWare crashes when being patched.
+2) AllowReplacingFirstCommand. Set it to 1 if patching fails (and debug output indicates
+ something like "0 free entries").
+3) DefaultPatchingAtTableStart. You can try setting this to increase the performance
+ (just a bit), but in can make VMWare crash on patching. Feel free to try ;)
+Additionally, you can set the WaitForOS to 0 in VirtualKD\Monitor to let the debugger
+be started immediately when a VM is detected (without waiting for OS to load).
+
+SOURCE STRUCTURE
+The information about source code structure and some hints for experimenting will be soon
+published at http://VirtualKD.sysprogs.org/.
+
+CHANGE LOG
+v1.0
+ Initial version
+
+v1.1
+ Fixed handler loss after Virtual Machine reset
+ Fixed bug with VMWare hanging when no debugger is connected
+ Added patcher/packet level log displaying in VMMON
+ Added support for KDCLIENT.DLL unloading from VMMON
+ Added advanced statistics reporting to VMMON
+ Added permissive SECURITY_ATTRIBUTES to statistics-related objects to support non-admin VMWare instances
+ Added debugger command line customization
+ Added proxy mode support for debug VMMON builds
+ Added TraceAssist feature
+ Implemented buffered VMWare GuestRPC resulting in ~1.7x communication speedup
+
+v1.2 (Only host-side part changed)
+ Fixed rare bug, when disconnecting debugger in the middle of a KdSendPacket() call caused hanging
+ Reduced CPU usage from 100% to 0% when a VM is active and no debugger is connected
+ Added workaround for truncated Driver Verifier messages
+ Added on-demand packet logging feature for easy packet-level KD protocol analyzis
+ Added API for detecting & patching VMs to KDCLIENT.DLL to support VisualDDK integration
+ Pipe name is now generated based on VMWARE-VMX.EXE command line, instead of current directory (fix for rare "kd_" pipes)
+ Added support for sending generated 'Target OS Shutdown' packet when VM is stopping to force debugger to disconnect
+ Added ",reconnect" option to WinDbg command line, instructing it to reconnect a pipe, when it is closed
+ (Due to 2 previous features, debugger does not need to be restarted when a VM is restored from a snapshot, while OS is running)
+
+v1.3 (Only host-side part changed)
+ Added support for 64-bit host operating systems and 64-bit versions of VMWare.
+
+v2.0 (KDVMWare was renamed to VirtualKD)
+ Added support for VirtualBox
+
+v2.1 Added support for Windows 7 host and guest machines
+ Added test signature to KDVM.DLL allowing it to run on Vista x64 in TESTSIGNING mode
+ Added automatic guest machine installer
+
+v2.2 Improved integration with VisualDDK
+ Added support for VMWARE-VMX-DEBUG.EXE etc.
+
+v2.3 Fixed memory leak in VMMON
+ Added support for patching VMs from non-administrator accounts via IPC with VMMON
+ Fixed bug when only first running VM was reported
+ Added support for VirtualBox 3.1.x
+
+v2.4 Fixed compatibility with UAC (.vmpatch files are now saved to Application Data)
+
+v2.5 Added "instant break" feature, reducing debugger break-in time to zero when using VisualDDK
+ Added support for restoring VM (VirtualBox/VMWare) to last snapshot from VMMON/VisualDDK
+
+v2.5.1 Added support for VirtualBox 3.2.x
+v2.5.2 Added support for VirtualBox 4.x
+v2.5.3 Fixed ICH9 compatibility issue
+v2.6 Renamed KDVM.DLL to KDBAZIS.DLL to avoid name colision in Windows 8
+ Added support for VirtualBox 4.1.x
+ Added a tool for automatic integration with VirtualBox
+v2.7 Fixed compatibility with Windows 8
+v2.8 Fixed ASSERT() support.
+ VirtualBox integration is now done via pluggable device manager and does not require replacing VBoxDD.DLL
+ Fixed boot.ini installation bug
+
+THANKS
+I would like to thank the following people for making the creation of this tool possible:
+ * Ken Johnson [http://www.nynaeve.net] for the idea (VMKD project).
+ * OpenVMTools team [http://sourceforge.net/projects/open-vm-tools]
+ * Tomasz Nowak [http://undocumented.ntinternals.net/]
+ * MS and VMWare for creating scalable and flexible architectures
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets" />
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <IncludePath>$(BZSLIB_PATH)\;C:\Program Files (x86)\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Common\Inc;C:\Program Files (x86)\Microsoft Visual Studio 9.0\DIA SDK\include;C:\Program Files (x86)\Debugging Tools for Windows (x86)\sdk;$(IncludePath)</IncludePath>
+ <LibraryPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\DIA SDK\lib;C:\Program Files (x86)\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Common\Lib\x86;$(LibraryPath)</LibraryPath>
+ </PropertyGroup>
+ <ItemDefinitionGroup />
+ <ItemGroup />
+</Project>
Oops, something went wrong.

0 comments on commit bf7f65f

Please sign in to comment.