idc.py: Fixed GetOpType() and GetOperandValue() to use decode_insn() so they are not destructive

idc.py: Fixed MakeCode() to use the new create_insn()
This commit is contained in:
gergely.erdelyi 2009-03-22 15:27:46 +00:00
parent 927ccec772
commit f4f5aa0441

View File

@ -578,7 +578,7 @@ def MakeCode(ea):
would overlap with existing items, etc) otherwise returns length of the would overlap with existing items, etc) otherwise returns length of the
instruction in bytes instruction in bytes
""" """
return idaapi.ua_code(ea) return idaapi.create_insn(ea)
def AnalyzeArea(sEA, eEA): def AnalyzeArea(sEA, eEA):
@ -2096,7 +2096,7 @@ def GetOpType(ea, n):
@return: any of o_* constants or -1 on error @return: any of o_* constants or -1 on error
""" """
inslen = idaapi.ua_code(ea) inslen = idaapi.decode_insn(ea)
if inslen == 0: if inslen == 0:
return -1 return -1
@ -2169,7 +2169,7 @@ def GetOperandValue(ea, n):
operand is a register phrase => phrase number operand is a register phrase => phrase number
otherwise => -1 otherwise => -1
""" """
inslen = idaapi.ua_code(ea) inslen = idaapi.decode_insn(ea)
if inslen == 0: if inslen == 0:
return -1 return -1