https://github.com/leoetlino/wiifs
A Wii NAND file system driver
https://github.com/leoetlino/wiifs
filesystem-library wii
Last synced: about 1 year ago
JSON representation
A Wii NAND file system driver
- Host: GitHub
- URL: https://github.com/leoetlino/wiifs
- Owner: leoetlino
- License: gpl-2.0
- Created: 2018-02-16T21:53:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T17:45:37.000Z (over 8 years ago)
- Last Synced: 2025-03-22T06:27:49.901Z (over 1 year ago)
- Topics: filesystem-library, wii
- Language: C++
- Size: 28.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# wiifs
**A Wii NAND file system driver**
## Features
wiifs supports most of the file system and file interface exposed by IOS, including
metadata and file read/write, HMAC verification and generation, and ECC data generation.
Some exceptions:
* boot2-related functions (`/dev/boot2`)
* Undocumented commands such as `/dev/fs` ioctlv 14 and `SetFileVersionControl`
wiifs strives to behave as close as possible to IOS's file system driver so
that NAND images which are used with this library can also still be used with IOS.
## Usage
```C++
#include
// Map the NAND image to memory, using mmap or any equivalent API.
auto* nand =
static_cast(mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)));
// Fill key information.
wiifs::FileSystemKeys keys;
keys.hmac = nand_hmac_key;
keys.aes = nand_aes_key;
// Create a wiifs::FileSystem.
std::unique_ptr fs = wiifs::FileSystem::Create(nand, keys);
```
Before using any of the file system or file functions, a file descriptor must be
obtained using `FileSystem::OpenFs` or `FileSystem::OpenFile`.
```C++
constexpr wiifs::Uid uid = 0;
constexpr wiifs::Gid gid = 0;
const auto fs_fd = fs->OpenFs(uid, gid);
if (!fs_fd)
// ...
const auto result = fs->ReadDirectory(*fs_fd, "/");
if (!result)
// ...
```
For more information about the API, please refer to [`wiifs/fs.h`](include/wiifs/fs.h).
## License
wiifs 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.