Package org.eclipse.cdt.utils.coff
Class PE64
- java.lang.Object
-
- org.eclipse.cdt.utils.coff.PE64
-
- All Implemented Interfaces:
AutoCloseable
public class PE64 extends Object implements AutoCloseable
The 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 class
PE64.Attribute
static class
PE64.DOSHeader
static class
PE64.IMAGE_DATA_DIRECTORY
static class
PE64.IMAGE_DEBUG_DIRECTORY
class
PE64.ImageDataDirectory
class
PE64.ImportDirectoryEntry
static class
PE64.NTOptionalHeader32
static class
PE64.NTOptionalHeader64
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
dispose()
protected void
finalize()
PE64.Attribute
getAttribute()
static PE64.Attribute
getAttribute(byte[] data)
static PE64.Attribute
getAttribute(String file)
static PE64.Attribute
getAttributes(Coff64.FileHeader filhdr)
PE64.DOSHeader
getDOSHeader()
Exe.ExeHeader
getExeHeader()
Coff64.FileHeader
getFileHeader()
String
getFilename()
PE64.ImageDataDirectory[]
getImageDataDirectories()
PE64.NTOptionalHeader32
getNTOptionalHeader32()
PE64.NTOptionalHeader64
getNTOptionalHeader64()
Coff64.OptionalHeader
getOptionalHeader()
Coff64.SectionHeader[]
getSectionHeaders()
byte[]
getStringTable()
String
getStringTableEntry(int offset)
ISymbolReader
getSymbolReader()
Coff64.Symbol[]
getSymbols()
static boolean
isExeHeader(byte[] e_signature)
static boolean
isValidMachine(int magic)
String
toString()
-
-
-
Field Detail
-
NL
public static final String NL
-
-
Constructor Detail
-
PE64
public PE64(String filename) throws IOException
- Throws:
IOException
-
PE64
public PE64(String filename, long pos) throws IOException
- Throws:
IOException
-
PE64
public PE64(String filename, long pos, boolean filter) throws IOException
- Throws:
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 IOException
- Throws:
IOException
-
getAttribute
public static PE64.Attribute getAttribute(byte[] data) throws IOException
- Throws:
IOException
-
getAttribute
public static PE64.Attribute getAttribute(String file) throws IOException
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
dispose
public void dispose() throws IOException
- Throws:
IOException
-
finalize
protected void finalize() throws 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 IOException
- Throws:
IOException
-
getSectionHeaders
public Coff64.SectionHeader[] getSectionHeaders() throws IOException
- Throws:
IOException
-
getSymbols
public Coff64.Symbol[] getSymbols() throws IOException
- Throws:
IOException
-
getStringTable
public byte[] getStringTable() throws IOException
- Throws:
IOException
-
getSymbolReader
public ISymbolReader getSymbolReader()
-
getStringTableEntry
public String getStringTableEntry(int offset) throws IOException
- Throws:
IOException
- Since:
- 5.1
-
getFilename
public String getFilename()
- Since:
- 5.1
-
-