本文整理匯總了Python中unicorn.UC_MODE_32屬性的典型用法代碼示例。如果您正苦於以下問題:Python unicorn.UC_MODE_32屬性的具體用法?Python unicorn.UC_MODE_32怎麽用?Python unicorn.UC_MODE_32使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類unicorn
的用法示例。
在下文中一共展示了unicorn.UC_MODE_32屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import unicorn [as 別名]
# 或者: from unicorn import UC_MODE_32 [as 別名]
def __init__(self, trace=True, sca_mode=False, local_vars={}):
super().__init__(trace, sca_mode)
self.emu = uc.Uc(uc.UC_ARCH_X86, uc.UC_MODE_32)
self.disasm = cs.Cs(cs.CS_ARCH_X86, cs.CS_MODE_32)
self.disasm.detail = True
self.word_size = 4
self.endianness = "little"
self.page_size = self.emu.query(uc.UC_QUERY_PAGE_SIZE)
self.page_shift = self.page_size.bit_length() - 1
self.pc = uc.x86_const.UC_X86_REG_EIP
known_regs = [i[len('UC_X86_REG_'):] for i in dir(uc.x86_const) if '_REG' in i]
self.reg_map = {r.lower(): getattr(uc.x86_const, 'UC_X86_REG_'+r) for r in known_regs}
self.stubbed_functions = local_vars
self.setup(sca_mode)
self.reset_stack()
示例2: __init__
# 需要導入模塊: import unicorn [as 別名]
# 或者: from unicorn import UC_MODE_32 [as 別名]
def __init__(self):
Emulator.__init__(self, "X86",
unicorn.UC_ARCH_X86, unicorn.UC_MODE_32,
"eip",
32,
["esp", "eip", "gs", "fs", "ds"
])
# "ss", "cs", "ds", "es",
self.syscall_regnames = ["edi", "esi", "ecx", "edx",
"ebx", "eax", "ebp", "esp"]
self.stackbot = "ebp"
self.stacktop = "esp"