simplemagic
simplemagic copied to clipboard
Excel and Powerpoint 97-2003 files return null mime type
I searched my magic file and found a few suspect entries for Excel, but found nothing for Powerpoint. Then I grep'd the source code of file-5.16 and found this in readcdf.c:
} app2mime[] = {
{ "Word", "msword", },
{ "Excel", "vnd.ms-excel", },
{ "Powerpoint", "vnd.ms-powerpoint", },
{ "Crystal Reports", "x-rpt", },
{ "Advanced Installer", "vnd.ms-msi", },
{ "InstallShield", "vnd.ms-msi", },
{ "Microsoft Patch Compiler", "vnd.ms-msi", },
{ "NAnt", "vnd.ms-msi", },
{ "Windows Installer", "vnd.ms-msi", },
{ NULL, NULL, },
},
Looks like in version 5.x of file, they use CDF to parse MS Office documents instead of magic numbers.
The major changes for 5.x are CDF file parsing, indirect magic, and overhaul in mime and ascii encoding handling.
src/cdf.c - parser for Microsoft Compound Document Files src/readcdf.c - CDF wrapper.
Thanks for this. I'm not sure I'm interested in writing a CDF specific wrapper unfortunately. I wonder if there are pieces of it that I can extract and turn into magic patterns.
Is this still not fixed? Cannot determine the mime type of xls and ppt
Feel free to donate the code @joistick11 .