Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the SigMaker IDA Pro plugin #913

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/ida.plugin.sigmaker.vm/ida.plugin.sigmaker.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.sigmaker.vm</id>
<version>1.0.0</version>
<description>Signature Maker Plugin for IDA Pro 8.3.</description>
<authors>A200K</authors>
<dependencies>
<dependency id="common.vm" />
</dependencies>
</metadata>
</package>
24 changes: 24 additions & 0 deletions packages/ida.plugin.sigmaker.vm/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$ErrorActionPreference = 'Stop'
Import-Module vm.common -Force -DisableNameChecking

try {
# Download the plugin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] I think this comment is not needed, as this package only download a single file and the code is IMO clear.

$pluginUrl = "https://github.com/A200K/IDA-Pro-SigMaker/releases/download/v1.0.0/SigMaker64.dll"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use consistent indentation here

$pluginPath = Join-Path ${Env:TEMP} "SigMaker.dll"
$pluginSha256 = "D8D14721515B1473408D21C40A1F223E18D402647B78F97B685E1A534C184402"
$packageArgs = @{
packageName = ${Env:ChocolateyPackageName}
url = $pluginUrl
checksum = $pluginSha256
checksumType = "sha256"
fileFullPath = $pluginPath
}
Get-ChocolateyWebFile @packageArgs
VM-Assert-Path $pluginPath

# Install the plugin
$pluginsDir = New-Item "$Env:APPDATA\Hex-Rays\IDA Pro\plugins" -ItemType "directory" -Force
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create $pluginsDir before downloading the plugin and use $pluginPath = Join-Path $pluginsDir "SigMaker.dll" so that you don't have to move it afterwards as we do in ida.plugin.capa.vm.

Move-Item $pluginPath -Destination $pluginsDir -Force
} catch {
VM-Write-Log-Exception $_
}
8 changes: 8 additions & 0 deletions packages/ida.plugin.sigmaker.vm/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$ErrorActionPreference = 'Continue'
Import-Module vm.common -Force -DisableNameChecking

$pluginsDir = "$Env:APPDATA\Hex-Rays\IDA Pro\plugins"

# Uninstall plugin
$pluginPath = Join-Path $pluginsDir "SigMaker.dll"
Remove-Item $pluginPath -Force
Comment on lines +4 to +8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I purpose to simplify the code:

Suggested change
$pluginsDir = "$Env:APPDATA\Hex-Rays\IDA Pro\plugins"
# Uninstall plugin
$pluginPath = Join-Path $pluginsDir "SigMaker.dll"
Remove-Item $pluginPath -Force
$pluginPath = "$Env:APPDATA\Hex-Rays\IDA Pro\plugins\SigMaker.dll"
Remove-Item $pluginPath -Force

Loading