: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) 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. Resources: - https://manpages.ubuntu.com/manpages/trusty/en/man5/locatedb.5.html .. py:method:: __iter__() -> Iterable[GNULocateFile] .. py:class:: GNULocatePlugin(target: dissect.target.Target) Bases: :py:obj:`dissect.target.plugins.os.unix.locate.locate.BaseLocatePlugin` Base class for plugins. Plugins can optionally be namespaced by specifying the ``__namespace__`` class attribute. Namespacing results in your plugin needing to be prefixed with this namespace when being called. For example, if your plugin has specified ``test`` as namespace and a function called ``example``, you must call your plugin with ``test.example``:: A ``Plugin`` class has the following private class attributes: - ``__namespace__`` - ``__record_descriptors__`` With the following three being assigned in :func:`register`: - ``__plugin__`` - ``__functions__`` - ``__exports__`` Additionally, the methods and attributes of :class:`Plugin` receive more private attributes by using decorators. The :func:`export` decorator adds the following private attributes - ``__exported__`` - ``__output__``: Set with the :func:`export` decorator. - ``__record__``: Set with the :func:`export` decorator. The :func:`internal` decorator and :class:`InternalPlugin` set the ``__internal__`` attribute. Finally. :func:`args` decorator sets the ``__args__`` attribute. :param target: The :class:`~dissect.target.target.Target` object to load the plugin for. .. py:attribute:: __namespace__ :value: 'gnulocate' .. 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 ``UnsupportedPluginError``. :raises UnsupportedPluginError: If the plugin could not be loaded. .. py:method:: locate() -> GNULocateRecord Yield file and directory names from GNU findutils' locatedb file. Resources: - https://manpages.debian.org/testing/locate/locatedb.5.en.html