From 84172132ffed56cb1ff97b33d729a3daeb637736 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Wed, 2 Oct 2024 12:55:43 +0800 Subject: Make sure the undefined data variable does not get recreated by auto-analysis. Fix https://github.com/Vector35/binaryninja-api/issues/5817 --- python/binaryview.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index 9fa471dd..3321a21a 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -4719,18 +4719,20 @@ class BinaryView: return self.get_data_var_at(addr) - def undefine_data_var(self, addr: int) -> None: + def undefine_data_var(self, addr: int, blacklist: bool = True) -> None: """ ``undefine_data_var`` removes the non-user data variable at the virtual address ``addr``. :param int addr: virtual address to define the data variable to be removed + :param bool blacklist: whether to add the address to the data variable black list so that the auto analysis + would not recreat the variable on re-analysis :rtype: None :Example: >>> bv.undefine_data_var(bv.entry_point) >>> """ - core.BNUndefineDataVariable(self.handle, addr) + core.BNUndefineDataVariable(self.handle, addr, blacklist) def undefine_user_data_var(self, addr: int) -> None: """ -- cgit v1.3.1