Hacking 3DS unbricking progress

  • Thread starter Thread starter krisztian1997
  • Start date Start date
  • Views Views 376,678
  • Replies Replies 1,233
  • Likes Likes 32
Status
Not open for further replies.
Update: RPU can now unlock the eMMC.

The usual header: this will neither enable a downgrade nor running pirated porkemon [sic] on >4.5.

An anonymous source gave me the key required to generate the console specific eMMC lock/unlock password in exchange for posting his/her following statement in my initial release posts and the tool itself:

If you are reading this your 3DS has most likely been bricked by a Virus called Gateway 3DS. If so return it and get a refund immediately.
Because what they have done is they made a soft-mod for the 3DS but then decided that they would earn more money if they added their own AP.
They also added a lot of obfuscation (to prevent pirates from pirating their card and software), which most likely also is the reason why some versions are not stable (and the brick code is triggered). And as you already see on your 3DS they added brick code in the 2.0_2b Version. This brick code is not even written correctly (else this unbricker wouldn't work). So they even failed at programming brick code.
To sum it all up you bought a badly programmed Virus.

Buy your games, don't pirate them. You see what happens when you pirate. I hope you learned from your mistake.

The good news: this makes it possible to unbrick even if you don't have a prior NAND backup.

The bad news: for now it has to be done in a quite roundabout way: unlock the eMMC/NAND -> dump it -> relock the eMMC/NAND -> force erase -> flash the NAND image -> unbricked.

The reason for this detour is that besides being locked, the eMMC also gets write protected (just like some people had already stated) and I wasn't able to remove said write protection yet (in this context: if anyone got any idea how on earth i could get the Pi to do CMD27 like it's supposed to work please let me know).

But said write protection gets wiped by a force erase too, thus offering a working solution for now (although I'd have preferred a single keypress unlock and will keep working on that).

I just pushed the changes to github, either do the online or offline update as described in the guide to get the new version.

As i believe not everyone to be interested in the technical details I'll put them in a spoiler:
The lock/unlock password is generated by encrypting the console specific CID (the unique serialnumber of the eMMC) with GW's master AES key (which I don't and don't want to have) using the 3DS AES engine in CTR mode. I had to look that one up as I only ever use CBC and XTS: CTR uses the block cipher to generate a keystream to be xored to the plaintext with no cleartext or cyphertext feedback whatsoever. In other words: this keystream is constant for all 3DSes, thus enabling an unlock without using a working 3DS to generate the password. To get this keystream one has just to encrypt 16 bytes of 0x00, which my source did.

Lock/Unlock mechanism (in pseudocode, those functions are named differently and have different signatures on the 3DS as well as in RPU):
Code:
uint8_t CID_buffer[CID_length];
CID_buffer = read_CID(eMMC);
CID = AES_encrypt(CTR , GW_MASTERKEY, CID, CID_length ); //this is equivalent to CID = CID xor AES_encrypt(CTR , GW_MASTERKEY, 0x0, CID_length);
CID[0] = 5; //bit 0 and 2 set, meaning "set password" and "lock eMMC", for the unlock it's CID[0] = 2; //bit 1 set meaning "clear password" (unlock happens implicit)
CID[1] = 14; //next 14 bytes are the password
SD_command(eMMC, 42, CID, CID_length); //command 42 (lock/unlock) on the eMMC sending 16 bytes starting from &CID as data payload

Thanks GW for choosing the one AES mode which made this approach possible.

This is another piece of evidence that the bricking doesn't happen random, as (on the most objective level) the locking occurs using a deterministic (not random) console specific password. I don't want to and will not make any claims beyond that (even though personally I do believe it happens with intent as a clone deterrent gone horribly wrong, this IMHO still isn't decisive damning evidence).

Feasibility of the unlock -> dump -> lock -> force erase -> flash approach was proven by gamesquest1 (using the unmodified 2.0b2) and Inaki (using the region patched 2.0b2). Thanks for testing dudes.
Also thanks to krisztian1997, khalaan and of course the anonymous source. Love you guys (no homo).


p.s. I'll use this opportunity to once again draw attention to step 18 of the guide *nudge nudge wink wink know what i mean*
 
This brick code is not even written correctly (else this unbricker wouldn't work)
bkifft, do you know what this means, what would have happened if the code was written correctly?
 
bkifft, do you know what this means, what would have happened if the code was written correctly?

Yes i know. GW would have created high price segment paper weights and incurred the biggest shitstorm in the history of the internet.

But i believe said sentence from the statement wasn't only meant as a "if you are gonna brick it brick it for good" but was also a snide remark on the choosen blockcipher operation mode. Heck, even ECB (which you should never ever use in production code) would have made it way harder to unlock.
 
The front page F.A.Q has been updated with the information supplied by bkifft as well as a direct link to the original statement - thank you for keeping us up-to-date with the unbricking progress! :)
 
The front page F.A.Q has been updated with the information supplied by bkifft as well as a direct link to the original statement - thank you for keeping us up-to-date with the unbricking progress! :)

hey, I'll do everything to fill my email storage.

anyway @thread: as I don't want to invade the non English and non German forums again to spread the news, feel free to do so if you can speak their respective languages.
 
hey, I'll do everything to fill my email storage.

anyway @thread: as I don't want to invade the non English and non German forums again to spread the news, feel free to do so if you can speak the languages.
Just so that it's clear, the Raspbery Pi-based Unbricker now has the eMMC-unlocking routine implemented, but the Arudino-based Unbricker does not (yet), correct?
 
Just so that it's clear, the Raspbery Pi-based Unbricker now has the eMMC-unlocking routine implemented, but the Arudino-based Unbricker does not (yet), correct?

Working on the arduino based unblocker, I am having some difficulty with it at the moment, mostly with the byte shifting and xoring but gonna fix it tonight or tommorow
 
Working on the arduino based unblocker, I am having some difficulty with it at the moment, mostly with the byte shifting and xoring but gonna fix it tonight or tommorow
Fantastic, thank you for your hard work!

I've updated the F.A.Q accordingly, I'm glad that RP users can now unbrick without having to worry about their NAND backups... which they should have anyways, but you know how it is! :P
 
Just so that it's clear, the Raspbery Pi-based Unbricker now has the eMMC-unlocking routine implemented, but the Arudino-based Unbricker does not (yet), correct?
Yes, only that frigging write protect seems to be left in the way to an (on the software side) easy to use one click unbrick solution.
 
  • Like
Reactions: Foxi4
...not to try start another of these what does and doesn't deserve a sticky debates, but personally i think this is sticky worthy very good news for people who are bricked and dont have their nand dump

ps im going to throw a little video tutorial up as the people who didn't follow the written instructions properly about getting a nand dump in the first place will be the most likely users for this.......and if they don't follow the steps properly you end up with a 100% bricked console
 
...not to try start another of these what does and doesn't deserve a sticky debates, but personally i think this is sticky worthy very good news for people who are bricked and dont have their nand dump

ps im going to throw a little video tutorial up as the people who didn't follow the written instructions properly about getting a nand dump in the first place will be the most likely users for this.......and if they don't follow the steps properly you end up with a 100% bricked console
It indeed does. The thread is now stickied until both tools are complete - then we'll think of replacing it with a comprehensive guide. Well, spotted. ;)
 
After playing around with those annoying bits, my code is updated too (and like before, not tested and its gonna take several weeks untill someone tests it), I succesfully locked my sd cards with it, and the password is unique, and then I unlocked them and it worked.
 
...not to try start another of these what does and doesn't deserve a sticky debates, but personally i think this is sticky worthy very good news for people who are bricked and dont have their nand dump

ps im going to throw a little video tutorial up as the people who didn't follow the written instructions properly about getting a nand dump in the first place will be the most likely users for this.......and if they don't follow the steps properly you end up with a 100% bricked console

Good on you mate. Can't wait to see the vid in question. Ii was going to make one myself and probably still am, but im left back at square one trying to make another solder less pogo pin setup as my current pins are too damn long. Cheers mate, and thanks for all the testing thus far.
 
After playing around with those annoying bits, my code is updated too (and like before, not tested and its gonna take several weeks untill someone tests it), I succesfully locked my sd cards with it, and the password is unique, and then I unlocked them and it worked.

Is there a way i can force brick my 7.x to try out?
 
or by using the diagnostic mode of gateway several times on 2.0b2. You can brick your device insanely fast that way
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum