dissect.target.filesystems.zip#

Module Contents#

Classes#

ZipFilesystem

Filesystem implementation for zip files.

ZipFilesystemEntry

Virtual file backed by a file-like object.

ZipFilesystemDirectoryEntry

Virtual directory implementation. Backed by a dict.

Attributes#

log

dissect.target.filesystems.zip.log#
class dissect.target.filesystems.zip.ZipFilesystem(fh: BinaryIO, base: str | None = None, *args, **kwargs)#

Bases: dissect.target.filesystem.Filesystem

Filesystem implementation for zip files.

Python does not have symlink support in the zipfile module, so that’s not currently supported. See https://github.com/python/cpython/issues/82102 for more information.

__type__ = 'zip'#
get(path: str, relentry: dissect.target.filesystem.FilesystemEntry = None) dissect.target.filesystem.FilesystemEntry#

Returns a ZipFilesystemEntry object corresponding to the given path.

class dissect.target.filesystems.zip.ZipFilesystemEntry(fs: Filesystem, path: str, entry: Any)#

Bases: dissect.target.filesystem.VirtualFile

Virtual file backed by a file-like object.

open() BinaryIO#

Returns file handle (file-like object).

Read the link if this entry is a symlink. Returns a string.

Read the link if this entry is a symlink. Returns a filesystem entry.

stat(follow_symlinks: bool = True) dissect.target.helpers.fsutil.stat_result#

Return the stat information of this entry.

lstat() dissect.target.helpers.fsutil.stat_result#

Return the stat information of the given path, without resolving links.

class dissect.target.filesystems.zip.ZipFilesystemDirectoryEntry(fs: ZipFilesystem, path: str, entry: zipfile.ZipInfo)#

Bases: dissect.target.filesystem.VirtualDirectory

Virtual directory implementation. Backed by a dict.

stat(follow_symlinks: bool = True) dissect.target.helpers.fsutil.stat_result#

Return the stat information of this entry.

lstat() dissect.target.helpers.fsutil.stat_result#

Return the stat information of the given path, without resolving links.