def insert(self, chunk): """ Insert a new chunk """ chunks = self.chunks() chunk.inserted = True chunks.append(chunk) chunks_sorted = sorted(chunks, cmp=compareChunks) orderChunks(chunks_sorted)
def load(self, offset=None, filemap=None): """ Loads the ELF file and all specific parts """ self.load_binary(offset, filemap) self.load_header() self.load_programs() self.load_sections() self.load_sections_names() self.load_symbols_names() # Now, creating the chunks hierarchy chunks = self.chunks() chunks_sorted = sorted(chunks, key=cmp_to_key(compareChunks)) orderChunks(chunks_sorted)