magic 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #------------------------------------------------------------------------------
  2. # $File: magic,v 1.11 2023/06/27 13:42:49 christos Exp $
  3. # magic: file(1) magic for magic files
  4. #
  5. # Update: Joerg Jenderek
  6. # skip Magicsee_R1.cfg found on retropie starting with # Magicsee R1 one-handed controller
  7. 0 string/t #\ Magic\ magic text file for file(1) cmd
  8. #!:mime text/plain
  9. !:mime text/x-file
  10. # no suffix in ../Header
  11. !:ext /
  12. #
  13. # some samples start with a comment line
  14. 0 ubyte =0x23
  15. # many samples start with separator line
  16. >4 string --------
  17. >>0 use magic-fragment
  18. # few samples with 1st comment line and without seperator comment line
  19. >4 default x
  20. # few sample with 1st comment line and without seperator comment line and regular expression like: sisu
  21. >>1 search/112 regex\x09
  22. >>>0 use magic-fragment
  23. >>1 default x
  24. # few samples with 1st comment line and without seperator comment line and string value like:
  25. # blcr bsi selinux ssh (file 3.34) digital gnu wordperfect
  26. >>>1 search/471 string\x09
  27. >>>>0 use magic-fragment
  28. >>>1 default x
  29. # few samples with 1st comment line and without seperator comment line and short value like:
  30. # (file 3.34) os9 osf1
  31. >>>>1 search/1716 short\x09
  32. >>>>>0 use magic-fragment
  33. # but many samples start with an empty first line
  34. 0 ubyte =0x0A
  35. # many samples sttart with separator comment line
  36. >4 string --------
  37. >>0 use magic-fragment
  38. # few samples with 1st empty line and without seperator comment line like: biosig espressif
  39. >4 default x
  40. >>1 search/581 \041:mime
  41. >>>0 use magic-fragment
  42. # display information (lines) about magic text fragment
  43. 0 name magic-fragment
  44. >0 string x magic text fragment for file(1) cmd
  45. !:mime text/x-file
  46. # most without suffix but mail.news varied.out varied.script
  47. !:ext /news/out/script
  48. # next lines are mainly for control reasons
  49. # some (34/339) samples start comment line
  50. >0 ubyte !0x0A
  51. >>0 string x \b, 1st line "%s"
  52. >>>&1 string x \b, 2nd line "%s"
  53. # but most (305/339) samples start with an empty first line
  54. >0 ubyte =0x0A
  55. >>1 string x \b, 2nd line "%s"
  56. >>>&1 string x \b, 3rd line "%s"
  57. #
  58. # URL: http://en.wikipedia.org/wiki/File_(command)
  59. # Reference: http://mark0.net/download/triddefs_xml.7z/defs/m/mgc.trid.xml
  60. # Note: called "magic compiled data (LE)" by TrID
  61. 0 lelong 0xF11E041C magic binary file for file(1) cmd
  62. #!:mime application/octet-stream
  63. !:mime application/x-file
  64. !:ext mgc
  65. >4 lelong x (version %d) (little endian)
  66. 0 belong 0xF11E041C magic binary file for file(1) cmd
  67. #!:mime application/octet-stream
  68. !:mime application/x-file
  69. !:ext mgc
  70. >4 belong x (version %d) (big endian)