From c63b8a9cdc019fcf81112423017127d3cdbed4d8 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Wed, 21 Dec 2022 20:27:59 -0500 Subject: Expose get_next_valid_offset in python api --- python/binaryview.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index 287b4395..554e6b46 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -3600,6 +3600,16 @@ class BinaryView: length = core.BNGetModificationArray(self.handle, addr, data, length) return [ModificationStatus(a) for a in data[:length]] + def get_next_valid_offset(self, addr: int) -> int: + """ + ``get_next_valid_offset`` returns the next valid offset after ``addr``. + + :param int addr: a virtual address + :return: The minimum of the next valid offset in the BinaryView and the end address of the BinaryView + :rtype: int + """ + return core.BNGetNextValidOffset(self.handle, addr) + def is_valid_offset(self, addr: int) -> bool: """ ``is_valid_offset`` checks if a virtual address ``addr`` is valid . -- cgit v1.3.1