Skip to content

Commit

Permalink
Fix ctl_remove_cache for python2
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Aug 9, 2023
1 parent 247d643 commit b6cedad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bindings/python/unicorn/unicorn_py2.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,11 @@ def __ctl_w_1_arg(self, ctl, val, ctp):
arg = ctp(val)
self.ctl(self.__ctl_w(ctl, 1), arg)

def __ctl_w_2_arg(self, ctl, val1, val2, ctp1, ctp2):
arg1 = ctp1(val1)
arg2 = ctp2(val2)
self.ctl(self.__ctl_w(ctl, 2), arg1, arg2)

def __ctl_rw_1_1_arg(self, ctl, val, ctp1, ctp2):
arg1 = ctp1(val)
arg2 = ctp2()
Expand Down Expand Up @@ -764,8 +769,8 @@ def ctl_get_cpu_model(self):
def ctl_set_cpu_model(self, val):
self.__ctl_w_1_arg(uc.UC_CTL_CPU_MODEL, val, ctypes.c_int)

def ctl_remove_cache(self, addr):
self.__ctl_w_1_arg(uc.UC_CTL_TB_REMOVE_CACHE, addr, ctypes.c_uint64)
def ctl_remove_cache(self, addr, end):
self.__ctl_(uc.UC_CTL_TB_REMOVE_CACHE, addr, end, ctypes.c_uint64, ctypes.c_uint64)

def ctl_request_cache(self, addr):
return self.__ctl_rw_1_1_arg(uc.UC_CTL_TB_REQUEST_CACHE, addr, ctypes.c_uint64, uc_tb)
Expand Down

0 comments on commit b6cedad

Please sign in to comment.