Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the lighthouse IDA Pro plugin #911

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
50 changes: 50 additions & 0 deletions packages/ida.plugin.lighthouse.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use $pluginsDir directly as unzip location instead of downloading to %TEMP% and copying items over

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add to the comment why they are needed

$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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this in %RAW_TOOLS_DIR%?


# 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
Loading