def get_fpu_regs(name): global rv assert (idaapi.is_reg_float(name)) rv = idaapi.regval_t() rv.clear() if idaapi.get_reg_val(name, rv): ptr = int(rv.get_data()) data = ctypes.cast(ptr, ctypes.POINTER(ctypes.c_uint8)) re = [] f80 = 0 for i in range(2, 12): b8 = data[i] re.append(b8) f80 = f80 | (b8 << (8 * i)) f64 = 0 f64_l = convert_f80le_to_f64le(re) for i in range(8): f64 = (f64 << 8) | f64_l[7 - i] return [f80, f64] raise ('fk names')
def get_xmm(name): rv = idaapi.regval_t() if idaapi.get_reg_val(name, rv): return int(rv.bytes()[::-1].encode('hex'), 16) raise ('fk names')
#used to follow instructions when debug import idaapi x=0 while x<100: idaapi.step_over() GetDebuggerEvent(WFNE_SUSP, -1) rv = idaapi.regval_t() idaapi.get_reg_val('EIP',rv) print GetDisasm(rv.ival) if GetMnem(rv.ival) == "retn": break x = x + 1