Coder Social home page Coder Social logo

mborgerson / fatx Goto Github PK

View Code? Open in Web Editor NEW
115.0 12.0 21.0 267 KB

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

License: GNU General Public License v2.0

CMake 2.86% C 76.75% Dockerfile 0.25% Shell 0.32% Python 13.96% C++ 5.85%
xbox filesystem fuse fatx python qt

fatx's Introduction

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!

fatx's People

Contributors

abaire avatar antangelo avatar gaasedelen avatar mborgerson avatar neofright avatar teufelchen1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fatx's Issues

Add libfatx GUI

A GUI application with an explorer / file commander interface would be useful for casual users and straightforward to implement. Preferably C++ with Qt.

wip on feat/gfatx branch:
unknown

Some feature thoughts:

  • Icon view
  • Set up multiplatform releases
  • Show timestamps
  • Column toggle
  • Import / Export files
  • Create dir
  • Delete dir / files
  • Copy / Paste files
  • Drag / Drop files
  • Column sorting
  • Show file sizes in human readable format
  • File details dialog / pane
  • Show partition info (% free vs used, sectors)
  • Main menu bar
    • Load new disk image
    • Search
      • Search for files by name
      • Search for files by contents
  • File decoding
    • Game save visualization (show game save icons and names)
    • Show XBE information
  • Show file hashes
  • Quick view (double click to open/edit)
  • Support XMUs, hotplug

Help fatx windows 10

Hello! I know this is not a pyfatx related question, but following the instructions I have this error:

**PS C:\WINDOWS\system32> pip install --use-pep517
ERROR: You must give at least one requirement to install (see "pip help install")
PS C:\WINDOWS\system32> pip install --use-pep517 pyfatx
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pyfatx/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/pyfatx/
Collecting pyfatx
Using cached pyfatx-0.0.7.tar.gz (36 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting cffi (from pyfatx)
Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl.metadata (1.5 kB)
Collecting pycparser (from cffi->pyfatx)
Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl (181 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Building wheels for collected packages: pyfatx
Building wheel for pyfatx (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for pyfatx (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [93 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-312
creating build\lib.win-amd64-cpython-312\pyfatx
copying pyfatx_init_.py -> build\lib.win-amd64-cpython-312\pyfatx
copying pyfatx_main_.py -> build\lib.win-amd64-cpython-312\pyfatx
running build_ext
generating cffi module 'build\temp.win-amd64-cpython-312\Release\pyfatx.libfatx.c'
creating build\temp.win-amd64-cpython-312
creating build\temp.win-amd64-cpython-312\Release
-- Building for: Visual Studio 16 2019
CMake Deprecation Warning at CMakeLists.txt:18 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- The C compiler identification is unknown
  -- The CXX compiler identification is unknown
  CMake Error at CMakeLists.txt:20 (project):
    No CMAKE_C_COMPILER could be found.



  CMake Error at CMakeLists.txt:20 (project):
    No CMAKE_CXX_COMPILER could be found.



  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "C:\Users\isaac\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\isaac\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\isaac\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\build_meta.py", line 410, in build_wheel
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\build_meta.py", line 395, in _build_with_temp_dir
      self.run_setup()
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
      super().run_setup(setup_script=setup_script)
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 9, in <module>
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
      dist.run_commands()
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\dist.py", line 968, in run_command
      super().run_command(command)
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\normal\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\dist.py", line 968, in run_command
      super().run_command(command)
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
      self.run_command(cmd_name)
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\dist.py", line 968, in run_command
      super().run_command(command)
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\normal\Lib\site-packages\cffi\setuptools_ext.py", line 141, in run
      ext.sources[0] = make_mod(self.build_temp, pre_run)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\isaac\AppData\Local\Temp\pip-build-env-ot4uiq_a\normal\Lib\site-packages\cffi\setuptools_ext.py", line 126, in make_mod
      pre_run(ext, ffi)
    File "C:\Users\isaac\AppData\Local\Temp\pip-install-l2faki4w\pyfatx_ec27292bf3ab4dcbae31f95f1f3b212d\build_cffi.py", line 34, in pre_run
      subprocess.check_call(['cmake', '-B', 'build'] + cmake_config_args, cwd=ROOT_DIR)
    File "C:\Users\isaac\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '-B', 'build', '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON', '-A', 'x64']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyfatx
Failed to build pyfatx
ERROR: Could not build wheels for pyfatx, which is required to install pyproject.toml-based projects
PS C:\WINDOWS\system32>**

also


** Visual Studio 2019 Developer Command Prompt v16.11.36
** Copyright (c) 2021 Microsoft Corporation


[vcvarsall.bat] Environment initialized for: 'x64'

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>

also

PS C:\WINDOWS\system32> pip install cmake
Requirement already satisfied: cmake in c:\users\isaac\appdata\local\programs\python\python312\lib\site-packages (3.29.3)
PS C:\WINDOWS\system32>

also added path

C:\Users\isaac\AppData\Local\Programs\Python\Python312\Lib\site-packages\cmake\data\bin\cmake.exe

to windows 10

Any help please???

failed to initialize the filesystem

hello,

with fatxfs now compiled, I'm trying to access a 250GB hard disk of Xbox 360 Slim, but every time I try, I come across "failed to initialize the filesystem": can you help me, put me on the right track ?

# fatxfs --help
FATXFS - Userspace FATX Filesystem Driver

Usage: fatxfs <device> <mountpoint> [<options>]
   or: fatxfs <device> <mountpoint> --drive=c|e|x|y|z [<options>]
   or: fatxfs <device> <mountpoint> --offset=<offset> --size=<size> [<options>]

General Options:
    -o opt, [opt...]       mount options
    -h --help              print help
    -V --version           print version

FATXFS options:
    --drive=<letter>       mount a partition by its drive letter
    --offset=<offset>      specify the offset (in bytes) of a partition manually
    --size=<size>          specify the size (in bytes) of a partition manually
    --log=<log path>       enable fatxfs logging
    --loglevel=<level>     control the log output level (a higher value yields more output)
...

the hard disk is accessible through /dev/loop1 :

# fatxfs /dev/loop1 /mountpoint/
failed to initialize the filesystem

with drive letter as in your example :

# fatxfs /dev/loop1 /mountpoint/ --drive=e
failed to initialize the filesystem

with offset and size of data partition :

# dd if=/dev/loop1 bs=1 count=4 skip=$((0x130eb0000)) status=none
XTAF

# fdisk -l /dev/loop1
Disque /dev/loop1 : 232,9 GiB, 250059350016 octets, 488397168 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets

# fatxfs /dev/loop1 /mountpoint/ --log=/tmp/log --loglevel=20 --offset=$((0x130eb0000)) --size=$((250059350016-0x130eb0000))
failed to initialize the filesystem

# cat /tmp/log 
fatx_dev_read(buf=0x0x7ffeed71cf2c, size=0x4, items=0x1)
invalid signature

the value 0x130eb0000 is comming from http://www.free60.org/wiki/FATX.

regards, lacsaP.

Allow setting sector size

Memory Units have a sector size of 4096 bytes, instead of 512. This should be a setting on the command line instead of being hardcoded.

Xbox Controller Memory card

The readme does not mention it, but is this meant to be able to mount an XBox controller memory card via USB?

Using an Xbox to USB cable, I was able to format a USB stick on the Xbox. But when I try to mount it with fatx, I just get an error "failed to initialize the filesystem".

I was able to use fatx to format the USB stick, and transfer save files to it, but the XBox does not seem to really like that. The save file is showing on the XBox, but as "Unknown Title" (but with the correct icon) with the only option to "Delete" (yes, after selecting the actual save file). Possibly because it is not expecting partitions on the memory card?

sudo ./fatxfs/fatxfs /dev/sdc /mnt --format=retail --destroy-all-existing-data

Floating Point Exception

I am getting a floating point exception when trying to mount a physical drive using the command ./fatxfs /dev/sdb --format=f-takes-all --destroy-all-existing-data.

Also, not sure if it's related, but I'm also unable to mount any existing physical drive over USB. Retail option results in same FPE.
I know that this USB adaptor works for FATX stuff usually and this drive is unlocked and verified using hdparm -I /dev/sdb

Using:
Fuse 3.10.3
Debian 11 Bullseye
Kernel 5.10.0.15-686-pae

cmake Fails on Linux Mint

Unable to generate make file.
was error:
cmake
Usage
cmake [options]
cmake [options] ...
...
Run 'cmake --help' for more information.

**** I had to specify :

cmake Unix Makefiles /home/bug725/fatx/src
cd ~/fatx/src
make

That took care of it for me. Please add a notation.

I do need to do a distro update system. My cat /etc/*release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.3
DISTRIB_CODENAME=sylvia
DISTRIB_DESCRIPTION="Linux Mint 18.3 Sylvia"
NAME="Linux Mint"
VERSION="18.3 (Sylvia)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 18.3"
VERSION_ID="18.3"
HOME_URL="http://www.linuxmint.com/"
SUPPORT_URL="http://forums.linuxmint.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/linuxmint/"
VERSION_CODENAME=sylvia
UBUNTU_CODENAME=xenial
cat: /etc/upstream-release: Is a directory

mktime() expects months numbered 0-11

diff --git a/src/fatxfs_fuse.c b/src/fatxfs_fuse.c
index 9ab8bb6..0dfca51 100644
--- a/src/fatxfs_fuse.c
+++ b/src/fatxfs_fuse.c
@@ -276,7 +276,7 @@ int fatx_fuse_get_attr(const char  *path, struct stat *stbuf)
     timeinfo.tm_min  = attr.modified.minute;
     timeinfo.tm_hour = attr.modified.hour;
     timeinfo.tm_mday = attr.modified.day;
-    timeinfo.tm_mon  = attr.modified.month;
+    timeinfo.tm_mon  = attr.modified.month-1;
     timeinfo.tm_year = attr.modified.year-1900;
     stbuf->st_mtime  = mktime(&timeinfo);

xemu

hi,

I don't know if you are aware of this project based on qemu which can possibly help the development of fatx...

https://xemu.app/

regards, lacsaP.

You cannot specify a folder path that is not relative to the current directory

[irix@shodan fatxfs]$ mkdir mount
[irix@shodan fatxfs]$ mkdir mount/c
[irix@shodan fatxfs]$ mkdir mount/e
[irix@shodan fatxfs]$ mkdir mount/x
[irix@shodan fatxfs]$ mkdir mount/y
[irix@shodan fatxfs]$ mkdir mount/z
[irix@shodan fatxfs]$ ./fatxfs /dev/nbd0 mount/c --drive=c
[irix@shodan fatxfs]$ ls mount/c
[irix@shodan fatxfs]$ cd mount/c
[irix@shodan c]$ ls
[irix@shodan c]$ cd ..
[irix@shodan mount]$ ls
c  e  x  y  z
[irix@shodan mount]$ umount c
[irix@shodan mount]$ ../fatxfs /dev/nbd0 c --drive=c
[irix@shodan mount]$ ls c
 Audio   'Xbox Book.xtf'   data    images   sounds         xboxdashdata.185EAD00   xshell.xbe
 XODASH   Xbox.xtf         fonts   media    xboxdash.xbe   xlaunch.ini

When attempting to mount with a folder path that is not relative to the current directory by solely name, the partition specified will be "mounted".
It will be shown with the proper permissions, no errors will be thrown. It will be considered properly mounted, and umount will let you unmount it, but the folder will remain empty.

The location of the fatxfs executable is irrelevant, but you have to be in the containing folder of your mount point, otherwise the command will simply not populate the folder with anything. Nothing out of the ordinary is shown in the logs.

I believe this functionality is somewhat crucial. Thanks in advance. Please let me know if I need to provide further information.

Missing gfatx features

Some feature thoughts:

  • Disk initialization
  • Icon view (showing one directory at a time, with each entry in the directory as an icon)
  • Explorer view (showing the directory tree on the left, with directory listing on the right)
  • Set up multiplatform releases
  • Show timestamps
  • Column toggle
  • Import / Export files
  • Create dir
  • Delete dir / files
  • Copy / Paste files
  • Drag / Drop files
  • Column sorting
  • Show file sizes in human readable format
  • File details dialog / pane
  • Show partition info (% free vs used, sectors)
  • Main menu bar
    • Load new disk image
    • Search
      • Search for files by name
      • Search for files by contents
  • File decoding
    • Game save visualization (show game save icons and names)
    • Show XBE information
  • Show file hashes
  • Quick view (double click to open/edit)
  • Support XMUs, hotplug

fatxfs is a directory

I'm trying to build the fatxfs binary, but after make

(image from readme)

image

trying to use the command:

./fatxfs /dev/nbd0 c_drive

I get this error: fatxfs is a directory

I check it with ls ./fatxfs

and its right, that is a directory....
sooooo
where is the binary o.O

Operation not permitted

Below are the commands I ran:

mkdir /mnt/f
fatxfs /dev/sdc /mnt/f --drive=f
cd /mnt/f
rsync -ra /mnt/ftp/games/  /mnt/f/games

I got error as below:

True Crime - Streets of LA/Data/Sounds/VOR_132.wav
True Crime - Streets of LA/Data/Sounds/VOR_137.wav
True Crime - Streets of LA/Data/Sounds/Vn01_Pnk.wav
True Crime - Streets of LA/Data/Sounds/Vn02_Fng.wav
True Crime - Streets of LA/Data/Sounds/Vn03_Guy.wav
rsync: [receiver] rename "/mnt/f/games/True Crime - Streets of LA/Data/Sounds/.Vn02_Fng.wav.jhOBCX" -> "True Crime - Streets of LA/Data/Sounds/Vn02_Fng.wav": Operation not permitted (1)
rsync: [receiver] mkstemp "/mnt/f/games/True Crime - Streets of LA/Data/Sounds/.Vn03_Guy.wav.A5RlkX" failed: Operation not permitted (1)
True Crime - Streets of LA/Data/Sounds/Vn04_Chg.wav
rsync: [receiver] mkstemp "/mnt/f/games/True Crime - Streets of LA/Data/Sounds/.Vn04_Chg.wav.yjpgmX" failed: Operation not permitted (1)
True Crime - Streets of LA/Data/Sounds/Vn05_Frc.wav
rsync: [receiver] mkstemp "/mnt/f/games/True Crime - Streets of LA/Data/Sounds/.Vn05_Frc.wav.sWZ0cZ" failed: Operation not permitted (1)
True Crime - Streets of LA/Data/Sounds/Vn06_Gns.wav
rsync: [receiver] mkstemp "/mnt/f/games/True Crime - Streets of LA/Data/Sounds/.Vn06_Gns.wav.ieEduW" failed: Operation not permitted (1)
True Crime - Streets of LA/Data/Sounds/Vn07_Cks.wav
rsync: [receiver] mkstemp "/mnt/f/games/True Crime - Streets of LA/Data/Sounds/.Vn07_Cks.wav.wgGwkZ" failed: Operation not permitted (1)
True Crime - Streets of LA/Data/Sounds/Vn08_Mbs.wav

Can't build on Ubuntu 17.04

When I try making this on Ubuntu 17.04 using the instructions provided, I get this set of errors:

[ 83%] Built target libfatxfs
[ 91%] Building C object CMakeFiles/fatxfs.dir/src/fatxfs_fuse.c.o
In file included from /home/xboxen/fatx/src/fatxfs_fuse.c:31:0:
/usr/include/fuse/fuse.h:444:54: error: array type has incomplete element type ‘struct timespec’
int (*utimens) (const char *, const struct timespec tv[2]);
^~
/usr/include/fuse/fuse.h:444:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
int (*utimens) (const char *, const struct timespec tv[2]);
^~~~~~~~
/usr/include/fuse/fuse.h:867:29: error: array type has incomplete element type ‘struct timespec’
const struct timespec tv[2]);
^~
/usr/include/fuse/fuse.h:867:20: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
const struct timespec tv[2]);
^~~~~~~~
CMakeFiles/fatxfs.dir/build.make:62: recipe for target 'CMakeFiles/fatxfs.dir/src/fatxfs_fuse.c.o' failed
make[2]: *** [CMakeFiles/fatxfs.dir/src/fatxfs_fuse.c.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/fatxfs.dir/all' failed
make[1]: *** [CMakeFiles/fatxfs.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Doesn't support Chihiro partitions

./fatxfs /mnt/c/Temp/V322_S.512_dec c_drive --offset=0x0 --size=0x01f400000 --log=log.log || cat log.log
failed to initialize the filesystem
expected cluster size to be 32, got 8

Size is just taken from the example but it doesn't matter anyway.

Support EOD marker as 0x00

I have a (flash) drive with files that seemingly use 0x00 as the end of directory marker. It would be nice to support 0x00 as well as 0xff as end of directory markers.

Very slow write speeds on Linux

I have mounted my Cerbios formatted F partition via:
./fatxfs /dev/sdx /mnt/Xbox_F --drive=f

I'm using # watch progress -w to monitor the speed of file transfers. e.g.
mv './Xbox Game (USA)' /mnt/Xbox_F/Games/

The write speeds are extremely slow (4 MiB/s) and are slower than they would be if using FTP.

[671837] mv Xbox Game (USA)/Xbox Game (USA).cci
        61.7% (734.8 MiB / 1.2 GiB) 4.1 MiB/s remaining 0:01:50 

If I cat one of the games on the FATX HDD to read it (and pipe it into /dev/null):

[709219] cat /mnt/Xbox_F/Games/Xbox Game (GLO)/Xbox Game (GLO).1.cci
        35.4% (1.4 GiB / 4.0 GiB) 127.9 MiB/s remaining 0:00:20  

Then I am getting the bus speed of the disk.

Is this a known/expected issue that write speeds are only ~3% of the speed of reads?

(I should state that to confirm it wasn't an issue with the filesystem that the source files are stored on, I also cat'ed the same file I am moving (to the Xbox disk) to /dev/null and I got 400 MiB/s from my RAIDZ.)

If you would like any system info please let me know and I'll be happy to provide it.

1GB Chihiro images crash fatxfs or has blank root directory

Attempting to load a 1GB Chihiro FATX partition crashes the driver.

Using the size as described in the example we end up crashing the driver.

--size=0x01f400000

Using a 'correct' size as calcuated by JayFoxRox's Chihiro-Tools project we end up being able to mount the image - however the root directory is empty.

--size=0x3B7D9000

Log with --size=0x01f400000 is too long to post, see: https://pastebin.com/Vy4ykv1u

Log below is from --size=0x3B7D9000

fatx_dev_read(buf=0x0x7fffcea32904, size=0x4, items=0x1)
fatx_dev_read(buf=0x0x7fffcea328fa, size=0xe, items=0x1)
Partition Info:
  Device Path:         /mnt/c/Temp/GCB0083s_b.img_dec
  Partition Offset:    0x0 bytes
  Partition Size:      0x3b7d9000 bytes
  Volume Id:           ffffffff
  Bytes per Sector:    512
  # of Sectors:        1949384
  Sectors per Cluster: 32
  # of Clusters:       60918
  FAT Offset:          0x1000 bytes
  FAT Size:            0x1e000 bytes
  FAT Type:            16
  Root Cluster:        1
  Cluster Offset:      0x1f000 bytes
fatx_fuse_get_attr(path="/")
fatx_fuse_read_dir(path="/", buf=0x0x55555f8794e0, offset=0x0)
fatx_open_dir(path="/")
checking component 1 in path /
fatx_read_dir(cluster=1, entry=0)
fatx_dev_seek_cluster(cluster=1, offset=0x0)
fatx_cluster_number_to_byte_offset - cluster = 1
fatx_dev_read(buf=0x0x7fffcea32360, size=0x40, items=0x1)
reached the end of the directory
fatx_close_dir()

A 512MB FATX partition is able to mount, read, and write using the example --size=0x01f400000.

Improve pyfatx CLI

Use subcommands for disk tools:

pyfatx <disk> cp <src> <dest>
pyfatx <disk> ls <path>
pyfatx <disk> rm <path>
pyfatx <disk> extract [<path> ...]

Writing over a deleted file with the same name may write garbage data

Sometimes, after writing a large file, and then deleting the file, writing over the file again will result in garbage data being read back.

Reproduced on a clean drive image by copying a 256MB file, deleting it, and then copying a smaller file with the same name. The MD5 sum of the second file is incorrect (it matches neither the first nor second file copied).

Can this be used to format a disk for Titan/Cerbios ?

Here it states that:

Matt's FATX project and FATXplorer are currently the only tools that can format disks with larger clusters

However, I can't find any examples in this project's README.

I don't use Windows so I'm hopeful there is a macOS solution to formatting disks!

Cannot compile bin

Problem: I cannot compile bin if I do not install qt5 and build-essential BEFORE following the how-to compile guide.
Solution: Install qt5 and build-essential before following the how to compile guide.
Result: It works great on ubuntu 24.04.

Suggestion: add that you need to install qt5 and build-essential packages

Thank you SO much.

Xbox 360?

Hi, does this work on Xbox 360 FATX HDDs? I'm hearing conflicting information as to whether the 360 FATX implementation differs from the original Xbox.

Write Support

Hi,

In 2016 I found myself wanting to perform whatever the closest thing to a "factory reset" would be, on the internal HDD of an Xbox. But I also wanted to have the ability to do this again and again with ease, so that I could try all kinds of different software mods and unofficial software... and know I'd have a clean slate each time.

I even modified an Xbox so that it uses two IDE ribbons which both poke out the back of the case, one connected to the motherboard and the other to the HDD. This way, when connected together it'll work as normal, but if you instead connect an USB-IDE adaptor (in the pic it is shown placed on top of the Xbox) to the ribbon cable going to the HDD then you've got super easy access to it without opening the Xbox.

img_20180520_215806

I even started working on a script so that I could repopulate the entire HDD (partition table, partitions, filesystems, contents of filesystems) from a modern Linux distribution which I'll post here...

##
#
#  This is an alternate version of your setup script...
#
#  It depends on getting mkfs.fatx from the XboxHDM Linux ISO
#  But ALSO depends on fatxfs being compiled from here...
#  https://github.com/mborgerson/fatx
#  HOWEVER they haven't added write support, until they do the below
#  is totally useless.  The XboxHDM VM is the only known thing
#  (compiled into the Kernel) to have read/write for FATX.
#
#  NOTE: the Christophe Duverger/baxter104 fusefatx is for 360 XTAF only
#
####


### Download and extract additional files needed

wget -O- http://downloads.sourceforge.net/xboxhdm2/hdparm/hdm2.3addon.tar.bz2 | tar -xj
# The below archive contains the default files for Drive C (see usual online sources if needed)
7z x Clean_C_E_files.7z

### Connect the disk using a JMicron JM20337 based USB to IDE adapter

disk="/dev/sdb"

### (as needed) Unlock the disk if pulled from your particular Xbox

./hdparm --security-eeprom-disable eeprom_xbox-1-1-samsung.bin $disk

### (optional) Wipe the beginning of the disk and where partitions should be

dd if=/dev/zero of=$disk bs=512k count=1
dd if=/dev/zero of=$disk seek=1 bs=512k count=1
dd if=/dev/zero of=$disk seek=1501 bs=512k count=1
dd if=/dev/zero of=$disk seek=3001 bs=512k count=1
dd if=/dev/zero of=$disk seek=4501 bs=512k count=1
dd if=/dev/zero of=$disk seek=5501 bs=512k count=1
dd if=/dev/zero of=$disk seek=15633072 bs=512 count=1

### Write partition table to the disk

dd if=head.raw of=$disk bs=512k
#dd if=fatx.raw of=$disk seek=1 bs=512k
#dd if=fatx.raw of=$disk seek=1501 bs=512k
#dd if=fatx.raw of=$disk seek=3001 bs=512k
#dd if=fatx.raw of=$disk seek=4501 bs=512k
#dd if=fatx.raw of=$disk seek=5501 bs=512k
#dd if=fatx.raw of=$disk seek=15633072 bs=512

### Create loop devices for each partition and store which loop device is which

x_drive="$(losetup --show -f -o 524288 --sizelimit 786432000 $disk)"
y_drive="$(losetup --show -f -o 786956288 --sizelimit 786432000 $disk)"
z_drive="$(losetup --show -f -o 1573388288 --sizelimit 786432000 $disk)"
c_drive="$(losetup --show -f -o 2359820288 --sizelimit 524288000 $disk)"
e_drive="$(losetup --show -f -o 2884108288 --sizelimit 5120024576 $disk)"
f_drive="$(losetup --show -f -o 8004132864 $disk)"

### (optional) Show the headers we wrote earlier to the disk and partitions

echo $(head -c1540 $disk|tail -c4)
echo $(head -c4 $x_drive)
echo $(head -c4 $y_drive)
echo $(head -c4 $z_drive)
echo $(head -c4 $c_drive)
echo $(head -c4 $e_drive)
echo $(head -c4 $f_drive)

### Format the partitions

./mkfs.fatx $x_drive
./mkfs.fatx $y_drive
./mkfs.fatx $z_drive
./mkfs.fatx $c_drive
./mkfs.fatx $e_drive
./mkfs.fatx $f_drive

### Mount drives C and E

mkdir -p /mnt/c_drive
mkdir -p /mnt/e_drive
./fatxfs $disk /mnt/c_drive --drive=c
./fatxfs $disk /mnt/e_drive --drive=e

### Copy files

cp -r C/* /mnt/c_drive
cp -r E/* /mnt/e_drive

### Unmount and tidy up loop devices

umount /mnt/c_drive
umount /mnt/e_drive
losetup -d $x_drive
losetup -d $y_drive
losetup -d $z_drive
losetup -d $c_drive
losetup -d $e_drive
losetup -d $f_drive

### Lock the disk so it can be used in your particular Xbox

./hdparm --security-eeprom-lock eeprom.bin $disk

### Other bits to tidy up

rm -R C E hdm2.3addon eeprom_xbox-1-1-samsung.bin /mnt/c_drive /mnt/e_drive

Trouble is I never really got around to using that script as it depended on fatxfs actually being able to write to the filesystems.

So my process hasn't changed really, basically I still have to grab the ageing Xbox-HDM v1.9 tool...
http://www.theisozone.com/downloads/xbox/tools/xbox-hard-drive-maker-v19-xboxhdm/
Use its make-iso-lin.sh script to make a bootable Linux ISO, and boot that ISO in VMware Workstation (configured with the Xbox HDD block device passed through to it as a VM disk). Xbox-HDM can then repopulate everything (as its Linux 2.4.25 kernel can write to FATX filesystems) but I still need to do the un-lock/re-lock of the disk outside of the VM.

Needless to say it's a lengthier process than it could be... but at least it means with a modern PC and a modern Linux distribution... it can be done - even if it does mean faffing with an old bootable Linux 2.4.25 ISO and a VM.

So I'm sticking all this information here in case anyone else was wanting to do the same or would find this information helpful.

If you are close to getting write support working or are stuck on something, count me as someone eager to help in anyway I can. Essentially in a long winded way, I'm saying the 'issue' I'm writing about is the lack of write support. But I'm also saying it'd have the really useful secondary side effect of helping people reset their Xbox's too! 😀

Steven

Error 2

hello,
compilation is meeting errors under Linux :

$ make      
[  8%] Building C object CMakeFiles/libfatxfs.dir/src/fatx.c.o
[ 16%] Building C object CMakeFiles/libfatxfs.dir/src/fatx_attr.c.o
[ 25%] Building C object CMakeFiles/libfatxfs.dir/src/fatx_dev.c.o
[ 33%] Building C object CMakeFiles/libfatxfs.dir/src/fatx_dir.c.o
[ 41%] Building C object CMakeFiles/libfatxfs.dir/src/fatx_fat.c.o
[ 50%] Building C object CMakeFiles/libfatxfs.dir/src/fatx_file.c.o
[ 58%] Building C object CMakeFiles/libfatxfs.dir/src/fatx_log.c.o
[ 66%] Building C object CMakeFiles/libfatxfs.dir/src/fatx_misc.c.o
[ 75%] Building C object CMakeFiles/libfatxfs.dir/src/fatx_partition.c.o
[ 83%] Linking C static library liblibfatxfs.a
[ 83%] Built target libfatxfs
[ 91%] Building C object CMakeFiles/fatxfs.dir/src/fatxfs_fuse.c.o
In file included from /tmp/fatx-master/src/fatxfs_fuse.c:31:0:
/usr/include/fuse/fuse.h:444:54: error: array type has incomplete element type 'struct timespec'
  int (*utimens) (const char *, const struct timespec tv[2]);
                                                      ^~
/usr/include/fuse/fuse.h:444:45: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
  int (*utimens) (const char *, const struct timespec tv[2]);
                                             ^~~~~~~~
/usr/include/fuse/fuse.h:867:29: error: array type has incomplete element type 'struct timespec'
       const struct timespec tv[2]);
                             ^~
/usr/include/fuse/fuse.h:867:20: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
       const struct timespec tv[2]);
                    ^~~~~~~~
make[2]: *** [CMakeFiles/fatxfs.dir/build.make:63: CMakeFiles/fatxfs.dir/src/fatxfs_fuse.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/fatxfs.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

regards.

Docker no longer builds

The Dockerfile states Ubuntu:17.04 which is end of live. As a result, the repos are offline, preventing the container image from being build.

However, the container and fatx build just fine in ubuntu 18.04 wich is LTS until April 2023.

donation link

where may I encourage more work for fatx support and a improved file manager possibly :)

Example file systems

Are there any example FATX16 and FATX32 file systems available to use to continue development? I'd love to implement file writing but I currently don't have access to a modded xbox.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.