From 5ef060de804b71ff2d789bc86b587e48b2c489fd Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:19:55 +0100 Subject: [PATCH 1/2] fix(disable idle): support multiple CPUs --- .../3. General Configuration/CPU Idle/Disable Idle.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/CPU Idle/Disable Idle.cmd b/src/playbook/Executables/AtlasDesktop/3. General Configuration/CPU Idle/Disable Idle.cmd index 1cb8d688f2..e872112007 100644 --- a/src/playbook/Executables/AtlasDesktop/3. General Configuration/CPU Idle/Disable Idle.cmd +++ b/src/playbook/Executables/AtlasDesktop/3. General Configuration/CPU Idle/Disable Idle.cmd @@ -1,7 +1,7 @@ @echo off :: Check if hyper threading is enabled -powershell -NonI -NoP -C "$proc = Get-CimInstance Win32_Processor; if ([int]$proc.NumberOfLogicalProcessors -gt [int]$proc.NumberOfCores) { exit 262 }" +powershell -NonI -NoP -C "Get-CimInstance Win32_Processor | Foreach-Object { if ([int]$_.NumberOfLogicalProcessors -gt [int]$_.NumberOfCores) { exit 262 } }" if "%errorlevel%"=="262" goto :hyperThreading if "%~1" neq "/silent" ( @@ -46,4 +46,4 @@ echo] echo %ESC%[1m%ESC%[33mPress any key to exit... %ESC%[?25l pause > nul -exit /b 1 \ No newline at end of file +exit /b 1 From f77bf29528882ee287b4e030f596f3b389759559 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:21:23 +0100 Subject: [PATCH 2/2] fix(enable all mitigations): support multiple CPUs --- .../7. Security/Mitigations/Enable All Mitigations.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playbook/Executables/AtlasDesktop/7. Security/Mitigations/Enable All Mitigations.cmd b/src/playbook/Executables/AtlasDesktop/7. Security/Mitigations/Enable All Mitigations.cmd index 48648ef8f8..a286811019 100644 --- a/src/playbook/Executables/AtlasDesktop/7. Security/Mitigations/Enable All Mitigations.cmd +++ b/src/playbook/Executables/AtlasDesktop/7. Security/Mitigations/Enable All Mitigations.cmd @@ -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 ) @@ -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 \ No newline at end of file +exit /b