@Override public int getOrDecideSize(Map<Element, LayoutDecisionMap> alreadyDecided, int sizeHint) { return (elements.sectionsCount()) * IMAGE_SECTION_HEADER.totalsize; }
/** * Logically create an empty SectionHeaderTable. This is a no-op, except to add an Element * to the enclosing ObjectFile. */ public SectionHeaderTable() { super("ELFSectionHeaderTable"); // assert that we do not have any other sections than shstrtab in the file yet assert elements.sectionsCount() == 1; }
public short getShNum() { return (short) ELFObjectFile.this.elements.sectionsCount(); }
public List<Section> getSections() { List<Section> sections = new ArrayList<>(elements.sectionsCount()); Iterator<Section> it = elements.sectionsIterator(); while (it.hasNext()) { sections.add(it.next()); } return sections; }
public List<PECoffSection> getPECoffSections() { List<PECoffSection> sections = new ArrayList<>(elements.sectionsCount()); Iterator<Section> it = elements.sectionsIterator(); while (it.hasNext()) { PECoffSection pe = (PECoffSection) it.next(); sections.add(pe); } return sections; }
assert i == sectionsCount(); return size();
@Override public int getOrDecideSize(Map<Element, LayoutDecisionMap> alreadyDecided, int sizeHint) { // our size is: // one per section in the file, plus one dummy, times the size of one entry SectionHeaderEntryStruct s = new SectionHeaderEntryStruct(); OutputAssembler oa = AssemblyBuffer.createOutputAssembler(getDataEncoding().toByteOrder()); s.write(oa); int entrySize = oa.pos(); return (elements.sectionsCount() + 1) * entrySize; }
assert elements.sectionsCount() == currentSectionIndex;