All Projects → zeldamods → sarc

zeldamods / sarc

Licence: GPL-2.0 license
Nintendo SARC archive reader and writer

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sarc

SARC-Tool
Tool for extracting and packing SARC files present in Nintendo EAD games.
Stars: ✭ 60 (+275%)
Mutual labels:  nintendo, nintendo-switch, nintendo-wii-u
Miyamoto
A supercharged fork of the modern day level editor.
Stars: ✭ 67 (+318.75%)
Mutual labels:  nintendo, nintendo-switch, nintendo-wii-u
byml-v2
Nintendo BYML or BYAML parser, writer and converter. Fully supports Breath of the Wild and Super Mario Odyssey files.
Stars: ✭ 23 (+43.75%)
Mutual labels:  nintendo, nintendo-switch, nintendo-wii-u
Switch-Screenshots
Script to organize Nintendo Switch screenshots by directory instead of date.
Stars: ✭ 50 (+212.5%)
Mutual labels:  nintendo, nintendo-switch
Splatoon 2 Meme Mod
Splatoon 2 mod about memes.
Stars: ✭ 11 (-31.25%)
Mutual labels:  nintendo, nintendo-switch
Arcropolis
Work-in-progress file replacement plugin for Super Smash Bros. Ultimate
Stars: ✭ 58 (+262.5%)
Mutual labels:  nintendo, nintendo-switch
Deepsea
The new All-in-One CFW package for the Nintendo Switch.
Stars: ✭ 488 (+2950%)
Mutual labels:  nintendo, nintendo-switch
Nintendeals
Library with a set of tools for scraping information about Nintendo games and its prices across all regions (NA, EU and JP).
Stars: ✭ 94 (+487.5%)
Mutual labels:  nintendo, nintendo-switch
Sys Clk Editor
Editor for your sys-clk configuration!
Stars: ✭ 89 (+456.25%)
Mutual labels:  nintendo, nintendo-switch
Ns Usbloader Mobile
Android Tinfoil/Awoo/GoldLeaf files uploader
Stars: ✭ 109 (+581.25%)
Mutual labels:  nintendo, nintendo-switch
Sunriseos
Horizon/NX kernel reimplementation
Stars: ✭ 157 (+881.25%)
Mutual labels:  nintendo, nintendo-switch
Vba M Nx
WIP full featured port of VBA-M for Nintendo Switch
Stars: ✭ 11 (-31.25%)
Mutual labels:  nintendo, nintendo-switch
Hydrosphere
Ocean beyond the Horizon
Stars: ✭ 17 (+6.25%)
Mutual labels:  nintendo, nintendo-switch
Nx Shell
A multi-purpose file manager for the Nintendo Switch.
Stars: ✭ 639 (+3893.75%)
Mutual labels:  nintendo, nintendo-switch
Ghidra Switch Loader
Nintendo Switch loader for Ghidra
Stars: ✭ 146 (+812.5%)
Mutual labels:  nintendo, nintendo-switch
Nstool
General purpose read/extract tool for Nintendo Switch file formats.
Stars: ✭ 159 (+893.75%)
Mutual labels:  nintendo, nintendo-switch
Pimiibo
A tool to create your own amiibo!
Stars: ✭ 92 (+475%)
Mutual labels:  nintendo, nintendo-switch
objmap
Breath of the Wild object map
Stars: ✭ 61 (+281.25%)
Mutual labels:  nintendo-switch, nintendo-wii-u
Rekado
Payload launcher and serial number checker for Nintendo Switch
Stars: ✭ 455 (+2743.75%)
Mutual labels:  nintendo, nintendo-switch
Nintendo Switch Eshop
Crawler for Nintendo Switch eShop
Stars: ✭ 463 (+2793.75%)
Mutual labels:  nintendo, nintendo-switch

Nintendo SARC archive reader and writer

Setup

Install Python 3.6+ (64 bit version) then run pip install sarc.

List files in an archive

sarc list ARCHIVE

Extract an archive

sarc extract ARCHIVE

Create an archive

sarc create [--be] FILES_TO_ADD  DEST_SARC

You can give it directories too, in which case the entire directory will be added to the archive recursively.

Pass --be (shorthand: -b) if you want sarc to use big endian mode (for the Wii U).

An important option is --base-path. This option lets you remove parts of the path. For example, if you pass a path like Mods/BotW/System/Version.txt, you will likely want to pass --base-path Mods/BotW to get rid of the leading components.

If only a single directory is passed, the base path is set for you automatically.

So typical usage example:

sarc create  ~/botw/Bootup/  ~/botw/ModifiedBootup.pack

Update an archive

sarc update  FILES_TO_ADD  SARC_TO_MODIFY

This is almost identical to create.

By default, sarc will keep the endianness of the original archive. You can override this with --endian {le,be} (le for little and be for big endian).

Delete files from an archive

sarc delete  FILES_TO_DELETE  SARC_TO_MODIFY

Nothing much to say here. Just keep in mind FILES_TO_DELETE takes archive paths (those that are printed by list).

Library usage

import sarc

archive = sarc.read_file_and_make_sarc(file)
# or if you already have a buffer
archive = sarc.SARC(archive_bytes)
if archive:
    for file_name in archive.list_files():
        size = archive.get_file_size(file_name)
        data = archive.get_file_data(file_name)

To modify an archive:

import sarc

writer = sarc.make_writer_from_sarc(archive)
# or if you're reading from a file
writer = sarc.read_sarc_and_make_writer(file)
# or for a blank archive
writer = sarc.SARCWriter(be=big_endian)

writer.add_file('test.bfevfl', b'file contents')
writer.add_file('another_file.txt', b'file contents')
writer.add_file('test.bfevfl', b'replacing a file')

writer.delete_file('another_file.txt')

writer.write(output_stream)

For more information, please look at sarc.py.

License

This software is licensed under the terms of the GNU General Public License, version 2 or later.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].