-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1069 from Ana06/diaphora_plugin
Install Diaphora as an IDA plugin
- Loading branch information
Showing
5 changed files
with
48 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
packages/ida.plugin.diaphora.vm/ida.plugin.diaphora.vm.nuspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
34
packages/ida.plugin.diaphora.vm/tools/chocolateyinstall.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
6 changes: 2 additions & 4 deletions
6
...diaphora.vm/tools/chocolateyuninstall.ps1 → ...diaphora.vm/tools/chocolateyuninstall.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |