Hacking Hardware Picofly - a HWFLY switch modchip

marhalloweenvt

Well-Known Member
Member
Joined
Oct 2, 2014
Messages
235
Trophies
0
Age
29
XP
926
Country
the code is on C, I am not getting there yet.

If somebody likes, this is my code on Arduino:

C-like:
#include "pico/unique_id.h"
String cadena;


void setup() {
  // put your setup code here, to run once:

  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  // send an intro:
  Serial.println("\n\nPico Unique Board ID:");
  Serial.println();
}

void loop() {
  pico_unique_board_id_t board_id;
  pico_get_unique_board_id(&board_id);
  //pico_get_unique_board_id_string;
  cadena = "";
  for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) {
 //   Serial.write(board_id.id[i]);
    //Serial.write(13);
    //Serial.write(10);
    cadena += board_id.id[i];
  }
  Serial.println(cadena);
  delay(5000);
}

I am using Raspberry Pi Pico/RP2040 https://github.com/earlephilhower/arduino-pico board library on the Arduino IDE, that have the unique_id.h file.
If you use micropython, you can simple run this in Shell (I am using Thorny to communicate with Pico):
Code:
>>> import ubinascii
>>> import machine
>>> ubinascii.hexlify(machine.unique_id())
 
Last edited by marhalloweenvt,

vittorio

Well-Known Member
Member
Joined
May 12, 2014
Messages
243
Trophies
1
Age
26
XP
995
Country
Italy
if you can find the payload let's try to decrypt it, theoretically a software hack on the switch is also possible since a webkit exploit has come out, only a kernel exploit is missing
 

ByteFun

Member
Newcomer
Joined
May 6, 2021
Messages
17
Trophies
0
Age
34
XP
85
Country
Russia
Or decrypt existed and remove decryptor from 1st stage.
This is the goal. I mean, you can't just patch one place by changing the ID. But, is it possible to make the get ID function return the same set of bytes? Sounds like a dirty patch, but can work as a temporary security bypass solution ))
Post automatically merged:

The encrypted firmware is located at 1000297C, the decryption magic happens at about 10013622. But I still can't start debugging and the context is missing. SWD disabled, OpenOCD saying "DAP init failed"
 
Last edited by ByteFun,

ByteFun

Member
Newcomer
Joined
May 6, 2021
Messages
17
Trophies
0
Age
34
XP
85
Country
Russia
Well. I successfully connected the debugger. The container is not checked for integrity, but any modification of the firmware will reset the chip into firmware download mode. Perhaps there are some checks during the execution of the firmware. But after doing something, I was able to start debugging and breakpoints also work. Gradually learning microcontrollers))
 

Mansi

Well-Known Member
Newcomer
Joined
Jan 14, 2023
Messages
70
Trophies
0
Age
30
XP
331
Country
Belarus
Well. I successfully connected the debugger. The container is not checked for integrity, but any modification of the firmware will reset the chip into firmware download mode. Perhaps there are some checks during the execution of the firmware. But after doing something, I was able to start debugging and breakpoints also work. Gradually learning microcontrollers))
Сan you write to me on 4pda?
 

Vladjaye

Well-Known Member
Newcomer
Joined
Jan 11, 2021
Messages
48
Trophies
0
Age
28
XP
379
Country
United States
The amount of new users who just register to dip in on this exact topic is, at least, a little suspicious.
Because the forum is quite popular and the specific topic might be discussed in different languages elsewhere. They join this place to ask\provide some feedback on their findings, no?
 

Adran_Marit

Walküre's Hacker
Member
Joined
Oct 3, 2015
Messages
3,781
Trophies
1
Location
42*South
XP
4,566
Country
Australia

PicoPro

Member
Newcomer
Joined
Jan 19, 2023
Messages
6
Trophies
0
Age
35
XP
48
Country
Poland
So is it like actively under development in China with closed source code?
The only thing i can say, it works fine with Mariko (with few exceptions).

I can't say who is bEhind the development, but Right now I wonder is thiS the only Thing they cAn do... ;)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://a.co/d/3aCbNk8 lol smart keyboard