• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Original Xbox FATX Filesystem Library, Python bindings, FUSE driver, and GUI explorer

fatx

Original Xbox FATX Filesystem Library, Python bindings, FUSE driver, and GUI explorer.

  • libfatx is a C library for working with the FATX filesystem, a variant of FAT16/32 developed by Microsoft for the original Xbox console.
  • fatxfs is a FUSE driver built using libfatx.
  • pyfatx is a Python module providing bindings to libfatx.
  • gfatx is a graphical utility for working with FATX disk images, built around libfatx.

libfatx

libfatx provides both read and write access to FATX filesystems, and formatting disks. Large disks are supported via F partition.

fatxfs

A FUSE userspace filesystem driver built using libfatx that enables you to mount a FATX filesystem on your host system and interact with it using your typical system tools. Works on Linux and macOS. Other platform support is possible, but untested.

Build via Docker

fatxfs can be easily built inside a Docker container. If you use this method, you can skip the prerequisites and build instructions below.

$ git clone https://github.com/mborgerson/fatx
$ docker build -t fatxfs .
$ docker run -it --rm -v $PWD:/work -w /work --device /dev/fuse --privileged fatxfs
# mkdir c
# fatxfs xbox.img c
# ls c

How to Build (Natively)

Prerequisites

Ubuntu

Assuming you already have typical build tools installed, install FUSE and CMake:

$ sudo apt-get install libfuse-dev cmake pkg-config
macOS

Download Xcode (available from the App Store) to get command line tools.

Assuming you have homebrew installed, install pkgconfig and cmake:

$ brew install pkgconfig cmake macfuse

Download Source

Clone the repository:

$ git clone https://github.com/mborgerson/fatx && cd fatx

Build

Create a build directory and run cmake to construct the Makefiles:

$ mkdir build && cd build
$ cmake ..

Finally, start the build:

$ make

How to Use

Firstly, you will need a raw disk image or block device to mount. Then, you can simply create a mountpoint and mount the "C drive" (default behavior). For example:

$ cd fatxfs
$ mkdir c_drive
$ ./fatxfs /dev/nbd0 c_drive
$ ls c_drive

You can specify the drive letter of the partition to mount:

$ ./fatxfs /dev/nbd0 e_drive --drive=e

Or, you can specify the offset and size of the partition manually:

$ ./fatxfs /dev/nbd0 c_drive --offset=0x8ca80000 --size=0x01f400000

Tips

Mounting a qcow Image

If your disk image is a qcow image, you can mount it as a network block device before mounting a partition on the device:

$ sudo apt-get install qemu-utils
$ sudo modprobe nbd max_part=8
$ sudo qemu-nbd --connect=/dev/nbd0 /path/to/your/image.qcow2
$ sudo chmod a+rwx /dev/nbd0

Unfortunately, on macOS, there is not a way to mount a qcow image like this (AFAIK). I recommend converting the qcow image to a raw disk image.

$ qemu-img convert /path/to/image.qcow /path/to/output.raw

Logging

For debug purposes, you can have fatxfs log operations to a file given by the --log option. You can control the amount of output using the --loglevel option.

pyfatx

pypi

A Python module providing bindings to libfatx. Wheels are provided for Windows and Linux.

The latest release of pyfatx can be installed via:

pip install pyfatx

You can install the latest version from source with:

pip install git+https://github.com/mborgerson/fatx

pyfatx provides a module with some helpful utilities, like listing drive contents and extracting a filesystem, e.g. a filesystem can be extracted with:

python -m pyfatx -x ./path/to/disk.img

gfatx

A graphical utility for working with FATX disk images, built around libfatx.

Note: This tool is in a very early state, and only has the functionality to browse filesystems in a disk at the moment.

gfatx

Build on Ubuntu

sudo apt install qt5-default
cd /path/to/fatx
mkdir build
cd build
cmake ..
make gfatx

Build on Windows

  • Install Visual Studio 2019 Community
  • Install Qt 5.15.2. I recommend using the Qt open source online installer.
  • From Start menu, launch a "Qt 5.15.2 + MSVC 2019" command prompt
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" amd64
cd C:\path\to\fatx
mkdir build
cd build
cmake ..
cmake --build . --target gfatx

Build on macOS

brew install pkgconfig qt@5
export PATH="/usr/local/opt/qt@5/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/qt@5/lib"
export CPPFLAGS="-I/usr/local/opt/qt@5/include"
export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig"
cd /path/to/fatx
mkdir build
cd build
cmake --build . --target gfatx

License

Copyright (C) 2015  Matt Borgerson

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Credit

This project was made possible in part by the research done by Andrew de Quincey, Lucien Murray-Pitts, and Michael Steil. Thank you!

More Repositories

1

xemu

Original Xbox Emulator for Windows, macOS, and Linux (Active Development)
C
1,384
star
2

mdec

Decompilation as a Service. Explore multiple decompilers and compare their output with minimal effort. Upload binary, get decompilation.
Python
451
star
3

gdbstub

Simple, single-file, dependency-free GDB stub that can be easily dropped in to your project.
C
197
star
4

TrayPlay

An app for macOS that lives in your menu bar and lets you easily control iTunes or Spotify, without interrupting your workflow.
Objective-C
143
star
5

l2tunnel

Open-source, cross-platform L2 tunneling for game consoles and other devices
C
49
star
6

blynclight

Open-source control software for the Embrava Blynclight
Python
37
star
7

dc27-dooom

Port of the classic first-person-shooter DOOM to Xbox for DEFCON 27 CTF
Shell
26
star
8

textureatlas

A simple, cross-platform Python-based tool and C library for creating and using a texture atlas in your application or game. Distributed under the terms of the MIT license.
Python
24
star
9

genconfig

Automatic runtime configuration / settings system for your C/C++ application. Load from TOML configs into a generated C struct and back again with minimal effort.
C++
22
star
10

xqemu-kernel

An open-source Xbox kernel alternative, designed for use with XQEMU.
C
21
star
11

basic_sdl2_gl

No-fuss Modern SDL2/OpenGL/GLEW Boilerplate
C
19
star
12

spotify-playlist-from-csv

Create playlists in Spotify using Python, libspotify, and pyspotify.
Python
19
star
13

jit

A little just-in-time compiler thing
C
18
star
14

xbox-includes

GPL Original Xbox kernel and library includes, sourced from Cxbx-Reloaded, Wine, OpenXDK
C
18
star
15

bintrace

Fast program tracing and analysis
Python
16
star
16

xbeeprom

Simple tool to edit Xbox EEPROMs
C++
15
star
17

pyxbe

Python 3 library to read and write XBE files, the executable file format for the original Xbox game console
Python
14
star
18

xemu-hdd-image

Copyright-Free Xbox HDD Image
C
13
star
19

OpenXBOX

Defunct proof of concept project--check out xemu!
12
star
20

xsm64

C
10
star
21

xemu-website

xemu.app website sources
SCSS
7
star
22

cromwell

GPL Xbox BIOS replacement
C
6
star
23

Pad

Sublime Text Plug-In to Add Padding to Lines
Python
5
star
24

xemu-test

xemu Automated Tests
Python
4
star
25

GoTruncateHtml

A Go library for truncating HTML and optionally appending an ellipsis.
Go
4
star
26

baremetal

"Bare Metal" C/C++ Demo Code
C
4
star
27

xbtests

Tests for the original Xbox
C
3
star
28

MarkdownViewer

A simple Markdown file viewer written in Python.
Python
3
star
29

MXMarqueeText

A simple OS X / Cocoa scrolling text (marquee) control.
Objective-C
3
star
30

xemu-test-agent

Python
1
star
31

simple-lru

Simple LRU cache
C
1
star
32

test-xemu-s3tc-volume-compress

C
1
star
33

mips_toolchain

Simple MIPS toolchain setup using dockcross
C
1
star
34

pyfuzzer

Like AFL, but worse. Python+QEMU-user based fuzzer
Python
1
star
35

PyXbSymbolDatabase

Python bindings to the "Xbox Symbol Database"
Python
1
star