From ece1a41afc605b3d1694b226a34790bde60e0494 Mon Sep 17 00:00:00 2001 From: Ana Maria Martinez Gomez Date: Mon, 3 Jun 2024 11:44:40 +0200 Subject: [PATCH] Install Diaphora as an IDA plugin Diaphora was in the `Tools\Utilities` directory before as it was not possible to install it as a plugin. Now it is installed as an IDA plugin and available directly in IDA Pro after its installation. --- .../ida.diaphora.vm/ida.diaphora.vm.nuspec | 13 ------- .../tools/chocolateyinstall.ps1 | 12 ------- .../ida.plugin.diaphora.vm.nuspec | 12 +++++++ .../tools/chocolateyinstall.ps1 | 34 +++++++++++++++++++ .../tools/chocolateyuninstall.ps1 | 6 ++-- 5 files changed, 48 insertions(+), 29 deletions(-) delete mode 100644 packages/ida.diaphora.vm/ida.diaphora.vm.nuspec delete mode 100644 packages/ida.diaphora.vm/tools/chocolateyinstall.ps1 create mode 100644 packages/ida.plugin.diaphora.vm/ida.plugin.diaphora.vm.nuspec create mode 100644 packages/ida.plugin.diaphora.vm/tools/chocolateyinstall.ps1 rename packages/{ida.diaphora.vm => ida.plugin.diaphora.vm}/tools/chocolateyuninstall.ps1 (51%) diff --git a/packages/ida.diaphora.vm/ida.diaphora.vm.nuspec b/packages/ida.diaphora.vm/ida.diaphora.vm.nuspec deleted file mode 100644 index 52a3fdc62..000000000 --- a/packages/ida.diaphora.vm/ida.diaphora.vm.nuspec +++ /dev/null @@ -1,13 +0,0 @@ - - - - ida.diaphora.vm - 3.2.0 - joxeankoret - Diaphora is a program diffing tool that works as an IDA plugin. - - - - - - diff --git a/packages/ida.diaphora.vm/tools/chocolateyinstall.ps1 b/packages/ida.diaphora.vm/tools/chocolateyinstall.ps1 deleted file mode 100644 index 5a23f5891..000000000 --- a/packages/ida.diaphora.vm/tools/chocolateyinstall.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -$ErrorActionPreference = 'Stop' -Import-Module vm.common -Force -DisableNameChecking - -$toolName = 'diaphora' -$category = 'Utilities' -$executableName = "diaphora.py" - -$zipUrl = 'https://github.com/joxeankoret/diaphora/archive/refs/tags/3.2.0.zip' -$zipSha256 = 'a58f261214eba0c163824f7ce42bd5d7f04e0137e4f955464a13be4ecb612fb1' - -# Diaphora needs to be executed from IDA, do not install bin file -VM-Install-From-Zip $toolName $category $zipUrl -zipSha256 $zipSha256 -executableName $executableName -innerFolder $true -withoutBinFile diff --git a/packages/ida.plugin.diaphora.vm/ida.plugin.diaphora.vm.nuspec b/packages/ida.plugin.diaphora.vm/ida.plugin.diaphora.vm.nuspec new file mode 100644 index 000000000..425a55390 --- /dev/null +++ b/packages/ida.plugin.diaphora.vm/ida.plugin.diaphora.vm.nuspec @@ -0,0 +1,12 @@ + + + + ida.plugin.diaphora.vm + 3.2.1 + joxeankoret + Diaphora is a program diffing IDA plugin. + + + + + diff --git a/packages/ida.plugin.diaphora.vm/tools/chocolateyinstall.ps1 b/packages/ida.plugin.diaphora.vm/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..3921135c6 --- /dev/null +++ b/packages/ida.plugin.diaphora.vm/tools/chocolateyinstall.ps1 @@ -0,0 +1,34 @@ +$ErrorActionPreference = 'Stop' +Import-Module vm.common -Force -DisableNameChecking + +$toolName = 'diaphora' +$toolDir = Join-Path ${Env:RAW_TOOLS_DIR} $toolName + +$pluginUrl = 'https://github.com/joxeankoret/diaphora/archive/refs/tags/3.2.1.zip' +$pluginSha256 = '5ae160e6bb1534bde8d990577390e609d7e616a869abece3ee6c73865018a54b' + +# Remove files from previous zips for upgrade +VM-Remove-PreviousZipPackage ${Env:chocolateyPackageFolder} + +# Download and unzip +$packageArgs = @{ + packageName = ${Env:ChocolateyPackageName} + unzipLocation = $toolDir + url = $pluginUrl + checksum = $pluginSha256 + checksumType = 'sha256' +} +Install-ChocolateyZipPackage @packageArgs | Out-Null +VM-Assert-Path $toolDir + +# There is an inner folder in the zip whose name changes as it includes the version +$dirList = Get-ChildItem $toolDir -Directory +$toolDir = Join-Path $toolDir $dirList[0].Name -Resolve + +$pluginName = "diaphora_plugin.py" +$pluginsDir = VM-Get-IDA-Plugins-Dir +$pluginFile = Get-Item "$toolDir\plugin\$pluginName" -ea 0 +Copy-Item "$pluginFile" "$pluginsDir" + +$cfgFile = Join-Path $pluginsDir "diaphora_plugin.cfg" +"[Diaphora]`npath=$toolDir" | out-file -encoding ASCII "$cfgFile" diff --git a/packages/ida.diaphora.vm/tools/chocolateyuninstall.ps1 b/packages/ida.plugin.diaphora.vm/tools/chocolateyuninstall.ps1 similarity index 51% rename from packages/ida.diaphora.vm/tools/chocolateyuninstall.ps1 rename to packages/ida.plugin.diaphora.vm/tools/chocolateyuninstall.ps1 index 43f920eb4..437ecdef7 100644 --- a/packages/ida.diaphora.vm/tools/chocolateyuninstall.ps1 +++ b/packages/ida.plugin.diaphora.vm/tools/chocolateyuninstall.ps1 @@ -1,7 +1,5 @@ $ErrorActionPreference = 'Continue' Import-Module vm.common -Force -DisableNameChecking -$toolName = 'diaphora' -$category = 'Utilities' - -VM-Uninstall $toolName $category +$pluginName = "diaphora_plugin.py" +VM-Uninstall-IDA-Plugin -pluginName $pluginName