Hacking Hardware Picofly - a HWFLY switch modchip

Mansi

Well-Known Member
Newcomer
Joined
Jan 14, 2023
Messages
70
Trophies
0
Age
30
XP
331
Country
Belarus
I said that the firmware was provided to me by Heinrich_frei and I have already published it here. I wrote to him about it, whether he succeeds or not, I don't know.
 

TheSynthax

Well-Known Member
Member
Joined
Apr 29, 2018
Messages
220
Trophies
0
XP
509
Country
United States
I said that the firmware was provided to me by Heinrich_frei and I have already published it here. I wrote to him about it, whether he succeeds or not, I don't know.
Ah, I see. Well, let's hope! It would make reimplementation a bit easier to be able to decompile it. If not, it'd be easiest to reference Spacecraft-NX and Starlink-FI to create a glitch firmware.
 

FruithatMods

Well-Known Member
Member
Joined
Dec 16, 2018
Messages
128
Trophies
0
Age
34
XP
450
Country
Germany
I am halfway through watching the first ccc video where the speaker explains how the glitch is performed.

He got lucky glitching the emmc and subsequently dumping the bootrom as his timings were based on the reset signals which are not accurate enough to time the attack. He kept resetting the cpu to perform the badly timed glitch and eventually he glitched at a correct time.

He did mention that it is possible to time the glitch better by "sniffing the emmc". Perhaps he is referring to a timing glitch based on a combination of the emmc CLK, dat0 and reset timings?

He doesn't explain which emmc lines to use as an anchor as he goes into the rcm and paperclip bug.

I think it is worth hooking up the logic analyser again to record the training process and the initial bootloader write to the emmc. This will give us a better understanding of the timings.
 
Last edited by FruithatMods,
  • Like
Reactions: peteruk and Mansi

TheSynthax

Well-Known Member
Member
Joined
Apr 29, 2018
Messages
220
Trophies
0
XP
509
Country
United States
I am halfway through watching the first ccc video where the speaker explains how the glitch is performed.

He got lucky glitching the emmc and subsequently dumping the bootrom as his timings were based on the reset signal which are not accurate enough to time the attack. He kept resetting the chip to perform the badly timed glitch and eventually he glitched at a correct time.

He did mention that it is possible to time the glitch better by "sniffing the emmc". Perhaps he is referring to a timing based on a combination of the emmc CLK, reset and something else?

He doesn't explain this further as he goes into the rcm and paperclip bug.

I think it is worth hooking up the logic analyser again to record the training process and the initial bootloader write to the emmc. This will give us a better understanding of the timings.
My guess would be that it just watches the traffic to see when boot0 has been fully loaded from the eMMC, then starts a timer (the "trained" timing offset) where it attempts to cut voltage to the core right before the completed signature check returns as failed. I don't know how tight that timing is, it could be that it works for the period of time while the signature is being calculated, or it could be as narrow as a single cycle if the boot coprocessor is running at only a few hundred MHz.
 

FruithatMods

Well-Known Member
Member
Joined
Dec 16, 2018
Messages
128
Trophies
0
Age
34
XP
450
Country
Germany
Who was the person who ran the logic analyser?

There should be a difference in logic when the emmc bootloader is written for the first time, when the modchip is training and when the modchip is in normal operation.

This will give us a clear image about which anchors to use for the timings.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,155
Country
United States
OK, I’m all in.

Picked up a junker Switch Lite w/ a bad screen on flea bay. The screen is cracked and the joysticks are shot.

View attachment 349609

Going to put this one piece screen on it and a pair of those garbage Gulikit Hall Effect sticks on it and call it good.
https://www.aliexpress.us/item/3256804496995627.html

Grabbing a HWFLY lite kit…just in case this all turns out to be much ado about nothing.

View attachment 349618

At worst I can resell it on flea bay as a fully modded switch lite for $200 and get my money back.

Let’s go!

I’ve moved from wishful thinking to reality.

image.jpg

The screen is definitely in need of replacement.

It’s OK, the new one will be here in (/me checks AliExpress)

279D306B-051E-4B29-9A64-2AE012CC934F.jpeg


1675108730009.jpeg

It’s OK, guys. We just have a little more time is all. :-)
 

Piorjade

Well-Known Member
Member
Joined
Nov 8, 2015
Messages
142
Trophies
0
XP
407
Country
Gambia, The
I am halfway through watching the first ccc video where the speaker explains how the glitch is performed.

He got lucky glitching the emmc and subsequently dumping the bootrom as his timings were based on the reset signals which are not accurate enough to time the attack. He kept resetting the cpu to perform the badly timed glitch and eventually he glitched at a correct time.

He did mention that it is possible to time the glitch better by "sniffing the emmc". Perhaps he is referring to a timing glitch based on a combination of the emmc CLK, dat0 and reset timings?

He doesn't explain which emmc lines to use as an anchor as he goes into the rcm and paperclip bug.

I think it is worth hooking up the logic analyser again to record the training process and the initial bootloader write to the emmc. This will give us a better understanding of the timings.
"sniffing the emmc" is kinda it



I haven't watched this video in a while, but I think he explains it pretty well

Gotta watch all these videos again
 

ByteFun

Member
Newcomer
Joined
May 6, 2021
Messages
17
Trophies
0
Age
34
XP
85
Country
Russia
Writing programs in C is not enough. You need to understand how to work with the controller and be able to write working code. Unfortunately, I'm not that good at this. In addition, you will have to debug it, A LOT OF DEBUGING, and not only software, but also hardware
 

FruithatMods

Well-Known Member
Member
Joined
Dec 16, 2018
Messages
128
Trophies
0
Age
34
XP
450
Country
Germany
I don't know how tight that timing is, it could be that it works for the period of time while the signature is being calculated, or it could be as narrow as a single cycle if the boot coprocessor is running at only a few hundred MHz.
The width of the glitch line on the previously posted image is how tight the timing is. I think that is a good starting point as it is a known working variable.
 
  • Like
Reactions: TheSynthax

Mansi

Well-Known Member
Newcomer
Joined
Jan 14, 2023
Messages
70
Trophies
0
Age
30
XP
331
Country
Belarus
I am halfway through watching the first ccc video where the speaker explains how the glitch is performed.

He got lucky glitching the emmc and subsequently dumping the bootrom as his timings were based on the reset signals which are not accurate enough to time the attack. He kept resetting the cpu to perform the badly timed glitch and eventually he glitched at a correct time.

He did mention that it is possible to time the glitch better by "sniffing the emmc". Perhaps he is referring to a timing glitch based on a combination of the emmc CLK, dat0 and reset timings?

He doesn't explain which emmc lines to use as an anchor as he goes into the rcm and paperclip bug.

I think it is worth hooking up the logic analyser again to record the training process and the initial bootloader write to the emmc. This will give us a better understanding of the timings.
~52mHz. Need use CMD, CLK, D0 pins.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,155
Country
United States
Who was the person who ran the logic analyser?

There should be a difference in logic when the emmc bootloader is written for the first time, when the modchip is training and when the modchip is in normal operation.

This will give us a clear image about which anchors to use for the timings.
If it would help, i have an LA and an HWFLY. If somebody can tell me which points to sniff I’d be happy to work on grabbing some better data.
Post automatically merged:

~52mHz. Need use CMD, CLK, D0 pins.
Oh…is that it? It looked like many more channels.
 
Last edited by binkinator,

FruithatMods

Well-Known Member
Member
Joined
Dec 16, 2018
Messages
128
Trophies
0
Age
34
XP
450
Country
Germany
You will need to probe the reset line, dat0, CLK, CMD and the glitch line at the very least.

What the previous person has done was to also probe the spi line between the Gd32 chip and the fpga but that doesn't appear to give a lot of clues and you would need to solder extra points to the modchip if you would like to do that.
 
  • Like
Reactions: binkinator

FruithatMods

Well-Known Member
Member
Joined
Dec 16, 2018
Messages
128
Trophies
0
Age
34
XP
450
Country
Germany
You would have to repeat this a few times.

1. You should probe it with the stock bootloader and the HWfly chip attached to it so you can record the whole training process.

2. You should probe a normal boot with glitch after the bootloader has been written.

3. For good measure reset the HWfly chip and probe it again.
 
  • Like
Reactions: peteruk and impeeza

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,155
Country
United States
You would have to repeat this a few times.

1. You should probe it with the stock bootloader and the HWfly chip attached to it so you can record the whole training process.

2. You should probe a normal boot with glitch after the bootloader has been written.

3. For good measure reset the HWfly chip and probe it again.
OK, I’ll give it a shot and see what I can see.
 

FruithatMods

Well-Known Member
Member
Joined
Dec 16, 2018
Messages
128
Trophies
0
Age
34
XP
450
Country
Germany
No, the original dev doesn't care. The dev that was working on the clone is the one who was bothered by the community.

where are all these bad boys on a HWFLY 4.2?

View attachment 350266

The OLED has them marked. V2 Switch they just say clip this to that and you’re good to go!
These are the labels used on a hwfly:
CLK is D
CMD is A
Dat0 is C
Reset is B

The glitch line is on the ribbon cable. I don't know if there is a testpad for the glitch line next to the ribbon connector on the HWfly. You could use a multimeter to find it.

The spi signals are signals on the pcb of the HWfly between the fpga and the Gd32 but I don't think you will need these necessarily.
Post automatically merged:

Don't forget to enhance!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: good night