AJMitev / FileTypeChecker

Cross platform file type validator for .NET
MIT License
139 stars 27 forks source link

stream of dll reported as exe #29

Closed ilmenwe closed 1 year ago

ilmenwe commented 1 year ago

Describe the bug A filestream of a dll is identified as DOS MZ executable .exe

To Reproduce Steps to reproduce the behavior: Use a local windows dll like one provided by dot.net 7 like System.Windows.Extensions.dll Run it trough var fileType = FileTypeValidator.GetFileType(stream); Examine the fileType.

Expected behavior reported as a dll / dynamic linked library.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Additional context It's not really important, I mean I will not allow executables either, but it would be nice to know if it's a exe or dll if possible.

AJMitev commented 1 year ago

This is not an issue. If you check that article you will see that the exec files and the dynamic linked libraries have the same signatures.

ilmenwe commented 1 year ago

Fair point did take a look around now. It's not part of the MZ magic bytes, but would be stored in a PE optional header. So I will just add a local solution that gives me extra details I need.