import idaapi
x=0
while x<10:
idaapi.step_into()
rv = idaapi.regval_t()
idaapi.get_reg_val('EIP',rv)
ea = rv.ival
print hex(ea)
x+=1
你好。这是一个可以进入 10 次的脚本。我想使用 idaapi.get_reg_val() API 获得更新版本的 EIP 值如果我在这里运行此代码就是我得到的。
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
虽然实际 EIP 值一直有效我也尝试过其他路径
while ea !=0x0040af75:
idaapi.step_into()
eip = GetRegValue('EIP')
print eip
但是后来我得到了纯粹的错误,其含义对我来说很神秘
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "C:\Program Files (x86)\IDA 6.8\python\idc.py", line 7889, in GetRegValue
assert res, "get_reg_val() failed, bogus register name ('%s') perhaps?" % name
AssertionError: get_reg_val() failed, bogus register name ('EIP') perhaps?
所以它看起来像它调用这个低级函数的任何一种方式 - get_reg_val 但不能正常使用字符串参数。如果不在循环中,这两个函数 get_reg_val 和 GetRegValue() 都可以正常工作。帮我