olahstatistik / idapython

Automatically exported from code.google.com/p/idapython
Other
0 stars 0 forks source link

GetOpType and GetOperandValue are destructive #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The functions GetOpType and GetOperandValue affect the DB. This is
unexpected of 'Get' functions.

The problem is that these functions call ua_code, which creates an
instruction. This is obviously a problem if the desired address is not a
code at all, but can also cause undesired result when the address already
contains an instruction.

The problem can be easily fixed by using ua_ana0 instead. It sets the 'cmd'
variable, thus allowing 'get_current_instruction' to work properly, but
without changing anything in the DB.

What version of the product are you using? On what operating system?
IDAPython 1.0.0

Original issue reported on code.google.com by ofe...@gmail.com on 29 Jan 2009 at 12:35

GoogleCodeExporter commented 9 years ago
The problem should fixed. Both functions now use decode_insn() which should not 
be destructive.

Thanks for the report!

Original comment by gergely.erdelyi on 22 Mar 2009 at 3:30