pub struct Ext4Fs<R: Read + Seek> { /* private fields */ }Expand description
Forensic-grade ext4 filesystem reader.
Accepts any Read + Seek source (raw image file, EWF reader, etc.).
Provides both standard filesystem access (tier 1) and forensic operations (tier 2).
Implementations§
Source§impl<R: Read + Seek> Ext4Fs<R>
impl<R: Read + Seek> Ext4Fs<R>
Sourcepub fn superblock(&self) -> &Superblock
pub fn superblock(&self) -> &Superblock
Reference to the superblock.
Sourcepub fn read_dir(&mut self, path: &str) -> Result<Vec<DirEntry>>
pub fn read_dir(&mut self, path: &str) -> Result<Vec<DirEntry>>
List directory entries by path.
Sourcepub fn metadata(&mut self, path: &str) -> Result<InodeMetadata>
pub fn metadata(&mut self, path: &str) -> Result<InodeMetadata>
Get full metadata for a path.
Sourcepub fn symlink_target(&mut self, path: &str) -> Result<Vec<u8>>
pub fn symlink_target(&mut self, path: &str) -> Result<Vec<u8>>
Read a symlink’s target by path.
Sourcepub fn read_dir_by_ino(&mut self, dir_ino: u64) -> Result<Vec<DirEntry>>
pub fn read_dir_by_ino(&mut self, dir_ino: u64) -> Result<Vec<DirEntry>>
List directory entries by inode number.
Sourcepub fn lookup_by_ino(
&mut self,
dir_ino: u64,
name: &[u8],
) -> Result<Option<u64>>
pub fn lookup_by_ino( &mut self, dir_ino: u64, name: &[u8], ) -> Result<Option<u64>>
Lookup a name inside a directory by inode number.
Sourcepub fn read_link_by_ino(&mut self, ino: u64) -> Result<Vec<u8>>
pub fn read_link_by_ino(&mut self, ino: u64) -> Result<Vec<u8>>
Read symlink target by inode number.
Sourcepub fn read_inode_data_range(
&mut self,
ino: u64,
offset: u64,
len: usize,
) -> Result<Vec<u8>>
pub fn read_inode_data_range( &mut self, ino: u64, offset: u64, len: usize, ) -> Result<Vec<u8>>
Read a range of file data by inode number.
Sourcepub fn all_inodes(&mut self) -> Result<Vec<(u64, Inode)>>
pub fn all_inodes(&mut self) -> Result<Vec<(u64, Inode)>>
Enumerate all inodes (allocated and deleted).
Sourcepub fn deleted_inodes(&mut self) -> Result<Vec<DeletedInode>>
pub fn deleted_inodes(&mut self) -> Result<Vec<DeletedInode>>
Find all deleted inodes (dtime != 0).
Sourcepub fn orphan_inodes(&mut self) -> Result<Vec<DeletedInode>>
pub fn orphan_inodes(&mut self) -> Result<Vec<DeletedInode>>
Find all orphan inodes (links_count == 0, dtime == 0, mode != 0).
Sourcepub fn recover_file(&mut self, ino: u64) -> Result<RecoveryResult>
pub fn recover_file(&mut self, ino: u64) -> Result<RecoveryResult>
Attempt to recover a deleted file by inode number.
Sourcepub fn timeline(&mut self) -> Result<Vec<TimelineEvent>>
pub fn timeline(&mut self) -> Result<Vec<TimelineEvent>>
Generate a forensic timeline of all filesystem events.
Sourcepub fn xattrs(&mut self, ino: u64) -> Result<Vec<Xattr>>
pub fn xattrs(&mut self, ino: u64) -> Result<Vec<Xattr>>
Read block-stored extended attributes for an inode.
Sourcepub fn unallocated_blocks(&mut self) -> Result<Vec<BlockRange>>
pub fn unallocated_blocks(&mut self) -> Result<Vec<BlockRange>>
Get all unallocated block ranges.
Sourcepub fn read_unallocated(&mut self, range: &BlockRange) -> Result<Vec<u8>>
pub fn read_unallocated(&mut self, range: &BlockRange) -> Result<Vec<u8>>
Read raw data from an unallocated block range.
Sourcepub fn slack_space(&mut self, ino: u64) -> Result<Option<SlackSpace>>
pub fn slack_space(&mut self, ino: u64) -> Result<Option<SlackSpace>>
Read slack space for a single file inode.
Sourcepub fn scan_all_slack(&mut self) -> Result<Vec<SlackSpace>>
pub fn scan_all_slack(&mut self) -> Result<Vec<SlackSpace>>
Scan all allocated regular file inodes for slack space.
Sourcepub fn hash_file(&mut self, ino: u64) -> Result<FileHash>
pub fn hash_file(&mut self, ino: u64) -> Result<FileHash>
Compute BLAKE3, SHA-256, MD5, and SHA-1 hashes for a file by inode number.
Sourcepub fn hash_all_files(&mut self) -> Result<Vec<FileHash>>
pub fn hash_all_files(&mut self) -> Result<Vec<FileHash>>
Hash all allocated regular files on the filesystem.
Sourcepub fn inode_history(&mut self, ino: u64) -> Result<Vec<HistoryVersion>>
pub fn inode_history(&mut self, ino: u64) -> Result<Vec<HistoryVersion>>
Reconstruct the version history of an inode from the journal.
Sourcepub fn recover_dir_entries(
&mut self,
dir_ino: u64,
) -> Result<Vec<RecoveredDirEntry>>
pub fn recover_dir_entries( &mut self, dir_ino: u64, ) -> Result<Vec<RecoveredDirEntry>>
Recover deleted directory entries from rec_len gaps in a single directory.
Sourcepub fn recover_all_dir_entries(&mut self) -> Result<Vec<RecoveredDirEntry>>
pub fn recover_all_dir_entries(&mut self) -> Result<Vec<RecoveredDirEntry>>
Recover deleted directory entries from all directories on the filesystem.
Sourcepub fn is_inode_allocated(&mut self, ino: u64) -> Result<bool>
pub fn is_inode_allocated(&mut self, ino: u64) -> Result<bool>
Check if a specific inode is allocated.
Sourcepub fn is_block_allocated(&mut self, block: u64) -> Result<bool>
pub fn is_block_allocated(&mut self, block: u64) -> Result<bool>
Check if a specific block is allocated.
Sourcepub fn verify_superblock_backups(&mut self) -> Result<Vec<SuperblockComparison>>
pub fn verify_superblock_backups(&mut self) -> Result<Vec<SuperblockComparison>>
Verify all superblock backups against the primary.
Sourcepub fn search_blocks(
&mut self,
pattern: &[u8],
scope: SearchScope,
) -> Result<Vec<SearchHit>>
pub fn search_blocks( &mut self, pattern: &[u8], scope: SearchScope, ) -> Result<Vec<SearchHit>>
Search for a byte pattern across filesystem blocks.