Skip to content

Commit

Permalink
Force updater learned how defeat PNP lockdown using Nirsoft Advanced Run
Browse files Browse the repository at this point in the history
  • Loading branch information
pal1000 committed Feb 11, 2022
1 parent d60bc05 commit 45342fd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Devcon tool and official setup
# Binary tools and official setup
*.exe
*.ini
*.dll
Expand All @@ -9,6 +9,9 @@
*.inx
*.isn

# Binary configuration files
AdvancedRun.cfg

# Driver folders
*.inf
*.cat
Expand Down
12 changes: 12 additions & 0 deletions forceupdater/defeatpnplock.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@rem XXX: This script needs to run as SYSTEM
@cd /d "%~dp0"
@cd ..
@for /f "tokens=*" %%a in ('dir /A:D /B "%SystemRoot%\System32\DriverStore\FileRepository\hdxrt.inf*"') do @(
@IF EXIST "%SystemRoot%\System32\DriverStore\FileRepository\%%a\RTKVHD64.sys" copy /y Win64\Realtek\UpdatedCodec\RTKVHD64.sys "%SystemRoot%\System32\DriverStore\FileRepository\%%a"
@IF EXIST "%SystemRoot%\System32\DriverStore\FileRepository\%%a\RTAIODAT.DAT" copy /y Win64\Realtek\UpdatedCodec\RTAIODAT.DAT "%SystemRoot%\System32\DriverStore\FileRepository\%%a"
)
@for /f "tokens=*" %%a in ('dir /A:D /B "%SystemRoot%\System32\DriverStore\FileRepository\hdxrtsst.inf*"') do @(
@IF EXIST "%SystemRoot%\System32\DriverStore\FileRepository\%%a\RTKVHD64.sys" copy /y Win64\Realtek\UpdatedCodec\RTKVHD64.sys "%SystemRoot%\System32\DriverStore\FileRepository\%%a"
@IF EXIST "%SystemRoot%\System32\DriverStore\FileRepository\%%a\RTAIODAT.DAT" copy /y Win64\Realtek\UpdatedCodec\RTAIODAT.DAT "%SystemRoot%\System32\DriverStore\FileRepository\%%a"
)
@pause
14 changes: 9 additions & 5 deletions forceupdater/forceupdater.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@

@rem Replace old driver
@CMD /C EXIT 0
@where /q devcon
@where /q devcon.exe
@if NOT "%ERRORLEVEL%"=="0" echo Windows Device console - devcon.exe is required.&pause&exit
@CMD /C EXIT 0
@where /q AdvancedRun.exe
@if NOT "%ERRORLEVEL%"=="0" echo NirSoft AdvancedRun is required.&pause&exit
@echo Stopping Windows Audio service to reduce reboot likelihood...
@echo.
@net stop Audiosrv /y
Expand All @@ -48,10 +51,11 @@
@devcon /r disable =MEDIA "HDAUDIO\FUNC_01&VEN_10EC*" "INTELAUDIO\FUNC_01&VEN_10EC*"
@echo.
@echo Copying files...
@echo.
@copy /y Win64\Realtek\UpdatedCodec\RTKVHD64.sys "%windir%\System32\drivers"
@copy /y Win64\Realtek\UpdatedCodec\RTAIODAT.DAT "%windir%\System32\drivers"
@echo.
@set advrunworkdir=%~dp0
@IF %advrunworkdir:~0,1%%advrunworkdir:~-1%=="" set advrunworkdir=%advrunworkdir:~1,-1%
@IF "%advrunworkdir:~-1%"=="\" set advrunworkdir=%advrunworkdir:~0,-1%
@set advrunworkdir=%advrunworkdir:~0,-13%
@AdvancedRun.exe /WaitProcess 1 /EXEFilename "%windir%\System32\cmd.exe" /CommandLine "/C forceupdater\defeatpnplock.cmd" /StartDirectory "%advrunworkdir%" /RunAs 4
@echo Done.
@echo.
@IF EXIST patches\*.* echo Applying registry patch...
Expand Down

0 comments on commit 45342fd

Please sign in to comment.