Closed CSBaum closed 4 years ago
Thank you for bringing this up! There was an issue that it should have been looking at the length of how many identifying bytes it found to assign confidence and that was not set properly.
Please try pip install puremagic>=1.10
and see if that fixes it for you!
Thanks again for bringing that up, can't believe it wasn't caught before!
Hi,
I just found PureMagic and am trying to use it to identify if a file my script receives is ELF or not. I am using a test ELF binary and instead of get back "ELF executable" as i would expect I am getting ".AppImage".
I did run
readelf
against the file and here is results:I also dug into the magic_data.json file and found out that those 2 file types share a lot of the same bytes:
After doing some more digging it looks like puremagic find both options but always returns the
AppImage
entry.These are the 2 results from the confidence function:
I admit that i can be totally blind and am not seeing where the logic decides which one to choose. I'd get it if it looked at the file extension and saw that there wasn't one and choose the ELF executable vs. the AppImage, but it looks like it is a toss up when the confidence level is the same...
Thanks in advance for any insight, suggestions, etc :)