Package ghidra.program.examiner

# Class ProgramExaminer

java.lang.Object
ghidra.program.examiner.ProgramExaminer

public class ProgramExaminer extends 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(File file)`
  Constructs a new ProgramExaminer.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dispose()`
  Releases file/database resources.
  `List<byte[]>`
  `getImages()`
  Returns a list of byte[] containing image data.
  `String`
  `getType()`
  Returns a string indication the program format.
  `static void`
  `initializeGhidra()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### 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(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 Details

  - ### getType

    public 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 List<byte[]> getImages()
    Returns a list of byte[] containing image data. The bytes will be either a png, a gif, or a bitmap