def __repr__(self): if self.size != 0: return ' '.join(('STACK CFI INIT', hex_str(self.address), hex_str(self.size), ' '.join(self.entries))) else: return ' '.join( ('STACK CFI', hex_str(self.address), ' '.join(self.entries)))
def __str__(self): res = 'L' if self.address_diff: res += hex_str(self.address_diff) res += ':' if self.size_diff: res += hex_str(self.size_diff) return res + '\n'
def __repr__(self): res = ' '.join( ('FUNC', hex_str(self.address), hex_str(self.size), hex_str(self.parameter_size), ' '.join(self.name))) + '\n' for line in self.lines: res = res + str(line) + '\n' return res
def __str__(self): if self.size_diff: res = hex_str(self.size_diff // 8) else: res = '' if self.address_diff: res += ':' + hex_str(self.address_diff) return res
def __repr__(self): res = 'Substitute ' + hex_str( self.deleted_size) + ' lines for ' + hex_str(len( self.added_lines)) + ' lines at ' + hex_str(self.offset) + '\n' for line in self.deleted_lines: res += str(line) + '\n' res += 'For:\n' for line in self.added_lines: res += str(line) + '\n' return res
def __str__(self): res = '' prev_idx = -1 for (idx, func) in enumerate(self.func_patches): patch = str(func) # We won't output empty patches. We simply prepend an offset to every function patch # that represents the number of empty patches that went before. If the offset is 0, # don't encode it. if patch != '\n': offset = idx - prev_idx - 1 if offset: res += hex_str(offset) res += 'F' + patch prev_idx = idx return res
def __str__(self): # If it exists, encode the stack offset in the function patch header. Else simply finish the header. if self.stack_patch: res = str(self.stack_patch) + '\n' else: res = '\n' # We encode the relative offsets between patches in such a way that two patches on two lines right after each other have offset 0 # If the offset is 0 we don't encode it. prev_offset = -1 for patch in self.patches: rel_offset = patch.offset - prev_offset - 1 if rel_offset: res += hex_str(rel_offset) res += str(patch) prev_offset = patch.offset return res
def __str__(self): return 'D' + hex_str(self.size) + '\n'
def __repr__(self): res = 'Delete ' + hex_str(self.size) + ' lines at ' + hex_str( self.offset) + '\n' for line in self.lines: res += str(line) + '\n' return res
def __repr__(self): return 'Patch the stack record with size difference: ' + hex_str( self.size_diff) + ' and address difference: ' + hex_str( self.address_diff) + '\n'
def __str__(self): res = 'A' + hex_str(len(self.lines)) + '\n' for line in self.lines: res += str(line) + '\n' return res
def __str__(self): res = 'S' + hex_str(self.deleted_size) + ':' + hex_str( len(self.added_lines)) + '\n' for line in self.added_lines: res += str(line) + '\n' return res
def __repr__(self): res = 'Add ' + hex_str(len(self.lines)) + ' lines at ' + hex_str( self.offset) + '\n' for line in self.lines: res += str(line) + '\n' return res
def __repr__(self): res = 'Change line at ' + hex_str(self.offset) + '\n' res += 'Address diff: ' + hex_str(self.address_diff) + '\n' res += 'Size diff: ' + hex_str(self.size_diff) + '\n' return res
def __repr__(self): return ' '.join( (hex_str(self.address), hex_str(self.size), str(self.location)))
def __repr__(self): return ' '.join(('PUBLIC', hex_str(self.address), hex_str(self.parameter_size), ' '.join(self.name)))