Skip to content

Commit

Permalink
Merge pull request #1069 from Ana06/diaphora_plugin
Browse files Browse the repository at this point in the history
Install Diaphora as an IDA plugin
  • Loading branch information
Ana06 authored Jun 3, 2024
2 parents 165ec34 + ece1a41 commit effb939
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 29 deletions.
13 changes: 0 additions & 13 deletions packages/ida.diaphora.vm/ida.diaphora.vm.nuspec

This file was deleted.

12 changes: 0 additions & 12 deletions packages/ida.diaphora.vm/tools/chocolateyinstall.ps1

This file was deleted.

12 changes: 12 additions & 0 deletions packages/ida.plugin.diaphora.vm/ida.plugin.diaphora.vm.nuspec
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.diaphora.vm</id>
<version>3.2.1</version>
<authors>joxeankoret</authors>
<description>Diaphora is a program diffing IDA plugin.</description>
<dependencies>
<dependency id="common.vm" version="0.0.0.20240509" />
</dependencies>
</metadata>
</package>
34 changes: 34 additions & 0 deletions packages/ida.plugin.diaphora.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit effb939

Please sign in to comment.