summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2022-12-21 20:27:59 -0500
committerJosh Ferrell <josh@vector35.com>2022-12-21 20:27:59 -0500
commitc63b8a9cdc019fcf81112423017127d3cdbed4d8 (patch)
treea0fdb3728a00c20562c34b16112ab0e7498e59bc /python/binaryview.py
parent9a53dd8e1c301192708487d12e7f1e273820921d (diff)
Expose get_next_valid_offset in python api
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py10
1 files changed, 10 insertions, 0 deletions
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 .