Skip to content

Commit 816e90c

Browse files
committed
[Python] Add BinaryView.is_offset_backed_by_file
Seems we forgot to expose this one
1 parent e7b1fae commit 816e90c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

python/binaryview.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4926,14 +4926,24 @@ def get_next_valid_offset(self, addr: int) -> int:
49264926

49274927
def is_valid_offset(self, addr: int) -> bool:
49284928
"""
4929-
``is_valid_offset`` checks if a virtual address ``addr`` is valid .
4929+
``is_valid_offset`` checks if a virtual address ``addr`` is valid.
49304930
49314931
:param int addr: a virtual address to be checked
49324932
:return: True if the virtual address is valid, False if the virtual address is invalid or error
49334933
:rtype: bool
49344934
"""
49354935
return core.BNIsValidOffset(self.handle, addr)
49364936

4937+
def is_offset_backed_by_file(self, addr: int) -> bool:
4938+
"""
4939+
``is_offset_backed_by_file`` checks if a virtual address ``addr`` is backed by the original file.
4940+
4941+
:param int addr: a virtual address to be checked
4942+
:return: True if the virtual address is backed by original file, False if the not backed by original file or error
4943+
:rtype: bool
4944+
"""
4945+
return core.BNIsOffsetBackedByFile(self.handle, addr)
4946+
49374947
def is_offset_readable(self, addr: int) -> bool:
49384948
"""
49394949
``is_offset_readable`` checks if a virtual address ``addr`` is valid for reading.

0 commit comments

Comments
 (0)