def __init__(self, abi): from peachpy.formats.macho.file import SegmentCommand, SymbolTableCommand from peachpy.formats.macho.section import StringTable, TextSection, ConstSection self.abi = abi self.segment_command = SegmentCommand(abi) self.segment_command.section_count = 0 self.sections = list() text_section = TextSection(abi) self.bind_section(text_section) const_section = ConstSection(abi) self.bind_section(const_section) self.symbol_table_command = SymbolTableCommand(abi) self.symbols = list() self.string_table = StringTable()
def __init__(self, abi): from peachpy.formats.macho.section import Segment, TextSection, ConstSection, StringTable, SymbolTable self.abi = abi self.segments = list() self.text_segment = Segment("__TEXT") self.add_segment(self.text_segment) self.text_section = TextSection() self.text_segment.add_section(self.text_section) self.const_section = ConstSection() self.text_segment.add_section(self.const_section) self.string_table = StringTable() self.symbol_table = SymbolTable(self.string_table)