trietptm / idapython

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

where is get_instruction_operand #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i'm using one of my old codes ida told me 

AttributeError: 'module' object has no attribute 'get_instruction_operand'

i searched trunk and issues and changelog get_instruction_operand is replaced 
by witch function ? how i can fix?

Original issue reported on code.google.com by hasti.sa...@gmail.com on 4 Dec 2010 at 9:16

GoogleCodeExporter commented 9 years ago
You can access the current decoded instruction in cvar. Something like this:

import idaapi
inslen = idaapi.decode_insn(ea)
ins = idaapi.cvar.cmd
print ins

Original comment by gergely.erdelyi on 4 Dec 2010 at 7:52

GoogleCodeExporter commented 9 years ago
Gergely,

This has been changed in IDA 5.7 after the introduction of process module 
scripts.

Now:

A)
import idautils

ins = idautils.DecodeInstruction(ea)

ins.itype, ins[0].reg, or ins.Operands[0]. ....

B)

inslen = idaapi.decode_insn(ea)
ins = idaapi.cmd # note: no longer in .cvar

Original comment by elias.ba...@gmail.com on 17 Dec 2010 at 4:36