Homebrew The bootroms

yifan_lu

@yifanlu
Member
Joined
Apr 28, 2007
Messages
663
Trophies
0
XP
1,671
Country
United States
I'm going to assume @yifan_lu's method is involving either decapping the chip, or performing the exception-vector timing attack from hardware as outlined earlier in the thread?
From the looks of the insides, it is highly likely that the debugger features are implemented in a FPGA. This gives us two possibilities: 1) it might be possible to reprogram the FPGA to enable JTAG debugging (my theory is that nintendo uses similar hw internally but different FPGA hardware definitions for developers. cuts down costs). 2) since the FPGA is connected directly to the main SoC, it could provide a very convenient way to try to trigger the timing attack without having to create custom hw.

I can't justify spending the money just to test this hypothesis since I could be wrong and brick a dev unit in the process.
 
Last edited by yifan_lu,

sirocyl

Are we Geniuses or what?
Newcomer
Joined
Apr 30, 2012
Messages
92
Trophies
1
Age
31
XP
324
Country
United States
That's what I get for not reading the whole thread. ._.

Either way, that's a very interesting conclusion. The actual 3DS SoC wouldn't happen to have the pins on it to support JTAG in the same way, right? Or, would the consumer-level chip simply have it disconnected from the die?
 

yifan_lu

@yifanlu
Member
Joined
Apr 28, 2007
Messages
663
Trophies
0
XP
1,671
Country
United States
That's what I get for not reading the whole thread. ._.

Either way, that's a very interesting conclusion. The actual 3DS SoC wouldn't happen to have the pins on it to support JTAG in the same way, right? Or, would the consumer-level chip simply have it disconnected from the die?
If nintendo was smart, they would tie off the JTAG pins on retail units. Other manufacturers use efuses for this: that way they can produce a single chip for both testing and consumer (makes sense since you don't want a bug to only be in a consumer unit and not a debug unit). If I were nintendo, I would have a value in the OTP that enables JTAG or not (since that's essentially efuses).

Of course nintendo isn't known for being smart in these things so it wouldn't hurt for someone to check though.
 

mathieulh

Well-Known Member
Member
Joined
Feb 28, 2008
Messages
378
Trophies
0
Website
keybase.io
XP
897
Country
France
If nintendo was smart, they would tie off the JTAG pins on retail units. Other manufacturers use efuses for this: that way they can produce a single chip for both testing and consumer (makes sense since you don't want a bug to only be in a consumer unit and not a debug unit). If I were nintendo, I would have a value in the OTP that enables JTAG or not (since that's essentially efuses).

Of course nintendo isn't known for being smart in these things so it wouldn't hurt for someone to check though.
As far as I can tell, a special purpose (write once) register used to disable JTAG is set by boot9 depending on your OTP configuration.
 

dark_samus3

Well-Known Member
Member
Joined
May 30, 2015
Messages
2,372
Trophies
0
XP
2,042
Country
United States
in case anyone cares, we did end up identifying the ISA of the MCU, documentation can be found here

We still aren't sure of the exact model, but we can actually disassemble the MCU FW now and get an idea of what they're doing (which is more than can be said from before). There's also a simulator, binutils and gcc for this thing already out in the wild... All this said, it isn't guaranteed that we'll find a way to dump bootrom through this, but it means we have more documentation and options available to us now.

Shoutouts to bilis randomly googling, picking the first result, and it being the exact thing we needed... (we all feel pretty stupid at this point, heh)
 

Billy Acuña

Well-Known Member
Member
Joined
Oct 10, 2015
Messages
3,126
Trophies
1
Age
31
XP
3,701
Country
Mexico
in case anyone cares, we did end up identifying the ISA of the MCU, documentation can be found here

We still aren't sure of the exact model, but we can actually disassemble the MCU FW now and get an idea of what they're doing (which is more than can be said from before). There's also a simulator, binutils and gcc for this thing already out in the wild... All this said, it isn't guaranteed that we'll find a way to dump bootrom through this, but it means we have more documentation and options available to us now.

Shoutouts to bilis randomly googling, picking the first result, and it being the exact thing we needed... (we all feel pretty stupid at this point, heh)
Something that was used to be called "bullshit" is coming a reallity.
 
  • Like
Reactions: Swiftloke

sirocyl

Are we Geniuses or what?
Newcomer
Joined
Apr 30, 2012
Messages
92
Trophies
1
Age
31
XP
324
Country
United States
As far as I can tell, a special purpose (write once) register used to disable JTAG is set by boot9 depending on your OTP configuration.
What this says to me, is "You can use JTAG to stop boot9 before boot9 disables JTAG."
Which in turn means, "You can use JTAG to stop boot9 before the sysprot write, then tell the CPU to dump the bootrom memory region over JTAG."

I mean, if someone were willing to solder a few tiny wires to a BGA part, we could easily download bootrom over a parallel port on a PC.
 

mathieulh

Well-Known Member
Member
Joined
Feb 28, 2008
Messages
378
Trophies
0
Website
keybase.io
XP
897
Country
France
What this says to me, is "You can use JTAG to stop boot9 before boot9 disables JTAG."
Which in turn means, "You can use JTAG to stop boot9 before the sysprot write, then tell the CPU to dump the bootrom memory region over JTAG."

I mean, if someone were willing to solder a few tiny wires to a BGA part, we could easily download bootrom over a parallel port on a PC.
It's not that easy, timing is too short to make it doable, in short they weren't that stupid.

Envoyé de mon SM-G935F en utilisant Tapatalk
 
  • Like
Reactions: sirocyl

sirocyl

Are we Geniuses or what?
Newcomer
Joined
Apr 30, 2012
Messages
92
Trophies
1
Age
31
XP
324
Country
United States
Is the actual timing known but not feasible to get?
Something like that. We need to stop the ARM9 CPU within 2-300 instructions, which is somewhere in the ballpark of 6-1200 clocks at 134MHz.
(Going by the average ARM9 cycles-per-instruction count.)

A back-of-the-napkin calculation says that, optimistically, we have almost 9 microseconds, or 9000 nanoseconds to work in.

Pessimistically? We only have 45 nanoseconds to work in.
Good luck finding something that quick to respond over JTAG.

But, if we can tie into the /RESET line, then we could use a clock drift strategy to eventually hit that sweet spot after a few million tries.
 
Last edited by sirocyl,

Xenon Hacks

Well-Known Member
Member
Joined
Nov 13, 2014
Messages
7,414
Trophies
1
Age
30
XP
4,687
Country
United States
Something like that. We need to stop the ARM9 CPU within 2-300 instructions, which is somewhere in the ballpark of 6-1200 clocks at 134MHz.
(Going by the average ARM9 cycles-per-instruction count.)

A back-of-the-napkin calculation says that, optimistically, we have almost 9 microseconds, or 9000 nanoseconds to work in.

Pessimistically? We only have 45 nanoseconds to work in.
Good luck finding something that quick to respond over JTAG.

But, if we can tie into the /RESET line, then we could use a clock drift strategy to eventually hit that sweet spot after a few million tries.
is there something you can do to force this window to widen kinda of like loading a bunch of crap 0's to cause "lag"?
 
Last edited by Xenon Hacks,

astronautlevel

Well-Known Member
Member
Joined
Jan 26, 2016
Messages
4,128
Trophies
2
Location
Maryland
Website
ataber.pw
XP
5,008
Country
United States
You mean longer it takes for the whole boot9 code to run? Be realistic, think nanoseconds.

Envoyé de mon SM-G935F en utilisant Tapatalk
The person who I was replying to said "making a loop that increments the number of ms (milliseconds)," trust me, I know the time frame is much shorter than that :P
 

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
is there something you can do to force this window to widen kinda of like loading a bunch of crap 0's to cause "lag"?

No. Not without tying to specific (and currently unidentified) pins that are potentially so small you can't solder. "Loading a bunch of crap 0's" is not only software, but we *physically* don't have execution so early (that's the entire point.) Even if software could stall (it can't) we don't have the ability to do so.

Please read the end of @sirocyl's post carefully.
 
  • Like
Reactions: astronautlevel

Poryhack

Well-Known Member
Member
Joined
Oct 18, 2009
Messages
332
Trophies
0
Age
32
XP
254
Country
United States
Can the bootrom of a dev unit be dumped over JTAG as @yifan_lu theorized? Would doing so be helpful? I've seen speculation that the bootrom could be the same between dev and retail.
 
Last edited by Poryhack,

Aletron9000

Well-Known Member
Member
Joined
May 10, 2016
Messages
1,716
Trophies
0
Location
Classified
XP
1,606
Country
United States
Can the bootrom of a dev unit be dumped over JTAG as @yifan_lu theorized? Would doing so be helpful? I've seen speculation that the bootrom could be the same between dev and retail.

The dev bootrom (as i have heard) can be used to decrypt dev roms and then we can use a retail 3ds to reencrypt it to a retail rom.
 

Poryhack

Well-Known Member
Member
Joined
Oct 18, 2009
Messages
332
Trophies
0
Age
32
XP
254
Country
United States
The dev bootrom (as i have heard) can be used to decrypt dev roms and then we can use a retail 3ds to reencrypt it to a retail rom.
That should already be quite doable without any bootroms. Hell the "bigbluemenu" that everyone was using for so long is nothing but a dev "rom" with a banner and (maybe) encryption/signing swap.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: This parrot is no more it has ceased to be!