Skip to content

Commit

Permalink
Merge pull request #1243 from Ana06/idapro
Browse files Browse the repository at this point in the history
Add idapro.vm
  • Loading branch information
Ana06 authored Jan 22, 2025
2 parents 6bf6463 + 134854c commit d2a0bae
Show file tree
Hide file tree
Showing 29 changed files with 180 additions and 43 deletions.
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.20250116</version>
<version>0.0.0.20250117</version>
<description>Common libraries for VM-packages</description>
<authors>Mandiant</authors>
</metadata>
Expand Down
3 changes: 3 additions & 0 deletions packages/common.vm/tools/vm.common/vm.common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ function VM-Uninstall {

# Uninstall binary
Uninstall-BinFile -Name $toolName

# Refresh Desktop, needed for example if shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
}

function VM-Remove-Tool-Shortcut {
Expand Down
2 changes: 1 addition & 1 deletion packages/cyberchef.vm/cyberchef.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>cyberchef.vm</id>
<version>10.19.4.20241209</version>
<version>10.19.4.20250117</version>
<authors>GCHQ</authors>
<description>The Cyber Swiss Army Knife - a web app for encryption, encoding, compression, data analysis, and more.</description>
<dependencies>
Expand Down
3 changes: 3 additions & 0 deletions packages/cyberchef.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ try {
$cyberchefPath = Get-Item "$toolDir\CyberChef*.html"
$iconLocation = VM-Create-Ico (Join-Path $toolDir "images\cyberchef-128x128.png")
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $chromePath -arguments "-home $cyberchefPath" -iconLocation $iconLocation

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
2 changes: 1 addition & 1 deletion packages/explorersuite.vm/explorersuite.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>explorersuite.vm</id>
<version>0.0.0.20240717</version>
<version>0.0.0.20250117</version>
<authors>Erik Pistelli</authors>
<description>A suite of tools including CFF Explorer and a process viewer.</description>
<dependencies>
Expand Down
3 changes: 3 additions & 0 deletions packages/explorersuite.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ try {
Remove-Item -Path "HKLM:\SOFTWARE\Classes\*file\shell\Open with CFF Explorer" -Recurse

VM-Add-To-Right-Click-Menu 'Open with CFF Explorer' 'Open with CFF Explorer' "`"$cffExecutablePath`" %1" $cffExecutablePath

# Refresh Desktop as CFF Explorer shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
3 changes: 3 additions & 0 deletions packages/explorersuite.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ foreach ($subtoolName in $subtoolNames) {
VM-Remove-From-Right-Click-Menu 'Open with CFF Explorer'

VM-Uninstall-With-Uninstaller "Explorer Suite IV" $category "EXE" "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-"

# Refresh Desktop as CFF Explorer shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
2 changes: 1 addition & 1 deletion packages/fakenet-ng.vm/fakenet-ng.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/2011/08/nuspec.xsd">
<metadata>
<id>fakenet-ng.vm</id>
<version>3.3.0.20241219</version>
<version>3.3.0.20250117</version>
<description>FakeNet-NG is a dynamic network analysis tool.</description>
<authors>Mandiant</authors>
<dependencies>
Expand Down
3 changes: 3 additions & 0 deletions packages/fakenet-ng.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ try {
$desktopShortcut = Join-Path ${Env:UserProfile} "Desktop\fakenet_logs.lnk"
Install-ChocolateyShortcut -shortcutFilePath $desktopShortcut -targetPath $toolDir
VM-Assert-Path $desktopShortcut

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
23 changes: 11 additions & 12 deletions packages/fakenet-ng.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

try {
$toolName = 'fakenet'
$category = 'Networking'

VM-Uninstall $toolName $category

# Remove Desktop shortcut to FakeNet tool directory
$desktopShortcut = Join-Path ${Env:UserProfile} "Desktop\fakenet_logs.lnk"
Remove-Item $desktopShortcut -Force -ea 0
} catch {
VM-Write-Log-Exception $_
}
$toolName = 'fakenet'
$category = 'Networking'

VM-Uninstall $toolName $category

# Remove Desktop shortcut to FakeNet tool directory
$desktopShortcut = Join-Path ${Env:UserProfile} "Desktop\fakenet_logs.lnk"
Remove-Item $desktopShortcut -Force -ea 0

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
2 changes: 1 addition & 1 deletion packages/googlechrome.vm/googlechrome.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>googlechrome.vm</id>
<version>0.0.0.20241212</version>
<version>0.0.0.20250117</version>
<authors>Google LLC.</authors>
<description>Chrome is a popular web browser.</description>
<dependencies>
Expand Down
3 changes: 1 addition & 2 deletions packages/googlechrome.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,4 @@ SetDefaultBrowser "chrome"
# Do not show the "Open with" popup
Set-ItemProperty -path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -name "NoNewAppAlert" -value 1 -type "DWord"

# Restart Explorer.exe for registry change to take effect
Stop-Process -Name explorer -Force
VM-Refresh-Desktop # For registry change to take effect
6 changes: 3 additions & 3 deletions packages/idafree.vm/idafree.vm.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>idafree.vm</id>
<version>8.4.0.20241124</version>
<authors>hex-rays</authors>
<description>Free version of IDA, a powerful Interactive DisAssembler and debugger</description>
<version>8.4.0.20250116</version>
<authors>Hex-Rays</authors>
<description>Free version of IDA Pro, a powerful Interactive DisAssembler and debugger.</description>
<dependencies>
<dependency id="common.vm" version="0.0.0.20240119" />
</dependencies>
Expand Down
20 changes: 9 additions & 11 deletions packages/idafree.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$toolName = 'idafree'
$toolName = 'ida'
$category = 'Disassemblers'

$packageArgs = @{
Expand All @@ -21,28 +21,26 @@ try {
Install-BinFile -Name $toolname -Path $executablePath

# Delete Desktop shortcut
$desktopShortcut = Join-Path ${Env:Public} "Desktop\IDA Freeware 8.4.lnk"
if (Test-Path $desktopShortcut) {
Remove-Item $desktopShortcut -Force -ea 0
}
$desktopShortcut = Resolve-Path "${Env:Public}\Desktop\IDA Freeware*"
if ($null -ne $desktopShortcut) { Remove-Item $desktopShortcut -Force -ea 0 }

# Download ida_launcher.exe to assist with taskbar and right click option and store it in %RAW_TOOLS_DIR%
# ida_launcher.exe is a custom binary that searches for the latest ida64.exe and executes it
$launcherName = 'ida_launcher'
$launcherSource = 'https://raw.githubusercontent.com/mandiant/VM-Packages/119ba385de053b01b0d1732d60ad1b1152496dc2/ida_launcher/ida_launcher.exe'
$launcherPath = Join-Path ${Env:RAW_TOOLS_DIR} "$launcherName.exe"
$launcherChecksum = "a98241e476150d053d67d149c1b54816c8306db51e0987613ec25a0f8ad22006"
Write-Host "[+] Downloading '$launcherSource'"
Get-ChocolateyWebFile -PackageName $launcherName -FileFullPath $launcherPath -Url $launcherSource -Checksum $launcherChecksum -ChecksumType "sha256"

VM-Assert-Path $launcherPath

$menuIcon = Join-Path $toolDir "ida.ico" -Resolve

VM-Install-Shortcut -toolName "ida" -category $category -executablePath $launcherPath -IconLocation $menuIcon
$icon = Join-Path $toolDir "$toolName.ico" -Resolve
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $launcherPath -IconLocation $icon

# ida64.exe supports both 32 bit and 64 bit in IDA >= 8.2
VM-Add-To-Right-Click-Menu $launcherName 'Open with IDA' "`"$launcherPath`" `"%1`"" "$menuIcon"
VM-Add-To-Right-Click-Menu $launcherName 'Open with IDA' "`"$launcherPath`" `"%1`"" "$icon"

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
8 changes: 3 additions & 5 deletions packages/idafree.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'idafree'
$toolName = 'ida'
$category = 'Disassemblers'

VM-Remove-Tool-Shortcut $toolName $category

# Remove binary from PATH
Uninstall-BinFile -Name $toolName

# Manually silently uninstall
VM-Uninstall-With-Uninstaller "IDA Freeware*?8.4" $category "EXE" "--mode unattended"
# Silently uninstall
VM-Uninstall-With-Uninstaller "IDA Freeware*" $category "EXE" "--mode unattended" | Out-Null
14 changes: 14 additions & 0 deletions packages/idapro.vm/idapro.vm.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>idapro.vm</id>
<version>0.0.0.20250116</version>
<authors>Hex-Rays</authors>
<description>IDA Pro 9 is an interactive DisAssembler and debugger. The installation requires an IDA Pro installer `ida-pro_9*.exe` (and optionally a license file) in the Desktop. Get your installer from https://hex-rays.com/ida-pro.</description>
<dependencies>
<dependency id="common.vm" version="0.0.0.20240509" />
<!-- IDA Pro requires Python3 and the rpyc library -->
<dependency id="libraries.python3.vm" version="0.0.0.20241213" />
</dependencies>
</metadata>
</package>
80 changes: 80 additions & 0 deletions packages/idapro.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$toolName = 'ida'
$category = 'Disassemblers'

$installerPaths = Resolve-Path "${Env:USERPROFILE}\Desktop\ida-pro_9*.exe"
if ($installerPaths.count -eq 0) {
throw "An IDA Pro installer 'ida-pro_9*.exe' in the Desktop is required. Get your installer from https://hex-rays.com/ida-pro"
}
elseif ($installerPaths.count -gt 1) {
# Only one installer supported (prospective change)
throw "Several IDA Pro installers found in Desktop, only 1 installer is supported."
}
$installerPath = $installerPaths | Select-Object -first 1
VM-Write-Log "INFO" "Installing IDA Pro: $installerPath"

# Run installer
$packageArgs = @{
packageName = $env:ChocolateyPackageName
file = $installerPath
fileType = 'exe'
# unclear what the required argument `--install_python` expects
silentArgs = '--mode unattended --install_python flare'
}
Install-ChocolateyInstallPackage @packageArgs | Out-Null

# Wait for IDA to be installed
Start-Sleep -Seconds 10
$executablePath = Resolve-Path "${Env:ProgramFiles}\IDA Professional 9*\ida.exe"
VM-Assert-Path $executablePath

Install-BinFile -Name $toolname -Path $executablePath

# Delete "IDA Teams Visual Client" Desktop shortcut
# Do not delete "IDA Professional 9.0", as it is useful to drag binaries to it
$desktopShortcut = Resolve-Path "${Env:Public}\Desktop\IDA Teams Visual Client*"
if ($null -ne $desktopShortcut) { Remove-Item $desktopShortcut -Force -ea 0 }

# Add ida to the Tools directory, use directly (instead of ida_launcher.exe) to avoid taskbar duplication
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $executablePath

# Download ida_launcher.exe and store it in %RAW_TOOLS_DIR%
# ida_launcher.exe is a custom binary that searches for the latest ida64.exe and executes it
$launcherName = 'ida_launcher'
$launcherSource = 'https://raw.githubusercontent.com/mandiant/VM-Packages/119ba385de053b01b0d1732d60ad1b1152496dc2/ida_launcher/ida_launcher.exe'
$launcherPath = Join-Path ${Env:RAW_TOOLS_DIR} "$launcherName.exe"
$launcherChecksum = "a98241e476150d053d67d149c1b54816c8306db51e0987613ec25a0f8ad22006"
Get-ChocolateyWebFile -PackageName $launcherName -FileFullPath $launcherPath -Url $launcherSource -Checksum $launcherChecksum -ChecksumType "sha256"
VM-Assert-Path $launcherPath

# Use ida_launcher.exe in the right click option "Open with IDA"
$icon = Resolve-Path "${Env:ProgramFiles}\IDA*\$toolName.ico" | Select-Object -last 1
VM-Add-To-Right-Click-Menu $launcherName 'Open with IDA' "`"$launcherPath`" `"%1`"" "$icon"


# Create IDA user directory (also if no license file is copied as it makes it easier to manually add the license file)
$idaDir = "${Env:APPDATA}\Hex-Rays\IDA Pro"
New-Item $idaDir -ItemType "directory" -Force | Out-Null

# Copy license file to IDA user directory if present in Desktop
$licensePaths = Resolve-Path "${Env:USERPROFILE}\Desktop\idapro_9*.hexlic"
if ($licensePaths.count -eq 0) {
VM-Write-Log "WARN" "No IDA Pro license file 'idapro_9*.hexlic' found in Desktop."
VM-Write-Log "WARN" "Get your license file from https://hex-rays.com/ida-pro and copy it to IDA user directory before launching IDA Pro."
}
else {
# Copy license file(s)
ForEach ($licensePath in $licensePaths) {
VM-Write-Log "INFO" "Copying license file to IDA user directory: $licensePath"
Copy-Item $licensePath $idaDir
}
}

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
16 changes: 16 additions & 0 deletions packages/idapro.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$toolName = 'ida'
$category = 'Disassemblers'

# Remove binary from PATH
Uninstall-BinFile -Name $toolName

# Replace tool shortcut's target by ida_launcher.exe
$launcherPath = Join-Path ${Env:RAW_TOOLS_DIR} "ida_launcher.exe"
$icon = Resolve-Path "${Env:ProgramFiles}\IDA*\$toolName.ico" | Select-Object -first 1
VM-Install-Shortcut -toolName $toolName -category $category -executablePath $launcherPath -IconLocation $icon

# Silently uninstall
VM-Uninstall-With-Uninstaller "IDA Pro*" $category "EXE" "--mode unattended" | Out-Null
2 changes: 1 addition & 1 deletion packages/notepadplusplus.vm/notepadplusplus.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>notepadplusplus.vm</id>
<version>8.7.5</version>
<version>8.7.5.20250122</version>
<description>Wrapper for Notepad++</description>
<authors>Don Ho</authors>
<dependencies>
Expand Down
3 changes: 3 additions & 0 deletions packages/notepadplusplus.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ try {

$executablePath = Join-Path ${Env:ProgramFiles} "Notepad++\${toolName}.exe" -Resolve
VM-Install-Shortcut $toolName $category $executablePath

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
2 changes: 1 addition & 1 deletion packages/sysinternals.vm/sysinternals.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>sysinternals.vm</id>
<version>0.0.0.20241122</version>
<version>0.0.0.20250117</version>
<authors>Mark Russinovich, Bryce Cogswell</authors>
<description>Sysinternals suite.</description>
<dependencies>
Expand Down
3 changes: 3 additions & 0 deletions packages/sysinternals.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ try {
New-Item -Path $registryKey -Force | Out-Null
New-ItemProperty -Path $registryKey -Name EulaAccepted -Value 1 -Force | Out-Null
}

# Refresh Desktop as the shortcuts are used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
3 changes: 3 additions & 0 deletions packages/sysinternals.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ ForEach ($category in $shortcuts.GetEnumerator()) {

$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName
Remove-Item $toolDir -Recurse -Force -ea 0 | Out-Null

# Refresh Desktop as the shortcuts are used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
3 changes: 3 additions & 0 deletions packages/visualstudio.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ try {
$shortcut = Join-Path $shortcutDir "$toolName.lnk"
Install-ChocolateyShortcut -shortcutFilePath $shortcut -targetPath $executablePath
VM-Assert-Path $shortcut

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
3 changes: 3 additions & 0 deletions packages/visualstudio.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ $category = 'Productivity Tools'

VM-Remove-Tool-Shortcut $toolName $category

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop

choco uninstall visualstudio2022community --removedependencies
2 changes: 1 addition & 1 deletion packages/visualstudio.vm/visualstudio.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>visualstudio.vm</id>
<version>17.6.1.20250120</version>
<version>17.6.1.20250121</version>
<description>IDE.</description>
<authors>Microsoft</authors>
<dependencies>
Expand Down
3 changes: 3 additions & 0 deletions packages/windows-terminal.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ try {
$label = "Open Terminal here"
$icon = "$executablePath"
VM-Add-To-Right-Click-Menu -menuKey $toolName -menuLabel $label -command $command -menuIcon $icon -type "directory" -background

# Refresh Desktop as shortcut is used in FLARE-VM LayoutModification.xml
VM-Refresh-Desktop
} catch {
VM-Write-Log-Exception $_
}
Loading

0 comments on commit d2a0bae

Please sign in to comment.