Skip to content

Commit

Permalink
fix(enable all mitigations): support multiple CPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als authored Oct 7, 2024
1 parent 5ef060d commit f77bf29
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ whoami /user | find /i "S-1-5-18" > nul 2>&1 || (
:main
:: Enable Spectre and Meltdown
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "FeatureSettingsOverrideMask" /t REG_DWORD /d "3" /f > nul
powershell -NonI -NoP -C "$proc = (Get-CimInstance Win32_Processor).Name; $env:CPU = if ($proc | sls 'Intel' -Quiet) {'0'} elseif ($proc | sls 'AMD' -Quiet) {'64'}"
powershell -NonI -NoP -C "$proc = (Get-CimInstance Win32_Processor | Select-Object -First 1).Name; $env:CPU = if ($proc | sls 'Intel' -Quiet) {'0'} elseif ($proc | sls 'AMD' -Quiet) {'64'}"
if "%CPU%" neq "" (
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "FeatureSettingsOverride" /t REG_DWORD /d "%CPU%" /f > nul
)
Expand Down Expand Up @@ -57,4 +57,4 @@ reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization" /v "M

echo Finished, please reboot your device for changes to apply.
pause
exit /b
exit /b

0 comments on commit f77bf29

Please sign in to comment.