Skip to content

Commit

Permalink
don't launch service if we're running in safe mode
Browse files Browse the repository at this point in the history
  • Loading branch information
katlogic committed Aug 9, 2016
1 parent 625c2ed commit a3ff9a7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wind.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,9 @@ static int usage(int interactive)
"This program can disable some restrictions of Windows:\n"
" * Driver signing ('DSE', breaks freeware utilities)\n"
" * Process protection ('unkillable processes', WinTCB)\n"
" * Hard locked registry keys (syscall, malware is the only user)\n\n"
" * Silently locked registry keys (notify, malware is the only user)\n\n"
" * Hard locked registry keys (syscall, malware is the only user)\n"
" * Silently locked registry keys (notify, malware is the only user)\n"
"\n"
);

if (!interactive) {
Expand Down Expand Up @@ -913,6 +914,10 @@ static int run_service()

StartServiceCtrlDispatcher(s_table);

// If we're in safe mode, do nothing.
if (GetSystemMetrics(SM_CLEANBOOT))
return 1;

elevate();

if (!NT_SUCCESS(NtQueryInformationProcess(GetCurrentProcess(), 0, &pbi, sizeof(pbi), &uls)))
Expand Down

0 comments on commit a3ff9a7

Please sign in to comment.