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

Load keys from save mode native firm #4348

Merged
merged 4 commits into from Oct 28, 2018

Conversation

Projects
None yet
3 participants
@B3n30
Copy link
Contributor

B3n30 commented Oct 17, 2018

There are some keys stored in the (save mode) native firms.
If the save mode native firm is provided to Citra it now can derive that keys.
The derived keys 0x31 KeyY and the common keys.

For now the only key that needs to be added manually to the aes_keys.txt is 0x25 KeyX
There are also 0x18 KeyX and 0x1B KeyX missing, that can get requested during NCCH decryption, but those are only used for new3DS-only games and thus at the moment not that relevant.

The keys are located by using a fixed offset. This works because there is only one version for the save mode native firm. (There are many different versions for the normal native firm and thus this fixed offset wouldn't work).

Since the native firm is different there are two different methods to handle them:

For o3DS / o2DS

Dump 00040138/00000003 with godmode9 as cia and install it in Citra

For n3DS/n2DS

  • Dump the secret section with godmode9 and copy the file (sector0x96.bin) to sys_data in the user folder
  • Dump 00040138/20000003 with godmode9 as cia and install it in Citra

The PR consists of 3 commits that could be reviewed separately


This change is Reviewable

@B3n30 B3n30 force-pushed the B3n30:native_firm_keys branch from 49058a8 to be3bd18 Oct 17, 2018

@wwylele
Copy link
Member

wwylele left a comment

Just some nit

Show resolved Hide resolved src/core/hw/aes/key.cpp Outdated
Show resolved Hide resolved src/core/hw/aes/key.cpp Outdated
Show resolved Hide resolved src/core/hw/aes/key.cpp Outdated

@B3n30 B3n30 force-pushed the B3n30:native_firm_keys branch from 10e746b to 807deb8 Oct 17, 2018

@B3n30 B3n30 force-pushed the B3n30:native_firm_keys branch from 807deb8 to ad232ef Oct 17, 2018

@bunnei

bunnei approved these changes Oct 28, 2018

@wwylele wwylele merged commit 67888f9 into citra-emu:master Oct 28, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ghost

This comment has been minimized.

Copy link

ghost commented Oct 30, 2018

you made a typo: save is incorrect, safe is correct.

@B3n30 B3n30 deleted the B3n30:native_firm_keys branch Apr 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.