use of org.apache.commons.io.input.CountingInputStream in project phoenicis by PhoenicisOrg.
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);
}
}
Aggregations