Package org.eclipse.cdt.utils.coff
Class PE64
- java.lang.Object
-
- org.eclipse.cdt.utils.coff.PE64
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class PE64 extends java.lang.Object implements java.lang.AutoCloseableThe PE file header consists of an MS-DOS stub, the PE signature, the COFF file Header and an Optional Header.+-------------------+ | DOS-stub | +-------------------+ | file-header | +-------------------+ | optional header | |- - - - - - - - - -| | | | data directories | | | +-------------------+ | | | section headers | | | +-------------------+ | | | section 1 | | | +-------------------+ | | | section 2 | | | +-------------------+ | | | ... | | | +-------------------+ | | | section n | | | +-------------------+
- Since:
- 6.9
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPE64.Attributestatic classPE64.DOSHeaderstatic classPE64.IMAGE_DATA_DIRECTORYstatic classPE64.IMAGE_DEBUG_DIRECTORYclassPE64.ImageDataDirectoryclassPE64.ImportDirectoryEntrystatic classPE64.NTOptionalHeader32static classPE64.NTOptionalHeader64
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddispose()protected voidfinalize()PE64.AttributegetAttribute()static PE64.AttributegetAttribute(byte[] data)static PE64.AttributegetAttribute(java.lang.String file)static PE64.AttributegetAttributes(Coff64.FileHeader filhdr)PE64.DOSHeadergetDOSHeader()Exe.ExeHeadergetExeHeader()Coff64.FileHeadergetFileHeader()java.lang.StringgetFilename()PE64.ImageDataDirectory[]getImageDataDirectories()PE64.NTOptionalHeader32getNTOptionalHeader32()PE64.NTOptionalHeader64getNTOptionalHeader64()Coff64.OptionalHeadergetOptionalHeader()Coff64.SectionHeader[]getSectionHeaders()byte[]getStringTable()java.lang.StringgetStringTableEntry(int offset)ISymbolReadergetSymbolReader()Coff64.Symbol[]getSymbols()static booleanisExeHeader(byte[] e_signature)static booleanisValidMachine(int magic)java.lang.StringtoString()
-
-
-
Constructor Detail
-
PE64
public PE64(java.lang.String filename) throws java.io.IOException- Throws:
java.io.IOException
-
PE64
public PE64(java.lang.String filename, long pos) throws java.io.IOException- Throws:
java.io.IOException
-
PE64
public PE64(java.lang.String filename, long pos, boolean filter) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
isValidMachine
public static boolean isValidMachine(int magic)
-
getAttributes
public static PE64.Attribute getAttributes(Coff64.FileHeader filhdr)
-
isExeHeader
public static boolean isExeHeader(byte[] e_signature)
-
getAttribute
public PE64.Attribute getAttribute() throws java.io.IOException
- Throws:
java.io.IOException
-
getAttribute
public static PE64.Attribute getAttribute(byte[] data) throws java.io.IOException
- Throws:
java.io.IOException
-
getAttribute
public static PE64.Attribute getAttribute(java.lang.String file) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.io.IOException
-
dispose
public void dispose() throws java.io.IOException- Throws:
java.io.IOException
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
getExeHeader
public Exe.ExeHeader getExeHeader()
-
getDOSHeader
public PE64.DOSHeader getDOSHeader()
-
getFileHeader
public Coff64.FileHeader getFileHeader()
-
getOptionalHeader
public Coff64.OptionalHeader getOptionalHeader()
-
getNTOptionalHeader64
public PE64.NTOptionalHeader64 getNTOptionalHeader64()
-
getNTOptionalHeader32
public PE64.NTOptionalHeader32 getNTOptionalHeader32()
-
getImageDataDirectories
public PE64.ImageDataDirectory[] getImageDataDirectories() throws java.io.IOException
- Throws:
java.io.IOException
-
getSectionHeaders
public Coff64.SectionHeader[] getSectionHeaders() throws java.io.IOException
- Throws:
java.io.IOException
-
getSymbols
public Coff64.Symbol[] getSymbols() throws java.io.IOException
- Throws:
java.io.IOException
-
getStringTable
public byte[] getStringTable() throws java.io.IOException- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSymbolReader
public ISymbolReader getSymbolReader()
-
getStringTableEntry
public java.lang.String getStringTableEntry(int offset) throws java.io.IOException- Throws:
java.io.IOException- Since:
- 5.1
-
getFilename
public java.lang.String getFilename()
- Since:
- 5.1
-
-