nccgroup / depthcharge

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

memory: More lenient hex dump output matching #92

Closed jynik closed 2 years ago

jynik commented 2 years ago

The following was observed on a device running (a fork of) U-Boot 2012.10 when a small (word-wise) memory read was performed when validating an applied MemoryPatch:

depthcharge.operation.OperationFailed:
    Failed to parse line: bff64d92: f7ff ffd5    ....

This failure arises from our regular expression expecting 16 characters in the ASCII section of the hex dump output, which clearly is not the case here. (It seems newer versions pad up to a fixed line length.)

We now look for 1 to 16 characters. I don't recall U-Boot ever outputting an address followed by an empty line, hence not {0, 16}.

Fixes #91