:py:mod:`dissect.esedb.page` ============================ .. py:module:: dissect.esedb.page Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.esedb.page.Page dissect.esedb.page.Tag dissect.esedb.page.Node dissect.esedb.page.LeafNode dissect.esedb.page.BranchNode .. py:class:: Page(esedb: dissect.esedb.esedb.EseDB, num: int, buf: bytes) Represents a logical page of an ESE database. :param esedb: An instance of :class:`~dissect.esedb.esedb.EseDB`. :param num: The logical page number. :param buf: The physical page data. .. py:method:: is_small_page() -> bool .. py:method:: is_root() -> bool .. py:method:: is_leaf() -> bool .. py:method:: is_parent() -> bool .. py:method:: is_empty() -> bool .. py:method:: is_space_tree() -> bool .. py:method:: is_index() -> bool .. py:method:: is_long_value() -> bool .. py:method:: is_branch() -> bool .. py:method:: key_prefix() -> Optional[bytes] .. py:method:: tag(num: int) -> Tag Retrieve a tag by index. :param num: The tag number to retrieve. :raises IndexError: If the tag number is out of bounds. .. py:method:: tags() -> Iterator[Tag] Yield all tags. .. py:method:: node(num: int) -> Union[BranchNode, LeafNode] Retrieve a node by index. Nodes are just tags, but indexed from the first tag. :param num: The node number to retrieve. :raises IndexError: If the node number is out of bounds. .. py:method:: nodes() -> Iterator[Union[BranchNode, LeafNode]] Yield all nodes. .. py:method:: iter_leaf_nodes() -> Iterator[LeafNode] Walk the page tree and yield leaf nodes. Two methods can be used, one is to travel down to the first leaf, and keep reading ``next_page``'s, the other is to traverse the tree branches. Impacket uses the first method, but gets caught in an infinite loop on some dirty databases. Traversing the branches seems safer, at the risk of missing a couple (possibly corrupt) pages. For this reason, we actually explicitly check if the last page we parse has a ``next_page`` attribute, and also parse that. This methods seems to work so far. .. py:method:: __repr__() -> str Return repr(self). .. py:class:: Tag(page: Page, num: int) A tag is the "physical" data entry of a page. :param page: The :class:`Page` this tag is in. :param num: The tag number to parse. .. py:attribute:: __slots__ :value: ('page', 'num', 'tag', 'offset', 'size', 'data', 'flags') .. py:method:: __repr__() -> str Return repr(self). .. py:class:: Node(tag: Tag) A node is the "logical" data entry of a page. :param tag: The :class:`Tag` to parse a node from. .. py:attribute:: __slots__ :value: ('tag', 'num', 'key', 'key_prefix', 'key_suffix', 'data') .. py:class:: LeafNode(tag: Tag) Bases: :py:obj:`Node` Special leaf node. .. py:method:: __repr__() -> str Return repr(self). .. py:class:: BranchNode(tag: Tag) Bases: :py:obj:`Node` Special branch node. Parses the child page information. .. py:attribute:: __slots__ :value: ('child',) .. py:method:: __repr__() -> str Return repr(self).