Package ghidra.app.util.bin.format.pe
Class PortableExecutable
java.lang.Object
ghidra.app.util.bin.format.pe.PortableExecutable
A class to manage loading Portable Executables (PE).
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumIndicates how sections of this PE are laid out in the underlying ByteProvider.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new Portable Executable using the specified byte provider and layout.PortableExecutable(ByteProvider bp, PortableExecutable.SectionLayout layout, boolean advancedProcess, boolean parseCliHeaders) Constructs a new Portable Executable using the specified byte provider and layout.
- 
Method SummaryModifier and TypeMethodDescriptionstatic intcomputeAlignment(int value, int alignment) Returns the DOS header from the PE image.longReturns the NT header from the PE image.Returns the Rich header from the PE image.voidwriteHeader(RandomAccessFile raf, DataConverter dc) 
- 
Field Details- 
NAME- See Also:
 
- 
DEBUGpublic static boolean DEBUG
 
- 
- 
Constructor Details- 
PortableExecutablepublic PortableExecutable(ByteProvider bp, PortableExecutable.SectionLayout layout) throws IOException Constructs a new Portable Executable using the specified byte provider and layout.Same as calling createFileAlignedPortableExecutable(factory, bp, layout, true, false)- Parameters:
- bp- the byte provider
- layout- specifies the layout of the underlying provider and governs RVA resolution
- Throws:
- IOException- if an I/O error occurs.
- See Also:
 
- 
PortableExecutablepublic PortableExecutable(ByteProvider bp, PortableExecutable.SectionLayout layout, boolean advancedProcess, boolean parseCliHeaders) throws IOException Constructs a new Portable Executable using the specified byte provider and layout.- Parameters:
- bp- the byte provider
- layout- specifies the layout of the underlying provider and governs RVA resolution
- advancedProcess- if true, the data directories are also processed
- parseCliHeaders- if true, CLI headers are parsed (if present)
- Throws:
- IOException- if an I/O error occurs.
 
 
- 
- 
Method Details- 
getDOSHeaderReturns the DOS header from the PE image.- Returns:
- the DOS header from the PE image
 
- 
getRichHeaderReturns the Rich header from the PE image.- Returns:
- the Rich header from the PE image
 
- 
getNTHeaderReturns the NT header from the PE image.- Returns:
- the NT header from the PE image
 
- 
writeHeader- Throws:
- IOException
 
- 
computeAlignmentpublic static int computeAlignment(int value, int alignment) 
- 
getFileLengthpublic long getFileLength()
 
-