bcdedit /set nointegritychecks on
bcdedit /set testsigning on
bcdedit /set recoveryenabled off

takeown /f %windir%\system32\ci.dll
icacls %windir%\system32\ci.dll /grant %username%:F
takeown /f %windir%\system32\winload.exe
icacls %windir%\system32\winload.exe /grant %username%:F
takeown /f %windir%\system32\winload.efi
icacls %windir%\system32\winload.efi /grant %username%:F
del %windir%\system32\ci.dll.bak
del %windir%\system32\winload.exe.bak
del %windir%\system32\winload.efi.bak
rename %windir%\system32\ci.dll ci.dll.bak
rename %windir%\system32\winload.exe winload.exe.bak
rename %windir%\system32\winload.efi winload.efi.bak

takeown /f %windir%\system32\kernel32.dll.bak
icacls %windir%\system32\kernel32.dll.bak /grant %username%:F
takeown /f %windir%\syswow64\kernel32.dll.bak
icacls %windir%\syswow64\kernel32.dll.bak /grant %username%:F
takeown /f %windir%\system32\winhttp.dll.bak
icacls %windir%\system32\winhttp.dll.bak /grant %username%:F
takeown /f %windir%\syswow64\winhttp.dll.bak
icacls %windir%\syswow64\winhttp.dll.bak /grant %username%:F
del %windir%\system32\kernel32.dll.bak
del %windir%\syswow64\kernel32.dll.bak
del %windir%\system32\winhttp.dll.bak
del %windir%\syswow64\winhttp.dll.bak
takeown /f %windir%\system32\kernel32.dll
icacls %windir%\system32\kernel32.dll /grant %username%:F
takeown /f %windir%\syswow64\kernel32.dll
icacls %windir%\syswow64\kernel32.dll /grant %username%:F
takeown /f %windir%\system32\winhttp.dll
icacls %windir%\system32\winhttp.dll /grant %username%:F
takeown /f %windir%\syswow64\winhttp.dll
icacls %windir%\syswow64\winhttp.dll /grant %username%:F
rename %windir%\system32\kernel32.dll kernel32.dll.bak
rename %windir%\syswow64\kernel32.dll kernel32.dll.bak
rename %windir%\system32\winhttp.dll winhttp.dll.bak
rename %windir%\syswow64\winhttp.dll winhttp.dll.bak

copy .\system32\* %windir%\system32\
copy .\syswow64\* %windir%\syswow64\