-
Notifications
You must be signed in to change notification settings - Fork 20
/
Import-ModulesToGhidra.ps1
41 lines (33 loc) · 1.13 KB
/
Import-ModulesToGhidra.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Author: Roberto Rodriguez (@Cyb3rWard0g)
# License: MIT
function Import-ModulesToGhidra {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[String]$GhidraFolder,
[parameter(Mandatory=$true)]
[string]$ProjectPath,
[parameter(Mandatory=$true)]
[string]$ProjectName,
[parameter(Mandatory=$true)]
[string]$FilesPath
)
# Validate Paths
$GhidraFolder = Resolve-Path $GhidraFolder -ErrorAction Stop
$ProjectPath = Resolve-Path $ProjectPath -ErrorAction Stop
$FilesPath = Resolve-Path $FilesPath -ErrorAction Stop
$GhidraHeadless = "$GhidraFolder\support\\analyzeHeadless.bat"
foreach ($module in (Get-Content $FilesPath)){
if ($module.ToLower() -eq 'combase.dll'){
continue
}
write-host "[+] Processing " $module
try {
& $GhidraHeadless $ProjectPath $ProjectName -import $module -overwrite
}
catch{
Write-Gost "[!] Something went WRONG with " $module
Write-Output $module | Out-File -append "$(Get-Location)\ERRORMODS.txt"
}
}
}