ROM Hack Question Is there a way to patch out NNID requirement for Super Kirby Clash like they did for Bloodstained?

GameSystem

Well-Known Member
OP
Member
Joined
Sep 14, 2009
Messages
606
Trophies
1
XP
1,733
Country
United States
Through this thread I figured out how to do it. I made a tutorial in the Switch Tutorials section in case anyone wants to do this for any other game


I've been reading around, and I heard about hacdiskmount and Kefir, but there are 4 profiles on the switch (Not mine), and there are a million game saves between all of them. If I use either of those two options, I would have to backup all the saves, delete all the profiles and use the special profile to link to Kirby, then rename that single account to my name, then backup all the saves across all the profiles. However, in order to return the saves, I heard you also have to start the game for that save once in the profile in order to get the option to bring it back, and needing to reinstall and uninstall hundreds of GB of games just to return saves is ridiculous.

I then heard about how they did it for Bloodstained, and these posts give me hope:

It's the "Startup User Account" Flag inside of control.nacp,
0x00 = None
0x01 = Required
0x02 = RequiredWithNetworkServiceAccountAvailable

All what he did, was to patch the 02 into 01.
As far as i know, atmosphere can't redirect Control's romfs currently, so the nca needs to be edited.

//edit: the Offset is 0x3025

control.nacp has the same format for every switch game, but of course a newer SDK can add more values.

It would be better if atmosphere would allow a layeredfs version of it, so we could add more stuff, like enable video/screenshot, disable hdcp/crash reports and of course homemenu title translation.

How can I do that specifically for Kirby?
 
Last edited by GameSystem,
  • Like
Reactions: cyberant

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,628
Country
Germany
With hactool, HxD and hacpack.

hactool:
- Unpack the nsp / a62cf0016dcf820520ef0078d9e21dd7.nca (Control.nca)

HxD:
- edit control.nacp

hacpack:
- repack control.nca
- generate a new meta.cnmt.nca from b78785a7d12258b660e7853342afa4d8.nca (Program.nca), e2d35c58387aa4cf967b79b854b5f42e.nca (LegalInformation.nca) and the new control.nca
- repack it as a new nsp

but the easiest way is to just link a NNID before you even start to modify your switch, there will be more of these titles in the future and you always have to repack it and all the updates yourself if you don't want to wait for a pre-patched nsp.
 

GameSystem

Well-Known Member
OP
Member
Joined
Sep 14, 2009
Messages
606
Trophies
1
XP
1,733
Country
United States
I would probably link the NNID in most cases, but as this isn't my switch, and a lot of children use it with their own profiles and saves, I'd rather have it so that an NNID isn't needed at all because the danger of having the switch connected to the internet is just too great.
I'll run through those steps now and see if it works. Thanks a ton.

EDIT: @Falo I've been stuck on step 1 since yesterday. No matter what I do, hactool keeps failing to save anything. I've tried 3 different versions, with and without included dlls, then again with 5 different GUIs, then with 3 other random nsp, and also both kirby nsp and xci version.

For nps, I get this:

hactool-1.2.2-win>hactool -k keys.txt -t pfs0 --outdir=extract kirby.nsp

PFS0:
Magic: PFS0
Number of files: 7
Files: pfs0:/01003fb00c5a80000000000000000008.cert 000000000000-000000000700
pfs0:/01003fb00c5a80000000000000000008.tik 000000000700-0000000009c0
pfs0:/a62cf0016dcf820520ef0078d9e21dd7.nca 0000000009c0-00000015afc0
pfs0:/ac3999e0744564eb48599e0e2e22bfa1.cnmt.nca 00000015afc0-00000015bdc0
pfs0:/ac3999e0744564eb48599e0e2e22bfa1.cnmt.xml 00000015bdc0-00000015c33b
pfs0:/b78785a7d12258b660e7853342afa4d8.nca 00000015c33b-000044c0833b
pfs0:/e2d35c58387aa4cf967b79b854b5f42e.nca 000044c0833b-000044c34f3b
Saving 01003fb00c5a80000000000000000008.cert to extract\01003fb00c5a80000000000000000008.cert...
Failed to open extract\01003fb00c5a80000000000000000008.cert!
Saving 01003fb00c5a80000000000000000008.tik to extract\01003fb00c5a80000000000000000008.tik...
Failed to open extract\01003fb00c5a80000000000000000008.tik!
Saving a62cf0016dcf820520ef0078d9e21dd7.nca to extract\a62cf0016dcf820520ef0078d9e21dd7.nca...
Failed to open extract\a62cf0016dcf820520ef0078d9e21dd7.nca!
Saving ac3999e0744564eb48599e0e2e22bfa1.cnmt.nca to extract\ac3999e0744564eb48599e0e2e22bfa1.cnmt.nca...
Failed to open extract\ac3999e0744564eb48599e0e2e22bfa1.cnmt.nca!
Saving ac3999e0744564eb48599e0e2e22bfa1.cnmt.xml to extract\ac3999e0744564eb48599e0e2e22bfa1.cnmt.xml...
Failed to open extract\ac3999e0744564eb48599e0e2e22bfa1.cnmt.xml!
Saving b78785a7d12258b660e7853342afa4d8.nca to extract\b78785a7d12258b660e7853342afa4d8.nca...
Failed to open extract\b78785a7d12258b660e7853342afa4d8.nca!
Saving e2d35c58387aa4cf967b79b854b5f42e.nca to extract\e2d35c58387aa4cf967b79b854b5f42e.nca...
Failed to open extract\e2d35c58387aa4cf967b79b854b5f42e.nca!
Done!

and for xci I get this:

C:\Users\HP\Desktop\hactool-1.2.2-win>hactool -k keys.txt -t xci --outdir=extract kirby.xci

XCI:
Magic: HEAD
Header Signature: AF447B2B2C9CAE53265711DF392218339373000D896D50A3225034F04D44BAA9
BCD86006C84BE933703579E1EBF656EA8548D44086A0AE73430862BCBE63AEDE
CE8604CD08E90AC9FF5CD51334D0E06E62C87920517BF8F1624981C144FAB51A
5BE84BEF46BBAD5634511A140928C5F88FAA739FB8EE58FF924957F181BC81CB
9E39EA469309B61C73148D584462AC527459E8F63E5DBBA73A35D9139A84F480
1F4FD251B93819DE5FDC0E319C8FCB6FAFC692366D75F361848C1B0FA39F1CC1
9A0CCD682A2040BF0A7BFA02E0DAFD4F05192892FE73535542DF6D1CC94289D3
1F78D7B8C5B7136D5AF1852CD2F62177E4F56C0D9DF3BA070B50009102BCB063
Cartridge Type: 2GB
Cartridge Size: 000044c43800
Header IV: 7B8D88947C67BFE5817E275E148B405B
Encrypted Header: 9109FF82971EE9935011CA063F3C4D87A13D28A9928D74F149919EB782E1F0CF
E4A5A3BDF978295CD52639A4991BDB1FED841779A3F85D23AA4242135616F518
7C03CF0D97E5D218FDB245381FD1CF8DFB796FBEDA4BF7F7D6B128CE89BC9EAA
8552D42F597C5DB866C67BB0DD8EEA11
Root Partition:
Magic: HFS0
Offset: 00000000f000
Number of files: 3
Files: rootpt:/update 000000000000-000000000200
rootpt:/normal 000000000200-000000000400
rootpt:/secure 000000000400-000044c34600
Update Partition:
Magic: HFS0
Offset: 00000000f200
Number of files: 0
Normal Partition:
Magic: HFS0
Offset: 00000000f400
Number of files: 0
Secure Partition:
Magic: HFS0
Offset: 00000000f600
Number of files: 4
Files: secure:/b78785a7d12258b660e7853342afa4d8.nca 000000000000-000044aac000
secure:/a62cf0016dcf820520ef0078d9e21dd7.nca 000044aac000-000044c06600
secure:/e2d35c58387aa4cf967b79b854b5f42e.nca 000044c06600-000044c33200
secure:/ac3999e0744564eb48599e0e2e22bfa1.cnmt.nca 000044c33200-000044c34000
Extracting XCI...
Saving b78785a7d12258b660e7853342afa4d8.nca to extract\secure\b78785a7d12258b660e7853342afa4d8.nca...
Failed to open extract\secure\b78785a7d12258b660e7853342afa4d8.nca!
Saving a62cf0016dcf820520ef0078d9e21dd7.nca to extract\secure\a62cf0016dcf820520ef0078d9e21dd7.nca...
Failed to open extract\secure\a62cf0016dcf820520ef0078d9e21dd7.nca!
Saving e2d35c58387aa4cf967b79b854b5f42e.nca to extract\secure\e2d35c58387aa4cf967b79b854b5f42e.nca...
Failed to open extract\secure\e2d35c58387aa4cf967b79b854b5f42e.nca!
Saving ac3999e0744564eb48599e0e2e22bfa1.cnmt.nca to extract\secure\ac3999e0744564eb48599e0e2e22bfa1.cnmt.nca...
Failed to open extract\secure\ac3999e0744564eb48599e0e2e22bfa1.cnmt.nca!
Done!

Did I screw up somewhere?

I also tried installing Kirby, then dumping it via nxdumptool to get romfs and exefs folder. I also dumped it to nsp. I tried hactool again, and this time the new nsp has a bunch of additional language files, but still won't extract. I tried building an nca with the romfs and exefs with hacpack, but I get Failed to open hacpack_backup\01003fb00c5a8000\8495273651802904066_main.npdm!
 
Last edited by GameSystem,

cyberant

Member
Newcomer
Joined
Sep 13, 2009
Messages
15
Trophies
0
XP
101
Country
Israel
I'm in the same boat as you: Multiple users which makes it a hassle to use methods like kefir, and I prefer not to link an account if possible.

After finding your thread I'm also trying to follow these instructions, but unfortunately I have little to no experience working with tools like hactool and hacpack to patch NSP files.

hactool-1.2.2-win>hactool -k keys.txt -t pfs0 --outdir=extract kirby.nsp
It seems like the problem lies with the "--outdir" flag. make sure you created a folder named "extract" or change it to "--outdir=." to save it in the same directory as the nsp file.

Right now I'm not sure what flags to use with hactool to extract the nca. (I get " section 0 is corrupted!" message in the end and get no output files.) I tried using --outdir / --romfsdir & --exefsdir .

I also haven't checked how hacpack works yet, so I'm not sure how to generate a new meta.cnmt.nca (hopefully it's straight forward)
 
  • Like
Reactions: GameSystem

GameSystem

Well-Known Member
OP
Member
Joined
Sep 14, 2009
Messages
606
Trophies
1
XP
1,733
Country
United States
I did have a folder called "extract" just in case, but I didn't know that just leaving nothing after the = will just put it in the same directory. Good to know if it ever works.
Also, you getting "section 0 is corrupted!" is probably a good thing because that already means you are further ahead in the process than I am.
 

cyberant

Member
Newcomer
Joined
Sep 13, 2009
Messages
15
Trophies
0
XP
101
Country
Israel
Okay, I think I did it! :yayswitch:

Steps done:


  1. Using lockpick_rcm.bin payload (not homebrew app) I extracted prod.keys.

  2. created a folder ./kirby_extracted (not sure if this is necessary or wheather hactool would create the directory by itself)
  3. extracted the file from the nsp (hactool.exe -k prod.keys -t pfs0 --outdir=kirby_extracted "super kirby*.nsp")

  4. created a folder ./kirby_extracted/romfs/
  5. Extracted control.nacp (hactool.exe -x .\a62cf0016dcf820520ef0078d9e21dd7.nca -t nca -k .\prod.keys --romfsdir=romfs)

  6. Edited byte 0x3025 to value 1.

  7. Using hacpack GUI, NCA tab: Generated a new control nca file named: "3dd33481e8121636e10bf77ec3b6494a.nca".
    (Keyset: select keys.prod, title id: type it from the output in hactool, NCA type: control, romfsdir=.../kirby_extracted/romfs

  8. placed in a single directory the following files:
    the newly created cnmt file
    the new control file ("3dd3*.nca")
    tik file, cert file, other nca files (b7*.nca, e2*.nca)

  9. Using hacpack GUI, NSP tab: select that single directory and press build

I've installed the new nsp and it runs without asking for a linked account. I haven't tested it thoroughly yet (I have to deal with some real life stuff first) I'm surprised I haven't messed anything up in the process.
Now I'd love to repeat my steps and understand how to do it directly with hacpack (without the gui) and then perhaps make a python script to automate the process...

Thank you Falo for the instructions and GameSystem too, without your thread I wouldn't even consider trying it.
 
  • Like
Reactions: GameSystem

GameSystem

Well-Known Member
OP
Member
Joined
Sep 14, 2009
Messages
606
Trophies
1
XP
1,733
Country
United States
I love you extra much right now. I had done everything you did a hundred different ways, but you creating a folder called .kirby_extracted gave me a hint. Originally I was running hactool from cmd when it was just on my desktop, but I decided to throw it in the .switch folder since that's where it defaults when it looks for prod.keys anyway. For some inexplicable reason, it decided to work. All this time all I had to do was move the file. I finally have it extracted and I can visibly see the .nca! Hurray!

So for people viewing this thread, hactool apparently goes in
C\users\<your user profile>\.switch\
The folder .switch has hactool.exe, prod.keys, and the .nsp file inside.
You don't need to create the <whatever_extracted> folder, as hactool does it for you if you specify it in the cmd line.

EDIT: the new control and cnmt file each person generates appears to be different, so anyone reading this shouldn't have to wonder why they aren't getting files with the exact name as cyberant. Mine started with "d" and his started with "3."
I got it working by the way! Every profile has their own save and it's working just the way I want it.
 
Last edited by GameSystem,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BigOnYa @ BigOnYa: Anybody here have a Xbox series S and a series X, is the performance difference noticeable? I...