Search in sources :

Example 1 with RsrcSection

use of org.phoenicis.win32.pe.rsrc.RsrcSection in project POL-POM-5 by PlayOnLinux.

the class PEReader method parseExecutable.

public PEFile parseExecutable(InputStream inputStream) throws IOException {
    try (CountingInputStream executableInputStream = new CountingInputStream(inputStream)) {
        final ImageDOSHeader imageDOSHeader = readDosHeader(executableInputStream);
        final byte[] realModeStubProgram = readRealModeStubProgram(executableInputStream, imageDOSHeader);
        final ImageNTHeaders imageNTHeaders = readImageNTHeaders(executableInputStream);
        final SectionHeader[] sectionHeaders = readSectionHeaders(executableInputStream, imageNTHeaders);
        final RsrcSection resourceSection = readResourceSection(executableInputStream, sectionHeaders);
        return new PEFile(imageDOSHeader, realModeStubProgram, imageNTHeaders, sectionHeaders, resourceSection);
    }
}
Also used : RsrcSection(org.phoenicis.win32.pe.rsrc.RsrcSection) CountingInputStream(org.apache.commons.io.input.CountingInputStream)

Aggregations

CountingInputStream (org.apache.commons.io.input.CountingInputStream)1 RsrcSection (org.phoenicis.win32.pe.rsrc.RsrcSection)1