:py:mod:`dissect.target.plugins.os.unix.locate.gnulocate` ========================================================= .. py:module:: dissect.target.plugins.os.unix.locate.gnulocate Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.target.plugins.os.unix.locate.gnulocate.GNULocateFile dissect.target.plugins.os.unix.locate.gnulocate.GNULocatePlugin Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.target.plugins.os.unix.locate.gnulocate.gnulocate_def dissect.target.plugins.os.unix.locate.gnulocate.GNULocateRecord dissect.target.plugins.os.unix.locate.gnulocate.c_gnulocate .. py:data:: gnulocate_def :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ #define MAGIC 0x004c4f43415445303200 /* b'/x00LOCATE02/x00' */ struct entry { int8 offset; char path[]; } """ .. raw:: html
.. py:data:: GNULocateRecord .. py:data:: c_gnulocate .. py:class:: GNULocateFile(fh: BinaryIO) GNU locate file parser. Multiple formats exist for the locatedb file. This class only supports the most recent version ``LOCATE02``. The file is encoded with front compression (incremental encoding). This is a form of compression which takes a number of characters of the previous encoded entries. Entries are separated with a null byte. .. rubric:: References - https://manpages.ubuntu.com/manpages/trusty/en/man5/locatedb.5.html .. py:attribute:: fh .. py:attribute:: count :value: 0 .. py:attribute:: previous_path :value: '' .. py:method:: __iter__() -> collections.abc.Iterator[GNULocateFile] .. py:class:: GNULocatePlugin(target: dissect.target.target.Target) Bases: :py:obj:`dissect.target.plugins.os.unix.locate.locate.BaseLocatePlugin` GNU locate plugin. .. py:attribute:: __namespace__ :value: 'gnulocate' Defines the plugin namespace. .. py:attribute:: path :value: '/var/cache/locate/locatedb' .. py:method:: check_compatible() -> None Perform a compatibility check with the target. This function should return ``None`` if the plugin is compatible with the current target (``self.target``). For example, check if a certain file exists. Otherwise it should raise an :class:`UnsupportedPluginError`. :raises UnsupportedPluginError: If the plugin could not be loaded. .. py:method:: locate() -> collections.abc.Iterator[GNULocateRecord] Yield file and directory names from GNU findutils' locatedb file. .. rubric:: References - https://manpages.debian.org/testing/locate/locatedb.5.en.html