This is a language agnostic way to identify file types by their magic numbers.
This supports every signature in https://en.wikipedia.org/wiki/List_of_file_signatures, with some changes & additions.
For usage, see the examples directory.
- file_sigs.csv is the source of truth for file signatures.
- dist/rows_map.json is a map of all the file signatures, except those in
offset_list.json
, it's primarily used for generatinglookup_map.json
. - dist/offset_list.json is a list of all the file signatures that need to be checked at a specific offset.
- dist/lookup_map.json is a lookup map of all the file signatures, except those in
offset_list.json
. It's used to quickly lookup a signature of unknown length.
Add new extensions by modifying file_sigs.csv, put it in this list, then run python3 convert.py
. Afterwards, submit a PR. All contributions are loved and welcome.
- svg
- pcap
- pcapng
- rpm
- sqlitedb
- bin
- wad
- PDB
- DBA
- TDA
- TDF$
- TDEF
- ico
- icns
- 3gp
- z
- lzh
- bac
- idx
- plist
- bz2
- gif
- tif
- cr2
- cin
- nui
- dpx
- exr
- bpg
- jpg
- jp2
- ilbm
- 8svx
- acbm
- anbm
- anim
- faxx
- ftxt
- smus
- cmus
- yuvn
- iff
- aiff
- lz
- cpio
- exe
- zip
- rar
- png
- com
- class
- txt
- ps
- eps
- chm
- hlp
- asf
- ogg
- psd
- wav
- avi
- mp3
- bmp
- iso
- cdi
- mgw
- nes
- d64
- g64
- d81
- t64
- crt
- fits
- flac
- mid
- doc
- dex
- vmdk
- crx
- fh8
- cwk
- toast
- dmg
- xar
- dat
- tar
- oar
- tox
- MLV
- 7z
- gz
- xz
- lz4
- cab
- ??_
- flif
- mkv
- stg
- djvu
- der
- csr
- key
- ppk
- pub
- dcm
- woff
- woff2
- xml
- wasm
- lep
- swf
- deb
- webp
- rtf
- ts
- m2p
- mpg
- mp4
- zlib
- lzfse
- orc
- avro
- rc
- p25
- pcv
- pbt
- ez2
- ez3
- luac
- alias
- Identifier
- eml
- tde
- kdb
- pgp
- zst
- rs
- sml
- srt
- vpk
- ace
- arj
- zoo
- pbm
- pgm
- ppm
- wmf
- xcf
- xpm
- aff
- Ex01
- e01
- qcow
- ani
- cda
- qcp
- dcr
- dir
- flv
- vdi
- vhd
- vhdx
- isz
- daa
- evt
- evtx
- sdb
- grp
- icm
- pst
- drc
- grib
- blend
- jxl
- ttf
- otf
- wim
- slob
- voc
- au
- hazelrules
- flp
- flm
- mny
- accdb
- mdb
- drw
- dss
- adx
- indd
- skf
- dtd
- wallet
- nri
- wks
- sib
- dsp
- amr
- sil
- hdr
- vbe
- cdb