1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*ae316d1dSXin LI# $File: magic,v 1.12 2024/06/10 23:09:52 christos Exp $ 4b6cee71dSXin LI# magic: file(1) magic for magic files 5b6cee71dSXin LI# 6898496eeSXin LI# Update: Joerg Jenderek 7898496eeSXin LI# skip Magicsee_R1.cfg found on retropie starting with # Magicsee R1 one-handed controller 8898496eeSXin LI0 string/t #\ Magic\ magic text file for file(1) cmd 9898496eeSXin LI#!:mime text/plain 10898496eeSXin LI!:mime text/x-file 11898496eeSXin LI# no suffix in ../Header 12898496eeSXin LI!:ext / 13898496eeSXin LI# 14*ae316d1dSXin LI# some (34/339) samples start with a comment line 15898496eeSXin LI0 ubyte =0x23 16*ae316d1dSXin LI# some (28/339) samples start with separator line (about 78 minus characters) like: 17*ae316d1dSXin LI# archive arm assembler beetle c-lang clojure compress der filesystems firmware gentoo lammps 18*ae316d1dSXin LI# m4 mail.news make marc21 music parrot pascal pc88 pc98 perl ringdove tcl varied.script webassembly x68000 zfs 19898496eeSXin LI>4 string -------- 20*ae316d1dSXin LI# skip scripts fse.sed stage1.sed constants.pxi gotmail.awk from fetchmail package by 21*ae316d1dSXin LI# searching for reference to man page file(1) {lammps v 1.1} or file (1) {muscic v 1.1} 22*ae316d1dSXin LI>>12 search/180 (1) 23*ae316d1dSXin LI>>>0 use magic-fragment 24*ae316d1dSXin LI# few (6/339) samples with 1st comment line and without separator comment line 25*ae316d1dSXin LI# like: blcr bsi selinux sisu ssh svf 26898496eeSXin LI>4 default x 27898496eeSXin LI# few sample with 1st comment line and without seperator comment line and regular expression like: sisu 28898496eeSXin LI>>1 search/112 regex\x09 29898496eeSXin LI>>>0 use magic-fragment 30898496eeSXin LI>>1 default x 31898496eeSXin LI# few samples with 1st comment line and without seperator comment line and string value like: 32898496eeSXin LI# blcr bsi selinux ssh (file 3.34) digital gnu wordperfect 33898496eeSXin LI>>>1 search/471 string\x09 34898496eeSXin LI>>>>0 use magic-fragment 35898496eeSXin LI>>>1 default x 36898496eeSXin LI# few samples with 1st comment line and without seperator comment line and short value like: 37898496eeSXin LI# (file 3.34) os9 osf1 38898496eeSXin LI>>>>1 search/1716 short\x09 39898496eeSXin LI>>>>>0 use magic-fragment 40898496eeSXin LI# but many samples start with an empty first line 41898496eeSXin LI0 ubyte =0x0A 42*ae316d1dSXin LI# many samples start with separator comment line 43898496eeSXin LI>4 string -------- 44*ae316d1dSXin LI# skip some MS-DOS C source text {EMSINIT.INC MEM.C RESTPARS.C RTDO.C RTDO1.C RTFILE.C RTFILE1.C RTNEW.C RTNEW1.C RTOLD.C RTOLD1.C RTT1.C RTT3.C} 45*ae316d1dSXin LI# and match many fragments by looking for Revision Control System keyword near the beginning 46*ae316d1dSXin LI>>1 search/128 $File 47*ae316d1dSXin LI>>>0 use magic-fragment 48*ae316d1dSXin LI# few samples {ctf (2022-03-26) msx (2021-06-30) nasa (2021-02-23) symbos (2021-02-23) weak (2021-02-23)} 49*ae316d1dSXin LI# with 1st empty line, separator comment line and without Revision Control System keyword but with reference to man page file(1) 50*ae316d1dSXin LI>>1 default x 51*ae316d1dSXin LI>>>1 search/180 file(1) 52*ae316d1dSXin LI>>>>0 use magic-fragment 53*ae316d1dSXin LI>>>1 default x 54*ae316d1dSXin LI# sample aria (2021-12-24) with 1st empty line, separator comment line and without Revision Control System keyword and without reference to man page file(1) 55*ae316d1dSXin LI>>>>1 search/1024 \041:mime 56*ae316d1dSXin LI>>>>>0 use magic-fragment 57*ae316d1dSXin LI# few samples with 1st empty line and without separator comment line like: biosig (2021-02-23) espressif (v 1.3) 58898496eeSXin LI>4 default x 59898496eeSXin LI>>1 search/581 \041:mime 60898496eeSXin LI>>>0 use magic-fragment 61898496eeSXin LI# display information (lines) about magic text fragment 62898496eeSXin LI0 name magic-fragment 63898496eeSXin LI>0 string x magic text fragment for file(1) cmd 64898496eeSXin LI!:mime text/x-file 65898496eeSXin LI# most without suffix but mail.news varied.out varied.script 66898496eeSXin LI!:ext /news/out/script 67898496eeSXin LI# next lines are mainly for control reasons 68*ae316d1dSXin LI# some (34/339) samples start with comment line 69898496eeSXin LI>0 ubyte !0x0A 70898496eeSXin LI>>0 string x \b, 1st line "%s" 71898496eeSXin LI>>>&1 string x \b, 2nd line "%s" 72*ae316d1dSXin LI# show more information to see difference between fragments and misidentfied scripts 73*ae316d1dSXin LI>>>>&1 string x \b, 3rd line "%s" 74*ae316d1dSXin LI>>>>>&1 string x \b, 4th line "%s" 75*ae316d1dSXin LI>>>>>>&1 string x \b, 5th line "%s" 76898496eeSXin LI# but most (305/339) samples start with an empty first line 77898496eeSXin LI>0 ubyte =0x0A 78898496eeSXin LI>>1 string x \b, 2nd line "%s" 79898496eeSXin LI>>>&1 string x \b, 3rd line "%s" 80*ae316d1dSXin LI# show more information to see difference between fragments and misidentfied scripts 81*ae316d1dSXin LI>>>>&1 string x \b, 4th line "%s" 82*ae316d1dSXin LI>>>>>&1 string x \b, 5th line "%s" 83898496eeSXin LI# 84898496eeSXin LI# URL: http://en.wikipedia.org/wiki/File_(command) 85898496eeSXin LI# Reference: http://mark0.net/download/triddefs_xml.7z/defs/m/mgc.trid.xml 86898496eeSXin LI# Note: called "magic compiled data (LE)" by TrID 87b6cee71dSXin LI0 lelong 0xF11E041C magic binary file for file(1) cmd 88898496eeSXin LI#!:mime application/octet-stream 89898496eeSXin LI!:mime application/x-file 90898496eeSXin LI!:ext mgc 91b6cee71dSXin LI>4 lelong x (version %d) (little endian) 92*ae316d1dSXin LI# Reference: http://mark0.net/download/triddefs_xml.7z/defs/m/mgc-be.trid.xml 93*ae316d1dSXin LI# Note: called "magic compiled data (BE)" by TrID 94b6cee71dSXin LI0 belong 0xF11E041C magic binary file for file(1) cmd 95898496eeSXin LI#!:mime application/octet-stream 96898496eeSXin LI!:mime application/x-file 97898496eeSXin LI!:ext mgc 98b6cee71dSXin LI>4 belong x (version %d) (big endian) 99