Exemple #1
0
 def as_bytearray(self):
     from peachpy.encoder import Encoder
     return Encoder.uint16le(self.abi.mscoff_machine_type) + \
         Encoder.uint16le(self.section_count) + \
         Encoder.uint32le(self.timestamp or 0) + \
         Encoder.uint32le(self.symbol_table_offset or 0) + \
         Encoder.uint32le(self.symbol_count) + \
         Encoder.uint16le(0) + \
         Encoder.uint16le(self.flags)
Exemple #2
0
 def as_bytearray(self):
     from peachpy.encoder import Encoder
     from peachpy.util import is_int
     if is_int(self.name):
         entry = Encoder.uint32le(0) + Encoder.uint32le(self.name)
     else:
         entry = Encoder.fixed_string(self.name, 8)
     return entry + \
         Encoder.uint32le(self.value) + \
         Encoder.uint16le(self.section_index) + \
         Encoder.uint16le(self.symbol_type) + \
         Encoder.uint8(self.storage_class) + \
         Encoder.uint8(self.auxiliary_entries)
Exemple #3
0
    def as_bytearray(self):
        from peachpy.encoder import Encoder
        from peachpy.util import is_int

        if is_int(self.name):
            header = Encoder.fixed_string("/" + str(self.name), 8)
        else:
            header = Encoder.fixed_string(self.name, 8)
        return header + \
            Encoder.uint32le(self.memory_size) + \
            Encoder.uint32le(self.memory_address) + \
            Encoder.uint32le(self.content_size) + \
            Encoder.uint32le(self.content_offset) + \
            Encoder.uint32le(self.relocations_offset or 0) + \
            Encoder.uint32le(self.line_numbers_offset or 0) + \
            Encoder.uint16le(self.relocations_count) + \
            Encoder.uint16le(self.line_numbers_count) + \
            Encoder.uint32le(self.flags)