当前位置: 首页>>代码示例>>Python>>正文


Python capstone.CS_GRP_CALL属性代码示例

本文整理汇总了Python中capstone.CS_GRP_CALL属性的典型用法代码示例。如果您正苦于以下问题:Python capstone.CS_GRP_CALL属性的具体用法?Python capstone.CS_GRP_CALL怎么用?Python capstone.CS_GRP_CALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在capstone的用法示例。


在下文中一共展示了capstone.CS_GRP_CALL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: annotate_content

# 需要导入模块: import capstone [as 别名]
# 或者: from capstone import CS_GRP_CALL [as 别名]
def annotate_content(self, node, content):
        if node.obj.is_simprocedure or node.obj.is_syscall:
            return
        for k in content['data']:
            ins = k['_ins']
            if ins.group(capstone.CS_GRP_CALL):
                caddr = ins.operands[0]
                try:
                    addr = int(caddr.value.imm)
                    fm = self.project.kb.functions
                    fname = None
                    if addr in fm:
                        fname = fm[addr].name
                        if fname.find('_Z') == 0:
                            try:
                                fname = self.demangle([fname])[0]
                            except Exception as e:
                                pass
                    
                    if fname:
                        if not ('comment' in k and 'content' in k['comment']):
                            k['comment'] = {
                                'content': "; "+ fname
                            }
                        else:
                            k['comment']['content'] += ", " + fname

                        k['comment']['color'] ='gray'
                        k['comment']['align'] = 'LEFT'
                except: 
                    pass 
开发者ID:axt,项目名称:bingraphvis,代码行数:33,代码来源:annotator.py

示例2: is_call

# 需要导入模块: import capstone [as 别名]
# 或者: from capstone import CS_GRP_CALL [as 别名]
def is_call(i):
    return i.group(CS_GRP_CALL) or i.id in JUMPS_LINK 
开发者ID:plasma-disassembler,项目名称:plasma,代码行数:4,代码来源:utils.py

示例3: is_call

# 需要导入模块: import capstone [as 别名]
# 或者: from capstone import CS_GRP_CALL [as 别名]
def is_call(i):
    return i.group(CS_GRP_CALL) 
开发者ID:plasma-disassembler,项目名称:plasma,代码行数:4,代码来源:utils.py

示例4: instruction_from_cs_insn

# 需要导入模块: import capstone [as 别名]
# 或者: from capstone import CS_GRP_CALL [as 别名]
def instruction_from_cs_insn(csInsn, executable):
    groups = []

    if executable.architecture in (ARCHITECTURE.ARM, ARCHITECTURE.ARM_64):
        if csInsn.mnemonic.startswith('bl'):
            groups.append(Instruction.GRP_CALL)
        elif csInsn.mnemonic.startswith('b'):
            groups.append(Instruction.GRP_JUMP)
    else:
        if capstone.CS_GRP_JUMP in csInsn.groups:
            groups.append(Instruction.GRP_JUMP)
        if capstone.CS_GRP_CALL in csInsn.groups:
            groups.append(Instruction.GRP_CALL)

    instruction = Instruction(csInsn.address, csInsn.size, csInsn.bytes, csInsn.mnemonic, [], groups, csInsn, executable)

    # We manually pull out the instruction details here so that capstone doesn't deepcopy everything which burns time
    # and memory
    detail = ctypes.cast(csInsn._raw.detail, ctypes.POINTER(capstone._cs_detail)).contents

    if executable.architecture == ARCHITECTURE.X86 or executable.architecture == ARCHITECTURE.X86_64:
        detail = detail.arch.x86
    elif executable.architecture == ARCHITECTURE.ARM:
        detail = detail.arch.arm
    elif executable.architecture == ARCHITECTURE.ARM_64:
        detail = detail.arch.arm64

    operands = [operand_from_cs_op(detail.operands[i], instruction) for i in range(detail.op_count)]

    instruction.operands = operands

    return instruction 
开发者ID:osirislab,项目名称:dispatch,代码行数:34,代码来源:constructs.py


注:本文中的capstone.CS_GRP_CALL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。