m4b / goblin

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

PE: handle empty import address table #371

Open williballenthin opened 1 year ago

williballenthin commented 1 year ago

This PE file has a valid import lookup table but the pointer to the import address table is 0x0:

image

goblin currently supports handling empty import lookup tables but not empty import address tables: https://github.com/m4b/goblin/blob/9f7fb6b1d68bd28d154c9d6587c1f132ce04cf54/src/pe/import.rs#L189-L191

Could we extend goblin to handle the above case (parse synthentic entries from the import lookup table when the import address table is 0x0)?

m4b commented 1 year ago

If you understand the issue and might be willing to fix, a PR would be appreciated :)