Add PyGhidra Crusader Toolkit and patch scripts
- Introduced README.md for the PyGhidra Crusader Toolkit, detailing setup and usage instructions. - Added bootstrap_env.ps1 script to create and refresh the Python virtual environment with necessary packages. - Implemented _tmp_patch_hidden_cheat_menu.py and _tmp_patch_hidden_cheat_menu_deferred.py scripts for patching specific memory addresses in Ghidra.
This commit is contained in:
parent
fafd849beb
commit
ad6ebd0b86
132 changed files with 41758 additions and 99 deletions
39
tools/pyghidra_crusader/bootstrap_env.ps1
Normal file
39
tools/pyghidra_crusader/bootstrap_env.ps1
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
param(
|
||||
[string]$PythonExe = "C:\Users\Maddo\.pyenv\pyenv-win\versions\3.11.6\python.exe",
|
||||
[string]$GhidraInstallDir = "I:\Apps\ghidra_12.0.4_PUBLIC",
|
||||
[string]$VenvPath = (Join-Path (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) ".venv-pyghidra311")
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$resolvedPython = (Resolve-Path $PythonExe).Path
|
||||
$resolvedGhidra = (Resolve-Path $GhidraInstallDir).Path
|
||||
|
||||
$pyghidraDist = Join-Path $resolvedGhidra "Ghidra\Features\PyGhidra\pypkg\dist"
|
||||
$ghidraStubsDist = Join-Path $resolvedGhidra "docs\ghidra_stubs"
|
||||
|
||||
if (-not (Test-Path $pyghidraDist)) {
|
||||
throw "Missing PyGhidra wheel directory: $pyghidraDist"
|
||||
}
|
||||
|
||||
if (-not (Test-Path $ghidraStubsDist)) {
|
||||
throw "Missing Ghidra stubs wheel directory: $ghidraStubsDist"
|
||||
}
|
||||
|
||||
& $resolvedPython -m venv $VenvPath
|
||||
|
||||
$venvPython = Join-Path $VenvPath "Scripts\python.exe"
|
||||
if (-not (Test-Path $venvPython)) {
|
||||
throw "Virtual environment python not found at $venvPython"
|
||||
}
|
||||
|
||||
& $venvPython -m pip install --upgrade --force-reinstall --no-index --find-links $pyghidraDist --find-links $ghidraStubsDist pyghidra==3.0.2 ghidra-stubs==12.0.4
|
||||
|
||||
$versionScript = @'
|
||||
from importlib.metadata import version
|
||||
|
||||
print(f"pyghidra={version('pyghidra')}")
|
||||
print(f"ghidra-stubs={version('ghidra-stubs')}")
|
||||
'@
|
||||
|
||||
& $venvPython -c $versionScript
|
||||
Loading…
Add table
Add a link
Reference in a new issue