Load minidumps whose writer left out a stream - #725
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
The tests get a dump with a missing stream by reading a real one and marking that stream's directory entry Origin of the change: a corpus sweep loaded 5,250 minidumps through Caveats:
|
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_725 |
A minidump's stream directory lists only the streams its writer chose to emit; the header and the directory are the only mandatory parts of the file. The backend read four of them and handled a missing one three different ways: the memory list was required, the module and thread lists were dereferenced unguarded and produced an AttributeError from the middle of a loop, and only the system information stream raised a considered error. A dump with no memory list now loads with no memory, and one with no module or thread list loads with no sections or with no threads. The module list is read on the architecture path as well, where a 64-bit dump without one failed before any of that. MinidumpMissingStreamError, which the missing system information stream still raises when no architecture was passed either, now derives from CLEError and hands its explanation to the base class. It was invisible to except CLEError, and str() on it was empty because the explanation only ever reached an attribute. A module whose image the dump did not capture is still rejected twenty lines further down; #715 covers that half.
376d41f to
9f41442
Compare
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
A minidump's directory lists only the streams its writer emitted. The backend reads
four of them and could not cope when one was absent: a dump with no memory list was
rejected outright, and one with no module or thread list raised an AttributeError
from inside a loop.
Those lists now read as empty when the stream is absent, so such a dump loads with
no memory, no sections or no threads. MinidumpMissingStreamError, which a missing
SystemInfoStream still raises, derives from CLEError and passes its explanation to
the base class rather than stashing it on an attribute that str() never reached.
The regression tests take a real dump and strike a stream out of its directory. One
of the two dumps they use is a 64-bit Windows minidump added by angr/binaries#176,
so the checks here stay red until that merges. A module whose image the dump did not
capture is still rejected a few lines below; #715 reworks the same function for that,
so whichever of the two lands second needs a rebase.
Validation: #725 (comment)