Skip to content

Commit 28336ca

Browse files
committed
feat: force preferences setup
1 parent 908316e commit 28336ca

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

DragonBurn-kernel/main.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ int wmain(const int argc, wchar_t** argv)
3333
bool free = false; //free --> Automatically frees mapped memory after execution. Dangerous unless the driver finishes instantly
3434
bool indPagesMode = CheckArg(argc, argv, L"securemode"); //indPagesMode --> Maps the driver into non-contiguous, separate memory pages. Better for stealth, but more complex
3535
bool legacyImg = CheckArg(argc, argv, L"legacyimg");
36+
bool forcePrefs = CheckArg(argc, argv, L"forceprefs");
3637
bool copyHeader = false; //copyHeader --> Ennsures the PE headers are copied into memory Needed for drivers that inspect their own image
3738
bool passAllocationPtr = false;//passAllocationPtr --> Passes allocated memory pointer as first param to entry point. Used by custom loaders or shellcode-style drivers
3839

@@ -89,7 +90,7 @@ int wmain(const int argc, wchar_t** argv)
8990
}
9091
#endif
9192

92-
if (!CheckWindowsKernelPrefs())
93+
if (forcePrefs || !CheckWindowsKernelPrefs())
9394
{
9495
Log::Warning("Your windows kernel preferences may lead to unexpected behavior.");
9596
std::string response;
@@ -100,14 +101,14 @@ int wmain(const int argc, wchar_t** argv)
100101
} while (response != "y" && response != "n");
101102
if (response == "y")
102103
{
103-
system("reg add \"HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity\" /v Enabled /t REG_DWORD /d 0 /f");
104-
system("reg add \"HKLM\SYSTEM\CurrentControlSet\Control\Lsa\" /v RunAsPPL /t REG_DWORD /d 0 /f");
105-
system("reg add \"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\DeviceGuard\" /v EnableVirtualizationBasedSecurity /t REG_DWORD /d 00000000 /f");
106-
system("bcdedit /set hypervisorlaunchtype off");
107-
system("reg add \"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CI\Config\" /v VulnerableDriverBlocklistEnable /t REG_DWORD /d 00000000 /f");
108-
system("sc stop faceit");
109-
system("sc stop vgc");
110-
system("sc stop vgk");
104+
system("reg add \"HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity\" /v Enabled /t REG_DWORD /d 0 /f >nul 2>&1");
105+
system("reg add \"HKLM\SYSTEM\CurrentControlSet\Control\Lsa\" /v RunAsPPL /t REG_DWORD /d 0 /f >nul 2>&1");
106+
system("reg add \"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\DeviceGuard\" /v EnableVirtualizationBasedSecurity /t REG_DWORD /d 00000000 /f >nul 2>&1");
107+
system("bcdedit /set hypervisorlaunchtype off >nul 2>&1");
108+
system("reg add \"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CI\Config\" /v VulnerableDriverBlocklistEnable /t REG_DWORD /d 00000000 /f >nul 2>&1");
109+
system("sc stop faceit >nul 2>&1");
110+
system("sc stop vgc >nul 2>&1");
111+
system("sc stop vgk >nul 2>&1");
111112

112113
Log::Fine("Recomended preferences applied, pls restart your pc");
113114
Log::Info("Ignore usermode-part mapper error, just reboot pc and run again");

0 commit comments

Comments
 (0)