diff --git a/bindings/python/sample_ctl.py b/bindings/python/sample_ctl.py index 202a2094..1578a010 100755 --- a/bindings/python/sample_ctl.py +++ b/bindings/python/sample_ctl.py @@ -57,7 +57,7 @@ def test_uc_ctl_tb_cache(): # Now we clear cache for all TBs. for i in range(8): - uc.ctl_remove_cache(addr + i * 512) + uc.ctl_remove_cache(addr + i * 512, addr + i * 512 + 1) evicted = time_emulation(uc, addr, addr + len(code)) @@ -66,7 +66,7 @@ def test_uc_ctl_tb_cache(): def trace_new_edge(uc, cur, prev, data): print(f">>> Getting a new edge from {hex(prev.pc + prev.size - 1)} to {hex(cur.pc)}") -def trace_tcg_sub(uc, address, arg1, arg2, data): +def trace_tcg_sub(uc, address, arg1, arg2, size, data): print(f">>> Get a tcg sub opcode at {hex(address)} with args: {arg1} and {arg2}") def test_uc_ctl_exits(): diff --git a/bindings/python/unicorn/unicorn.py b/bindings/python/unicorn/unicorn.py index e893d6fe..bd266935 100644 --- a/bindings/python/unicorn/unicorn.py +++ b/bindings/python/unicorn/unicorn.py @@ -210,7 +210,7 @@ UC_HOOK_EDGE_GEN_CB = ctypes.CFUNCTYPE( None, uc_engine, ctypes.POINTER(uc_tb), ctypes.POINTER(uc_tb), ctypes.c_void_p ) UC_HOOK_TCG_OPCODE_CB = ctypes.CFUNCTYPE( - None, uc_engine, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_void_p + None, uc_engine, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_uint32, ctypes.c_void_p ) # access to error code via @errno of UcError @@ -647,9 +647,9 @@ class Uc(object): return result.value @_catch_hook_exception - def _hook_tcg_op_cb(self, handle, address, arg1, arg2, user_data): + def _hook_tcg_op_cb(self, handle, address, arg1, arg2, size, user_data): (cb, data) = self._callbacks[user_data] - cb(self, address, arg1, arg2, user_data) + cb(self, address, arg1, arg2, size, user_data) @_catch_hook_exception def _hook_edge_gen_cb(self, handle, cur, prev, user_data):