3 Commits

Author SHA1 Message Date
zeffy
6da6069d9c echo.s 2017-03-28 14:12:52 -07:00
zeffy
94a3de6c8a commit patch scripts and xdeltas 2017-03-28 14:09:27 -07:00
zeffy
c1559447d5 Update README.md 2017-03-26 02:18:42 -07:00
14 changed files with 419 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.exe
*.rar

View File

@@ -1,3 +1,7 @@
### [If you are looking for the latest xdelta patch files, you can find them here!](https://github.com/zeffy/kb4012218-kb4012219/releases)
---
### Here's a list of the Windows updates that I will be talking about in this paper:
Title | Products | Classification | Last Updated | Version | Size
@@ -106,7 +110,7 @@ We have found culprits, [`IsDeviceServiceable(void)`](https://gist.github.com/z
`IsCPUSupported(void)` is only ever called by `IsDeviceServiceable(void)`, which is called by five other functions. Luckily, there are a couple easy ways to kill this CPU check.
1. Patch `wuaueng.dll` and change `dword_600002EE948` (see [this line](https://gist.github.com/zeffy/e5ec266952932bc905eb0cbc6ed72185#file-isdeviceserviceable-c-L7)) which is at file offset `0x26C948`, from `0x01` to `0x00`, which makes `IsDeviceServiceable(void)` jump over its entire body and return 1 (supported CPU) immediately. This is my preferred method. **These offsets are only for the Windows 7 x64 version, I will upload `.xdelta` files for all of the other versions eventually. I haven't tested this yet, because I don't want to install this garbage update onto my PC, so it'll take me a while to test everything in a VM.**
1. Patch `wuaueng.dll` and change `dword_600002EE948` (see [this line](https://gist.github.com/zeffy/e5ec266952932bc905eb0cbc6ed72185#file-isdeviceserviceable-c-L7)) which is at file offset `0x26C948`, from `0x01` to `0x00`, which makes `IsDeviceServiceable(void)` jump over its entire body and return 1 (supported CPU) immediately. This is my preferred method. **Note: these offsets are only for the Windows 7 x64 version.**
2. Patch `wuaueng.dll` and `nop` out all the instructions highlighted [here](https://gist.github.com/zeffy/e5ec266952932bc905eb0cbc6ed72185#file-isdeviceserviceable-asm-L24-L26) in `IsDeviceServiceable(void)`, this will enable the usage of the `ForceUnsupportedCPU` of type `REG_DWORD` under the registry key `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Test\Scan` (you will most likely have to create this registry key). Set this value to `0x00000001` to force unsupported CPUs, and back to `0x00000000` to change the behaviour back to default. You will probably need to restart your PC or restart the `wuauserv` service in order for changes to apply. **This behaviour is undocumented and could be removed in future updates.**

View File

@@ -0,0 +1,103 @@
@echo off
net session >nul 2>&1 || (
echo This batch script requires administrator privileges. Right-click on
echo %~nx0 and select "Run as administrator".
goto :die
)
echo Checking system requirements...
echo.
wmic /output:stdout qfe get hotfixid | find "KB4012218" >nul || (
echo Detected that update KB4012218 is not installed, please verify that
echo you are trying to install the right patch file and try again.
goto :die
)
wmic /output:stdout os get osarchitecture | find "64-bit" >nul || (
echo Detected that you are not running 64-bit Windows, please verify
echo that you are trying to install the right patch file and try again.
goto :die
)
echo This patch is *ONLY* for Windows 7 x64 and Server 2008 R2 wuaueng.dll,
echo if you have another version of Windows 7 or 8.1, please close this
echo window and use the appropriate patch file for your OS. I take no
echo responsibility if you somehow wreck your system.
echo.
set /p CONTINUE=Press 'Y' if you understand, and still want to continue:
echo.
if /i "%CONTINUE%" NEQ "Y" goto :cancel
:ask
echo Would you like to install the patch or uninstall it?
echo.
echo 1. Install
echo 2. Uninstall
echo.
set /p CHOICE=Enter your choice:
if /i "%CHOICE%" EQU "1" (
set "PATCH_TYPE=patch"
goto :begin
)
if /i "%CHOICE%" EQU "2" (
set "PATCH_TYPE=unpatch"
goto :begin
)
echo Invalid choice, please try again...
goto :ask
:begin
set "DELTA_FILE=%~dp0w7s08r2x64-wuaueng.dll-%PATCH_TYPE%.xdelta"
set "XDELTA3_EXE=%~dp0xdelta3-3.0.11-x86_64.exe"
set "SYSTEM32_DIR=%windir%\System32"
set "WUAUENG_DLL=%SYSTEM32_DIR%\wuaueng.dll"
for /f "delims=" %%a in ('wmic os get localdatetime ^| find "."') do set dt=%%a
set "TIMESTAMP=%dt:~0,4%-%dt:~4,2%-%dt:~6,2%_%dt:~8,2%-%dt:~10,2%-%dt:~12,2%"
set "BACKUP_FILE=%WUAUENG_DLL%.bak_%TIMESTAMP%_%random%"
set "PERMISSIONS_TEMP_FILE=%temp%\wuaueng.dll_acl_%TIMESTAMP%_%random%.txt"
net stop wuauserv
takeown /F "%WUAUENG_DLL%" /A
echo Backing up wuaueng.dll file permissions...
icacls "%WUAUENG_DLL%" /save "%PERMISSIONS_TEMP_FILE%"
icacls "%WUAUENG_DLL%" /grant Administrators:F
move "%WUAUENG_DLL%" "%BACKUP_FILE%"
"%XDELTA3_EXE%" -d -s "%BACKUP_FILE%" "%DELTA_FILE%" "%WUAUENG_DLL%"
if errorlevel 1 (
set "THERE_WAS_AN_ERROR=%errorlevel%"
move /Y "%BACKUP_FILE%" "%WUAUENG_DLL%"
)
icacls "%WUAUENG_DLL%" /setowner "NT Service\TrustedInstaller"
icacls "%SYSTEM32_DIR%" /restore "%PERMISSIONS_TEMP_FILE%"
net start wuauserv
if defined THERE_WAS_AN_ERROR (
echo There was an error while %PATCH_TYPE%ing. Nothing has been modified.
echo If you didn't screw with the script or anything like that and this
echo error was unexpected, please create an issue on my GitHub here:
echo https://github.com/zeffy/kb4012218-kb4012219/issues
) else (
echo Successfully %PATCH_TYPE%ed!
echo If you want to reverse the changes that have been made for whatever
echo reason, you can run this script again. Or, you can also manually
echo restore the backup file located at `%BACKUP_FILE%`, by renaming it
echo back to `wuaueng.dll` and restoring the owner and permissions on the
echo file.
)
:die
echo.
echo Press any key to close . . .
pause >nul
exit
:cancel
echo.
echo Canceled by user input, press any key to close . . .
pause >nul
exit

View File

@@ -0,0 +1,103 @@
@echo off
net session >nul 2>&1 || (
echo This batch script requires administrator privileges. Right-click on
echo %~nx0 and select "Run as administrator".
goto :die
)
echo Checking system requirements...
echo.
wmic /output:stdout qfe get hotfixid | find "KB4012218" >nul || (
echo Detected that update KB4012218 is not installed, please verify that
echo you are trying to install the right patch file and try again.
goto :die
)
wmic /output:stdout os get osarchitecture | find "32-bit" >nul || (
echo Detected that you are not running 32-bit Windows, please verify
echo that you are trying to install the right patch file and try again.
goto :die
)
echo This patch is *ONLY* for Windows 7 x86 wuaueng.dll,
echo if you have another version of Windows 7 or 8.1, please close this
echo window and use the appropriate patch file for your OS. I take no
echo responsibility if you somehow wreck your system.
echo.
set /p CONTINUE=Press 'Y' if you understand, and still want to continue:
echo.
if /i "%CONTINUE%" NEQ "Y" goto :cancel
:ask
echo Would you like to install the patch or uninstall it?
echo.
echo 1. Install
echo 2. Uninstall
echo.
set /p CHOICE=Enter your choice:
if /i "%CHOICE%" EQU "1" (
set "PATCH_TYPE=patch"
goto :begin
)
if /i "%CHOICE%" EQU "2" (
set "PATCH_TYPE=unpatch"
goto :begin
)
echo Invalid choice, please try again...
goto :ask
:begin
set "DELTA_FILE=%~dp0w7x86-wuaueng.dll-%PATCH_TYPE%.xdelta"
set "XDELTA3_EXE=%~dp0xdelta3-3.0.11-i686.exe"
set "SYSTEM32_DIR=%windir%\System32"
set "WUAUENG_DLL=%SYSTEM32_DIR%\wuaueng.dll"
for /f "delims=" %%a in ('wmic os get localdatetime ^| find "."') do set dt=%%a
set "TIMESTAMP=%dt:~0,4%-%dt:~4,2%-%dt:~6,2%_%dt:~8,2%-%dt:~10,2%-%dt:~12,2%"
set "BACKUP_FILE=%WUAUENG_DLL%.bak_%TIMESTAMP%_%random%"
set "PERMISSIONS_TEMP_FILE=%temp%\wuaueng.dll_acl_%TIMESTAMP%_%random%.txt"
net stop wuauserv
takeown /F "%WUAUENG_DLL%" /A
echo Backing up wuaueng.dll file permissions...
icacls "%WUAUENG_DLL%" /save "%PERMISSIONS_TEMP_FILE%"
icacls "%WUAUENG_DLL%" /grant Administrators:F
move "%WUAUENG_DLL%" "%BACKUP_FILE%"
"%XDELTA3_EXE%" -d -s "%BACKUP_FILE%" "%DELTA_FILE%" "%WUAUENG_DLL%"
if errorlevel 1 (
set "THERE_WAS_AN_ERROR=%errorlevel%"
move /Y "%BACKUP_FILE%" "%WUAUENG_DLL%"
)
icacls "%WUAUENG_DLL%" /setowner "NT Service\TrustedInstaller"
icacls "%SYSTEM32_DIR%" /restore "%PERMISSIONS_TEMP_FILE%"
net start wuauserv
if defined THERE_WAS_AN_ERROR (
echo There was an error while %PATCH_TYPE%ing. Nothing has been modified.
echo If you didn't screw with the script or anything like that and this
echo error was unexpected, please create an issue on my GitHub here:
echo https://github.com/zeffy/kb4012218-kb4012219/issues
) else (
echo Successfully %PATCH_TYPE%ed!
echo If you want to reverse the changes that have been made for whatever
echo reason, you can run this script again. Or, you can also manually
echo restore the backup file located at `%BACKUP_FILE%`, by renaming it
echo back to `wuaueng.dll` and restoring the owner and permissions on the
echo file.
)
:die
echo.
echo Press any key to close . . .
pause >nul
exit
:cancel
echo.
echo Canceled by user input, press any key to close . . .
pause >nul
exit

View File

@@ -0,0 +1,103 @@
@echo off
net session >nul 2>&1 || (
echo This batch script requires administrator privileges. Right-click on
echo %~nx0 and select "Run as administrator".
goto :die
)
echo Checking system requirements...
echo.
wmic /output:stdout qfe get hotfixid | find "KB4012219" >nul || (
echo Detected that update KB4012219 is not installed, please verify that
echo you are trying to install the right patch file and try again.
goto :die
)
wmic /output:stdout os get osarchitecture | find "64-bit" >nul || (
echo Detected that you are not running 64-bit Windows, please verify
echo that you are trying to install the right patch file and try again.
goto :die
)
echo This patch is *ONLY* for Windows 8.1 x64 and Server 2012 R2 wuaueng.dll,
echo if you have another version of Windows 7 or 8.1, please close this
echo window and use the appropriate patch file for your OS. I take no
echo responsibility if you somehow wreck your system.
echo.
set /p CONTINUE=Press 'Y' if you understand, and still want to continue:
echo.
if /i "%CONTINUE%" NEQ "Y" goto :cancel
:ask
echo Would you like to install the patch or uninstall it?
echo.
echo 1. Install
echo 2. Uninstall
echo.
set /p CHOICE=Enter your choice:
if /i "%CHOICE%" EQU "1" (
set "PATCH_TYPE=patch"
goto :begin
)
if /i "%CHOICE%" EQU "2" (
set "PATCH_TYPE=unpatch"
goto :begin
)
echo Invalid choice, please try again...
goto :ask
:begin
set "DELTA_FILE=%~dp0w81s12r2x64-wuaueng.dll-%PATCH_TYPE%.xdelta"
set "XDELTA3_EXE=%~dp0xdelta3-3.0.11-x86_64.exe"
set "SYSTEM32_DIR=%windir%\System32"
set "WUAUENG_DLL=%SYSTEM32_DIR%\wuaueng.dll"
for /f "delims=" %%a in ('wmic os get localdatetime ^| find "."') do set dt=%%a
set "TIMESTAMP=%dt:~0,4%-%dt:~4,2%-%dt:~6,2%_%dt:~8,2%-%dt:~10,2%-%dt:~12,2%"
set "BACKUP_FILE=%WUAUENG_DLL%.bak_%TIMESTAMP%_%random%"
set "PERMISSIONS_TEMP_FILE=%temp%\wuaueng.dll_acl_%TIMESTAMP%_%random%.txt"
net stop wuauserv
takeown /F "%WUAUENG_DLL%" /A
echo Backing up wuaueng.dll file permissions...
icacls "%WUAUENG_DLL%" /save "%PERMISSIONS_TEMP_FILE%"
icacls "%WUAUENG_DLL%" /grant Administrators:F
move "%WUAUENG_DLL%" "%BACKUP_FILE%"
"%XDELTA3_EXE%" -d -s "%BACKUP_FILE%" "%DELTA_FILE%" "%WUAUENG_DLL%"
if errorlevel 1 (
set "THERE_WAS_AN_ERROR=%errorlevel%"
move /Y "%BACKUP_FILE%" "%WUAUENG_DLL%"
)
icacls "%WUAUENG_DLL%" /setowner "NT Service\TrustedInstaller"
icacls "%SYSTEM32_DIR%" /restore "%PERMISSIONS_TEMP_FILE%"
net start wuauserv
if defined THERE_WAS_AN_ERROR (
echo There was an error while %PATCH_TYPE%ing. Nothing has been modified.
echo If you didn't screw with the script or anything like that and this
echo error was unexpected, please create an issue on my GitHub here:
echo https://github.com/zeffy/kb4012218-kb4012219/issues
) else (
echo Successfully %PATCH_TYPE%ed!
echo If you want to reverse the changes that have been made for whatever
echo reason, you can run this script again. Or, you can also manually
echo restore the backup file located at `%BACKUP_FILE%`, by renaming it
echo back to `wuaueng.dll` and restoring the owner and permissions on the
echo file.
)
:die
echo.
echo Press any key to close . . .
pause >nul
exit
:cancel
echo.
echo Canceled by user input, press any key to close . . .
pause >nul
exit

View File

@@ -0,0 +1,103 @@
@echo off
net session >nul 2>&1 || (
echo This batch script requires administrator privileges. Right-click on
echo %~nx0 and select "Run as administrator".
goto :die
)
echo Checking system requirements...
echo.
wmic /output:stdout qfe get hotfixid | find "KB4012219" >nul || (
echo Detected that update KB4012219 is not installed, please verify that
echo you are trying to install the right patch file and try again.
goto :die
)
wmic /output:stdout os get osarchitecture | find "32-bit" >nul || (
echo Detected that you are not running 32-bit Windows, please verify
echo that you are trying to install the right patch file and try again.
goto :die
)
echo This patch is *ONLY* for Windows 8.1 x86 wuaueng.dll,
echo if you have another version of Windows 7 or 8.1, please close this
echo window and use the appropriate patch file for your OS. I take no
echo responsibility if you somehow wreck your system.
echo.
set /p CONTINUE=Press 'Y' if you understand, and still want to continue:
echo.
if /i "%CONTINUE%" NEQ "Y" goto :cancel
:ask
echo Would you like to install the patch or uninstall it?
echo.
echo 1. Install
echo 2. Uninstall
echo.
set /p CHOICE=Enter your choice:
if /i "%CHOICE%" EQU "1" (
set "PATCH_TYPE=patch"
goto :begin
)
if /i "%CHOICE%" EQU "2" (
set "PATCH_TYPE=unpatch"
goto :begin
)
echo Invalid choice, please try again...
goto :ask
:begin
set "DELTA_FILE=%~dp0w81x86-wuaueng.dll-%PATCH_TYPE%.xdelta"
set "XDELTA3_EXE=%~dp0xdelta3-3.0.11-i686.exe"
set "SYSTEM32_DIR=%windir%\System32"
set "WUAUENG_DLL=%SYSTEM32_DIR%\wuaueng.dll"
for /f "delims=" %%a in ('wmic os get localdatetime ^| find "."') do set dt=%%a
set "TIMESTAMP=%dt:~0,4%-%dt:~4,2%-%dt:~6,2%_%dt:~8,2%-%dt:~10,2%-%dt:~12,2%"
set "BACKUP_FILE=%WUAUENG_DLL%.bak_%TIMESTAMP%_%random%"
set "PERMISSIONS_TEMP_FILE=%temp%\wuaueng.dll_acl_%TIMESTAMP%_%random%.txt"
net stop wuauserv
takeown /F "%WUAUENG_DLL%" /A
echo Backing up wuaueng.dll file permissions...
icacls "%WUAUENG_DLL%" /save "%PERMISSIONS_TEMP_FILE%"
icacls "%WUAUENG_DLL%" /grant Administrators:F
move "%WUAUENG_DLL%" "%BACKUP_FILE%"
"%XDELTA3_EXE%" -d -s "%BACKUP_FILE%" "%DELTA_FILE%" "%WUAUENG_DLL%"
if errorlevel 1 (
set "THERE_WAS_AN_ERROR=%errorlevel%"
move /Y "%BACKUP_FILE%" "%WUAUENG_DLL%"
)
icacls "%WUAUENG_DLL%" /setowner "NT Service\TrustedInstaller"
icacls "%SYSTEM32_DIR%" /restore "%PERMISSIONS_TEMP_FILE%"
net start wuauserv
if defined THERE_WAS_AN_ERROR (
echo There was an error while %PATCH_TYPE%ing. Nothing has been modified.
echo If you didn't screw with the script or anything like that and this
echo error was unexpected, please create an issue on my GitHub here:
echo https://github.com/zeffy/kb4012218-kb4012219/issues
) else (
echo Successfully %PATCH_TYPE%ed!
echo If you want to reverse the changes that have been made for whatever
echo reason, you can run this script again. Or, you can also manually
echo restore the backup file located at `%BACKUP_FILE%`, by renaming it
echo back to `wuaueng.dll` and restoring the owner and permissions on the
echo file.
)
:die
echo.
echo Press any key to close . . .
pause >nul
exit
:cancel
echo.
echo Canceled by user input, press any key to close . . .
pause >nul
exit