當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。