m4b / goblin

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

pe.import: Add get_imports_rva to SynthethicImportDirectoryEntry #278

Open Maimonator opened 3 years ago

Maimonator commented 3 years ago

I've added an extra function called get_imports_rva To be honest I'm not sure about the correct interface so I'm leaving it like this and opening it to the discussion.

I've separated get_imports_rva according to the discussion in #171 , As saving this information was considered wasteful since it's easily calculated. The problem with this function is that it needs to know the bitness of the PE (whether it's 32bit or 64bit) to properly calculate the RVAs.

Also, I started working with rust a few days ago, so any tips or comments are more than welcome. Thanks!

Maimonator commented 3 years ago

@m4b Thanks for reviewing, I'll do the fixes and make sure the PR passes the tests.