diff --git a/packages/common.vm/common.vm.nuspec b/packages/common.vm/common.vm.nuspec index d45420aa2..01dc50779 100755 --- a/packages/common.vm/common.vm.nuspec +++ b/packages/common.vm/common.vm.nuspec @@ -2,7 +2,7 @@ common.vm - 0.0.0.20240509 + 0.0.0.20240514 Common libraries for VM-packages Mandiant diff --git a/packages/common.vm/tools/vm.common/vm.common.psm1 b/packages/common.vm/tools/vm.common/vm.common.psm1 index 039f56e5c..54c78421a 100755 --- a/packages/common.vm/tools/vm.common/vm.common.psm1 +++ b/packages/common.vm/tools/vm.common/vm.common.psm1 @@ -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[]])] @@ -473,17 +493,10 @@ function VM-Install-Node-Tool-From-Zip { [Parameter(Mandatory=$false)] [bool] $innerFolder=$true # Default to true as most node apps are GH repos (ZIP with inner folder) ) - # Install dependencies with npm when running shortcut as we ignore errors below - $powershellCommand = "npm install; node $command" - - $toolDir = (VM-Install-From-Zip $toolName $category $zipUrl $zipSha256 -innerFolder $innerFolder -powershellCommand $powershellCommand)[0] + $toolDir = (VM-Install-From-Zip $toolName $category $zipUrl $zipSha256 -innerFolder $innerFolder -powershellCommand "node $command")[0] - # Prevent the following warning from failing the package: "npm WARN deprecated request@2.79.0" - $ErrorActionPreference = 'Continue' - # Get absolute path as npm may not be in PATH until Powershell is restarted - $npmPath = Join-Path ${Env:ProgramFiles} "\nodejs\npm.cmd" -Resolve # Install tool dependencies with npm - Set-Location $toolDir; & "$npmPath" install | Out-Null + Set-Location $toolDir; npm install --no-update-notifier } # This functions returns $executablePath diff --git a/packages/obfuscator-io-deobfuscator.vm/obfuscator-io-deobfuscator.vm.nuspec b/packages/obfuscator-io-deobfuscator.vm/obfuscator-io-deobfuscator.vm.nuspec new file mode 100644 index 000000000..0a9f66db8 --- /dev/null +++ b/packages/obfuscator-io-deobfuscator.vm/obfuscator-io-deobfuscator.vm.nuspec @@ -0,0 +1,13 @@ + + + + obfuscator-io-deobfuscator.vm + 0.0.0.20240514 + ben-sb + A deobfuscator for scripts obfuscated by Obfuscator.io + + + + + + diff --git a/packages/obfuscator-io-deobfuscator.vm/tools/chocolateyinstall.ps1 b/packages/obfuscator-io-deobfuscator.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..267688cea --- /dev/null +++ b/packages/obfuscator-io-deobfuscator.vm/tools/chocolateyinstall.ps1 @@ -0,0 +1,7 @@ +$ErrorActionPreference = 'Stop' +Import-Module vm.common -Force -DisableNameChecking + +$toolName = 'obfuscator-io-deobfuscator' +$category = 'Javascript' + +VM-Install-Node-Tool -toolName $toolName -category $category -arguments "--help" diff --git a/packages/obfuscator-io-deobfuscator.vm/tools/chocolateyuninstall.ps1 b/packages/obfuscator-io-deobfuscator.vm/tools/chocolateyuninstall.ps1 new file mode 100644 index 000000000..60e8aa54b --- /dev/null +++ b/packages/obfuscator-io-deobfuscator.vm/tools/chocolateyuninstall.ps1 @@ -0,0 +1,7 @@ +$ErrorActionPreference = 'Continue' +Import-Module vm.common -Force -DisableNameChecking + +$toolName = 'obfuscator-io-deobfuscator' +$category = 'Javascript' + +VM-Remove-Tool-Shortcut $toolName $category