ns-usbloader icon indicating copy to clipboard operation
ns-usbloader copied to clipboard

Dumping NSP's from nxdumptool to PC

Open Corgano opened this issue 5 years ago • 5 comments

This is not immediately useful, but more an idea for the future.

I dump lots of game files from NXdumptool, copy them to PC, and then merge them. This leaves me thinking why not stream the dump directly to PC? Essentially the exact opposite of installing to the switch.

I mentioned the idea to the developer of nxdumptool, and he said he 1. Would need to make a multiplatform PC app, which he didn't currently know what to do, and 2. was busy with a rewrite of nxdumptool. ns-usbloader is already a multi platform tool, and you already have communication with the switch to load games to it, how difficult would it be to create a protocol to send dumps from the switch to a file on PC? Make both tools significantly more useful.

Corgano avatar Apr 28 '20 23:04 Corgano

how difficult would it be to create a protocol to send dumps from the switch to a file on PC?

I'm ready for work with him on this =)

developersu avatar Apr 29 '20 17:04 developersu

@developersu I can give you access to my private nxdumptool-rewrite repository if you'd like to. Development stage is still very early (e.g. no title/content listing functions yet), but the following formats are already both supported and dumpeable:

  • XCI.
    • Hash File System (HFS0). Entire partition block / extracted file entries / specific file entry.
  • NCA0/NCA2/NCA3 (raw/plaintext).
    • Partition File System (PFS0). Entire decrypted FS block / extracted file entries / specific file entry.
    • RomFS. Entire decrypted FS block / extracted dir-file tree / dir-file tree from a specific directory / specific file entry.
    • Patch RomFS (BKTR). Same as above.
  • Ticket.
  • Certificate (including cert chain generation).

Other formats, like CNMT, NSO, NPDM and NACP will also be supported, because they're needed to generate the AuditingTool XMLs provided by nxdumptool in all dumped NSPs. But the hard part of the work has mostly been finished already. 😃

Since I plan to eventually implement threaded I/O using function pointers, I would like to start working on an USB protocol to avoid further code rearrangement down the road, which is one of things I wish to avoid with this rewrite.

I've been reading code from other projects that implement an USB protocol and it doesn't look too complicated, so, just let me know when you'd like to start. Thanks for being willing to lend me a hand on this.

DarkMatterCore avatar May 01 '20 05:05 DarkMatterCore

@DarkMatterCore Ok. Let's discuss it on Atlas NX discord. Thanks!

developersu avatar May 01 '20 12:05 developersu

Just popping in, wondering if there has been any progress on this end of things

Corgano avatar Jun 02 '20 05:06 Corgano

Yes, we have some progress in this. I think we did the most piece of work in adding USB support to both our apps.

developersu avatar Jun 02 '20 13:06 developersu