Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

HacPack Switch: Difference between revisions

From GameBrew
(Created page with "{{Infobox Switch Homebrews |title=hacPack |image=hacpackswitch.png |description=Build and Repack NCAs and NSPs. |author=The-4n |lastupdated=2019/01/19 |type=PC Utilities |version=1.36-r2 |license=GPL-2.0 |download=https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch.7z |website=https://gbatemp.net/threads/hacpack-build-and-repack-ncas-and-nsps.519815/ |source=https://github.com/The-4n/hacPack |donation= }} {{#seo: |title=Switch Homebrew PC Tools (PC Utilities) - GameB...")
 
No edit summary
Line 1: Line 1:
{{Infobox Switch Homebrews
{{Infobox Switch Homebrews
|title=hacPack
|title=hacPack
|image=hacpackswitch.png
|image=hacpacknx.png
|description=Build and Repack NCAs and NSPs.
|description=Build and Repack NCAs and NSPs.
|author=The-4n
|author=The-4n
Line 8: Line 8:
|version=1.36-r2
|version=1.36-r2
|license=GPL-2.0
|license=GPL-2.0
|download=https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch.7z
|download=https://dlhb.gamebrew.org/switchhomebrews/hacpacknx.7z hacPack + NACP
|website=https://gbatemp.net/threads/hacpack-build-and-repack-ncas-and-nsps.519815/
|website=https://gbatemp.net/threads/hacpack-build-and-repack-ncas-and-nsps.519815/
|source=https://github.com/The-4n/hacPack
|source=https://github.com/The-4n/hacPack
|donation=
|donation=
}}
}}
{{#seo:
hacPack is a tool for make/build and repacking NCAs (Nintendo Content Archive) and NSPs (Nintendo Submission Package).
|title=Switch Homebrew PC Tools (PC Utilities) - GameBrew
 
|title_mode=append
hacPack is totally written from scratch and it's fully open-source, there's nothing illegal (Nintendo's stuff) in it.
|image=hacpackswitch.png
 
|image_alt=hacPack
With hacPack, you can mod your game and repack them into NSP, make custom NCAs and NSPs, remove and add contents to NCAs, etc.
}}
 
{{cleanup|article|Needs cleanup}}
There's also a GUI interface for hacPack to make it easy to use for everyone, but CLI is version is recommended.
Build and Repack NCAs and NSPs.
 
==User guide==
===hacPack===
Key features:
*Support all types of NCAs (Program, Control, Data, Metadata, PublicData).
*Options for creating program nca with/without romfs and logo sections.
*Support Application, AddOnContent, SystemData and System Program Metadata NCAs.
*Support for creating Metadata nca from ncas and cnmt.
*Fully crypto customization, Including Keygeneration, Keyarea encryption key 2, Section encryption.
*CLI app, also includes a simple GUI for end-users.
*Multi architecture and Multi platform compatibility, Including but not limited to: Windows, Linux, macOS, x86, x86-64, arm-le.
 
Some of the use cases of hacPack:
*Creating homebrew and custom NCAs/NSPs.
*Merging updates and dlcs NCAs/NSPs into game NCAs/NSPs.
*Making NCAs/NSPs from game mods and merging game mods with existing game NCAs/NSPs.
*Fully modifying and repacking applications and system NCAs.
*Changing titleid, icons and other control parameters of games and dlcs, changing the game loading logos.
*Repacking games to work on lower firmwares.
*Repacking dlcs to work on lower game versions.
*Add translations to game.
 
Also hacPack is now comes with hacPackTools, hacPackTools are tools for viewing and modifying the files inside ncas.
 
===hacPackTools-NACP===
NACP is a file in control nca that specifies multiple parameters of the game including screenshot permissions, video capture permission, savedata file size and etc...
 
Key features of hacPackTools-NACP:
*Viewing the value of NACP parameters.
*Creating .nacp.xml from .nacp.
*Creating .nacp from .nacp.xml.
 
Some of the use cases of hacPackTools-NACP:
*Making xml from nacp so it becomes human readable, modifying it and make nacp again from xml.
*Creating nacp for homebrew nsps.
*Changing the game data save size.
*Changing the games and apps permissions, like allowing screenshot and video capture.
*Remove the need of selecting user account when launching a game/app.
 
===hacBrewPack===
[[hacBrewPack Switch|hacBrewPack]] is a tool for creating homebrew nsps is based on hacPack. It's a simplified version of hacPack which is designed for creating nsps from homebrews fast and easy.
 
First and the only legal hbmenu nsp is built with hacPack and the latest version features hacPackTools-NACP which enables capabilities like videocapture and 0 size save data and no need for user selection.
 
Also all custom nsps from Developers and Scene groups are built with hacPack/hacBrewPack.
 
===Keys===
You should place your keyset file with "keys.dat" filename in the same folder as hacPack.
 
Alternatively, You can use -k or --keyset option to load your keyset file.
 
Required keys are:
{| class="wikitable"
! Key Name||Description
|-
| header_key||NCA Header Key
|-
| key_area_key_application_xx||Application key area encryption keys
|-
| titlekek_xx||Title key encryption key
|-
|}
 
===CLI options===
<pre>
*nix: ./hacpack [options...] 
Windows: .\hacpack.exe [options...] 
 
Options: 
General options: 
-o, --outdir            Set output directory 
-k, --keyset            Set keyset filepath, default filepath is ./keys.dat 
-h, --help              Display usage 
--type                  Set file type [nca, nsp] 
--titleid                Set titleid 
NCA required options: 
--ncatype                Set nca type if file type is nca [program, control, manual, data, publicdata, meta] 
NCA general options: 
--tempdir                Set temp directory filepath, default filepath is ./hacbpack_temp/ 
--backupdir              Set backup directory filepath, default filepath is ./hacbpack_backup/ 
--keygeneration          Set keygeneration for encrypting key area, default keygeneration is 1 
--plaintext              Skip encrypting sections and set section header block crypto type to plaintext 
--sdkversion            Set SDK version in hex, default SDK version is 000C1100 
--keyareakey            Set key area key 2 in hex with 16 bytes length 
--ncasig                Set nca signature type [zero, static, random]. Default is zero 
--disttype              Set nca distribution type [download, gamecard]. Default is download 
--ncasig1privatekey      Set private key filepath for signing nca signature 1 with PEM format 
Program NCA options: 
--exefsdir              Set program exefs directory path 
--romfsdir              Set program romfs directory path 
--logodir                Set program logo directory path 
--titlekey              Set Titlekey for encrypting nca 
--acidsigprivatekey      Set private key filepath for signing acid with PEM format 
--ncasig2privatekey      Set private key filepath for signing nca signature 2 with PEM format 
--ncasig2modulus        Set modulus filepath for signing nca signature 2 
--nosignncasig2          Skip patching acid public key in npdm and signing nca header with self-signed keys 
Control NCA options: 
--romfsdir              Set control romfs directory path 
Manual NCA options: 
--romfsdir              Set manual romfs directory path 
--titlekey              Set Titlekey for encrypting nca 
Data NCA options: 
--romfsdir              Set data romfs directory path 
PublicData NCA options: 
--romfsdir              Set publicdata romfs directory path 
--titlekey              Set Titlekey for encrypting nca 
Metadata NCA options: 
--titletype              Set cnmt title type [application, patch, addon, systemprogram, systemdata] 
--titleversion          Set title-version in hex with 4 bytes length, default value is 0x0 
--programnca            Set program nca path 
--controlnca            Set control nca path 
--legalnca              Set legal information nca path 
--htmldocnca            Set offline manual nca path 
--datanca                Set data nca path 
--cnmt                  Set cnmt path 
--digest                Set cnmt digest 
NSP options: 
--ncadir                Set input nca directory path 
</pre>
 
===GUI===
hacPack GUI is just an interface for CLI. It's just available for Microsoft Windows and it requires .NetFramework 4.5 or higher.
 
Currently, all options are not implemented in GUI and it's recommended to use CLI.


==Media==
===Tools===
<youtube></youtube>
hacPackTools are tools aiming for modifying and parsing the files in ncas. make sure to check hacPackTools folder


Also check [https://github.com/The-4n/hacPack/tree/master/docs docs] for more info.


==Screenshots==
==Screenshots==
https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch-01.png
{| style="width: 80%; margin-left:0em;"
https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch-02.png
|
https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch-03.png
https://dlhb.gamebrew.org/switchhomebrews/hacpacknx2.png
https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch-04.png
https://dlhb.gamebrew.org/switchhomebrews/hacpacknx3.png
https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch-05.png
|}
https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch-06.png
https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch-07.png
https://dlhb.gamebrew.org/switchhomebrews/hacpackswitch-08.png


==Changelog==
==Changelog==
'''v.1.0'''
'''v1.36-r2 2019/01/19'''
* First Release.
*Fixed a bug cause hacPack-GUI to display an invalid titleid error while titleid is valid.
 
'''v1.36 2019/01/14'''
*Fixed a bug cause titletype error when creating metadata nca with cnmt.
*Changed Valid titleid range.
 
'''v1.35 2018/12/25'''
*Added option for setting nca distribution type to gamecard.
*Removed --noromfs and --nologo options, hacPack now skips creating romfs and logo sections for program nca if romfsdir and logodir are not set.
*Changed pfs0 padding size and hash table block size for better compatiblity and less nca size.
 
'''v1.33 2018/12/05'''
*Added support for keygeneration 7.
*Changed default ncasig to zero.
 
'''v1.32 2019/11/26'''
*Changed hash block size for better compatibility.
*Increased NCA section encryption buffer size.
 
'''v1.31 2018/11/25'''
*Fixed a bug cause invalid IVFC level 6 when romfs section is big.
 
'''v1.30 2018/11/20'''
*Added TitleKey encryption.
*Added Signature generation.
*Added NPDM verification and signature zeroing.
*Added NPDM backup.
*Fixed sdkversion valid range.
 
hacPackTools-NACP v1.03:
*Fixed videocapture invalid value error message.
*Added error message for unknown xml elements.
 
'''v1.20-r3 2018/10/25'''
*Fixed a bug cause compiled version of hacPackTools-NACP not running on windows machines.
 
'''v1.20-r2 2018/10/24'''
 
hacPack-Tools:
*Added RequiredNetworkServiceLicenseOnLaunch and UserAccountSwitchLock options for hacPackTools-NACP.
 
'''v1.20 2018/10/22'''
 
hacPack:
*Added option for creating Metadata nca from cnmt.
 
hacPack-GUI:
*Added option for creating Metadata nca from cnmt in gui.
 
hacPack-Tools:
*Added hacPackTools-NACP v1.00.
 
'''v1.12 2018/10/10'''
*Fixed a bug cause making bad PFS0 for files larger than 4GB in 32-bit platforms.
 
'''v1.11 2018/10/09'''
*Added buffer for creating PFS0.
*Increased buffer size for creating RomFS.
 
'''v1.10 2018/10/06'''
*Added support for creating SystemProgram and SystemData Metadata NCA.
*Added titleversion option for creating Metadata NCA.
 
'''v1.02 2018/10/05'''
 
GUI:
*Fixed a bug cause failure of building meta ncas with legal information nca and without data nca.
 
'''v1.01 2018/10/03'''
*Fixed a bug cause failure of control.nacp validation in titles without AmericanEnglish title name and title author.
 
'''v1.00 2018/10/02'''
*Initial Release.
 
==Credits==
Thanks: SciresM, yellows8, Adubbz, SwitchBrew.


== External links ==
== External links ==
* Gbatemp - https://gbatemp.net/threads/hacpack-build-and-repack-ncas-and-nsps.519815/
* GitHub - https://github.com/The-4n/hacPack
* Github - https://github.com/The-4n/hacPack
* GBAtemp - https://gbatemp.net/download/hacpack-v1-20-r3.35244/
* Reddit -
* GBAtemp - https://gbatemp.net/threads/hacpack-build-and-repack-ncas-and-nsps.519815/

Revision as of 05:12, 8 Haziran 2023

hacPack
Hacpacknx.png
General
AuthorThe-4n
TypePC Utilities
Version1.36-r2
LicenseGPL-2.0
Last Updated2019/01/19
Links
hacPack + NACP Download
Website
Source

hacPack is a tool for make/build and repacking NCAs (Nintendo Content Archive) and NSPs (Nintendo Submission Package).

hacPack is totally written from scratch and it's fully open-source, there's nothing illegal (Nintendo's stuff) in it.

With hacPack, you can mod your game and repack them into NSP, make custom NCAs and NSPs, remove and add contents to NCAs, etc.

There's also a GUI interface for hacPack to make it easy to use for everyone, but CLI is version is recommended.

User guide

hacPack

Key features:

  • Support all types of NCAs (Program, Control, Data, Metadata, PublicData).
  • Options for creating program nca with/without romfs and logo sections.
  • Support Application, AddOnContent, SystemData and System Program Metadata NCAs.
  • Support for creating Metadata nca from ncas and cnmt.
  • Fully crypto customization, Including Keygeneration, Keyarea encryption key 2, Section encryption.
  • CLI app, also includes a simple GUI for end-users.
  • Multi architecture and Multi platform compatibility, Including but not limited to: Windows, Linux, macOS, x86, x86-64, arm-le.

Some of the use cases of hacPack:

  • Creating homebrew and custom NCAs/NSPs.
  • Merging updates and dlcs NCAs/NSPs into game NCAs/NSPs.
  • Making NCAs/NSPs from game mods and merging game mods with existing game NCAs/NSPs.
  • Fully modifying and repacking applications and system NCAs.
  • Changing titleid, icons and other control parameters of games and dlcs, changing the game loading logos.
  • Repacking games to work on lower firmwares.
  • Repacking dlcs to work on lower game versions.
  • Add translations to game.

Also hacPack is now comes with hacPackTools, hacPackTools are tools for viewing and modifying the files inside ncas.

hacPackTools-NACP

NACP is a file in control nca that specifies multiple parameters of the game including screenshot permissions, video capture permission, savedata file size and etc...

Key features of hacPackTools-NACP:

  • Viewing the value of NACP parameters.
  • Creating .nacp.xml from .nacp.
  • Creating .nacp from .nacp.xml.

Some of the use cases of hacPackTools-NACP:

  • Making xml from nacp so it becomes human readable, modifying it and make nacp again from xml.
  • Creating nacp for homebrew nsps.
  • Changing the game data save size.
  • Changing the games and apps permissions, like allowing screenshot and video capture.
  • Remove the need of selecting user account when launching a game/app.

hacBrewPack

hacBrewPack is a tool for creating homebrew nsps is based on hacPack. It's a simplified version of hacPack which is designed for creating nsps from homebrews fast and easy.

First and the only legal hbmenu nsp is built with hacPack and the latest version features hacPackTools-NACP which enables capabilities like videocapture and 0 size save data and no need for user selection.

Also all custom nsps from Developers and Scene groups are built with hacPack/hacBrewPack.

Keys

You should place your keyset file with "keys.dat" filename in the same folder as hacPack.

Alternatively, You can use -k or --keyset option to load your keyset file.

Required keys are:

Key Name Description
header_key NCA Header Key
key_area_key_application_xx Application key area encryption keys
titlekek_xx Title key encryption key

CLI options

*nix: ./hacpack [options...]  
Windows: .\hacpack.exe [options...]  
  
Options:  
General options:  
-o, --outdir             Set output directory  
-k, --keyset             Set keyset filepath, default filepath is ./keys.dat  
-h, --help               Display usage  
--type                   Set file type [nca, nsp]  
--titleid                Set titleid  
NCA required options:  
--ncatype                Set nca type if file type is nca [program, control, manual, data, publicdata, meta]  
NCA general options:  
--tempdir                Set temp directory filepath, default filepath is ./hacbpack_temp/  
--backupdir              Set backup directory filepath, default filepath is ./hacbpack_backup/  
--keygeneration          Set keygeneration for encrypting key area, default keygeneration is 1  
--plaintext              Skip encrypting sections and set section header block crypto type to plaintext  
--sdkversion             Set SDK version in hex, default SDK version is 000C1100  
--keyareakey             Set key area key 2 in hex with 16 bytes length  
--ncasig                 Set nca signature type [zero, static, random]. Default is zero  
--disttype               Set nca distribution type [download, gamecard]. Default is download  
--ncasig1privatekey      Set private key filepath for signing nca signature 1 with PEM format  
Program NCA options:  
--exefsdir               Set program exefs directory path  
--romfsdir               Set program romfs directory path  
--logodir                Set program logo directory path  
--titlekey               Set Titlekey for encrypting nca  
--acidsigprivatekey      Set private key filepath for signing acid with PEM format  
--ncasig2privatekey      Set private key filepath for signing nca signature 2 with PEM format  
--ncasig2modulus         Set modulus filepath for signing nca signature 2  
--nosignncasig2          Skip patching acid public key in npdm and signing nca header with self-signed keys  
Control NCA options:  
--romfsdir               Set control romfs directory path  
Manual NCA options:  
--romfsdir               Set manual romfs directory path  
--titlekey               Set Titlekey for encrypting nca  
Data NCA options:  
--romfsdir               Set data romfs directory path  
PublicData NCA options:  
--romfsdir               Set publicdata romfs directory path  
--titlekey               Set Titlekey for encrypting nca  
Metadata NCA options:  
--titletype              Set cnmt title type [application, patch, addon, systemprogram, systemdata]  
--titleversion           Set title-version in hex with 4 bytes length, default value is 0x0  
--programnca             Set program nca path  
--controlnca             Set control nca path  
--legalnca               Set legal information nca path  
--htmldocnca             Set offline manual nca path  
--datanca                Set data nca path  
--cnmt                   Set cnmt path  
--digest                 Set cnmt digest  
NSP options:  
--ncadir                 Set input nca directory path  

GUI

hacPack GUI is just an interface for CLI. It's just available for Microsoft Windows and it requires .NetFramework 4.5 or higher.

Currently, all options are not implemented in GUI and it's recommended to use CLI.

Tools

hacPackTools are tools aiming for modifying and parsing the files in ncas. make sure to check hacPackTools folder

Also check docs for more info.

Screenshots

hacpacknx2.png hacpacknx3.png

Changelog

v1.36-r2 2019/01/19

  • Fixed a bug cause hacPack-GUI to display an invalid titleid error while titleid is valid.

v1.36 2019/01/14

  • Fixed a bug cause titletype error when creating metadata nca with cnmt.
  • Changed Valid titleid range.

v1.35 2018/12/25

  • Added option for setting nca distribution type to gamecard.
  • Removed --noromfs and --nologo options, hacPack now skips creating romfs and logo sections for program nca if romfsdir and logodir are not set.
  • Changed pfs0 padding size and hash table block size for better compatiblity and less nca size.

v1.33 2018/12/05

  • Added support for keygeneration 7.
  • Changed default ncasig to zero.

v1.32 2019/11/26

  • Changed hash block size for better compatibility.
  • Increased NCA section encryption buffer size.

v1.31 2018/11/25

  • Fixed a bug cause invalid IVFC level 6 when romfs section is big.

v1.30 2018/11/20

  • Added TitleKey encryption.
  • Added Signature generation.
  • Added NPDM verification and signature zeroing.
  • Added NPDM backup.
  • Fixed sdkversion valid range.

hacPackTools-NACP v1.03:

  • Fixed videocapture invalid value error message.
  • Added error message for unknown xml elements.

v1.20-r3 2018/10/25

  • Fixed a bug cause compiled version of hacPackTools-NACP not running on windows machines.

v1.20-r2 2018/10/24

hacPack-Tools:

  • Added RequiredNetworkServiceLicenseOnLaunch and UserAccountSwitchLock options for hacPackTools-NACP.

v1.20 2018/10/22

hacPack:

  • Added option for creating Metadata nca from cnmt.

hacPack-GUI:

  • Added option for creating Metadata nca from cnmt in gui.

hacPack-Tools:

  • Added hacPackTools-NACP v1.00.

v1.12 2018/10/10

  • Fixed a bug cause making bad PFS0 for files larger than 4GB in 32-bit platforms.

v1.11 2018/10/09

  • Added buffer for creating PFS0.
  • Increased buffer size for creating RomFS.

v1.10 2018/10/06

  • Added support for creating SystemProgram and SystemData Metadata NCA.
  • Added titleversion option for creating Metadata NCA.

v1.02 2018/10/05

GUI:

  • Fixed a bug cause failure of building meta ncas with legal information nca and without data nca.

v1.01 2018/10/03

  • Fixed a bug cause failure of control.nacp validation in titles without AmericanEnglish title name and title author.

v1.00 2018/10/02

  • Initial Release.

Credits

Thanks: SciresM, yellows8, Adubbz, SwitchBrew.

External links

Advertising: