Tyulis / 3DSkit

A multi-purpose and pluggable program to extract and repack files found in 3DS (and some other Nintendo consoles) games
GNU General Public License v3.0
65 stars 11 forks source link

Extracting files inside exefs Nintendo Switch #19

Open Migushthe2nd opened 5 years ago

Migushthe2nd commented 5 years ago

You seem quite skilled (especially because I have no idea what has to be done to extract all these binary files), so I wanted to ask you if you could also take a look at the files in the exefs partition. I was wondering if those can be unpacked an converted to a readable format aswell. I don't know though if it'll be of anything useful. The three files inside the qlaunch's (Nintendo's system titles) exefs: image And here's the link https://drive.google.com/drive/folders/1RixtA-_BSjd0-ihIJ1tHPQUDgxm0ctfY?usp=sharing

I'm not saying you have to do this, just asking (<- that 'just' can be quite a lot tho) if you could if you have the time available. I don't know if it is even possible, also because there isn't much documentation.

Tyulis commented 5 years ago

Actually, I don't have so many experience with the Switch. But anyways, files are quite similar. There, main and rtld are basically executable files, or libraries. So it might be converted to ELF, but I don't think it will be so interesting. Then main.npdm is "The Switch equivalent of the 3DS exheader", as Switchbrew said, so it may be converted as 3DSkit does with 3DS exheader, but it mostly contains information used internally, such as memory mapping, acccess controls, permissions... So another time, some informations that are not so interesting nor useful in my mind. But if you want, I can take a look if I finally succeed with BFLAN files (that are significally less documented)

(And digging into file formats like that is not so complicated, you just don't have to be afraid by hex editors)

Migushthe2nd commented 5 years ago

Again, I have no experience, but a developer of Qcean once said this

"Implementing more stuff isn't easy cause yes we can edit the layout but the code doesn't "know" that our custom entries are there, (...) would require an insane level of skill to properly patch the home menu exefs."

Where do you think the code that would have to edited would be? I simply thought "main is the biggest file in exefs, so I guess that would contain the code that controls the rest." (Sorry I didn't provide sizes) image

Edit: I found a github page that says which file (apparantly main.npdm) was edited to launch the Homebrew menu via another button. (Yeah I don't have enough knowledge for this, as I have no idea what you would get when 'unpacking' such a file)

UserPageHBMenu
A quick modification to the .npdm file that Atmoshphere uses to launch the HBMenu as done by the original project, nx-hbloader.

Usage:
Rename your /atmosphere/titles/010000000000100D directory to /atmosphere/title/0100000000001013
Move main.npdm to /atmosphere/title/0100000000001013/exefs/
Start up Hekate, and click any user icon at the top left of the home menu.
Dependencies:
npdmtool

(https://github.com/bzzus/UserPageHBMenu)

Tyulis commented 5 years ago

Actually, I don't have many knowledge about how Atmosphere works, and even less about that. If it does not take account of custom entries, it's probably somewhere in the code, and I won't dig into machine code on a console I don't know very well, to find something I don't actually know. I confirm, it would require an insane level of skill ^^. But maybe I'll try to look at this someday if I have the time