Skip to content


Ext2Filesystem (ExtFilesystem) dataclass

Linux EXT2 filesystem.

Ext3Filesystem (ExtFilesystem) dataclass

Linux EXT3 filesystem.

Ext4Filesystem (ExtFilesystem) dataclass

Linux EXT4 filesystem.

ExtFilesystem (GenericBinary, FilesystemRoot) dataclass


ExtUnpacker (Unpacker)

Unpack a Linux EXT filesystem.

unpack(self, resource, config=None) async

Unpack the given resource.

Users should not call this method directly; rather, they should run or Resource.unpack.


Name Type Description Default
resource Resource

The resource that is being unpacked

config ComponentConfig

Optional config for unpacking. If an implementation provides a default, this default will always be used when config would otherwise be None. Note that a copy of the default config will be passed, so the default config values cannot be modified persistently by a component run.

Source code in ofrak/core/
async def unpack(self, resource: Resource, config: ComponentConfig = None) -> None:
    with tempfile.NamedTemporaryFile(suffix=".extfs") as temp_fs_file:
        temp_fs_file.write(await resource.get_data())

        with tempfile.TemporaryDirectory() as temp_dir:
            command = [
                f"rdump / {temp_dir}",
            proc = await asyncio.create_subprocess_exec(
            returncode = await proc.wait()
            if returncode:
                raise CalledProcessError(returncode=returncode, cmd=command)

            fs_view = await resource.view_as(ExtFilesystem)
            await fs_view.initialize_from_disk(temp_dir)