def get_inverted(func_ea): # Returns set of relative virtual addresses which are tied to IF and swapped internal_name = _ARRAY_STORAGE_PREFIX + hex( int(func_ea - idaapi.get_imagebase())) internal_id = idc.get_array_id(internal_name) array = idc.get_array_element(idc.AR_STR, internal_id, 0) return set(map(int, array.split()))
def load_long_str_from_idb(array_name): id = idc.get_array_id(array_name) if id == -1: return None max_idx = idc.get_last_index(idc.AR_STR, id) result = [idc.get_array_element(idc.AR_STR, id, idx) for idx in range(max_idx + 1)] return b"".join(result).decode("utf-8")
def load_long_str_from_idb(array_name): id = idc.get_array_id(array_name) if id == -1: return None max_idx = idc.get_last_index(idc.AR_STR, id) result = [] for idx in range(max_idx + 1): e = idc.get_array_element(idc.AR_STR, id, idx) if type(e) == int: e = e.to_bytes((e.bit_length() + 7) // 8, 'little') result.append(e) return b"".join(result).decode("utf-8")
def get_inverted(self): if self.__id != -1: array = idc.get_array_element(idc.AR_STR, self.__id, 0) return set(map(int, array.split())) return set()