├── .gitignore ├── BUNDLE └── readme.txt ├── DummySign.bat ├── SDKIncludes.props ├── TestSign.bat ├── VirtualBoxIntegration ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── VirtualBoxIntegration.csproj ├── VirtualKD.sln ├── _help.cfg ├── database ├── 47CDBA1A.vmpatch ├── 48F2576A.vmpatch └── 4907CE46.vmpatch ├── footer.html ├── header.html ├── kdclient ├── 32to64.cpp ├── 32to64.h ├── KDClient.h ├── ReadMe.txt ├── TerminationNotifier.h ├── VBoxCmdLine.cpp ├── VBoxCmdLine.h ├── VBoxSnapsnotRestorer.cpp ├── VMAPI │ ├── VirtualBox.h │ ├── VirtualBox_i.c │ └── VixCOM.h ├── VMWareSnapshotRestorer.cpp ├── cmdline.cpp ├── cmdline.h ├── dllmain.cpp ├── findproc.cpp ├── findproc.h ├── hook64.cpp ├── hook64.h ├── kdclient.cpp ├── kdclient.def ├── kdclient.rc ├── kdclient.sln ├── kdclient.vcxproj ├── kdclient.vcxproj.filters ├── loader.h ├── patchapi.cpp ├── patchapi.h ├── resource.h ├── stdafx.cpp ├── stdafx.h ├── tablemgr.cpp ├── tablemgr.h └── targetver.h ├── kdpatch ├── kdpatch.cpp ├── kdpatch.rc ├── kdpatch.reg ├── kdpatch.sln ├── kdpatch.vcxproj ├── kdpatch.vcxproj.filters ├── moduleapi.h ├── resource.h ├── stdafx.cpp └── stdafx.h ├── kdvm ├── emptyfunc.cpp ├── kdrpc.h ├── kdvm.cpp ├── kdvm.def ├── kdvm.h ├── kdvm.rc ├── kdvm.vcxproj ├── kdvm.vcxproj.filters ├── kdxxx.h ├── resource.h ├── stdafx.cpp ├── stdafx.h ├── vboxrpc.h ├── vboxrpc64.asm ├── vmwrpc.h └── vmwrpc64.asm ├── kdvmguestlib ├── VisualDDKHelpers.h ├── kdvmguestlib.vcxproj ├── kdvmguestlib.vcxproj.filters ├── stdafx.cpp └── stdafx.h ├── make.bat ├── masm64.rules ├── pipeproxy ├── ReadMe.txt ├── pipeproxy.cpp ├── pipeproxy.sln ├── pipeproxy.vcxproj ├── pipeproxy.vcxproj.filters ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── rpcdispatch ├── PacketLog.cpp ├── PacketLog.h ├── ServiceCommandHandler.h ├── ServiceCommandProtocol.h ├── kdcomdisp.cpp ├── kdcomdisp.h ├── permdesc.h ├── pipesrv.h ├── reporter.cpp ├── reporter.h ├── rpcdisp.h ├── status.h └── trassist.h ├── vkdversion.h ├── vminstall ├── MainDlg.cpp ├── MainDlg.h ├── TakeOwnership.cpp ├── bootedit.cpp ├── bootedit.h ├── install.cpp ├── install.h ├── res │ └── vminstall.ico ├── resource.h ├── resource1.h ├── resource2.h ├── stdafx.cpp ├── stdafx.h ├── vminst_vddk.rc ├── vminst_ver.rc ├── vminstall.cpp ├── vminstall.h ├── vminstall.rc ├── vminstall.sln ├── vminstall.vcxproj └── vminstall.vcxproj.filters ├── vmmon ├── MainDlg.cpp ├── MainDlg.h ├── PatchList.h ├── green.ico ├── grey.ico ├── red.ico ├── res │ └── vmmon.ico ├── resource.h ├── resource1.h ├── stdafx.cpp ├── stdafx.h ├── trparams.h ├── vmmon.cpp ├── vmmon.rc ├── vmmon.sln ├── vmmon.vcxproj ├── vmmon.vcxproj.filters ├── vmmon_ver.h ├── vmmon_ver.rc ├── vmmon_ver.rc_bak ├── windbg.ico └── yellow.ico └── vmxpatch ├── ReadMe.txt ├── resource.h ├── stdafx.cpp ├── stdafx.h ├── targetver.h ├── vmxpatch.cpp ├── vmxpatch.rc ├── vmxpatch.vcxproj └── vmxpatch.vcxproj.filters /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | *.pdb 30 | *.exp 31 | Debug 32 | Release 33 | x64 34 | Debug (user-mode) 35 | Release (user-mode) 36 | DebugPS 37 | ReleasePS 38 | _distr/app 39 | _distr/drivers 40 | ipch 41 | *.sdf 42 | *.suo 43 | /VirtualAutorunDisabler/VirtualAutorunDisabler_i.c 44 | /VirtualAutorunDisabler/VirtualAutorunDisabler_i.h 45 | /VirtualAutorunDisabler/VirtualAutorunDisabler_p32.c 46 | /VirtualAutorunDisabler/VirtualAutorunDisabler_p64.c 47 | /WinCDEmuContextMenu/WinCDEmuContextMenu_i.c 48 | /WinCDEmuContextMenu/WinCDEmuContextMenu_i.h 49 | /WinCDEmuContextMenu/WinCDEmuContextMenu_p32.c 50 | /WinCDEmuContextMenu/WinCDEmuContextMenu_p64.c 51 | /AllModules 52 | /_distr/_drvinst.bzz 53 | /_distr/_drvinst.bzz.stat 54 | /_distr/drivers.bzz 55 | /_distr/drivers.bzz.stat 56 | /_distr/main.bzz 57 | /_distr/main.bzz.stat 58 | /vmnt/vmnt.lng 59 | /vmnt/vmnt_lng.cpp 60 | /vmnt/vmnt_lng.h 61 | /BUNDLE/target 62 | /*.opensdf 63 | /vminstall/*.aps 64 | -------------------------------------------------------------------------------- /DummySign.bat: -------------------------------------------------------------------------------- 1 | @echo Warning: SIGN_RELEASE_BINARY not defined. %1 will not be signed. -------------------------------------------------------------------------------- /SDKIncludes.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | $(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) 7 | 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) 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TestSign.bat: -------------------------------------------------------------------------------- 1 | "%WDKPATH%\bin\x86\signtool.exe" sign /i Testsigning /t http://timestamp.verisign.com/scripts/timstamp.dll %1 -------------------------------------------------------------------------------- /VirtualBoxIntegration/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /VirtualBoxIntegration/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Diagnostics; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Runtime.InteropServices; 9 | using System.Security.Principal; 10 | using System.Windows; 11 | 12 | namespace VirtualBoxIntegration 13 | { 14 | /// 15 | /// Interaction logic for App.xaml 16 | /// 17 | public partial class App : Application 18 | { 19 | [DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)] 20 | [return: MarshalAs(UnmanagedType.Bool)] 21 | public static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool lpSystemInfo); 22 | 23 | 24 | public App() 25 | { 26 | this.DispatcherUnhandledException += App_DispatcherUnhandledException; 27 | } 28 | 29 | void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) 30 | { 31 | MessageBox.Show(e.Exception.ToString(), "VirtualBoxIntegration", MessageBoxButton.OK, MessageBoxImage.Error); 32 | } 33 | 34 | public static bool Is64Bit() 35 | { 36 | try 37 | { 38 | if (IntPtr.Size == 8) 39 | return true; 40 | bool retVal; 41 | IsWow64Process(Process.GetCurrentProcess().Handle, out retVal); 42 | return retVal; 43 | } 44 | catch (System.Exception) 45 | { 46 | return false; 47 | } 48 | } 49 | 50 | internal static bool IsVirtualBoxRunning() 51 | { 52 | return Process.GetProcesses().Where(p => StringComparer.InvariantCultureIgnoreCase.Compare(Path.GetFileNameWithoutExtension(p.ProcessName), "VirtualBox") == 0).Count() != 0; 53 | } 54 | 55 | static bool IsSystemOwned(string fn) 56 | { 57 | return (File.GetAccessControl(fn).GetOwner(typeof(SecurityIdentifier)) as SecurityIdentifier) == new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null); 58 | } 59 | 60 | static void ChownToSystem(string fn) 61 | { 62 | if (!IsSystemOwned(fn)) 63 | RunAsAdmin("icacls", "\"" + fn + "\" /setowner system", true); 64 | } 65 | 66 | 67 | internal static void CheckKDClientPermissions(string myDir) 68 | { 69 | if (!IsSystemOwned(Path.Combine(myDir, "kdclient64.dll")) || !IsSystemOwned(Path.Combine(myDir, "kdclient.dll"))) 70 | { 71 | if (MessageBox.Show("VirtualBox won't load KDCLIENT.DLL/KDCLIENT64.DLL unless it is owned by the System acoount. Do you want to fix it now?", "VirtualBoxIntegration", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) 72 | { 73 | ChownToSystem(Path.Combine(myDir, "kdclient64.dll")); 74 | ChownToSystem(Path.Combine(myDir, "kdclient.dll")); 75 | } 76 | } 77 | } 78 | 79 | public static void RunAsAdmin(string cmd, string args, bool wait = false) 80 | { 81 | try 82 | { 83 | var p = new Process(); 84 | p.StartInfo.FileName = cmd; 85 | p.StartInfo.Arguments = args; 86 | if (System.Environment.OSVersion.Version.Major >= 6) 87 | p.StartInfo.Verb = "runas"; 88 | p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; 89 | p.Start(); 90 | if (wait) 91 | p.WaitForExit(); 92 | } 93 | catch 94 | { 95 | 96 | } 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /VirtualBoxIntegration/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 |