本文整理汇总了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))