Skip to content

Commit

Permalink
Add ida.plugin.apply_callee_type.vm
Browse files Browse the repository at this point in the history
In addition to copy the `apply_callee_type_plugin.py` file to the IDA
plugins directory, we need 3 extra files from the `flare` Python module.
  • Loading branch information
Ana06 committed May 8, 2024
1 parent bf33e93 commit e60f5a3
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>ida.plugin.apply_callee_type.vm</id>
<version>0.0.0.20240508</version>
<authors>Jay Smith</authors>
<description>IDA plugin to specify or choose a function type for indirect calls</description>
<dependencies>
<dependency id="common.vm" version="0.0.0.20240509" />
</dependencies>
</metadata>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
$pluginName = 'apply_callee_type_plugin.py'
$pluginUrl = 'https://github.com/mandiant/flare-ida/archive/011cb3310d82a1c00104a4830289ea2fed5165f5.zip'
$pluginSha256 = 'd74c81d9fb1db2de801a05aeeb289ea98d93604aa11e44b27568382e78225bb2'

$tempDownloadDir = Join-Path ${Env:chocolateyPackageFolder} "temp_$([guid]::NewGuid())"
# Download and unzip
$packageArgs = @{
packageName = ${Env:ChocolateyPackageName}
unzipLocation = $tempDownloadDir
url = $pluginUrl
checksum = $pluginSha256
checksumType = 'sha256'
}
Install-ChocolateyZipPackage @packageArgs | Out-Null
VM-Assert-Path $tempDownloadDir

# Copy plugin to IDA plugins directory
$pluginsDir = VM-Get-IDA-Plugins-Dir
$plugin = Get-Item "$tempDownloadDir\*\plugins\$pluginName"
Copy-Item $plugin $pluginsDir -Force

# Copy needed files from the flare Python module to the IDA plugins directory
$flareDirTemp = Get-Item "$tempDownloadDir\*\python\flare"
$flareDir = New-Item "$pluginsDir\flare" -ItemType "directory" -Force
$files = @('apply_callee_type.py', 'apply_callee_type_widget.py', 'jayutils.py')
ForEach ($file in $files) {
$filePath = Join-Path $flareDirTemp $file -Resolve
Copy-Item $filePath $flareDir -Force
}
} catch {
VM-Write-Log-Exception $_
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$pluginItems = @('apply_callee_type_plugin.py', 'flare')
ForEach ($name in $pluginItems) {
VM-Uninstall-IDA-Plugin -pluginName $name
}

0 comments on commit e60f5a3

Please sign in to comment.