Minor code quality tweaks

This commit is contained in:
elicn
2022-09-14 13:35:58 +03:00
parent 9290c7f277
commit 36d4264f15
2 changed files with 3 additions and 4 deletions

View File

@@ -6,9 +6,8 @@ from typing import Any, Tuple
import ctypes
from .. import Uc, UcError
from .. import Uc
from .. import arm_const as const
from ..unicorn_const import UC_ERR_ARG
from .types import UcReg128

View File

@@ -444,7 +444,7 @@ class Uc(RegStateManager):
self._mode = mode
# initialize the unicorn instance
self._uch = ctypes.c_void_p()
self._uch = uc_engine()
status = uclib.uc_open(arch, mode, ctypes.byref(self._uch))
if status != uc.UC_ERR_OK:
@@ -814,7 +814,7 @@ class Uc(RegStateManager):
def __hook_edge_gen():
@_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)
cb = _cast_func(HOOK_EDGE_GEN_CFUNC, __hook_edge_gen_cb)