mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-24 10:09:20 +01:00
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:
parent
927ccec772
commit
f4f5aa0441
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user