PeNet
PeNet copied to clipboard
AddImport(s) doesn't handle the case where IAT doesn't already exist
Steps to reproduce:
- Create a PE file without any imports
- Try using PeNet to add an import
- Exception
Is there any plans to create the ability to parse .NET headers to extract information such as Directory Com Descriptor?
If your PE doesn't already have imports, you'll need manually set the Import Directory RVA to something valid, and keep the size 0.
PeFile.ImageNtHeaders.OptionalHeader.DataDirectory[(int)DataDirectoryType.Import].VirtualAddress = [Valid RVA]