Ghidra uses .cspec
files like x86win.cspec
to define compiler related information, which are imported in the .ldef
files like x86.ldef
that define a processor language.
How can I add a new CompilerSpec
via a .cspec
file to Ghidra without editing the existing .ldef
file which is inherently part of the Ghidra core, but also without adding a new processor (with a new .ldef
file)? This should also work with analyzeHeadless
, so no just adding it in the GUI.
This will probably end up requiring an extension which isn't an issue, I just don't know where to either put the file so it gets automatically loaded, or which API functions to call as part of the extension initialization to add the new CompilerSpec
. The classes that implement the CompilerSpec
interface have public constructors, that take the .cspec
file as a parameter, but this doesn't look like it will be automatically added then after just creating an instance of it.