Class PortableExecutable
java.lang.Object
ghidra.app.util.bin.format.pe.PortableExecutable
A class to manage loading Portable Executables (PE).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIndicates how sections of this PE are laid out in the underlyingByteProvider. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newPortableExecutableusing the specified byte provider and layoutPortableExecutable(ByteProvider bp, PortableExecutable.SectionLayout layout, boolean advancedProcess, boolean parseCliHeaders) Constructs a newPortableExecutableusing the specified byte provider and layout -
Method Summary
Modifier and TypeMethodDescriptionReturns the DOS header from the PE image.longReturns the length of thePortableExecutablefile in bytes.Returns the NT header from the PE image.Returns the rich header from the PE image.
-
Field Details
-
NAME
- See Also:
-
DEBUG
public static boolean DEBUG
-
-
Constructor Details
-
PortableExecutable
public PortableExecutable(ByteProvider bp, PortableExecutable.SectionLayout layout) throws IOException Constructs a newPortableExecutableusing the specified byte provider and layout- Parameters:
bp- theByteProviderlayout- specifies the layout of the underlying provider and governs RVA resolution- Throws:
IOException- if an I/O error occurs
-
PortableExecutable
public PortableExecutable(ByteProvider bp, PortableExecutable.SectionLayout layout, boolean advancedProcess, boolean parseCliHeaders) throws IOException Constructs a newPortableExecutableusing the specified byte provider and layout- Parameters:
bp- theByteProviderlayout- specifies the layout of the underlying provider and governs RVA resolutionadvancedProcess- if true, the data directories are also processedparseCliHeaders- if true, CLI headers are parsed (if present)- Throws:
IOException- if an I/O error occurs
-
-
Method Details
-
getDOSHeader
Returns the DOS header from the PE image.- Returns:
- the DOS header from the PE image
-
getRichHeader
Returns the rich header from the PE image.- Returns:
- the rich header from the PE image
-
getNTHeader
Returns the NT header from the PE image.- Returns:
- the NT header from the PE image
-
getFileLength
public long getFileLength()Returns the length of thePortableExecutablefile in bytes.- Returns:
- the length of the
PortableExecutablefile in bytes
-