# fileid **Repository Path**: Shaksper/fileid ## Basic Information - **Project Name**: fileid - **Description**: 数据常用格式头 - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-05 - **Last Updated**: 2021-11-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FileId Generic file identifier (for linux and windows) Like the linux utility "file", this tool will take an arbirtrary file blob and attempt to identify the file type/extension based on magic numbers. In addition it will attempt to pull as much pertinant details as it knows from the file about its format. It will identify specific formats in container formats. For example it will identify Microsoft Office file types specifically for OLE Structured Storage files (doc, xls, ppt, pub, vsd, etc), and ZIP files (docx, docm, xlsx, xlsm, pptx, pptm, jar, war, xpi, xap, apk, etc) ## Binaries Binaries availabe at the build server: [![](https://github.com/DBHeise/fileid/workflows/Continuous%20Integration/badge.svg)](https://github.com/dbheise/fileid/actions) Build scripts are included for both gcc/g++ (>=5.1) (via makefile) and Microsoft Visual Studio (>=2015) builds (via sln) ## Levels of Coverage There are three levels of coverage for a file format: 1. Identification - we are able to identify the file format from a binary blob, sometimes this is as simple as matching the magic number/bytes, but for many formats it is not as simple 2. Metadata - we are able to identify the file format and extract some or all of the associated meta data included in the format. For example, we can tell its an Microsoft Office Binary Document and tell you the specific version of DOC file. This level is further broken down to a rating of how much metadata can be extracted on a scale of 1 to 10 (1 being very basic metadata, 10 be all available meta data fully extracted) 3. Full Extraction - we are able to identify pretty much every byte in the file, what it does and why its there. ## File Format Coverage [File Format Coverage](./coverage.md) ## Usage ``` fileid {file} [format] {file} - required path the file in question [format] - optional output format (TEXT [default], CSV, JSON, XML) ``` ## Examples * Exe with JSON output ``` fileid c:\windows\notepad.exe json { "name": "C:\\Windows\\notepad.exe", "extensions": [ { "extension": "exe", "name": "Executable", "machinetype": "x64", "LinkerVersion": "12.10", "OsVersion": "10.0", "ImageVersion": "10.0", "Characteristics": [ "Executable Image","LARGE_ADDRESS_AWARE"]} ] } ``` * XLS with XML output ``` fileid C:\TestFiles\Sample\Good.macro.xls xml C:\TestFiles\Sample\Good.macro.xls .xls1536BIFF8 .vbaVisual Basic for ApplicationsVBAProject13634726012stdoleOfficeModule1Module1109200,ThisWorkbookThisWorkbook80500,Sheet1Sheet180500,Sheet2Sheet280500,Sheet3Sheet380500,000 ```