:py:mod:`dissect.shellitem.lnk.lnk` =================================== .. py:module:: dissect.shellitem.lnk.lnk Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.shellitem.lnk.lnk.LnkExtraData dissect.shellitem.lnk.lnk.LnkStringData dissect.shellitem.lnk.lnk.LnkInfo dissect.shellitem.lnk.lnk.LnkTargetIdList dissect.shellitem.lnk.lnk.Lnk Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.shellitem.lnk.lnk.log .. py:data:: log .. py:class:: LnkExtraData(fh: Optional[BinaryIO] = None) Class that represents the a LNK file's EXTRA_DATA structure This optional structure hold additional optional structures that convey additional information about a link target :param fh: A file-like object to an EXTRA_DATA structure .. py:method:: __getattr__(attr: str) -> Any .. py:method:: __repr__() -> str Return repr(self). .. py:class:: LnkStringData(fh: Optional[BinaryIO] = None, lnk_flags: Optional[dissect.shellitem.lnk.c_lnk.c_lnk.LINK_FLAGS] = None) This class represents the LNK file's STING_DATA structure. The STRING_DATA structure refers to a set of structures that convey user interface and path identification information. STRING_DATA = [NAME_STRING] [RELATIVE_PATH] [WORKING_DIR] [COMMAND_LINE_ARGUMENTS] [ICON_LOCATION] :param fh: A file-lke object to a STRING_DATA structure :param lnk_flags: Parsed LINK_HEADER flags .. py:method:: __getattr__(attr: str) -> Any .. py:method:: __repr__() -> str Return repr(self). .. py:class:: LnkInfo(fh: Optional[BinaryIO] = None) This class represents a LNK file's LINK_INFO structure. The optional LINK_INFO structure specifies information necessary to resolve a link target if it is not found in its original location. This includes information about the volume that the target was stored on, the mapped drive letter, and a UNC path if existed when the link was created. :param fh: A file-like objet to a LINK_INFO structure .. py:method:: flag(name: str) -> int Returns whether supplied flag is set. :param name: Name of the flag :returns: >0 if flag is set :rtype: int .. py:method:: __getattr__(attr: str) -> Any .. py:method:: __repr__() -> str Return repr(self). .. py:class:: LnkTargetIdList(fh: Optional[BinaryIO] = None, size: Optional[int] = None) This class represents a LNK file's TARGET_IDLIST structure. The TARGET_IDLIST structure specifies the target of the link. This information is stored in individual ITEM_ID structures. :param fh: A file-like object to a TARGET_IDLIST structure. :param size: Size of the TARGET_IDLIST structure .. py:method:: __repr__() -> str Return repr(self). .. py:class:: Lnk(fh: io.BufferedReader, target_idlist: Optional[LnkTargetIdList] = None, linkinfo: Optional[LnkInfo] = None, stringdata: Optional[LnkStringData] = None, extradata: Optional[LnkExtraData] = None) This class represents a LNK file's SHELL_LINK_HEADER, and the remainder of the parsed LNK file structures. This SHELL_LINK_HEADER structure contains identification information, timestamps, and flags that specify the presence of optional structures. Parses a .lnk file (aka Microsoft Shell Item) according to the MS-SHLLINK specification reference: https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SHLLINK/%5bMS-SHLLINK%5d.pdf :param path: (string) Path to a link file. :param target_idlist: A LnkTargetIdList object. :param linkinfo: A LnkInfo object. :param stringdata: A LnkStringData object. :param extradata: A LnkExtraData object. .. py:property:: clsid :type: uuid.UUID Returns the class id (clsid) of the LNK file. .. py:method:: flag(name: str) -> int Returns whether supplied flag is set. :param name: Name of the flag :returns: >0 if flag is set :rtype: int .. py:method:: __repr__() -> str Return repr(self).