本文整理匯總了Python中idaapi.o_reg方法的典型用法代碼示例。如果您正苦於以下問題:Python idaapi.o_reg方法的具體用法?Python idaapi.o_reg怎麽用?Python idaapi.o_reg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類idaapi
的用法示例。
在下文中一共展示了idaapi.o_reg方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _process_stub_template_1
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import o_reg [as 別名]
def _process_stub_template_1(stub):
"""A template to match the following stub pattern:
ADRP X<reg>, #<offset>@PAGE
LDR X<reg>, [X<reg>, #<offset>@PAGEOFF]
BR X<reg>
"""
adrp, ldr, br = idau.Instructions(stub, count=3)
if (adrp.itype == idaapi.ARM_adrp and adrp.Op1.type == idaapi.o_reg
and adrp.Op2.type == idaapi.o_imm
and ldr.itype == idaapi.ARM_ldr and ldr.Op1.type == idaapi.o_reg
and ldr.Op2.type == idaapi.o_displ and ldr.auxpref == 0
and br.itype == idaapi.ARM_br and br.Op1.type == idaapi.o_reg
and adrp.Op1.reg == ldr.Op1.reg == ldr.Op2.reg == br.Op1.reg):
offset = adrp.Op2.value + ldr.Op2.addr
target = idau.read_word(offset)
if target and idau.is_mapped(target):
return target
示例2: has_reg
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import o_reg [as 別名]
def has_reg(self):
return self._type in (idaapi.o_reg, idaapi.o_displ, idaapi.o_phrase)
示例3: register
# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import o_reg [as 別名]
def register(ea, op):
'''Operand type decoder for ``idaapi.o_reg`` which returns a ``register_t``.'''
get_dtype_attribute = operator.attrgetter('dtyp' if idaapi.__version__ < 7.0 else 'dtype')
dtype_by_size = utils.fcompose(idaapi.get_dtyp_by_size, six.byte2int) if idaapi.__version__ < 7.0 else idaapi.get_dtype_by_size
global architecture
if op.type in {idaapi.o_reg}:
res, dt = op.reg, dtype_by_size(database.config.bits()//8)
return architecture.by_indextype(res, get_dtype_attribute(op))
optype = "{:s}({:d})".format('idaapi.o_reg', idaapi.o_reg)
raise E.InvalidTypeOrValueError(u"{:s}.register({:#x}, {!r}) : Expected operand type `{:s}` but operand type {:d} was received.".format('.'.join((__name__, 'operand_types')), ea, op, optype, op.type))