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
Hi. Here is a script to step-into 10 times. I want to have an updated version of EIP value with idaapi.get_reg_val() API If i run this code here is what i get.
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
0xffffffffffffffffL
Although the actual EIP value is valid all the time I've also tried other path
while ea !=0x0040af75:
idaapi.step_into()
eip = GetRegValue('EIP')
print eip
But then I just get pure error, the meaning of which is misterious to me
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?
So it looks like either way it calls this low-level func - get_reg_val but can't use the string argument normaly. Both theese functions get_reg_val and GetRegValue() work fine if not within a loop. Help me
RIP
instead ofEIP
?