simplemagic icon indicating copy to clipboard operation
simplemagic copied to clipboard

Excel and Powerpoint 97-2003 files return null mime type

Open zAlbee opened this issue 11 years ago • 3 comments

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.

zAlbee avatar Jan 16 '14 15:01 zAlbee

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.

j256 avatar Jan 16 '14 15:01 j256

Is this still not fixed? Cannot determine the mime type of xls and ppt

joistick11 avatar Aug 08 '18 16:08 joistick11

Feel free to donate the code @joistick11 .

j256 avatar Aug 08 '18 17:08 j256