Skip to content

Commit

Permalink
Add obfuscator-io-deobfuscator.vm
Browse files Browse the repository at this point in the history
Introduce `VM-Install-Node-Tool` to easily create packages that use
`npm` to install tools published on the JavaScript Package Registry.

Use `VM-Install-Node-Tool` to add `obfuscator-io-deobfuscator`.
  • Loading branch information
Ana06 committed May 15, 2024
1 parent a4bd746 commit 349fb4f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common.vm/common.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>common.vm</id>
<version>0.0.0.20240509</version>
<version>0.0.0.20240514</version>
<description>Common libraries for VM-packages</description>
<authors>Mandiant</authors>
</metadata>
Expand Down
20 changes: 20 additions & 0 deletions packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,26 @@ function VM-Install-From-Zip {
}
}

function VM-Install-Node-Tool {
[CmdletBinding()]
[OutputType([System.Object[]])]
Param
(
[Parameter(Mandatory=$true, Position=0)]
[string] $toolName,
[Parameter(Mandatory=$true, Position=1)]
[string] $category,
[Parameter(Mandatory=$false)]
[string] $arguments
)
try {
npm install -g $toolName --no-update-notifier
VM-Install-Shortcut -toolName $toolName -category $category -arguments "$toolName $arguments" -powershell
} catch {
VM-Write-Log-Exception $_
}
}

function VM-Install-Node-Tool-From-Zip {
[CmdletBinding()]
[OutputType([System.Object[]])]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>obfuscator-io-deobfuscator.vm</id>
<version>0.0.0.20240514</version>
<authors>ben-sb</authors>
<description>A deobfuscator for scripts obfuscated by Obfuscator.io</description>
<dependencies>
<dependency id="common.vm" version="0.0.0.20240514"/>
<dependency id="nodejs.vm" />
</dependencies>
</metadata>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'obfuscator-io-deobfuscator'
$category = 'Javascript'
VM-Install-Node-Tool -toolName $toolName -category $category -arguments "--help"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'obfuscator-io-deobfuscator'
$category = 'Javascript'

VM-Remove-Tool-Shortcut $toolName $category

0 comments on commit 349fb4f

Please sign in to comment.