From 4bcf1d33b419aa2a49783e2b3588f46497e76831 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Wed, 28 Aug 2019 07:30:30 -0400 Subject: initial documentation for add_user_section and add_user_segment --- python/binaryview.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index 868342a6..594109bf 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -4706,6 +4706,16 @@ class BinaryView(object): core.BNRemoveAutoSegment(self.handle, start, length) def add_user_segment(self, start, length, data_offset, data_length, flags): + """ + ``add_user_segment`` creates a user-defined segment that specifies how data form the raw file is mapped into a virtual address space. + + :param int start: virtual address of the start of the segment + :param int length: length of the segment (may be larger than the source data) + :param int data_offset: offset from the parent view + :param int data_length: length of the data from the parent view + :param enums.SegmentFlag flags: SegmentFlags + :rtype: None + """ core.BNAddUserSegment(self.handle, start, length, data_offset, data_length, flags) def remove_user_segment(self, start, length): @@ -4733,6 +4743,22 @@ class BinaryView(object): def add_user_section(self, name, start, length, semantics = SectionSemantics.DefaultSectionSemantics, type = "", align = 1, entry_size = 1, linked_section = "", info_section = "", info_data = 0): + """ + ``add_user_section`` creates a user-defined section that can help inform analysis by clarifying what types of + data exist in what ranges. Note that all data specified must already be mapped by an existing segment. + + :param str name: name of the section + :param int start: virtual address of the start of the section + :param int length: length of the section + :param enums.SectionSemantics semantics: SectionSemantics of the section + :param str type: optional type + :param int align: optional byte alignment + :param int entry_size: optional entry size + :param str linked_section: optional name of a linked section + :param str info_section: optional name of an associated informational section + :param int info_data: optional info data + :rtype: None + """ core.BNAddUserSection(self.handle, name, start, length, semantics, type, align, entry_size, linked_section, info_section, info_data) -- cgit v1.3.1