Skip to content

Commit cef5ab8

Browse files
committed
fix(account ads): use ViVe (issue #1140)
1 parent 99c0ad3 commit cef5ab8

File tree

4 files changed

+44
-29
lines changed

4 files changed

+44
-29
lines changed

src/playbook/Executables/AtlasModules/README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Some of the Playbook contains binary executables. This file provides some verifi
44
The root of the file paths listed here starts in `src\playbook\Executables`.
55

66
### Multi-Choice
7+
78
- Path: `\AtlasModules\Tools\multichoice.exe`
89
- SHA256 Hash: `6AB2FF0163AFE0FAC4E7506F9A63293421A1880076944339700A59A06578927D`
910
- Source: https://github.com/Atlas-OS/Atlas-Utilities/releases/download/multichoice-v0.4/multichoice-compressed.exe
@@ -14,6 +15,7 @@ The root of the file paths listed here starts in `src\playbook\Executables`.
1415
- Last Verified: 5/24/2024 by Xyueta
1516

1617
## SetTimerResolution & MeasureSleep
18+
1719
- Path: `\AtlasModules\Tools\SetTimerResolution.exe`
1820
- SHA256 Hash: `0515C2428E8960C751AD697ACA1C8D03BD43E2F0F1A0C0D2B4D998361C35EB57`
1921
- Source: https://github.com/deaglebullet/TimerResolution/releases/download/SetTimerResolution-v1.0.0/SetTimerResolution.exe
@@ -24,4 +26,21 @@ The root of the file paths listed here starts in `src\playbook\Executables`.
2426
- Version: v1.0.0
2527
- Repository: https://github.com/deaglebullet/TimerResolution
2628
- License: [GNU General Public License v3.0](https://github.com/adeaglebullet/TimerResolution/blob/main/LICENSE)
27-
- Last Verified: 5/24/2024 by Xyueta
29+
- Last Verified: 5/24/2024 by Xyueta
30+
31+
## ViVeTool
32+
33+
> [!NOTE]
34+
> This is included in the Playbook and isn't in the AtlasModules.
35+
36+
- Path: `Executables\ViVeTool-v0.3.3.zip`
37+
- SHA256 hash: `59D1E792EDCC001A319C16435A03D203975BF50EB38BD55CA34370900606F9F0`
38+
- Source: https://github.com/thebookisclosed/ViVe/releases/download/v0.3.3/ViVeTool-v0.3.3.zip
39+
- Version: v0.3.3
40+
- Path: `Executables\ViVeTool-v0.3.3-ARM64CLR.zip`
41+
- SHA256 hash: `37708C95C5053539CD068460E28E565D6B25A33C87F09B6B91A4F82A18E30132`
42+
- Source: https://github.com/thebookisclosed/ViVe/releases/download/v0.3.3/ViVeTool-v0.3.3-ARM64CLR.zip
43+
- Version: v0.3.3
44+
- Repository: https://github.com/thebookisclosed/ViVe
45+
- License: [GNU General Public License v3.0](https://github.com/thebookisclosed/ViVe/blob/master/LICENSE)
46+
- Last Verified: 7/14/2024 by he3als

src/playbook/Executables/CLIENTCBS.ps1

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
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')
1314
if (!(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"
7779
foreach ($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
}
391 KB
Binary file not shown.
391 KB
Binary file not shown.

0 commit comments

Comments
 (0)