Files
lief-project-LIEF/plugins/ghidra/ghidra_scripts/LiefVersionInfoScript.java
T
Romain Thomas 5a19dc9d73 Add support for creating DWARF files
This commit also bootstraps plugin for Ghidra and BinaryNinja

Related to NationalSecurityAgency/ghidra#2687
2025-05-27 14:48:07 +02:00

35 lines
1.1 KiB
Java

import ghidra.app.script.GhidraScript;
import lief.Utils;
import lief.ghidra.core.NativeBridge;
public class LiefVersionInfoScript extends GhidraScript {
@Override
protected void run() throws Exception {
print("LIEF");
NativeBridge.init();
if (!NativeBridge.isLoaded()) {
printerr("Can't load native bridge");
throw new Exception();
}
print("LIEF Extended: " + Utils.isExtended());
if (Utils.isExtended()) {
Utils.Version version = Utils.getExtendedVersion();
print(String.format(
"Extended Version: %d.%d.%d.%d",
version.major(), version.minor(), version.patch(), version.id()
));
print(String.format(
"Extended Version:\n%s\n",
Utils.getExtendedVersionInfo()
));
} else {
Utils.Version version = Utils.getVersion();
print(String.format(
"Version: %d.%d.%d",
version.major(), version.minor(), version.patch()
));
}
}
}