This is an open source version of Boufallo Lab flash command
Go to file
2023-04-22 14:53:45 -07:00
chips pack files are generated by the flash loader 2023-04-22 14:06:40 -07:00
libs add options function to config object 2023-04-22 14:45:01 -07:00
utils/flash add flash configuration 2023-04-22 14:30:19 -07:00
.gitignore ignore pack files 2023-04-22 14:07:21 -07:00
BLFlashCommand.py fix miscompile in BLFlashCommand 2023-04-22 10:26:11 -07:00
config.py code starts up 2023-04-20 14:04:18 -07:00
LICENSE add Apache 2.0 license, matching the Bouffalo SDK 2023-04-20 16:30:53 -07:00
README.md add README 2023-04-22 14:53:45 -07:00
requirements.txt code starts up 2023-04-20 14:04:18 -07:00

Boufallo Lab Flash Command - Open Source Version

This repo contains the completed work of "open sourcing" the Boufallo Lab flash command. This utility is provided in binary form under Apache 2.0 License. It is a pyinstaller executable, so I have unpacked the binary, run it through several Python 3.7 decompilers, and made a few adjustments. Primary changes:

  • The libs/bflb_configobj.py file has been completely rewritten. It appears to have been a handwritten recursive descent parser for ini files that include the ability to have complex objects. In reality, the configuration that seems to exist for flashing is simple key/value pairs in sections, so 2k+ lines of code were removed and replaced with simple shims to the python standard library
  • Some additional logs were added to the output to let the user know what files were being used. This was necessary to debug the decompiler output and I thought they were useful

I have licensed this as Apache 2.0 to reflect the origin license. This is tested and working with BL616 MCU. The flashing host computer was running Linux. This is good for my needs and it should work for other MCUs/other flashing hosts. However, I do not intend to provide support for anything beyond my own needs. I am happy to take pull requests!

Decompilers used

  • decompyle3: This was the primary decompiler for the project
  • unpyc3: unpyc3 did a better job on 2 or 3 of the files (see logs)
  • pycdc: While not used on any files, it served as a useful comparison tool. A few miscompiles from decompyle3 were more obvious because both pycdc and unpyc3 disagreed with the decompyle3 output