Expand description
A library for working with the data.arc file from Smash Ultimate.
use smash_arc::{ArcFile, ArcLookup, FileNode, Hash40, Region};
// Load the hashes needed to list directories (file format restriction)
Hash40::set_global_labels_file("hash_labels.txt").unwrap();
// Parse the arc from a file
let arc = ArcFile::open("data.arc").unwrap();
// loop over every file in the root
for node in arc.get_dir_listing("/").unwrap() {
match node {
FileNode::Dir(dir) => {
// print out name of directory
println!("directory: {}", dir.global_label().unwrap());
}
FileNode::File(file) => {
// extract file
let path = file.global_label().unwrap();
std::fs::write(path, arc.get_file_contents(file, Region::UsEnglish).unwrap()).unwrap();
}
}
}
§Cargo Features
-
network
(enabled by default) = Ability to parse the file over the network -
dir-listing
(enabled by default) = List directories -
global-hashes
(enabled by default) = Enable a global table for cracking hashes -
smash-runtime
= Enables features for running under the context of Smash Ultimate itself (enable Aarch64 crc32 hardware acceleration, enable parsing the Arc from the game’s memory layout) -
search
= Enable functionality to fuzzy searchArcFile
s -
ZSTD backends
libzstd
- Recommended for use on platforms it builds forrust-zstd
- Increased portability (Recommended for use on switch)nozstd
- Provide no zstd backend, panic on ZSTD decompression
Re-exports§
pub use hash_labels::GLOBAL_LABELS;
Structs§
- ArcFile
- A struct representing the data.arc file
- Comp
Table Header - DirInfo
- Also known as MassLoadingGroup
- DirInfo
Flags - Directory
Offset - Also known as MassLoadingData
- File
Data - File
Data Flags - File
Data Idx - File
Info - File
Info Bucket - File
Info Flags - File
Info Idx - File
Info Index - File
Info Indice Idx - File
Info ToFile Data - File
Info ToFile Data Bitfield - File
Path - File
Path Idx - File
System - The filesystem itself. Includes all the linking between paths, file data, directories, and mass-loading groups.
- File
System Header - Folder
Path List Entry - GLOBAL_
LABELS - Hash40
- Hash
Labels - Hash
ToIndex - Info
ToData Idx - Path
List Entry - Quick
Dir - Search
File System - Search
File System Header - Search
List Entry - Stream
Data - Stream
Entry - Stream
Entry Flags - Stream
Header
Enums§
- File
Node - A node in the file tree, the hash of which can be used to handle lookups.
- Lookup
Error - Redirection
Type - Region
- An enum representing a Region (country and associated language) supported by Smash Ultimate.
Traits§
- ArcLookup
- The trait that allows different implementations of the arc to share the same code for making lookups into the filesystem use the same logic.
- Search
Lookup - Seek
Read