1010$windir = [Environment ]::GetFolderPath(' Windows' )
1111$cbsPublic = " $windir \SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\Public"
1212$settingsExtensions = " $cbsPublic \wsxpacks\Account\SettingsExtensions.json"
13+ $arm = ((Get-CimInstance - Class Win32_ComputerSystem).SystemType -match ' ARM64' ) -or ($env: PROCESSOR_ARCHITECTURE -eq ' ARM64' )
1314if (! (Test-Path $settingsExtensions )) {
1415 Write-Output " Settings extensions ($settingsExtensions ) not found."
1516 Write-Output " User is likely on Windows 10, nothing to do. Exiting..."
@@ -49,38 +50,33 @@ if ($ids.Count -le 0) {
4950# If the velocity IDs aren't set, then the account page disappears
5051& " $windir \AtlasModules\Scripts\settingsPages.cmd" / hide account
5152
52- # Obfuscate velocity IDs
53- # Rewritten in PowerShell from ViVE
54- # https://github.com/thebookisclosed/ViVe/blob/master/ViVe/ObfuscationHelpers.cs
55- class ObfuscationHelpers {
56- static [uint32 ] SwapBytes([uint32 ] $x ) {
57- $x = ($x -shr 16 ) -bor ($x -shl 16 )
58- return (($x -band 0xFF00FF00 ) -shr 8 ) -bor (($x -band 0x00FF00FF ) -shl 8 )
59- }
60-
61- static [uint32 ] RotateRight32([uint32 ] $value , [int ] $shift ) {
62- return ($value -shr $shift ) -bor ($value -shl (32 - $shift ))
63- }
64-
65- static [uint32 ] ObfuscateFeatureId([uint32 ] $featureId ) {
66- return [ObfuscationHelpers ]::RotateRight32(([ObfuscationHelpers ]::SwapBytes($featureId -bxor 0x74161A4E ) -bxor 0x8FB23D4F ), -1 ) -bxor 0x833EA8FF
67- }
53+ # Extract ViVeTool https://github.com/thebookisclosed/ViVe
54+ # Not done in PowerShell as it's too complicated, it's just easiest to use the actual tool
55+ $viveZip = Get-ChildItem " ViVeTool-*.zip" - Name
56+ if ($arm ) {
57+ $viveZip = $viveZip | Where-Object { $_ -match ' -ARM64CLR' }
58+ } else {
59+ $viveZip = $viveZip | Where-Object { $_ -notmatch ' -ARM64CLR' }
60+ }
6861
69- static [uint32 ] DeobfuscateFeatureId([uint32 ] $featureId ) {
70- return [ObfuscationHelpers ]::SwapBytes(([ObfuscationHelpers ]::RotateRight32($featureId -bxor 0x833EA8FF , 1 ) -bxor 0x8FB23D4F )) -bxor 0x74161A4E
62+ # Extract & setup ViVeTool
63+ if ($viveZip ) {
64+ $viveFolder = Join-Path - Path (Get-Location ) - ChildPath " vivetool"
65+ if (! (Test-Path - Path $viveFolder )) {
66+ New-Item - ItemType Directory - Path $viveFolder | Out-Null
7167 }
68+ Expand-Archive - Path $viveZip - DestinationPath $viveFolder - Force
69+ } else {
70+ throw " ViVeTool not found!"
71+ }
72+ $env: PATH += " ;$viveFolder "
73+ if (! (Get-Command ' vivetool' - EA 0 )) {
74+ throw " ViVeTool EXE not found in ZIP!"
7275}
7376
74- # Disable velocity IDs
77+ # Disable feature IDs
7578# Applies next reboot
76- $featureKey = " HKLM:\SYSTEM\CurrentControlSet\Control\FeatureManagement\Overrides\8"
7779foreach ($id in $ ($ids | Sort-Object - Unique)) {
78- $veloId = " $featureKey \$ ( [ObfuscationHelpers ]::ObfuscateFeatureId($id )) "
79- Write-Output " Disabling velocity ID '$veloId '..."
80- New-Item $veloId - Force | Out-Null
81- Set-ItemProperty - Path $veloId - Name " EnabledStateOptions" - Value 0 - Force
82- Set-ItemProperty - Path $veloId - Name " EnabledState" - Value 1 - Force
83- Set-ItemProperty - Path $veloId - Name " VariantPayload" - Value 0 - Force
84- Set-ItemProperty - Path $veloId - Name " Variant" - Value 0 - Force
85- Set-ItemProperty - Path $veloId - Name " VariantPayloadKind" - Value 0 - Force
80+ Write-Output " Disabling feature ID $id ..."
81+ ViVeTool.exe / disable / id:$id | Out-Null
8682}
0 commit comments