Class PE64

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class PE64
    extends java.lang.Object
    implements java.lang.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
    • Field Detail

      • NL

        public static final java.lang.String NL
    • 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)
      • 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:
        close in interface java.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:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • 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:
        toString in class java.lang.Object
      • 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