From 1f06d5630da9d3a539ac14d6da9bf0d39475b4f4 Mon Sep 17 00:00:00 2001 From: zeffy Date: Sat, 7 Oct 2017 05:39:44 -0700 Subject: [PATCH] update install_wufuc.bat and readme.md --- README.md | 19 +++++++++++++++++++ setup-batch/install_wufuc.bat | 29 ++++++++++++----------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 51b01aa..01e1b22 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ If you are interested, you can read my original write up on discovering the CPU - `/NORESTART` - Automatically declines rebooting after the setup finishes. - `/UNATTENDED` - Skips all prompts for user interaction, and automatically restarts unless `/NORESTART` is also specified. +These must be used from an elevated command line prompt. + ## How it works Basically, inside a system file called `wuaueng.dll` there are two functions responsible for the CPU check: `IsDeviceServiceable(void)` and `IsCPUSupported(void)`. @@ -64,6 +66,23 @@ My patch takes advantage of this behavior by patching a couple of boolean values * `RegQueryValueExW` hook is necessary to provide compatibility with attempts by other third-parties at bypassing the CPU check. (see issue [#100](../../issues/100)) - If wufuc gets loaded by a `svchost.exe` process that isn't related to Windows Update, it goes into a dormant state and no hooks are applied. +## What to do if you get stuck on a black screen with just a cursor after the Windows boot animation + +This will happen if wufuc somehow manages to crash the `svchost.exe` process that is responsible for displaying the login screen. +Normally this should **never ever** happen, because wufuc goes dormant in `svchost.exe` processes that are unrelated to Windows Update. +I have only encountered this during development with very unstable code, or by causing it intentionally. + +However, just in case this does happen to someone, here is how to fix it: + +1. [Boot into Safe Mode with Command Prompt](https://support.microsoft.com/en-us/help/17419/windows-7-advanced-startup-options-safe-mode). +2. In the command prompt type `regedit` and press enter. +3. Navigate to the key `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options` +4. Expand the `Image File Execution Options` tree. +5. Locate the `svchost.exe` sub key, right-click it and press **Delete**. +6. Reboot. +7. You should be able to log in normally again. +8. **If this happens to you, please report it in the issues tab so I can try to figure out what is causing the crash!** + ## Sponsors ### [Advanced Installer](http://www.advancedinstaller.com/) diff --git a/setup-batch/install_wufuc.bat b/setup-batch/install_wufuc.bat index c792cad..ac00281 100644 --- a/setup-batch/install_wufuc.bat +++ b/setup-batch/install_wufuc.bat @@ -56,12 +56,8 @@ set "systemfolder=%systemroot%\System32" if /I "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( goto :is_x64 ) else ( - if /I "%PROCESSOR_ARCHITEW6432%"=="AMD64" ( - goto :is_wow64 - ) - if /I "%PROCESSOR_ARCHITECTURE%"=="x86" ( - goto :is_x86 - ) + if /I "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto :is_wow64 + if /I "%PROCESSOR_ARCHITECTURE%"=="x86" goto :is_x86 ) goto :unsupported @@ -160,24 +156,23 @@ echo You will need to restart your PC to finish uninstalling wufuc. goto :confirm_restart :uninstall - sfc /SCANFILE="%systemroot%\System32\wuaueng.dll" + :: restore wuaueng.dll if it was modified by 0.1-0.5 + sfc /SCANFILE="%systemfolder%\wuaueng.dll" + + :: remove traces of wufuc 0.6-0.7 set "wufuc_task=wufuc.{72EEE38B-9997-42BD-85D3-2DD96DA17307}" schtasks /Query /TN "%wufuc_task%" >nul 2>&1 && ( - schtasks /Delete /TN "%wufuc_task%" /F - ) + schtasks /Delete /TN "%wufuc_task%" /F ) rundll32 "%wufuc_dll_fullpath%",RUNDLL32_LegacyUnload - reg query "%regkey%" >nul 2>&1 || ( - goto :delete_target - ) - reg delete "%regkey%" /f || ( - goto :skip_delete - ) + + :: remove traces of wufuc >=0.8 + reg query "%regkey%" >nul 2>&1 || goto :delete_target + reg delete "%regkey%" /f || goto :skip_delete :delete_target set "del_ext=.del-%random%" if exist "%wufuc_dll_target%" ( ren "%wufuc_dll_target%" "%wufuc_dll%%del_ext%" && ( - rundll32 "%wufuc_dll_fullpath%",RUNDLL32_DeleteFile "%wufuc_dll_target%%del_ext%" - ) + rundll32 "%wufuc_dll_fullpath%",RUNDLL32_DeleteFile "%wufuc_dll_target%%del_ext%" ) ) :skip_delete exit /b