Homebrew RELEASE LibHac & hactoolnet v0.1.3

SupImBirDy

Member
Newcomer
Joined
Aug 24, 2018
Messages
24
Trophies
0
Age
32
XP
274
Country
United States
I'm a little late posting it here, but v0.2.0 has been released.

Download

v0.2.0

A single-exe version of hactoolnet has been added to the downloads for convenience over using an exe with dlls
  • Use a new `IStorage` interface throughout the library instead of `Stream`
    • This interface is more similar to the `IStorage` interface used by Horizon.
    • Instead of having a Stream that keeps track of the current position, IStorage accepts an offset, buffer, and length when reading or writing.
    • Unlike a Stream, an IStorage instance can be shared between multiple consumers without issue
    • `Stream.AsStorage()` and `IStorage.AsStream()` methods are provided for switching between `Stream` and `IStorage`
  • Improve AES-XTS performance by ~16x
  • Improve AES-CTR performance by 2x
  • Add AES-XTS tests
  • Add benchmarks for AES-XTS and AES-CTR
  • Ability to open a decrypted IStorage of an NCA, Package1 or Package2
  • Validate NCA, NPDM and package2 signatures
  • Add NPDM parsing support
  • Allow more disposal methods to cascade down to the base storage
  • Support writing version 5 of `JournalStorage` used in newer save data files
  • Fix a fatal save allocation table bug that would occur if the last block of the save data FS was read
  • Add a build script

    hactoolnet changes

  • Add the ability to replace files in a save data file (Currently the new file must be the same size as the old file)
  • Add benchmarks for AES-XTS and AES-CTR
  • Change how Switch FS title info is displayed, and add an option to display info on all NCAs
Hey man jw, can this be used to modify NSO files
 

mrdude

Developer
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
Can someone post some examples on how to use the command line for this...The readme isn't that helpful - thanks.
 

gghaxor

New Member
Newbie
Joined
May 6, 2020
Messages
1
Trophies
0
Age
38
XP
36
Country
Vietnam
I found a need for hactoolnet recently and struggled with the command line a bit until I got it, figure I post it here for future reference. A prior warning here, any modifications to the Nintendo Switch partition and any files within may result in data corruption, the worst case may be bricking the Switch. Now that we are aware of the risk, before attempting any of the steps below, make sure you have a good NAND backup as well as back up of the save files.

# 1. Read the save file from the User partition (e.g. User\save\000000000000000a). Note the CMAC Signature line is FAIL because we have not provided the proper key to verify its signature yet
hactoolnet.exe -t save 000000000000000a

# 2. Extract the save file with the proper key file (-t keys.txt). The key file essentially is a copy of the prod.keys and title.keys combined if you have backed it up with Lockpick_RCM
hactoolnet.exe -k keys.txt -t save --outdir output_folder 000000000000000a

# 3. Repack the extracted directory and sign it with the Switch's device key you like to transfer to. It needs an actual save file (e.g. 000000000000000a) to overwrite to, that's where it was confusing for me
hactoolnet.exe -k keys.txt --sign --repack .\output_folder -t save 000000000000000a

# 4. Verify if the repacked/signed save file with the same key as in the last step. It should have "CMAC Signature (GOOD)" instead of "CMAC Signature (FAIL)"
hactoolnet.exe -k keys.txt -t save 000000000000000a

Now we can put the save file (e.g. 000000000000000a) back to the User partition (e.g. User\save\000000000000000a) now. If we are putting in on a different Switch, just make sure to match the file name which you will overwrite.

Source
[1] Search in GBAtemp for "Edit OFW clean Switch save data from NAND backup/restoring via Fusee Gelee payloads", the author laid out a very detailed instruction and example for hactoolnet
 
Last edited by gghaxor,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    I've been taking fiber pills, eating more grapes, switched to wheat bread in hopes to lower it
    +1
  • BigOnYa @ BigOnYa:
    I like wheat bread, I even like the chunky wheat bread with pieces of whole grain in it.
  • K3Nv2 @ K3Nv2:
    Been getting this honey wheat bread from aldis pretty decent not very sweet to out do it
  • K3Nv2 @ K3Nv2:
    Me making any food at home is an improvement to how I use to be
    +1
  • BigOnYa @ BigOnYa:
    I have an bread machine and use it alot, better than breads you buy, but don't last as long, cause no bs preservatives
  • K3Nv2 @ K3Nv2:
    I got compliments about my weight loss and thought well guess I can pig out again now I'm the piggy
  • BigOnYa @ BigOnYa:
    My biggest prob is alcohol, definitely is fattening
  • K3Nv2 @ K3Nv2:
    I know when to stop at least honestly don't get those that go and go with food
  • BigOnYa @ BigOnYa:
    Or those that order 2 big macs , large fry, ice cream sundie, then a diet coke
  • K3Nv2 @ K3Nv2:
    I might get downing two big macs but nah that's it
  • BigOnYa @ BigOnYa:
    Ok that will be $15.99, cash or charge?
  • K3Nv2 @ K3Nv2:
    My go to orders usually a mcdouble and a mcchicken and I'm happy rarely mess with fries
  • K3Nv2 @ K3Nv2:
    Pro tip ask for that clowns jizzmac sauce on your mcdouble
    +1
  • BigOnYa @ BigOnYa:
    Do they charge extra when you add sauce,etc? I know burger king used to not, but don't know nowadays
  • K3Nv2 @ K3Nv2:
    They may squrit it for free if you ask nice
    +1
  • K3Nv2 @ K3Nv2:
    Last time I got bk it was 35c per sauce fuck you king of my nutsack
    +1
  • K3Nv2 @ K3Nv2:
    I'll buy a bottle of baby rays BBQ for $2 and add it from home out of spite
    +1
  • BigOnYa @ BigOnYa:
    I like baby rays, my favorite is KC masterpiece tho. Figured all you could buy is that there.
  • K3Nv2 @ K3Nv2:
    The metro doesn't discriminate good sauce
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Baby Rays isn't that what killed the crocodile hunter?
  • Psionic Roshambo @ Psionic Roshambo:
    If only he had done an endorsement for them....
  • Psionic Roshambo @ Psionic Roshambo:
    Oy mate don't let a bad bbq sauce kill your party! Baby Rays are killing it!! The flavor hits you right in the chest!
    +1
  • Xdqwerty @ Xdqwerty:
    My phone only has 13% battery so i don't have much time left
  • Xdqwerty @ Xdqwerty:
    Now 12%
  • BigOnYa @ BigOnYa:
    Happy birthday, btw
    BigOnYa @ BigOnYa: Happy birthday, btw