Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting a patch file with a ticket #106

Open
hgdagon opened this issue Oct 12, 2023 · 10 comments
Open

Extracting a patch file with a ticket #106

hgdagon opened this issue Oct 12, 2023 · 10 comments
Labels
enhancement NCA Patch Issues related to NCA Patches

Comments

@hgdagon
Copy link

hgdagon commented Oct 12, 2023

I had no issues extracting the base game with this command:

nstool --tik maintik.tik -x ./game mainnca.nca

But I can't figure out how to extract the patch. The patch comes with it's own ticket, and I can only provide one. If I provide the main ticket:

nstool -x ./patch --tik ../main/maintik.tik --basenca ../main/mainnca.nca patchnca.nca

Nothing is extracted and I see this output:

[WARNING] NCA Partition 0 not readable. (AES-CTR Key was not determined)
[WARNING] NCA Partition 1 not readable. (AES-CTR Key was not determined)

If I provide the patch ticket:

nstool -x ./patch --tik patchtik.tik --basenca ../main/mainnca.nca patchnca.nca

Only partition 0 is extracted and I get this output:

[WARNING] NCA Partition 1 not readable. (Cannot determine RomFs from base nca.)
@jakcron
Copy link
Owner

jakcron commented Oct 13, 2023

Oh dear. I hadn't considered this, but I guess it's rather obvious that if both the base game and patch were digital downloads they'd have separate tickets & right ids.

I'll see what I can do about allowing the user to specify multiple tickets.

@hgdagon
Copy link
Author

hgdagon commented Oct 13, 2023

@jakcron While you're at it, do you think you can add support for extracted nca? i.e instead of --basenca, pass --basedir and avoid the ticket problem altogether? I don't know which one would be easier to implement, but eh... just an idea.

@thonkinator
Copy link

@jakcron Any update on this? I'm running into the same issue, and I tried poking around in the code for a bit to see if I could add something like a --base-tik argument but I can't say I understand much

@thonkinator
Copy link

actually scratch that, i got it to work. it's definitely ugly but i'll clean it up and PR, i suppose? i'm gonna make it so you can specify as many tickets as you want (all with --tik)

@jakcron jakcron added enhancement NCA Patch Issues related to NCA Patches labels Dec 31, 2023
@jakcron
Copy link
Owner

jakcron commented Dec 31, 2023

actually scratch that, i got it to work. it's definitely ugly but i'll clean it up and PR, i suppose? i'm gonna make it so you can specify as many tickets as you want (all with --tik)

That's actually a good idea, specifying as many tickets as required using --tik. Feel free to make a PR.

@jakcron
Copy link
Owner

jakcron commented Jan 1, 2024

After sleeping on this I felt motivated to do this myself, see here https://github.com/jakcron/nstool/tree/feature-106-multipletickets

I'm also adding support for automatically reading ~/.switch/title.keys (same format as used by hactool and everything else)

@jakcron
Copy link
Owner

jakcron commented Jan 1, 2024

I just need to make some documentation updates to explain how to use this, and specify the title.keys file.

@jakcron
Copy link
Owner

jakcron commented Jan 1, 2024

@jakcron While you're at it, do you think you can add support for extracted nca? i.e instead of --basenca, pass --basedir and avoid the ticket problem altogether? I don't know which one would be easier to implement, but eh... just an idea.

Sadly the way patches work makes this very difficult to implement.

@jakcron
Copy link
Owner

jakcron commented Jan 20, 2024

Hey @hgdagon @thonkinator can you try using NSTool v1.9.0 (https://github.com/jakcron/nstool/releases/tag/v1.9.0)?

You should be able to specify two tickets by invoking --tik for each ticket file.

@hgdagon
Copy link
Author

hgdagon commented Jan 21, 2024

Works as expected on my end!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement NCA Patch Issues related to NCA Patches
Projects
None yet
Development

No branches or pull requests

3 participants