m4b / goblin

An impish, cross-platform binary parsing crate, written in Rust
MIT License
1.17k stars 156 forks source link

fix: Iterate all ImageDebugDirectory entries #319

Open Swatinem opened 2 years ago

Swatinem commented 2 years ago

Turns out, a PE file can have more than one ImageDebugDirectory. Thus far, goblin only looks at the very first one, trying to interpret it as a CV record.

This code changes that logic to rather iterate over all the entries to find the one that is a CV record. We still only capture a single entry in the DebugData for backwards compatibility reasons. In the future we could as well capture all of them.

Swatinem commented 2 years ago

fun fact: I wrote a detailed blog post about how I made this discovery: https://swatinem.de/blog/format-ossification/

m4b commented 2 years ago

looks like a CI failure?