Lockpick_RCM payload - Official Thread


Description

Lockpick_RCM is a bare metal Nintendo Switch payload that derives encryption keys for use in Switch file handling software like hactool, hactoolnet/LibHac, ChoiDujour, etc. without booting Horizon OS.

Source: https://github.com/shchmue/Lockpick_RCM
Payload: https://github.com/shchmue/Lockpick_RCM/releases

Due to changes imposed by firmware 7.0.0, Lockpick homebrew can no longer derive the latest keys. In the boot-time environment however, there are fewer limitations. That means the new keys are finally easy to dump!

Usage
  • Launch Lockpick_RCM.bin using your favorite payload injector or chainload from Hekate by placing it in /bootloader/payloads
  • Upon completion, keys will be saved to /switch/prod.keys on SD
  • If the console has Firmware 7.x, the /sept/ folder from Atmosphère or Kosmos release zip containing both sept-primary.bin and sept-secondary.enc must be present on SD or else only keyblob master key derivation is possible (ie. up to master_key_05 only)
Big thanks to CTCaer
For Hekate and all the advice while developing this!

Known Issues
  • Chainloading from SX will hang immediately due to quirks in their hwinit code, please launch payload directly
 

Attachments

  • AB1248EA-8BB9-448B-83F5-FF68C2579FB1.jpeg
    AB1248EA-8BB9-448B-83F5-FF68C2579FB1.jpeg
    11.2 KB · Views: 0
Last edited by shchmue,
The + 65 is simply used to reserve, in addition to the “useful” text_buffer_size bytes, a safety margin of 65 bytes to accommodate :
- The string terminator ('\0', 1 byte)
- Additional storage area (64 bytes)
- In many cases, this can be used to store, for example, the hexadecimal representation of a SHA-256 hash (32 bytes → 64 hexadecimal characters), or any other auxiliary data block (metadata, signature, padding, fixed header, etc.).

I'd much rather modify the line above, it's cleaner than adding a safety margin abitrairement this way.
 
Guys with the help of @Zoria here are a summary of the steps normally used to upgrade the code of LockPick when a new firmware is released.


Lockpick code is heavy based on Hekate, when a new Firmware is released some files must be changed to upgrade values for the new firmware, those values are taken by Hekate and LockPick from the most recent commit of Atmosphère supporting the new firmware. The values used by Atmosphère are found using a script created by SciresM as he shown on the stream about upgrading Atmosphère to FW 20.

So for upgrade LockPic you need to change some files, as far I know:

  • /source/keys/crypto.h, for this file you need to upgrade three sections, the values can be extracted from exosphere/program/source/boot/secmon_boot_key_data.s or fusee/program/source/fusee_key_derivation.cpp from Atmosphère repo, the next table summarize the sections where you can get them.
Name on file CRYPTO.HSection Name on secmon_boot_key_data.sFunction Name on fusee_key_derivation.cpp
device_master_kek_sourcesProduction Device Master Kek Sources.DeviceMasterKekSources
device_master_kek_sources_devDevelopment Device Master Kek Sources.DeviceMasterKekSourcesDev
device_master_key_source_sourcesDevice Master Key Source Sources.DeviceMasterKeySourceSources

  • source/keys/key_sources.inl, for this file you need to upgrade five sections, the values can be extracted from exosphere/program/source/boot/secmon_boot_key_data.s or fusee/program/source/fusee_key_derivation.cpp from Atmosphère repo, the next table summarize the sections where you can get them.
Name on file KEY_SOURCES.INLSection Name on secmon_boot_key_data.sFunction Name on fusee_key_derivation.cpp
master_kek_sources*not in secmon_boot_key_data*EristaMasterKekSource
master_key_vectors Production Master Key Vectors.MasterKeySources
master_key_vectors_dev Development Master Key Vectors.MasterKeySourcesDev
mariko_master_kek_sources Mariko Production Master Kek Source.MarikoMasterKekSource
mariko_master_kek_sources_devMariko Development Master Kek Source.MarikoMasterKekSourceDev

  • /source/hos/hos.h for this file you need to add new KB_FIRMWARE_VERSION_xxxx and update KB_FIRMWARE_VERSION_MAX

  • /Versions.inc, modify the version number.
 
Last edited by impeeza,
Apparently the keys are not read correctly under an emuMMC on a 2 TB SD card. Can anyone confirm this? I've only heard this because I don't use such a large capacity myself (400 & 512 GB)
 
Apparently the keys are not read correctly under an emuMMC on a 2 TB SD card. Can anyone confirm this? I've only heard this because I don't use such a large capacity myself (400 & 512 GB)
could be because the code of atmosphère and Hekate had to be tweaked for that capacities and LockPick uses several code from Hekate, Sadly I have not a such large SD to test.
 
LockPick uses several code from Hekate
As far as I know, Hekate now supports SD cards with a capacity of up to 2 TB. It is possible that this adjustment has not yet been incorporated into the Lockpick_RCM code? The same applies to the Tegra Explorer, which currently only supports SD cards up to 1 TB.
 
As far as I know, Hekate now supports SD cards with a capacity of up to 2 TB. It is possible that this adjustment has not yet been incorporated into the Lockpick_RCM code. The same applies to the Tegra Explorer, which currently only supports SD cards up to 1 TB.
very possible, but we need somebody which understand the code implemented on Hekate and translate to LockPick.
 
  • Like
Reactions: hetop and Muxi
I'm brain-farting and my wife says it's time to go, so no time to search the thread. How many kays is Mariko supposed to have? I'm definitely not getting 242 (or any errors... and it says keys were found up to 13). I do get 242 on Erista.
 
I'm brain-farting and my wife says it's time to go, so no time to search the thread. How many kays is Mariko supposed to have? I'm definitely not getting 242 (or any errors... and it says keys were found up to 13). I do get 242 on Erista.
I really do not know about Mariko but 242 are for Erista. Mariko have different set, and there are some you need to generate offline.
https://github.com/impeeza/Lockpick_RCMDecScots#mariko-specific-keys
Sadly I have not mariko unit to test.
 
  • Like
Reactions: Blythe93
I'm brain-farting and my wife says it's time to go, so no time to search the thread. How many kays is Mariko supposed to have? I'm definitely not getting 242 (or any errors... and it says keys were found up to 13). I do get 242 on Erista.
 

Attachments

  • lockpick_rcm.png
    lockpick_rcm.png
    25.1 KB · Views: 52
  • Like
Reactions: Blythe93
Ok, 213 is what I got as well. So my own build is good then. Thanks. :wacko:
Post automatically merged:

I really do not know about Mariko but 242 are for Erista. Mariko have different set, and there are some you need to generate offline.
https://github.com/impeeza/Lockpick_RCMDecScots#mariko-specific-keys
Sadly I have not mariko unit to test.
Yea, I did the mariko specific ones a while back, just because I was bored. Nothing at all makes use of them, as far as I know. Wonder what the actual purpose is/was...
 
Hello! So I recently dumped my keys to my Nintendo Switch, so that I can dumped my legally owned games to emuMMC using GoldLeaf. However, when I'm at GoldLeaf, despite saying that I'm at the latest firmware, the key generation is stuck to 9. I contact the creator of GoldLeaf about it, but he told me that it isn't an issue with GoldLeaf. So I want to ask you guys if you see anything that's off with my prod.keys file (I got rid of the sensitive information).
 

Attachments

Hello! So I recently dumped my keys to my Nintendo Switch, so that I can dumped my legally owned games to emuMMC using GoldLeaf. However, when I'm at GoldLeaf, despite saying that I'm at the latest firmware, the key generation is stuck to 9. I contact the creator of GoldLeaf about it, but he told me that it isn't an issue with GoldLeaf. So I want to ask you guys if you see anything that's off with my prod.keys file (I got rid of the sensitive information).

Why don't you just use DBI instead?.
 
  • Like
Reactions: Blythe93
Hello! So I recently dumped my keys to my Nintendo Switch, so that I can dumped my legally owned games to emuMMC using GoldLeaf. However, when I'm at GoldLeaf, despite saying that I'm at the latest firmware, the key generation is stuck to 9. I contact the creator of GoldLeaf about it, but he told me that it isn't an issue with GoldLeaf. So I want to ask you guys if you see anything that's off with my prod.keys file (I got rid of the sensitive information).
Are you using latest goldleaf? There is a new version supporting firmware 20. Also you can use NXDumpTool to dump installed apps
 
  • Like
Reactions: Blythe93

Site & Scene News

Popular threads in this forum