From bd3d79d51267975a9ff2167bb6731222e9618c27 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Wed, 23 Oct 2024 12:39:33 -0400 Subject: Add API to bulk add segments, use it in elf view --- python/binaryview.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index 60cc4f28..3d5187d6 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -9055,8 +9055,22 @@ to a the type "tagRECT" found in the typelibrary "winX64common" return value.value def add_auto_segment(self, start: int, length: int, data_offset: int, data_length: int, flags: SegmentFlag) -> None: + """ + ``add_auto_segment`` Adds an analysis segment that specifies how data from the raw file is mapped into a virtual address space + + Note that the segments added may have different size attributes than requested + """ core.BNAddAutoSegment(self.handle, start, length, data_offset, data_length, flags) + def add_auto_segments(self, segments: List[core.BNSegmentInfo]) -> None: + """ + ``add_auto_segments`` Adds analysis segments that specify how data from the raw file is mapped into a virtual address space + + Note that the segments added may have different size attributes than requested + """ + segment_arr = (core.BNSegmentInfo * len(segments))(*segments) + core.BNAddAutoSegments(self.handle, segment_arr, len(segments)) + def remove_auto_segment(self, start: int, length: int) -> None: """ ``remove_auto_segment`` removes an automatically generated segment from the current segment mapping. -- cgit v1.3.1