-
Notifications
You must be signed in to change notification settings - Fork 2
/
deobfuscate.ps1
63 lines (50 loc) · 1.14 KB
/
deobfuscate.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
param (
[string]$Version,
[bool]$Verbose,
[bool]$Decompile,
[bool]$DryRun,
[int]$Parallelism,
[string]$Report
)
function Test-Tool {
param (
[Parameter(Mandatory=$true)]
[string]$Tool
)
if (Get-Command -ErrorAction SilentlyContinue $Tool) {} else {
Write-Output "$Tool not detected!"
Write-Output "Please add $Tool to your PATH"
Exit 1
}
}
# Ensure CLI tools are installed
Test-Tool "git"
Test-Tool "msbuild"
Test-Tool "dotnet"
# Ensure submodule is setup
git submodule update --init
# Resolve paths
$project = Resolve-Path -Path ./Scoresaber-Deobfuscate/Deobfuscator.Bulk
$versions = Resolve-Path -Path ./versions.tsv
# Build command
$command = "dotnet run -c Release --project '$project' -- --versions '$versions' --password velvet99"
if ($version) {
$command = "$command -V '$version'"
}
if ($Verbose) {
$command = "$command --verbose"
}
if ($Decompile) {
$command = "$command --decompile"
}
if ($DryRun) {
$command = "$command --dry-run"
}
if ($Parallelism) {
$command = "$command --parallelism $Parallelism"
}
if ($Report) {
$command = "$command --report $Report"
}
# Run
Invoke-Expression $command