diff --git a/packages/ida.plugin.apply_callee_type.vm/ida.plugin.apply_callee_type.vm.nuspec b/packages/ida.plugin.apply_callee_type.vm/ida.plugin.apply_callee_type.vm.nuspec new file mode 100644 index 000000000..6422473e6 --- /dev/null +++ b/packages/ida.plugin.apply_callee_type.vm/ida.plugin.apply_callee_type.vm.nuspec @@ -0,0 +1,12 @@ + + + + ida.plugin.apply_callee_type.vm + 0.0.0.20240508 + Jay Smith + IDA plugin to specify or choose a function type for indirect calls + + + + + diff --git a/packages/ida.plugin.apply_callee_type.vm/tools/chocolateyinstall.ps1 b/packages/ida.plugin.apply_callee_type.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..a65772c92 --- /dev/null +++ b/packages/ida.plugin.apply_callee_type.vm/tools/chocolateyinstall.ps1 @@ -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 $_ +} diff --git a/packages/ida.plugin.apply_callee_type.vm/tools/chocolateyuninstall.ps1 b/packages/ida.plugin.apply_callee_type.vm/tools/chocolateyuninstall.ps1 new file mode 100644 index 000000000..5c4a12aa1 --- /dev/null +++ b/packages/ida.plugin.apply_callee_type.vm/tools/chocolateyuninstall.ps1 @@ -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 +} +