logo elektroda
logo elektroda
X
logo elektroda

Ripping firmware from the ESP32-WROOM-32D IoT module: tools and methods

gigiraffa 3801 15
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19257500
    gigiraffa
    Level 4  
    Welcome,

    I'm new to the subject so I'm very much asking for your understanding and help.

    I need to rip firmware from an IoT device that uses the ESP32-WROOM-32D module. I am very much asking for advice on how to bite this. I've taken the device apart and verified that I can plug into the pinouts: (2) 3V3, (34) RXD0, (35) TXD0, (3) EN, (25) IO0, (38) GND.

    What is the best tool to use? Will a simple UART converter do the job?

    Warm regards
  • ADVERTISEMENT
  • Helpful post
    #2 19257510
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #3 19257628
    gigiraffa
    Level 4  
    Ok, thank you.

    Is there anything I should watch out for when linking?

    What baud rates does this module operate on? Or how can this be easily calculated?

    Best regards
  • Helpful post
    #4 19257659
    Anonymous
    Level 1  
  • #5 19258377
    gigiraffa
    Level 4  
    Extra, thanks!

    One more question - could you please advise how to find which addressing to use in the read_flash command to read the firmware? Would it be read_flash 0 0x400000 for 4MB flash or should I limit the range somehow? Additionally, how do I check the COM port?

    Best regards
  • Helpful post
    #6 19258465
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #7 19259964
    gigiraffa
    Level 4  
    Thank you!!!

    And one more question regarding the earlier connection diagram. What if I would like to have the power source from the wall and not from the UART dongle? Do I still need to connect the EN somewhere?

    Additionally, I came across a tutorial that talks about pressing a button on the dev board to enter programming mode. Do I need to override this somehow without having a programming board? Is connecting IO0 enough to boot into programming mode?

    Thank you very much for your help and understanding!
  • #8 19260159
    Anonymous
    Level 1  
  • #9 19260851
    gigiraffa
    Level 4  
    Super! Thank you again!

    One last (I hope) question: I connected to the device and found out from the esptool flash_id that the flash is 16MB. I used esptool first as a test to read the first 2MB from read_flash and everything worked nicely. Now I have tried to read the whole 16MG but it crashes at 72% and goes no further. Could this be because the range that can be read is smaller than 16MB? What is the best way to check the correct addressing to read_flash?
  • #10 19261208
    Anonymous
    Level 1  
  • #11 19261716
    gigiraffa
    Level 4  
    With speed do you mean baud rate? I set 115200 - checking the port screen this baud rate gave me reasonable output, others I tried gave garbage. Is this a reasonable baud rate for read_flash? Maybe use some other one better?

    Additionally, as I mentioned - it crashed at 72%, and 72% of 1600000 is 1152000 which is a total of ten times the baud rate set. Is this somehow related to each other?

    As for the device - it's a hub that connects other iot devices so maybe that's why the larger (custom) flash?
  • #12 19261974
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #13 19262752
    gigiraffa
    Level 4  
    sudo esptool -p /dev/ttyUSB0 -b 115200 read_flash 0 0x1600000 flash.bin - did I mess something up here?

    I am now trying to read in chunks. What is the best way to then combine them for analysis in Ghidra?

    Warm regards
  • #14 19262758
    Anonymous
    Level 1  
  • #15 19262840
    gigiraffa
    Level 4  
    yes yes, I just grasped that too! but I think it was 6 zeros and not 5 as you stated?

    Added after 55 [seconds]: .

    Speaking of merging, a simple merge will be ok?
  • #16 19262861
    Anonymous
    Level 1  

Topic summary

The discussion revolves around extracting firmware from an IoT device utilizing the ESP32-WROOM-32D module. The primary tool recommended for this task is the esptool, which can be installed on various operating systems. Users are advised to connect the GPIO 0 to ground during boot to enter programming mode and ensure the EN pin is connected to a 3.3V power supply. The baud rate for communication can be set to 512 kbps or 115200, depending on the USB converter used. When reading firmware, it is suggested to read in chunks, especially for devices with larger flash memory, and to use the correct addressing format in the read_flash command. Issues with reading the entire flash memory at once can be mitigated by specifying the flash size and reading in smaller segments. Additionally, care must be taken to maintain a common ground between the device and the UART converter.
Summary generated by the language model.
ADVERTISEMENT