Minor code quality tweaks
This commit is contained in:
@@ -6,9 +6,8 @@ from typing import Any, Tuple
|
|||||||
|
|
||||||
import ctypes
|
import ctypes
|
||||||
|
|
||||||
from .. import Uc, UcError
|
from .. import Uc
|
||||||
from .. import arm_const as const
|
from .. import arm_const as const
|
||||||
from ..unicorn_const import UC_ERR_ARG
|
|
||||||
|
|
||||||
from .types import UcReg128
|
from .types import UcReg128
|
||||||
|
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ class Uc(RegStateManager):
|
|||||||
self._mode = mode
|
self._mode = mode
|
||||||
|
|
||||||
# initialize the unicorn instance
|
# initialize the unicorn instance
|
||||||
self._uch = ctypes.c_void_p()
|
self._uch = uc_engine()
|
||||||
status = uclib.uc_open(arch, mode, ctypes.byref(self._uch))
|
status = uclib.uc_open(arch, mode, ctypes.byref(self._uch))
|
||||||
|
|
||||||
if status != uc.UC_ERR_OK:
|
if status != uc.UC_ERR_OK:
|
||||||
@@ -814,7 +814,7 @@ class Uc(RegStateManager):
|
|||||||
|
|
||||||
def __hook_edge_gen():
|
def __hook_edge_gen():
|
||||||
@_catch_hook_exception
|
@_catch_hook_exception
|
||||||
def __hook_edge_gen_cb(handle: int, cur: ctypes.pointer[uc_tb], prev: ctypes.pointer[uc_tb], key: int):
|
def __hook_edge_gen_cb(handle: int, cur: ctypes._Pointer[uc_tb], prev: ctypes._Pointer[uc_tb], key: int):
|
||||||
callback(self, cur.contents, prev.contents, user_data)
|
callback(self, cur.contents, prev.contents, user_data)
|
||||||
|
|
||||||
cb = _cast_func(HOOK_EDGE_GEN_CFUNC, __hook_edge_gen_cb)
|
cb = _cast_func(HOOK_EDGE_GEN_CFUNC, __hook_edge_gen_cb)
|
||||||
|
|||||||
Reference in New Issue
Block a user