Skip to content

Using GhidraScript.createProgram from pyghidra #7333

Answered by astrelsky
bdemick asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry if it wasn't clear - I'm attempting to do this via a standalone Python script importing pyghidra, not with a script to be run with, say analyzeHeadless or the script launcher in the GUI.

Ah I see. This may seem like a lame solution but GhidraScript does have a no argument public constructor.... Nevermind it's abstract. I did a bit of digging because I have outdated docs but try something like

from ghidra.pyghidra import PyGhidraScriptProvider

PyGhidraScriptProvider().getScriptInstance(None, None).createProgram

You could have previously done ghidra.python.PythonScript().createProgram but it looks like that class no longer exists.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@bdemick
Comment options

@astrelsky
Comment options

Answer selected by bdemick
@bdemick
Comment options

@bdemick
Comment options

@bdemick
Comment options

@astrelsky
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants