diff --git a/packages/ida.plugin.lighthouse.vm/ida.plugin.lighthouse.vm.nuspec b/packages/ida.plugin.lighthouse.vm/ida.plugin.lighthouse.vm.nuspec new file mode 100644 index 000000000..96f4d9640 --- /dev/null +++ b/packages/ida.plugin.lighthouse.vm/ida.plugin.lighthouse.vm.nuspec @@ -0,0 +1,13 @@ + + + + ida.plugin.lighthouse.vm + 0.9.3 + Lighthouse is a powerful code coverage explorer for IDA Pro and Binary Ninja, providing software researchers with uniquely interactive controls to study execution maps for native applications without requiring symbols or source. + gaasedelen + + + + + + diff --git a/packages/ida.plugin.lighthouse.vm/tools/chocolateyinstall.ps1 b/packages/ida.plugin.lighthouse.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..1ce6972ee --- /dev/null +++ b/packages/ida.plugin.lighthouse.vm/tools/chocolateyinstall.ps1 @@ -0,0 +1,50 @@ +$ErrorActionPreference = 'Stop' +Import-Module vm.common -Force -DisableNameChecking + +try { + # Download the plugin + $toolName = "lighthouse" + $toolVersion = "0.9.3" + $toolDir = Join-Path ${Env:chocolateyPackageFolder} "temp_$([guid]::NewGuid())" + $toolUrl = "https://github.com/gaasedelen/lighthouse/archive/refs/tags/v0.9.3.zip" + $toolSha256 = "b9f1888827f68d69672d1202783b47f7603fb80f42f9b70edeb9349d40c4f33c" + $packageArgs = + @{ + packageName = ${Env:ChocolateyPackageName} + unzipLocation = $toolDir + url = $toolUrl + checksum = $toolSha256 + checksumType = "sha256" + } + Install-ChocolateyZipPackage @packageArgs + + # Install the plugin + $pluginsDir = New-Item "$Env:APPDATA\Hex-Rays\IDA Pro\plugins" -ItemType "directory" -Force + $pluginFile = Join-Path $toolDir "$toolName-$toolVersion\plugins\lighthouse_plugin.py" -Resolve + $pluginDir = Join-Path $toolDir "$toolName-$toolVersion\plugins\lighthouse" -Resolve + Copy-Item $pluginFile -Destination $pluginsDir -Force + Copy-Item $pluginDir -Destination $pluginsDir -Force -Recurse + + # Remove the temp installation folder + Remove-Item $toolDir -Recurse + + # Install the code coverage binaries + $toolName = "CodeCoverage" + $zipUrl = "https://github.com/gaasedelen/lighthouse/releases/download/v$toolVersion/CodeCoverage-v$toolVersion-98830.zip" + $zipSha256 = "5b3e9659e934f8d7f4751cc0e20aa76de28822bc4f28b4936aa9be9c9e108595" + + $toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName + + # Download and unzip + $packageArgs = @{ + packageName = $toolName + unzipLocation = $toolDir + url = $zipUrl + checksum = $zipSha256 + checksumType = "sha256" + } + Install-ChocolateyZipPackage @packageArgs + VM-Assert-Path $toolDir +} catch { + VM-Write-Log-Exception $_ +} diff --git a/packages/ida.plugin.lighthouse.vm/tools/chocolateyuninstall.ps1 b/packages/ida.plugin.lighthouse.vm/tools/chocolateyuninstall.ps1 new file mode 100644 index 000000000..b23d168db --- /dev/null +++ b/packages/ida.plugin.lighthouse.vm/tools/chocolateyuninstall.ps1 @@ -0,0 +1,15 @@ +$ErrorActionPreference = 'Continue' +Import-Module vm.common -Force -DisableNameChecking + +$pluginsDir = "$Env:APPDATA\Hex-Rays\IDA Pro\plugins" + +# Uninstall plugin +$pluginFile = Join-Path $pluginsDir "lighthouse_plugin.py" +$pluginDir = Join-Path $pluginsDir "lighthouse" +Remove-Item $pluginFile +Remove-Item $pluginDir -Recurse + +# Uninstall the code coverage binaries +$toolName = "CodeCoverage" +$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName +Remove-Item $toolDir -Recurse