Skip to content

Latest commit

 

History

44 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ext2 Filesystem Reader

An ext2 filesystem parser and extractor developed for UP Diliman's CS140 class. This tool allows users to explore and extract files from an ext2 disk image without mounting it via the OS (setup scripts use debugfs for population).


Group Members:

Features

  • Path Enumeration: Recursively lists all files and directories within a given ext2 filesystem image.
  • Object Extraction: Extracts a specific file or directory from the filesystem image to the host system.
  • Indirect Block Support: Handles singly, doubly, and triply indirect blocks for larger files.
  • Directory Traversal: Correctly parses directory entries and follows nested structures.

Installation & Build

Prerequisites

  • GCC and G++ compilers
  • make
  • e2fsprogs (provides mkfs.ext2)
  • debugfs

Building the project

To build the target executable:

make build

The binary will be located at build/main.

Usage

The program operates in two modes depending on the number of arguments provided.

1. Path Enumeration

Recursively lists all files and directories starting from the root of the filesystem image.

Command:

./build/main <fs_image_path>

Example:

./build/main testfs

2. Object Extraction

Extracts a specific file or directory from the filesystem image to the current working directory on the host system.

Command:

./build/main <fs_image_path> <internal_path>

Example (Extracting a file):

./build/main testfs dir1/cs153.txt

Example (Extracting a directory):

./build/main testfs dir2

Makefile Commands

make build

Compiles the source files in src/ into build/main.

make populate

Creates a 100MB testfs image, formats it as ext2, and populates it with a predefined set of files and directories for testing using debugfs.

make run

The quickest way to test: builds the project, sets up/populates the test filesystem, and runs path enumeration on it.

make clean

Deletes all build artifacts, the generated filesystem image, and any extracted output.


Note: This project was originally developed within a private GitHub organization for academic purposes.

About

ext2 filesystem parser and extractor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages