5050import docking .widgets .OptionDialog ;
5151import docking .widgets .filechooser .GhidraFileChooser ;
5252import functioncalls .plugin .FcgProvider ;
53+ import generic .jar .ResourceFile ;
5354import ghidra .app .CorePluginPackage ;
5455import ghidra .app .context .ProgramActionContext ;
5556import ghidra .app .context .ProgramContextAction ;
5859import ghidra .app .events .ProgramLocationPluginEvent ;
5960import ghidra .app .plugin .PluginCategoryNames ;
6061import ghidra .app .plugin .ProgramPlugin ;
62+ import ghidra .app .plugin .core .analysis .AutoAnalysisManager ;
6163import ghidra .app .plugin .core .decompile .DecompilerProvider ;
6264import ghidra .app .plugin .core .symboltree .actions .*;
6365import ghidra .app .script .GhidraScript ;
66+ import ghidra .app .script .GhidraScriptProvider ;
67+ import ghidra .app .script .GhidraScriptUtil ;
6468import ghidra .app .script .GhidraState ;
6569import ghidra .app .services .BlockModelService ;
6670import ghidra .app .services .GoToService ;
8892import ghidra .program .util .GhidraProgramUtilities ;
8993import ghidra .program .util .ProgramChangeRecord ;
9094import ghidra .program .util .ProgramLocation ;
91- import ghidra .jython .GhidraJythonInterpreter ;
92- import ghidra .jython .JythonScript ;
95+ import ghidra .program .util .ProgramSelection ;
9396import ghidra .util .HTMLUtilities ;
9497import ghidra .util .HelpLocation ;
9598import ghidra .util .Msg ;
@@ -1222,7 +1225,7 @@ public void exportC(String startAddr, String endAddr) {
12221225 }
12231226
12241227 }
1225- private class CExporter extends JythonScript {
1228+ private class CExporter extends GhidraScript {
12261229 Program program = GhidraProgramUtilities .getCurrentProgram (tool );
12271230 GhidraState state = new GhidraState (tool , tool .getProject (), program , null , null , null );
12281231 String start_addr ;
@@ -1234,7 +1237,6 @@ public CExporter(String start, String end, File file) {
12341237 this .start_addr = start ;
12351238 this .end_addr = end ;
12361239 this .outfile = file .getAbsolutePath ();
1237- this .state .addEnvironmentVar ("ghidra.python.interpreter" , GhidraJythonInterpreter .get ());
12381240 this .path = this .outfile .substring (0 , this .outfile .lastIndexOf ("/" )+1 );
12391241 }
12401242 @ Override
@@ -1245,7 +1247,8 @@ public void run() {
12451247 String [] args = {start_addr , end_addr , outfile };
12461248 try {
12471249 //runScript("ghidra2dwarf.py", args);
1248- runScript ("range.py" ,args );
1250+ runScript ("range.py" , args );
1251+
12491252 } catch (Exception e ) {
12501253 e .printStackTrace ();
12511254 }
0 commit comments