mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-1101 Improved javadoc for PdbParserConstants and updated script to
use them
This commit is contained in:
parent
1f18bb621d
commit
79b9e9a6ec
2 changed files with 38 additions and 8 deletions
|
@ -15,12 +15,44 @@
|
|||
*/
|
||||
package ghidra.app.util.bin.format.pdb;
|
||||
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
||||
/**
|
||||
* Program Information options related to PDB data. All option keys specified
|
||||
* by this constants file are children of the Program Information options. Example:
|
||||
* <pre>
|
||||
* Options options = program.getOptions({@link Program#PROGRAM_INFO});
|
||||
* boolean isPdbLoaded = options.getBoolean({@link #PDB_LOADED}, false);
|
||||
* </pre>
|
||||
*/
|
||||
public class PdbParserConstants {
|
||||
/**
|
||||
* Option key which indicates if PDB has been loaded/applied to program (Boolean).
|
||||
*/
|
||||
public final static String PDB_LOADED = "PDB Loaded";
|
||||
|
||||
/**
|
||||
* Option key which indicates PDB filename or path as specified by loaded program (String).
|
||||
*/
|
||||
public final static String PDB_FILE = "PDB File";
|
||||
// NOTE: PDB_AGE stored as Hex string value without 0x or other format indicator
|
||||
|
||||
/**
|
||||
* Option key which indicates PDB Age as specified by loaded program (String, hex value without 0x prefix).
|
||||
*/
|
||||
public final static String PDB_AGE = "PDB Age";
|
||||
|
||||
/**
|
||||
* Option key which indicates PDB Signature as specified by loaded program (String).
|
||||
*/
|
||||
public final static String PDB_SIGNATURE = "PDB Signature";
|
||||
|
||||
/**
|
||||
* Option key which indicates PDB Version as specified by loaded program (String).
|
||||
*/
|
||||
public final static String PDB_VERSION = "PDB Version";
|
||||
|
||||
/**
|
||||
* Option key which indicates PDB GUID as specified by loaded program (String).
|
||||
*/
|
||||
public final static String PDB_GUID = "PDB GUID";
|
||||
}
|
||||
|
|
|
@ -63,13 +63,13 @@ import ghidra.app.plugin.core.analysis.DecompilerFunctionAnalyzer;
|
|||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.app.services.Analyzer;
|
||||
import ghidra.app.services.GraphDisplayBroker;
|
||||
import ghidra.app.util.bin.format.pdb.PdbParserConstants;
|
||||
import ghidra.app.util.importer.MessageLog;
|
||||
import ghidra.framework.options.Options;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.program.model.listing.Function;
|
||||
import ghidra.program.model.listing.Parameter;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.mem.MemoryBlock;
|
||||
import ghidra.service.graph.*;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
|
@ -273,10 +273,8 @@ public class RecoverClassesFromRTTIScript extends GhidraScript {
|
|||
* @return true if pdb info has been applied to program
|
||||
*/
|
||||
private boolean isPDBLoadedInProgram() {
|
||||
|
||||
Options options = currentProgram.getOptions("Program Information");
|
||||
return options.getBoolean("PDB Loaded", false);
|
||||
|
||||
Options options = currentProgram.getOptions(Program.PROGRAM_INFO);
|
||||
return options.getBoolean(PdbParserConstants.PDB_LOADED, false);
|
||||
}
|
||||
|
||||
public String validate() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue