Package ghidra.program.examiner
Class ProgramExaminer
- java.lang.Object
-
- ghidra.program.examiner.ProgramExaminer
-
public class ProgramExaminer extends java.lang.Object
Wrapper for Ghidra code to find images (and maybe other artifacts later) in a program NOTE: This is intended for end-user use and has no direct references within Ghidra. Typical use of the class entails generating a ghidra.jar (see BuildGhidraJarScript.java) and referencing this class from end-user code.
-
-
Constructor Summary
Constructors Constructor Description ProgramExaminer(byte[] bytes)
Constructs a new ProgramExaminer.ProgramExaminer(java.io.File file)
Constructs a new ProgramExaminer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Releases file/database resources.java.util.List<byte[]>
getImages()
Returns a list of byte[] containing image data.java.lang.String
getType()
Returns a string indication the program format.static void
initializeGhidra()
-
-
-
Constructor Detail
-
ProgramExaminer
public ProgramExaminer(byte[] bytes) throws GhidraException
Constructs a new ProgramExaminer.- Parameters:
bytes
- the bytes of the potential program to be examined.- Throws:
GhidraException
- if any exception occurs while processing the bytes.
-
ProgramExaminer
public ProgramExaminer(java.io.File file) throws GhidraException
Constructs a new ProgramExaminer.- Parameters:
file
- file object containing the bytes to be examined.- Throws:
GhidraException
- if any exception occurs while processing the bytes.
-
-
Method Detail
-
getType
public java.lang.String getType()
Returns a string indication the program format. i.e. PE, elf, raw
-
initializeGhidra
public static void initializeGhidra() throws GhidraException
- Throws:
GhidraException
-
dispose
public void dispose()
Releases file/database resources.
-
getImages
public java.util.List<byte[]> getImages()
Returns a list of byte[] containing image data. The bytes will be either a png, a gif, or a bitmap
-
-