@Test public void testGetSections() throws Exception { PEFile file = new PEFile(new File("target/test-classes/wineyes.exe")); List<Section> sections = file.getSections(); assertNotNull(sections); assertFalse("No section found", sections.isEmpty()); for (Section section : file.getSections()) { assertNotNull("null section found", section); assertEquals(0, section.getPointerToRelocations()); assertEquals(0, section.getPointerToLineNumbers()); assertEquals(0, section.getNumberOfRelocations()); assertEquals(0, section.getNumberOfLineNumbers()); } }
public synchronized List<Section> getSections() { List<Section> sections = new ArrayList<>(); int sectionTableOffset = getDataDirectoryOffset() + 8 * getNumberOfRvaAndSizes(); for (int i = 0; i < getNumberOfSections(); i++) { sections.add(new Section(this, sectionTableOffset + 40 * i)); } return sections; }
PEFile implements Signable, Closeable { public synchronized List<Section> getSections() { List<Section> sections = new ArrayList<>(); int sectionTableOffset = getDataDirectoryOffset() + 8 * getNumberOfRvaAndSizes(); for (int i = 0; i < getNumberOfSections(); i++) { sections.add(new Section(this, sectionTableOffset + 40 * i)); } return sections; } }
PEFile implements Signable, Closeable { public synchronized List<Section> getSections() { List<Section> sections = new ArrayList<>(); int sectionTableOffset = getDataDirectoryOffset() + 8 * getNumberOfRvaAndSizes(); for (int i = 0; i < getNumberOfSections(); i++) { sections.add(new Section(this, sectionTableOffset + 40 * i)); } return sections; } PEFile(File file);  PEFile(SeekableByteChannel channel); }
PEFile implements Signable, Closeable { public synchronized List<Section> getSections() { List<Section> sections = new ArrayList<>(); int sectionTableOffset = getDataDirectoryOffset() + 8 * getNumberOfRvaAndSizes(); for (int i = 0; i < getNumberOfSections(); i++) { sections.add(new Section(this, sectionTableOffset + 40 * i)); } return sections; } PEFile(File file);  PEFile(SeekableByteChannel channel); static boolean isPEFile(File file); void save(); synchronized void close(); MachineType getMachineType(); int getNumberOfSections(); Date getTimeDateStamp(); long getPointerToSymbolTable(); long getNumberOfSymbols(); int getSizeOfOptionalHeader(); int getCharacteristics(); PEFormat getFormat(); int getMajorLinkerVersion(); int getMinorLinkerVersion(); long getSizeOfCode(); long getSizeOfInitializedData(); long getSizeOfUninitializedData(); long getAddressOfEntryPoint(); long getBaseOfCode(); long getBaseOfData(); long getImageBase(); long getSectionAlignment(); long getFileAlignment(); int getMajorOperatingSystemVersion(); int getMinorOperatingSystemVersion(); int getMajorImageVersion(); int getMinorImageVersion(); int getMajorSubsystemVersion(); int getMinorSubsystemVersion(); long getWin32VersionValue(); long getSizeOfImage(); long getSizeOfHeaders(); long getCheckSum(); synchronized long computeChecksum(); synchronized void updateChecksum(); Subsystem getSubsystem(); int getDllCharacteristics(); long getSizeOfStackReserve(); long getSizeOfStackCommit(); long getSizeOfHeapReserve(); long getSizeOfHeapCommit(); long getLoaderFlags(); int getNumberOfRvaAndSizes(); DataDirectory getDataDirectory(DataDirectoryType type); synchronized void writeDataDirectory(DataDirectoryType type, byte[] data); @Override synchronized List<CMSSignedData> getSignatures(); @Override void setSignature(CMSSignedData signature); synchronized List<Section> getSections(); void printInfo(OutputStream out); void printInfo(PrintWriter out); @Override synchronized byte[] computeDigest(MessageDigest digest); byte[] computeDigest(DigestAlgorithm algorithm); @Override ASN1Object createIndirectData(DigestAlgorithm digestAlgorithm); synchronized void pad(int multiple); }
PEFile implements Signable, Closeable { public synchronized List<Section> getSections() { List<Section> sections = new ArrayList<>(); int sectionTableOffset = getDataDirectoryOffset() + 8 * getNumberOfRvaAndSizes(); for (int i = 0; i < getNumberOfSections(); i++) { sections.add(new Section(this, sectionTableOffset + 40 * i)); } return sections; } PEFile(File file);  PEFile(SeekableByteChannel channel); static boolean isPEFile(File file); void save(); synchronized void close(); MachineType getMachineType(); int getNumberOfSections(); Date getTimeDateStamp(); long getPointerToSymbolTable(); long getNumberOfSymbols(); int getSizeOfOptionalHeader(); int getCharacteristics(); PEFormat getFormat(); int getMajorLinkerVersion(); int getMinorLinkerVersion(); long getSizeOfCode(); long getSizeOfInitializedData(); long getSizeOfUninitializedData(); long getAddressOfEntryPoint(); long getBaseOfCode(); long getBaseOfData(); long getImageBase(); long getSectionAlignment(); long getFileAlignment(); int getMajorOperatingSystemVersion(); int getMinorOperatingSystemVersion(); int getMajorImageVersion(); int getMinorImageVersion(); int getMajorSubsystemVersion(); int getMinorSubsystemVersion(); long getWin32VersionValue(); long getSizeOfImage(); long getSizeOfHeaders(); long getCheckSum(); synchronized long computeChecksum(); synchronized void updateChecksum(); Subsystem getSubsystem(); int getDllCharacteristics(); long getSizeOfStackReserve(); long getSizeOfStackCommit(); long getSizeOfHeapReserve(); long getSizeOfHeapCommit(); long getLoaderFlags(); int getNumberOfRvaAndSizes(); DataDirectory getDataDirectory(DataDirectoryType type); synchronized void writeDataDirectory(DataDirectoryType type, byte[] data); @Override synchronized List<CMSSignedData> getSignatures(); @Override void setSignature(CMSSignedData signature); synchronized List<Section> getSections(); void printInfo(OutputStream out); void printInfo(PrintWriter out); @Override synchronized byte[] computeDigest(MessageDigest digest); byte[] computeDigest(DigestAlgorithm algorithm); @Override ASN1Object createIndirectData(DigestAlgorithm digestAlgorithm); synchronized void pad(int multiple);  }