RELEASE hacPack - Build and Repack NCAs and NSPs

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by The-4n, Oct 2, 2018.

  1. Valdrrak

    Valdrrak Member

    Newcomer
    2
    Sep 15, 2016
    Ah fair enough, makes sense. Just wondering is it even possible to add mods to the game in the way I am trying to achieve or am I wasting my time? It seems RomFS doesnt wanna work with dragons dogma even with the tiniest change.
     
  2. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    It works
     
  3. Valdrrak

    Valdrrak Member

    Newcomer
    2
    Sep 15, 2016
    Hey sorry for the no reply decided to give it some days then try again, So I am looking at the hacpack readme and I cant see the input I would need to do to specify the version number? would I need to make the version number the same as the one that the patch updates to or just 1.0.0 to get past the switch telling me I have to update it? Its in the metadata section in the readme right?
     
  4. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    Same as update, in hex
    --titleversion
     
  5. Valdrrak

    Valdrrak Member

    Newcomer
    2
    Sep 15, 2016
    ok I did find the version it seems to be the same as most switch games in there 1.01 update, however with that command --titleversion how do I use it, its it in hactool or hacpack and do I just do the usual hactool -t nca --titleversion 65536 cnmt.nca ?
     
  6. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    Use it with hacpack
    convert 65536 to hex which is 0x10000 and use --titleversion to set it
    It'll be like hacpack.exe --type nca --ncatype meta --titletype program --titleversion 0x10000 and so on
     
  7. Valdrrak

    Valdrrak Member

    Newcomer
    2
    Sep 15, 2016
    Ok awesome so I did:

    E:\aaSwitch Tools\hactool> .\hacpack --keyset "E:\aaSwitch Tools\hactool\keys.txt" -o "E:\aaSwitch Tools\hactool\repackedNCA\new meta" --type nca --ncatype meta --titletype appli
    cation --titleversion 0x10000 --titleid 010032C00AC58000 --cnmt "E:\aaSwitch Tools\hactool\repackedNCA\3afbe7fa0180975fb65f04600c0485e8.cnmt.nca"

    it seemed to work, it made a new meta witch was 8kb instead of 4kb like the old one, so now I should be able to rebuild and install right?
     
  8. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    No thats wrong
    You have to set your control, legalinformation and program ncas
    https://github.com/The-4n/hacPack#cli-options
     
  9. tomi1578

    tomi1578 GBAtemp Regular

    Member
    3
    Sep 12, 2018
    Israel
  10. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    Yes
     
  11. tomi1578

    tomi1578 GBAtemp Regular

    Member
    3
    Sep 12, 2018
    Israel
    how?
     
  12. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    With hactool:
    Extract the game's nsp, extract its program nca

    Apply lfs to romfs

    With hacpack:
    repack program nca, rebuild metadata nca, rebuild nsp
     
  13. tomi1578

    tomi1578 GBAtemp Regular

    Member
    3
    Sep 12, 2018
    Israel
    thank you so much
    i made a super luigi odyssey nsp
     
  14. ressit

    ressit GBAtemp Regular

    Member
    2
    Jun 4, 2018
    Vietnam
    Atms can load hbl.nsp
    With hacpack
    Can rebuild nsp and run it same hbl.nsp ???
     
  15. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    Exefs nsps, yes
     
    ressit likes this.
  16. MacleodTW

    MacleodTW Newbie

    Newcomer
    1
    Jun 28, 2019
    Taiwan
    In order to support modifying control.ncap parameters in update(patch) nsp, I added --patchcnmt flag to hacpack source in attachment.
    Now, I can use my automatic script to finish unpack/repack update nsp then install it.

    ex:
    hacpack --keys=keys.txt --type=nca --ncatype=meta --titletype=patch --titleid=xxx --patchcnmt=Patch_xxx.cnmt --controlnca=new_ctrl.nca -o output_dir

    Remove_Patch_SUA.
     

    Attached Files:

    masagrator and hippy dave like this.
  17. 18Phoenix

    18Phoenix GBAtemp Regular

    Member
    5
    Nov 21, 2005
    Germany
    Hi,
    I tinker a lot with the NES Online NSP, because I'm a huge retro-emu fan.
    I know how to add more roms using LayeredFS and how to extract the NCA's out of the update NSP
    and how to unzpck/unzip its nca's to its original files (using NCA-NSP-XCI_to_LayeredFS_v1.6).
    I do this only to see the changings in the newest update.
    But therefor I only extract only one nca (biggest) where the new roms are inside.

    Can I add roms here and repack it as "the same NCA like before" and then repack all (base+changed update) to one single NSP ?
    I'm more a rookie, so help would be nice.
    Big thanks in advance.
     
    Last edited by 18Phoenix, Jun 28, 2019
  18. 18Phoenix

    18Phoenix GBAtemp Regular

    Member
    5
    Nov 21, 2005
    Germany
    Ok, I made it myself successfully - no more help needed.
     
  19. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    Sorry i didn't notice your message
    If you need any help, feel free to ask
     
    18Phoenix likes this.
  20. 18Phoenix

    18Phoenix GBAtemp Regular

    Member
    5
    Nov 21, 2005
    Germany
    I always get a lot key errors, but the result runs fine nevertheless.

    [WARN]: Failed to match key "bis_kek_source", (value "xxx")
    [WARN]: Failed to match key "bis_key_00", (value "xxx")
    [WARN]: Failed to match key "bis_key_01", (value "xxx")
    [WARN]: Failed to match key "bis_key_02", (value "xxx")
    ...
    [WARN]: Failed to match key "bis_key_03", (value "xxx")
    [WARN]: Failed to match key "bis_key_source_00", (value "xxx")
    [WARN]: Failed to match key "bis_key_source_01", (value "xxx")
    [WARN]: Failed to match key "bis_key_source_02", (value "xxx")
    ...
    [WARN]: Failed to match key "device_key", (value "xxx")
    [WARN]: Failed to match key "eticket_rsa_kek", (value "xxx")
    [WARN]: Failed to match key "eticket_rsa_kek_source", (value "xxx")
    [WARN]: Failed to match key "eticket_rsa_kekek_source", (value "xxx")
    ...
    [WARN]: Failed to match key "per_console_key_source", (value "xxx")
    [WARN]: Failed to match key "retail_specific_aes_key_source", (value "xxx")
    [WARN]: Failed to match key "rsa_oaep_kek_generation_source", (value "xxx")
    [WARN]: Failed to match key "rsa_private_kek_generation_source", (value "xxx")
    ...
    [WARN]: Failed to match key "save_mac_key", (value "xxx")
    [WARN]: Failed to match key "sd_seed", (value "xxx")
    [WARN]: Failed to match key "ssl_rsa_kek", (value "xxx")
    [WARN]: Failed to match key "ssl_rsa_kek_source_x", (value "xxx")
    ...
    [WARN]: Failed to match key "ssl_rsa_kek_source_y", (value "xxx")
     
    Last edited by 18Phoenix, Jun 30, 2019
Loading...