From 816e90c9ef4b2093b4245a992e5ca576fb9da8e4 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 30 Nov 2025 16:02:49 -0500 Subject: [Python] Add `BinaryView.is_offset_backed_by_file` Seems we forgot to expose this one --- python/binaryview.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index 2f190375..f9afe2b8 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -4926,7 +4926,7 @@ class BinaryView: def is_valid_offset(self, addr: int) -> bool: """ - ``is_valid_offset`` checks if a virtual address ``addr`` is valid . + ``is_valid_offset`` checks if a virtual address ``addr`` is valid. :param int addr: a virtual address to be checked :return: True if the virtual address is valid, False if the virtual address is invalid or error @@ -4934,6 +4934,16 @@ class BinaryView: """ return core.BNIsValidOffset(self.handle, addr) + def is_offset_backed_by_file(self, addr: int) -> bool: + """ + ``is_offset_backed_by_file`` checks if a virtual address ``addr`` is backed by the original file. + + :param int addr: a virtual address to be checked + :return: True if the virtual address is backed by original file, False if the not backed by original file or error + :rtype: bool + """ + return core.BNIsOffsetBackedByFile(self.handle, addr) + def is_offset_readable(self, addr: int) -> bool: """ ``is_offset_readable`` checks if a virtual address ``addr`` is valid for reading. -- cgit v1.3.1