Given a specification of bitfields defined e.g. as follows:
specfile:
{
"field1" : 8,
"field2" : 4,
"field3" : 4
}
and a set of values for setting defaults:
setterfile:
{
"field1" = 0xff,
"field2" = 0xf,
"field3" = 0xf
}
You can generate a binary packed blob as follows:
./blobtool specfile setterfile binaryoutput
binaryoutput: ff ff
The reverse is also possible, i.e. you can regenerate the setter:
./blobtool -d specfile binaryoutput setterorig
setterorig:
# AUTOGENERATED SETTER BY BLOBTOOL
{
"field1" = 0xff,
"field2" = 0xf,
"field3" = 0xf
}
This tool comes with spec/set files for X200 flash descriptor
and ICH9M GbE region, and can be extended or used to decompile
other data blobs with known specs.
Change-Id: I744d6b421003feb4fc460133603af7e6bd80b1d6
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/17445
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Martin Roth <martinroth@google.com>
|
||
|---|---|---|
| .. | ||
| abuild | ||
| acpi | ||
| amdfwtool | ||
| amdtools | ||
| archive | ||
| arm_boot_tools/mksunxiboot | ||
| autoport | ||
| bimgtool | ||
| blobtool | ||
| board_status | ||
| broadcom | ||
| cbfstool | ||
| cbmem | ||
| checklist | ||
| chromeos | ||
| crossgcc | ||
| docker | ||
| dtd_parser | ||
| ectool | ||
| exynos | ||
| futility | ||
| fuzz-tests | ||
| genbuild_h | ||
| genprof | ||
| gitconfig | ||
| ifdfake | ||
| ifdtool | ||
| intelmetool | ||
| inteltool | ||
| intelvbttool | ||
| ipqheader | ||
| k8resdump | ||
| kconfig | ||
| lint | ||
| marvell | ||
| me_cleaner | ||
| mma | ||
| msrtool | ||
| mtkheader | ||
| nvidia | ||
| nvramtool | ||
| optionlist | ||
| post | ||
| release | ||
| riscvtools | ||
| rockchip | ||
| romcc | ||
| sconfig | ||
| scripts | ||
| showdevicetree | ||
| spkmodem_recv | ||
| superiotool | ||
| uio_usbdebug | ||
| vgabios | ||
| viatool | ||
| xcompile | ||