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

[Feature Suggestion] Nintendo switch "Official SDK" injection support #165

Open
baconwaifu opened this issue Feb 28, 2023 · 2 comments
Open

Comments

@baconwaifu
Copy link

baconwaifu commented Feb 28, 2023

With the removal of python 2 from distros, running it "standalone" is getting harder, so injection seems preferable. The switch is a fairly bog-standard renpy environment, just with a few "interesting" limitations:

Injection can't be done through file insertion, must be done either through replacement or pickle save-bombing (The latter being my preferred technique for dealing with their custom 'zng' image encoding, will attach my tools when I have time to get to the machine they're on). EDIT: can't be done through rpyc overwrite either, you have to overwrite bytecode.rpyb and probably update the ~INDEX file. Or you can just backup and clobber the persistent store pickle instead, it's loaded at around the same time, and isn't subject to the various index-hells.

Another limitation is a complete lack of arbitrary file writing; the interpreter blackholes file writes from python. There is however, a way to get files out: It has to be able to write to savegames somehow, and that happens to be done in pure-python. They also have a custom binary index for those as well, though, so you have to either figure out how to "create" savegames, or overwrite an existing one.

EDIT: more details on insertion points (debugging a mod, game does not like itself trying to update bytecode.rpyb)

@CensoredUsername
Copy link
Owner

I just noticed I never replied to this.

It is still possible to run it with python 2, it might not be the standard distribution anymore but you can easily compile it yourself when needed. That said, we're now supporting python 3 for a significant amount of games as well.

Loading unrpyc through a save sounds possible, and wouldn't be that hard to implement. But this seems like a lot of work and I don't have the required hardware (or time) to work on this. But if you need some tips where to start, I can help.

@baconwaifu
Copy link
Author

baconwaifu commented Jun 27, 2024

I just realized that if you only want to dump the scripts, you can also just copy-paste the rpyc files into a PC renpy 'skeleton' and inject into that instead. Possibly just add that 'workaround' to the documentation instead? I should probably still document my "picklebomb" technique for decoding the images though, even if it's only really useful for switch-only releases (using a picklebomb to inject a stub that loads all the images and saves them out into the save file as normal PNGs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants