nccgroup / depthcharge

A U-Boot hacking toolkit for security researchers and tinkerers
https://depthcharge.readthedocs.io
BSD 3-Clause "New" or "Revised" License
258 stars 14 forks source link

Add `global data` inspection payload helper #6

Open jynik opened 4 years ago

jynik commented 4 years ago

Currently, the host-side Python code drives global data structure inspection, provided a means to read the gd pointer (e.g. bdinfo, RegisterReader) and a MemoryReader implementation to read the gd structure and potential jump table.

Currently, the memory and register reader payloads must have the jump table address passed to them. This is fine for built-in payloads, given that it gives us more visibility into failures.

However, it's definitely desirable to allow payloads to be made more self-sufficient. The same general approach should be implemented as a payload helper that can be included in any new payloads. (I'm thinking a static inline function in payloads/include/u-boot.h)