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,610
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.
  • SylverReZ @ SylverReZ:
    @Jayro, I don't see whats so special about the DS ML, its just a DS lite in a phat shell. At least the phat model had louder speakers, whereas the lite has a much better screen.
    +1
  • SylverReZ @ SylverReZ:
    They probably said "Hey, why not we combine the two together and make a 'new' DS to sell".
  • Veho @ Veho:
    It's a DS Lite in a slightly bigger DS Lite shell.
    +1
  • Veho @ Veho:
    It's not a Nintendo / iQue official product, it's a 3rd party custom.
    +1
  • Veho @ Veho:
    Nothing special about it other than it's more comfortable than the Lite
    for people with beefy hands.
    +1
  • Jayro @ Jayro:
    I have yaoi anime hands, very lorge but slender.
  • Jayro @ Jayro:
    I'm Slenderman.
  • Veho @ Veho:
    I have hands.
  • BakerMan @ BakerMan:
    imagine not having hands, cringe
    +1
  • AncientBoi @ AncientBoi:
    ESPECIALLY for things I do to myself :sad:.. :tpi::rofl2: Or others :shy::blush::evil:
    +1
  • The Real Jdbye @ The Real Jdbye:
    @SylverReZ if you could find a v5 DS ML you would have the best of both worlds since the v5 units had the same backlight brightness levels as the DS Lite unlockable with flashme
  • The Real Jdbye @ The Real Jdbye:
    but that's a long shot
  • The Real Jdbye @ The Real Jdbye:
    i think only the red mario kart edition phat was v5
  • BigOnYa @ BigOnYa:
    A woman with no arms and no legs was sitting on a beach. A man comes along and the woman says, "I've never been hugged before." So the man feels bad and hugs her. She says "Well i've also never been kissed before." So he gives her a kiss on the cheek. She says "Well I've also never been fucked before." So the man picks her up, and throws her in the ocean and says "Now you're fucked."
    +2
  • BakerMan @ BakerMan:
    lmao
  • BakerMan @ BakerMan:
    anyways, we need to re-normalize physical media

    if i didn't want my games to be permanent, then i'd rent them
    +1
  • BigOnYa @ BigOnYa:
    Agreed, that why I try to buy all my games on disc, Xbox anyways. Switch games (which I pirate tbh) don't matter much, I stay offline 24/7 anyways.
  • AncientBoi @ AncientBoi:
    I don't pirate them, I Use Them :mellow:. Like I do @BigOnYa 's couch :tpi::evil::rofl2:
    +1
  • cearp @ cearp:
    @BakerMan - you can still "own" digital media, arguably easier and better than physical since you can make copies and backups, as much as you like.

    The issue is DRM
  • cearp @ cearp:
    You can buy drm free games / music / ebooks, and if you keep backups of your data (like documents and family photos etc), then you shouldn't lose the game. but with a disk, your toddler could put it in the toaster and there goes your $60

    :rofl2:
  • cearp @ cearp:
    still, I agree physical media is nice to have. just pointing out the issue is drm
  • rqkaiju2 @ rqkaiju2:
    i like physical media because it actually feels like you own it. thats why i plan on burning music to cds
  • cearp @ cearp:
    It's nice to not have to have a lot of physical things though, saves space
    cearp @ cearp: It's nice to not have to have a lot of physical things though, saves space