mirror of
https://github.com/lief-project/LIEF
synced 2026-06-08 15:30:44 +00:00
5a19dc9d73
This commit also bootstraps plugin for Ghidra and BinaryNinja Related to NationalSecurityAgency/ghidra#2687
35 lines
1.1 KiB
Java
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()
|
|
));
|
|
}
|
|
|
|
}
|
|
}
|