vpelletier / python-dfu

Python implementation of USB DFU device class
GNU General Public License v2.0
25 stars 7 forks source link

How I can convert or decompile .dfu to .hex? #2

Open Drovosek01 opened 5 years ago

Drovosek01 commented 5 years ago

Hello. Please tell me how I can decompile the file .dfu to file .hex? I have system unit Dell Vostro 3267 which has a network module DW1707. Module DW1707 integrated Wi fi and bluetooth QCA9565. I installed hackintosh on this computer, but in this bluetooth module the firmware is loaded only by drivers, when Windows starts. In order for the firmware in the bluetooth module to load when you start macOS, you need to take the firmware in the format .hex. I downloaded the official drivers for my bluetooth module, but there are firmware files only in the format .dfu. Here is the link to the drivers: https://yadi.sk/d/cYGax0NEdoCF3w https://www.dell.com/support/home/us/en/19/drivers/driversdetails?driverid=g66t8&oscode=wt64a&productcode=vostro-3267-desktop&lwp=rt Please help me convert or decompile .dfu to .hex. Thanks.

vpelletier commented 5 years ago

Hello,

Are the DFU and desired firmwares really the same thing ? I would expect the DFU files to contain a persistent firmware, while the firmwares usually needed by network device drivers are volatile and loaded after each boot.

Anyway, assuming these are really the same, I've forgotten a lot about DFU format, but what I can see in the code (dfu.py) the DFU format is a file suffix which describes the intended device recipient for that image. If the file uses STM extensions to the format, it also describes multiple concatenated firmware slices and the offsets each should be written to on the device. So the general idea would be to check what version of the DFU format is used, strip the suffix and maybe trivially transcode the file (as I guess expected .hex file will contain ASCII hexadecimal chars instead of raw binary).

Josverl commented 1 year ago

install the IntelHex package (pip install intelhex),

bin2hex --offset=0x???? I do not know if or what offset address you need to use for your device