Skip to content

aoiflux/libxfat

Repository files navigation

Project Logo

LIBXFAT

High Performance Digital Forensics

last-commit repo-top-language repo-language-count


Table of Contents


Overview

libxfat is a Go library offering a robust and efficient solution for parsing and manipulating ExFAT filesystems. It provides comprehensive tools for extracting data and accessing metadata.

Why libxfat?

This project simplifies ExFAT filesystem interaction for developers. The core features include:

  • 🟢 Robust ExFAT Parsing: Handles both contiguous and chained cluster allocation schemes for reliable data extraction.
  • 🔵 Comprehensive Metadata Access: Easily retrieve file size, attributes, timestamps, and generate directory listings.
  • 🟡 Efficient Data Extraction: Optimized for speed and performance when working with large ExFAT volumes.
  • 🔴 Clear Data Structures: Well-defined structs (VBR, Entry) simplify ExFAT data manipulation and understanding.
  • 🟣 Thorough Error Handling: Includes integrity checks and robust error handling to prevent data loss.
  • 🟠 Well-Documented Code: Clean, well-commented code ensures easy integration and maintainability.

Features

Component Details
⚙️ Architecture
  • Pure Go implementation
  • Modular design with separate packages for different FAT functionalities
🔩 Code Quality
  • Generally well-structured code
  • Uses descriptive variable and function names
  • Some areas could benefit from more comments
📄 Documentation
  • Limited documentation
  • Relies heavily on code comments for explanation
  • No formal API documentation
🔌 Integrations
  • Designed to be easily integrated into other Go projects
  • No external library dependencies beyond Go's standard library
🧩 Modularity
  • Good modularity with distinct packages for file system operations, directory handling, etc.
  • Facilitates independent testing and maintainability
⚡️ Performance
  • Performance not explicitly optimized in the code
  • Further analysis required to determine performance characteristics
🛡️ Security
  • No explicit security measures implemented (e.g., input validation)
  • Security considerations need to be addressed for production use
📦 Dependencies
  • Only relies on the Go standard library
  • No external dependencies, reducing complexity and potential conflicts
🚀 Scalability
  • Scalability depends on the application using the library
  • The library itself is not inherently limited in scalability
  • Tested with datasets up to 1TiB

Project Structure

└── libxfat/
    ├── README.md
    ├── cluster.go
    ├── const.go
    ├── entry.go
    ├── exfat.go
    ├── go.mod
    ├── go.sum
    ├── struct.go
    ├── util.go
    └── vbr.go

Project Index

LIBXFAT/
__root__
⦿ __root__
File Name Summary
cluster.go - Cluster.go` facilitates data extraction from a disk image within a larger FAT file system library
- It provides functions to locate and read data clusters, handling both contiguous and chained allocation schemes
- The code determines cluster offsets, retrieves cluster chains from the FAT table, and extracts file content based on entry metadata, writing the extracted data to a specified destination.
const.go - Const.go` defines constants crucial for the libxfat library, which processes the ExFAT file system
- It specifies sizes, offsets, and values related to the volume boot record, file allocation table, directory entries, and other structural elements
- These constants are used throughout the library to correctly interpret and manipulate ExFAT data structures, ensuring proper interaction with ExFAT formatted storage.
entry.go - Entry.go provides functions to format and display directory entry information within the libxfat` package
- It offers methods to retrieve file size, determine indexability, and generate both short and long directory listings
- These functions facilitate user-friendly presentation of file system metadata, likely for a command-line interface or similar application.
exfat.go - Exfat.go` provides functionality for interacting with the ExFAT filesystem
- It offers methods to retrieve allocated and free cluster counts, extract file contents, and list directory entries
- The code traverses directory structures, allowing for file extraction and detailed information display
- These functions are integral to the projects ability to explore and manipulate ExFAT volumes.
go.mod - Go.mod declares the module github.com/aoiflux/libxfat for the Go project, specifying Go version 1.21
- It serves as the projects manifest, defining the projects identity and dependencies within the larger
github.com/aoiflux` organization
- This file is crucial for dependency management and build processes, ensuring consistent and reproducible builds across different environments.
go.sum - Go.sum` records checksums of dependencies, ensuring the integrity and reproducibility of the Go project
- It acts as a security measure, preventing unauthorized modification of downloaded packages
- Within the broader project architecture, it safeguards against dependency vulnerabilities and guarantees consistent builds across different environments
- This file is crucial for maintaining the reliability and security of the application.
struct.go - Struct.go defines data structures for representing an ExFAT filesystem
- It introduces
VBR to encapsulate the Volume Boot Record information and Entry to represent directory entries
- The code provides methods for manipulating and querying these structures, facilitating ExFAT filesystem parsing and analysis within the
libxfat package
-
ExFAT struct manages the overall filesystem representation, using VBR and Entry` to access and process filesystem metadata and data.
util.go - Util.go` provides utility functions for the libxfat library, aiding in EXFAT filesystem processing
- It offers functions for validating entry types, counting bits in bitmaps, handling Unicode conversion from ASCII, formatting timestamps, interpreting file attributes, and converting byte sizes to human-readable formats
- These functions streamline data manipulation and presentation within the larger EXFAT parsing and analysis process.
vbr.go - Vbr.go parses the Volume Boot Record (VBR) of an exFAT file system
- It reads VBR data from a disk image, verifies its integrity using signature checks and sync values, and extracts key metadata
- This metadata includes volume size, FAT location and size, data region offset, cluster information, and other essential parameters
- The parsed VBR data is crucial for subsequent file system operations within the
libxfat` library.

Getting Started

Prerequisites

This project requires the following dependencies:

  • Programming Language: Go
  • Package Manager: Go modules

Installation

Build libxfat from the source and intsall dependencies:

  1. Clone the repository:

    ❯ git clone https://github.com/aoiflux/libxfat
  2. Navigate to the project directory:

    cd libxfat
  3. Install the dependencies:

<!-- [![go modules][go modules-shield]][go modules-link] -->
<!-- REFERENCE LINKS -->
<!-- [go modules-shield]: https://img.shields.io/badge/Go-00ADD8.svg?style={badge_style}&logo=go&logoColor=white -->
<!-- [go modules-link]: https://golang.org/ -->

**Using [go modules](https://golang.org/):**

```sh
❯ go build
```

Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/aoiflux/libxfat
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


Cite

Gogia, G., & Rughani, P. (2024). Parex: A novel exfat parser for file system forensics. Computación y Sistemas, 28(2). https://doi.org/10.13053/cys-28-2-4804

Paper

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages