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

Dump data to a PC via USB. #58

Open
Corgano opened this issue Apr 28, 2020 · 25 comments
Open

Dump data to a PC via USB. #58

Corgano opened this issue Apr 28, 2020 · 25 comments
Labels
enhancement New feature or request implemented This feature or request has already been implemented

Comments

@Corgano
Copy link

Corgano commented Apr 28, 2020

Opposite of installing to PC, have it batch dump to PC. In effect, the exact opposite of nx_usbloader

@DarkMatterCore DarkMatterCore added the enhancement New feature or request label Apr 28, 2020
@DarkMatterCore
Copy link
Owner

DarkMatterCore commented Apr 28, 2020

@Corgano Hi there. Thanks for opening this feature request issue.

It's on my to-do list, albeit with a very low priority at this moment, because of two different reasons:

  1. Working on a Switch <-> PC transfer protocol will inevitably require a PC companion program capable of running under multiple OS, which means I'll have to get better at another language (Python, Java) in order to achieve that.

  2. I'm busy with the ongoing nxdumptool rewrite in the private GitHub repository. Everything really is being rewritten from scratch. :P

I won't promise anything right away, but neither will I disregard this feature request. I do wish to implement this sometime in the future.

@Corgano
Copy link
Author

Corgano commented Apr 28, 2020

Just future thinking here, but maybe when you do get around to it you could chat up the guys at nxusbloader about integrating dumping into it. They already have a payload injector and a nsp merger integrated with their pc app, so it's something they might be interested in adding. It would be awesome to have one app that does everything. If you and them could figure out a protocol, you'd only have to worry about your end of things, the nxusbloader guys can work about the pc side of things

@Corgano
Copy link
Author

Corgano commented Apr 30, 2020

I mentioned it on an issue at NS_Usbloader and he seems game to come up with something, whenever you're ready.

@DarkMatterCore
Copy link
Owner

@Corgano Just took a look at the issue and made a comment there. Hopefully we'll both come up with something nice for the nxdumptool rewrite.

@Corgano
Copy link
Author

Corgano commented May 1, 2020

I must say I'm quite excited. Any idea when the rewrite will be done? Some time before christmas?

@DarkMatterCore
Copy link
Owner

No ETA at this moment, sadly. I do *hope* to release it before Christmas, though. Let me elaborate.

I'd say format compatibility is around 70% done, with only CNMT, NPDM, NSO and NACP support missing - luckily, these are pretty easy to implement, and shouldn't take me more than a few days.

Then again, I also have to rewrite title/content listing, which will be critical to take advantage of the new codebase - it's basically what "glues" everything else.

And don't even get me started on the new UI... I have a small PoC in a different repository with touch support, but it's far from complete - button/stick inputs are kinda wonky to handle under lvgl, and I need to optimize the current screen drawing code, because it doesn't run as smooth as I want. Basically, I have to study lvgl in-depth.

... Also, let's not forget that my Internet connection is total garbage and that I suffer from daily power outages on a regular basis. For the record, I spent more than two days trying to upload the silent update NRO. This totally hinders my daily progress.

@DarkMatterCore
Copy link
Owner

DarkMatterCore commented May 1, 2020

The rewrite is needed because the level of disorder in the current codebase is hideous. It was already becoming unmainteinable, and adding new features to it was a nightmare. Honestly, I just grabbed the best parts of it and decided to ditch it.

The stack corruption issue I fixed in the last release was actually what motivated me to start the rewrite - this bug was driving me crazy and I couldn't find any possible explanation for it.

Turns out I was able to reproduce the same issue in the rewrite and fixed it there before backporting the needed changes to the current codebase.

That just goes to show my previous lack of programming guidelines, and why I'm currently striving to get better at creating code that not only works, but looks good as well and is easy to work with. I won't abandon this project, that's for sure.

@DarkMatterCore DarkMatterCore changed the title [Feature request] Batch dump to PC Dump data to a PC via USB. May 1, 2020
@DarkMatterCore
Copy link
Owner

Not only batch dumps will benefit from this. Everything else will do as well. 😛

@DarkMatterCore
Copy link
Owner

DarkMatterCore commented May 5, 2020

@Corgano Status update: Switch <-> PC communication now works in the rewrite codebase, thanks to a debug tool written in Java by developersu. 🙂

Actual tests haven't been carried out because the companion app still needs to be developed, but the groundwork for this feature has mostly been finished (Switch side of things, at least).

Combined with the new threaded I/O, it's gonna be interesting to see how fast will USB dumping perform.

My full Super Mario Odyssey gamecard is dumped in 4 minutes and 20 seconds using my SD card as the output storage device.

I also benchmarked BKTR performance by dumping the data.arc file (~15 GiB) from the latest SSBU update, and the process finished after ~15 minutes. This is nice, considering the code needs to deal with up to three different crypto layers at the same time, as well as patching data on-the-fly before writing it.

@DarkMatterCore
Copy link
Owner

@Corgano USB I/O is pretty much complete at this point.

ns-usbloader

nxdumptool

Extracted Dark Souls RomFS dump via USB. Took 97 secs.

Other tests have been carried out as well, like dumping my SMO gamecard (took 3:20 minutes) and SSBU's full RomFS image (took 5:45 minutes).

This issue will be kept open until the rewrite is finished.

@Corgano
Copy link
Author

Corgano commented May 10, 2020

That is fantastic! As soon as you have something stable enough to test I'd be happy to test it.

@Corgano
Copy link
Author

Corgano commented May 10, 2020

Will this feature need to wait for the rewrite to be completed, or is it possible to back this to the current release version in the meantime?

@DarkMatterCore
Copy link
Owner

@Corgano It will only be available in the rewrite. It could be possible to port this back to the old nxdumptool branch, but honestly I don't want to lose any more time glueing new code to it.

@Corgano
Copy link
Author

Corgano commented Jun 1, 2020

Any news on the rewrite? Which discord do you usually hang out at?

@DarkMatterCore
Copy link
Owner

DarkMatterCore commented Jun 2, 2020

@Corgano Still working on it at irregular intervals, sadly. Power outages in my city aren't very helpful. Feel free to send me a DM or a friend request on Discord, they're both open to anyone. It's easier than trying to contact me through a server.

You can find my Discord handle on my GitHub profile.

@Corgano
Copy link
Author

Corgano commented Jun 2, 2020 via email

@DarkMatterCore
Copy link
Owner

DarkMatterCore commented Jun 2, 2020

@Corgano Orders of magnitude faster with USB. @averne tested ACNH's RomFS dumping via USB and it took less than 6 minutes to dump all 60k+ files.

@Corgano
Copy link
Author

Corgano commented Jun 2, 2020 via email

@DarkMatterCore
Copy link
Owner

@Corgano More than 2 hours for most people. This is because random access writes are way slower for SD cards, thus dumping many small files takes a lot of time. We're talking about 60k+ files, and most of them don't even reach 500 KiB in size.

@Corgano
Copy link
Author

Corgano commented Jun 2, 2020 via email

@DarkMatterCore
Copy link
Owner

@Corgano Indeed. Speed improvements for sequential access writes are not as big, but they're still very much noticeable.

@DarkMatterCore
Copy link
Owner

@Corgano Some days ago, I decided to make the rewrite codebase public as a separate branch in this repository. If you ever feel like testing this feature yourself, by all means go ahead. If you hit me up at Discord, I'll happily assist you.

@PolyCatDev
Copy link

PolyCatDev commented Nov 10, 2023

Imma jump in here and show off a client for Linux. I've been using it and it works wonders: https://flathub.org/apps/org.v1993.NXDumpClient

@halotroop2288
Copy link

This is complete now, right?

Is there a client for this on Windows yet?

@DarkMatterCore
Copy link
Owner

This is complete now, right?

Is there a client for this on Windows yet?

Yes, but you need to use a rewrite branch build.

We offer a Python script that can be used under Windows. It requires a USB driver installation with Zadig.

We also offer EXE builds of this script in our Discord server.

@DarkMatterCore DarkMatterCore added the implemented This feature or request has already been implemented label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request implemented This feature or request has already been implemented
Projects
None yet
Development

No branches or pull requests

4 participants