Serialize section parameters into a JSON string. This is useful for generating a properly formatted section description as options when using `load`. :param int image_base: The base address of the image. :param str name: The name of the section. :param int start: The start address of the s
(cls, image_base: int, name: str, start: int, length: int, semantics: SectionSemantics=SectionSemantics.DefaultSectionSemantics, type: str="", align: int=1, entry_size: int=0, link: str="", info_section: str="", info_data: int=0, auto_defined: bool=True, sections: str="[]")
| 1578 | @classmethod |
| 1579 | @deprecation.deprecated(deprecated_in="4.3.6653", details="Use `SectionDescriptorList` instead.") |
| 1580 | def serialize(cls, image_base: int, name: str, start: int, length: int, semantics: SectionSemantics=SectionSemantics.DefaultSectionSemantics, type: str="", align: int=1, entry_size: int=0, link: str="", info_section: str="", info_data: int=0, auto_defined: bool=True, sections: str="[]"): |
| 1581 | """ |
| 1582 | Serialize section parameters into a JSON string. This is useful for generating a properly formatted section description as options when using `load`. |
| 1583 | |
| 1584 | :param int image_base: The base address of the image. |
| 1585 | :param str name: The name of the section. |
| 1586 | :param int start: The start address of the section. |
| 1587 | :param int length: The length of the section. |
| 1588 | :param SectionSemantics semantics: The semantics of the section. |
| 1589 | :param str type: The type of the section. |
| 1590 | :param int align: The alignment of the section. |
| 1591 | :param int entry_size: The entry size of the section. |
| 1592 | :param str link: The linked section of the section. |
| 1593 | :param str info_section: The info section of the section. |
| 1594 | :param int info_data: The info data of the section. |
| 1595 | :param bool auto_defined: Whether the section is auto-defined. |
| 1596 | :param str sections: An optional, existing array of sections to append to. |
| 1597 | :return: A JSON string representing the section. |
| 1598 | :rtype: str |
| 1599 | """ |
| 1600 | sections_list = json.loads(sections) |
| 1601 | section_info = { |
| 1602 | "align": align, |
| 1603 | "auto_defined": auto_defined, |
| 1604 | "entry_size": entry_size, |
| 1605 | "info_data": info_data, |
| 1606 | "info_section": info_section, |
| 1607 | "length": length, |
| 1608 | "link": link, |
| 1609 | "name": name, |
| 1610 | "semantics": semantics, |
| 1611 | "start": start - image_base, |
| 1612 | "type": type |
| 1613 | } |
| 1614 | sections_list.append(section_info) |
| 1615 | return json.dumps(sections_list) |
| 1616 | |
| 1617 | @property |
| 1618 | def name(self) -> str: |