Merge branch 'dev' into uc-py-next
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# New and improved Unicorn Python bindings by elicn
|
||||
# based on Nguyen Anh Quynnh's work
|
||||
|
||||
from . import arm_const, arm64_const, mips_const, sparc_const, m68k_const, x86_const, riscv_const
|
||||
from . import arm_const, arm64_const, mips_const, sparc_const, m68k_const, x86_const, riscv_const, s390x_const, tricore_const
|
||||
from .unicorn_const import *
|
||||
from .unicorn import Uc, ucsubclass, uc_version, uc_arch_supported, version_bind, debug, UcError, __version__
|
||||
|
||||
@@ -1073,6 +1073,11 @@ class Uc(RegStateManager):
|
||||
def ctl_flush_tb(self) -> None:
|
||||
self.__ctl_w(uc.UC_CTL_TB_FLUSH)
|
||||
|
||||
def ctl_tlb_mode(self, mode: int) -> None:
|
||||
self.__ctl_w(uc.UC_CTL_TLB_TYPE,
|
||||
(ctypes.c_uint, mode)
|
||||
)
|
||||
|
||||
|
||||
class UcContext(RegStateManager):
|
||||
def __init__(self, h, arch: int, mode: int):
|
||||
|
||||
@@ -104,6 +104,7 @@ UC_HOOK_MEM_READ_AFTER = 8192
|
||||
UC_HOOK_INSN_INVALID = 16384
|
||||
UC_HOOK_EDGE_GENERATED = 32768
|
||||
UC_HOOK_TCG_OPCODE = 65536
|
||||
UC_HOOK_TLB_FILL = 131072
|
||||
UC_HOOK_MEM_UNMAPPED = 112
|
||||
UC_HOOK_MEM_PROT = 896
|
||||
UC_HOOK_MEM_READ_INVALID = 144
|
||||
@@ -121,6 +122,9 @@ UC_CTL_IO_WRITE = 1
|
||||
UC_CTL_IO_READ = 2
|
||||
UC_CTL_IO_READ_WRITE = 3
|
||||
|
||||
UC_TLB_CPU = 0
|
||||
UC_TLB_VIRTUAL = 1
|
||||
|
||||
UC_CTL_UC_MODE = 0
|
||||
UC_CTL_UC_PAGE_SIZE = 1
|
||||
UC_CTL_UC_ARCH = 2
|
||||
@@ -132,6 +136,8 @@ UC_CTL_CPU_MODEL = 7
|
||||
UC_CTL_TB_REQUEST_CACHE = 8
|
||||
UC_CTL_TB_REMOVE_CACHE = 9
|
||||
UC_CTL_TB_FLUSH = 10
|
||||
UC_CTL_TLB_FLUSH = 11
|
||||
UC_CTL_TLB_TYPE = 12
|
||||
|
||||
UC_PROT_NONE = 0
|
||||
UC_PROT_READ = 1
|
||||
|
||||
Reference in New Issue
Block a user