Giter Club home page Giter Club logo

libacnh's Introduction

LibACNH

LibACNH is a C++ Library For Parsing Proprietary File Formats, Algorithms & Cryptography used by Animal Crossing: New Horizons (ACNH).

Special thanks to Ninji for their CylindricalEarth research.

Disclaimer

  • LibACNH is not affiliated with, endorsed or approved by Nintendo or Animal Crossing: New Horizons in any way.
  • LibACNH 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.

Usage & Compilation

C++11 and above is supported for compilation, though C++20 is recommended.

Supported File Formats, Algorithms & Cryptography

File Formats

Algorithms

Cryptography

BCSV

BCSV (Binary CSV) is a proprietary file format created by Nintendo. This format is a CSV file compiled as a binary format.

The BCSV class contains functions to parse and retrieve values from a .bcsv file.

ACNH uses CRC32 to hash a majority of column names in these files.

BFTTF

BFTTF is a proprietary file format created by Nintendo. The BFTTF namespace contains a single function, BFTTF::Decrypt.

This supports decrypting .bfttf files to .ttf, aswell as .bfotf files to .otf.

Byaml

Byaml (Binary Yaml) is a proprietary file format created by Nintendo. This format is a Yaml file compiled as a binary format.

The Byaml class contains functions to parse and retrieve values from a .byml file.

ACNH uses MurmurHash3 to hash a majority of column names in these files.

ACNHByaml

The ACNHByaml class extends the Byaml class, adding one new function: ACNHByaml::CalcOffsets.

This function is for use with the save struct files found in romfs:/System/Smmh. The function allows programmatically calculating save addresses based on the specified .byml file. This enables a version agnostic method of getting save addresses at runtime.

CRC32

The CRC32 namespace implements the CRC32 Algorithm used by ACNH.

ACNH uses the polynomial 0x04C11DB7 for CRC32 operations, aswell as hashes within BCSV files. consteval functions are also provided for C++20 users.

EncryptedInt

The EncryptedInt class implements the custom numerical cryptography that is used by ACNH.

ACNH uses this custom encryption for various numerical values, such as a Player's Money.

MSBT

MSBT is a proprietary file format created by Nintendo. These files are used to store the game's text, as well as define how it's displayed.

The MSBT class contains functions to parse and retrieve strings from a .msbt file.

ACNHItemMsbt

The ACNHItemMsbt class extends the MSBT class.

This class has one sole purpose, which is to fix Item Names from the various Item Name MSBT files. These files need to be 'fixed' as ACNH-specific MSBT Tags are usually before an Item's name, making it difficult to otherwise parse them.

MurmurHash3

The MurmurHash3 namespace implements the MurmurHash3 Algorithm used by ACNH.

ACNH uses MurmurHash3 for save checksums, as well as hashes within Byaml files. A consteval function is also provided for C++20 users.

  • A MurmurHash3 hashcat implementation can be found here, as hash-type 94200.

SARC

SARC is a proprietary file format created by Nintendo. This format is an archive format, used for bundling files together.

The SARC class contains functions to parse and retrieve files from a .sarc file.

ACNHSarc

The ACNHSarc class extends the SARC class. The main purpose of this class is to easily decompress and parse a sarc.zs file simultaneously. sarc.zs files appear throughout ACNH's filesystem.

SaveCrypto

The SaveCrypto namespace implements the savefile cryptography that is used by ACNH.

ACNH uses 128bit AES-CTR x-crypting, with a Key and Counter both generated from the respected save's Header file.

The SaveCrypto::Crypt function provides in-place encryption and decryption.

sead::Random

The sead::Random class implements the random number generator used by ACNH.

ACNH uses sead::Random for generating random values, aswell as the seeded function, sead::Random::init(u32 seed), for SaveCrypto use.

libacnh's People

Contributors

cuyler36 avatar slattz avatar

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.