From c6ed1dd374515d0e23a9d627a7dfb659c7981d16 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 19 Jan 2017 21:15:32 -0500 Subject: Add API to find virtual address from file offset --- python/binaryview.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python/binaryview.py') 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, -- cgit v1.3.1