Fix TLB fill hook (#2042)
* Fix the TLB fill hook * Add missing annotations
This commit is contained in:
@@ -1048,7 +1048,7 @@ class Uc(RegStateManager):
|
||||
|
||||
def __hook_intr():
|
||||
@uccallback(self, HOOK_INTR_CFUNC)
|
||||
def __hook_intr_cb(uc: Uc, intno: int, key: int):
|
||||
def __hook_intr_cb(uc: Uc, intno: int, key: int) -> None:
|
||||
callback(uc, intno, user_data)
|
||||
|
||||
return (__hook_intr_cb,)
|
||||
@@ -1061,7 +1061,7 @@ class Uc(RegStateManager):
|
||||
|
||||
def __hook_code():
|
||||
@uccallback(self, HOOK_CODE_CFUNC)
|
||||
def __hook_code_cb(uc: Uc, address: int, size: int, key: int):
|
||||
def __hook_code_cb(uc: Uc, address: int, size: int, key: int) -> None:
|
||||
callback(uc, address, size, user_data)
|
||||
|
||||
return (__hook_code_cb,)
|
||||
@@ -1089,14 +1089,14 @@ class Uc(RegStateManager):
|
||||
|
||||
def __hook_edge_gen():
|
||||
@uccallback(self, HOOK_EDGE_GEN_CFUNC)
|
||||
def __hook_edge_gen_cb(uc: Uc, cur: ctypes._Pointer[uc_tb], prev: ctypes._Pointer[uc_tb], key: int):
|
||||
def __hook_edge_gen_cb(uc: Uc, cur: ctypes._Pointer[uc_tb], prev: ctypes._Pointer[uc_tb], key: int) -> None:
|
||||
callback(uc, cur.contents, prev.contents, user_data)
|
||||
|
||||
return (__hook_edge_gen_cb,)
|
||||
|
||||
def __hook_tcg_opcode():
|
||||
@uccallback(self, HOOK_TCG_OPCODE_CFUNC)
|
||||
def __hook_tcg_op_cb(uc: Uc, address: int, arg1: int, arg2: int, size: int, key: int):
|
||||
def __hook_tcg_op_cb(uc: Uc, address: int, arg1: int, arg2: int, size: int, key: int) -> None:
|
||||
callback(uc, address, arg1, arg2, size, user_data)
|
||||
|
||||
opcode = ctypes.c_uint64(aux1)
|
||||
@@ -1106,8 +1106,8 @@ class Uc(RegStateManager):
|
||||
|
||||
def __hook_tlb_fill():
|
||||
@uccallback(self, HOOK_TLB_FILL_CFUNC)
|
||||
def __hook_tlb_fill_cb(uc: Uc, vaddr: int, access: int, entry: ctypes._Pointer[uc_tlb_entry], key: int):
|
||||
callback(uc, vaddr, access, entry.contents, user_data)
|
||||
def __hook_tlb_fill_cb(uc: Uc, vaddr: int, access: int, entry: ctypes._Pointer[uc_tlb_entry], key: int) -> bool:
|
||||
return callback(uc, vaddr, access, entry.contents, user_data)
|
||||
|
||||
return (__hook_tlb_fill_cb,)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user