mirror of
https://github.com/yuzu-mirror/unicorn.git
synced 2026-04-07 15:34:17 +00:00
support uc_mem_map_ptr in Go and Python bindings
This commit is contained in:
parent
6d21ebabea
commit
18066b3578
2 changed files with 13 additions and 0 deletions
|
|
@ -104,6 +104,7 @@ _setup_prototype(_uc, "uc_emu_start", ucerr, uc_engine, ctypes.c_uint64, ctypes.
|
|||
_setup_prototype(_uc, "uc_emu_stop", ucerr, uc_engine)
|
||||
_setup_prototype(_uc, "uc_hook_del", ucerr, uc_engine, uc_hook_h)
|
||||
_setup_prototype(_uc, "uc_mem_map", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_size_t, ctypes.c_uint32)
|
||||
_setup_prototype(_uc, "uc_mem_map_ptr", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_size_t, ctypes.c_void_p)
|
||||
_setup_prototype(_uc, "uc_mem_unmap", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_size_t)
|
||||
_setup_prototype(_uc, "uc_mem_protect", ucerr, uc_engine, ctypes.c_uint64, ctypes.c_size_t, ctypes.c_uint32)
|
||||
|
||||
|
|
@ -241,6 +242,13 @@ class Uc(object):
|
|||
raise UcError(status)
|
||||
|
||||
|
||||
# map a range of memory from a raw host memory address
|
||||
def mem_map_ptr(self, address, size, ptr):
|
||||
status = _uc.uc_mem_map_ptr(self._uch, address, size, ptr)
|
||||
if status != UC_ERR_OK:
|
||||
raise UcError(status)
|
||||
|
||||
|
||||
# unmap a range of memory
|
||||
def mem_unmap(self, address, size):
|
||||
status = _uc.uc_mem_unmap(self._uch, address, size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue