linux-sunxi / sunxi-tools

A collection of command line tools for ARM devices with Allwinner SoCs.
http://linux-sunxi.org/
GNU General Public License v2.0
579 stars 421 forks source link

sunxi-fexc does not work on Allwinner D1 binaries #169

Closed sichel94 closed 2 years ago

sichel94 commented 2 years ago

Trying to decompile the binaries supplied by sipeed at: https://dl.sipeed.com/shareURL/LICHEE/D1/Lichee_RV/SDK/board, results in the following output: $ bin2fex a.bin a.fex E: fexc-bin: Malformed data: version 1734437731.101.

apritzel commented 2 years ago

This is because those files there are not real FEX files (as in: compiled key/value pairs to describe hardware and configuration, supported by fex2bin/bin2fex), but are actually multi-binary packages. If you look into the files with a hex editor, you will see "sunxi-package" in the beginning, then "opensbi", "u-boot" and "dtb". Think of them as glorified tarballs, with load addresses. They just (ab)used the file extension .fex for them. So conceptually bin2fex will never support this, so closing this issue.