summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-01-19 21:15:32 -0500
committerRusty Wagner <rusty@vector35.com>2017-01-19 21:15:32 -0500
commitc6ed1dd374515d0e23a9d627a7dfb659c7981d16 (patch)
tree0d5046cbf1ff9c5ced5920fab95e395102fb344f /python
parentded271158000d7fa509f513b425d95390a7f2058 (diff)
Add API to find virtual address from file offset
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index f8fe1fde..ba706fe5 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -3052,6 +3052,12 @@ class BinaryView(object):
segment.flags)
return result
+ def get_address_for_data_offset(self, offset):
+ address = ctypes.c_ulonglong()
+ if not core.BNGetAddressForDataOffset(self.handle, offset, address):
+ return None
+ return address.value
+
def add_auto_section(self, name, start, length, type = "", align = 1, entry_size = 1, linked_section = "",
info_section = "", info_data = 0):
core.BNAddAutoSection(self.handle, name, start, length, type, align, entry_size, linked_section,