def yatest_reference_views(self): addr = yaunit.get_next_function() f = idaapi.get_flags_novalue(addr) while not idaapi.isNum1(f) and not idaapi.isOff(f, 1): addr += idc.ItemSize(addr) f = idaapi.get_flags_novalue(addr) self.assertTrue(idaapi.set_offset(addr, self.operand, self.reference_addr)) yaunit.save('reference_view_addr', addr)
def yatest_reference_views(self): eas = [] for (operand, is_num, reference) in tests: ea = yaunit.get_next_function() f = idaapi.get_flags_novalue(ea) while not is_num(f) and not idaapi.isOff(f, operand): ea += idc.ItemSize(ea) f = idaapi.get_flags_novalue(ea) self.assertTrue(idaapi.set_offset(ea, operand, reference)) eas.append(ea) yaunit.save('reference_views', eas)
def name_cmt_long(ea, name, cmt): idaapi.set_name(ea, name) idaapi.set_cmt(ea, cmt, False) # nonrepeatable comment idaapi.doDwrd(ea, 4) idaapi.set_offset(ea, 0, 0)
def name_long(ea, name): idaapi.set_name(ea, name) idaapi.doDwrd(ea, 4) idaapi.set_offset(ea, 0, 0)
def name_dword_array(ea, name, nitems): idaapi.set_name(ea, name) idaapi.create_data(ea, idaapi.dword_flag(), 4 * nitems, idaapi.BADNODE) idaapi.set_offset(ea, 0, 0)
def name_array(ea, name, nitems): idaapi.set_name(ea, name) idc.make_array(ea, nitems) idaapi.set_offset(ea, 0, 0)
def name_long(ea, name): idaapi.set_name(ea, name) idaapi.create_dword(ea, 4) idaapi.set_offset(ea, 0, 0)
def name_word(ea, name): idaapi.set_name(ea, name) idaapi.create_word(ea, 2) idaapi.set_offset(ea, 0, 0)
def name_byte(ea, name): idaapi.set_name(ea, name) idaapi.create_byte(ea, 1) idaapi.set_offset(ea, 0, 0)