當前位置: 首頁>>代碼示例>>Python>>正文


Python unicorn.UC_ARCH_ARM64屬性代碼示例

本文整理匯總了Python中unicorn.UC_ARCH_ARM64屬性的典型用法代碼示例。如果您正苦於以下問題:Python unicorn.UC_ARCH_ARM64屬性的具體用法?Python unicorn.UC_ARCH_ARM64怎麽用?Python unicorn.UC_ARCH_ARM64使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在unicorn的用法示例。


在下文中一共展示了unicorn.UC_ARCH_ARM64屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import unicorn [as 別名]
# 或者: from unicorn import UC_ARCH_ARM64 [as 別名]
def __init__(self):
        Emulator.__init__(self, "ARM64",
                          unicorn.UC_ARCH_ARM64,
                          unicorn.UC_MODE_ARM,
                          "pc",
                          64,
                          ["sp", "cpsr"])
        self.syscall_regnames = map(lambda x: "x%d" % x, range(0, 8)) + ["x8",
                                                                         "pc"]
        self.stackbot = "fp"
        self.stacktop = "sp"
        self.syscall_reg = "x8" 
開發者ID:bx,項目名稱:bootloader_instrumentation_suite,代碼行數:14,代碼來源:unicorn_trace.py

示例2: __init__

# 需要導入模塊: import unicorn [as 別名]
# 或者: from unicorn import UC_ARCH_ARM64 [as 別名]
def __init__(self):
        super(Arm64, self).__init__()
        self.unicorn_arch = unicorn.UC_ARCH_ARM64
        self.unicorn_mode = unicorn.UC_MODE_ARM
        self.capstone_arch = capstone.CS_ARCH_ARM64
        self.capstone_mode = capstone.CS_MODE_ARM 
開發者ID:iGio90,項目名稱:frick,代碼行數:8,代碼來源:main.py

示例3: getIvarTypeFromFunc

# 需要導入模塊: import unicorn [as 別名]
# 或者: from unicorn import UC_ARCH_ARM64 [as 別名]
def getIvarTypeFromFunc(self, eh, va):
        if va in self.ivarSetters:
            return self.ivarSetters[va]
        elif va in self.notIvarSetters:
            return UNKNOWN
        addr = va
        endVa = idc.get_func_attr(va, idc.FUNCATTR_END)
        if endVa - va < 0x20:
            ivarVa = None
            while addr <= endVa:
                srcOpnd = idc.print_operand(addr, 1)
                # if ivar is the src op for an instruction, assume this function will return it
                if eh.arch == unicorn.UC_ARCH_ARM and "_OBJC_IVAR_$_" in srcOpnd:
                    oploc = idc.get_name_ea_simple(
                        srcOpnd[srcOpnd.find("_OBJC_IVAR_$_"):srcOpnd.find(" ")])
                    if oploc != idc.BADADDR:
                        ivarVa = oploc
                        break
                elif eh.arch == unicorn.UC_ARCH_ARM64:
                    for x in idautils.XrefsFrom(addr):
                        if (idc.get_segm_name(x.to) == "__objc_ivar" and
                                idc.get_name(x.to, idc.ida_name.GN_VISIBLE)[:13] == "_OBJC_IVAR_$_"):
                            ivarVa = x.to
                            break
                elif eh.arch == unicorn.UC_ARCH_X86:
                    if "_OBJC_IVAR_$_" in srcOpnd:
                        ivarVa = idc.get_operand_value(addr, 1)
                        break

                addr = idc.next_head(addr, idc.get_inf_attr(idc.INF_MAX_EA))

            if ivarVa:
                for x in idautils.XrefsTo(ivarVa):
                    if x.frm >= self.objcConst[0] and x.frm < self.objcConst[1]:
                        typeStr = eh.getIDBString(
                            eh.derefPtr(x.frm + eh.size_pointer * 2))
                        self.ivarSetters[va] = typeStr[2:-1]
                        logging.debug("%s is an ivar getter function, returning type %s" % (
                            eh.hexString(va), typeStr[2:-1]))
                        return typeStr[2:-1]
            else:
                logging.debug(
                    "%s determined not to be an ivar getter function", eh.hexString(va))
                self.notIvarSetters.append(va)
        else:
            logging.debug(
                "%s determined not to be an ivar getter function", eh.hexString(va))
            self.notIvarSetters.append(va)
        return UNKNOWN


    # returns class or sel name from IDA name 
開發者ID:fireeye,項目名稱:flare-ida,代碼行數:54,代碼來源:objc2_analyzer.py


注:本文中的unicorn.UC_ARCH_ARM64屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。