Skip to content

Commit

Permalink
Add ida.plugin.lighthouse.vm
Browse files Browse the repository at this point in the history
  • Loading branch information
d35ha committed Feb 20, 2024
1 parent 2b5d0b1 commit 9308663
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/ida.plugin.lighthouse.vm/ida.plugin.lighthouse.vm.nuspec
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>ida.plugin.lighthouse.vm</id>
<version>0.9.3</version>
<description>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.</description>
<authors>gaasedelen</authors>
<dependencies>
<dependency id="common.vm" />
<dependency id="libraries.python3.vm" version="0.0.0.20230927" />
</dependencies>
</metadata>
</package>
51 changes: 51 additions & 0 deletions packages/ida.plugin.lighthouse.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
$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 $_
}

15 changes: 15 additions & 0 deletions packages/ida.plugin.lighthouse.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9308663

Please sign in to comment.