misctools 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #-----------------------------------------------------------------------------
  2. # $File: misctools,v 1.21 2023/02/03 20:43:48 christos Exp $
  3. # misctools: file(1) magic for miscellaneous UNIX tools.
  4. #
  5. 0 search/1 %%!! X-Post-It-Note text
  6. # URL: http://fileformats.archiveteam.org/wiki/ICalendar
  7. # https://en.wikipedia.org/wiki/ICalendar
  8. # Update: Joerg Jenderek
  9. # Reference: https://www.rfc-editor.org/rfc/rfc5545
  10. # http://mark0.net/download/triddefs_xml.7z/defs/v/vcs.trid.xml
  11. # Note: called "iCalendar - vCalendar" by TrID
  12. 0 string/c BEGIN:vcalendar
  13. # skip DROID fmt-387-signature-id-572.vcs fmt-388-signature-id-573.ics
  14. # with invalid separator 0x0 or 0xAB instead of CarriageReturn (0x0D) or LineFeed (0x0A)
  15. >15 ubyte&0xF8 =0x08
  16. # look for VERSION keyword often on second line but sometimes later as in holidays_NRW_2014.ics
  17. >>0 search/188 VERSION
  18. # after VERSION keword :1.0 or often :2.0 but sometimes also ;VALUE=TEXT:2.0 like in Jewish religious Juish.ics
  19. # http://www.webcal.guru/de-DE/kalender_herunterladen?calendar_instance_id=217
  20. # \n\040:2.0 like in import-real-world-2004-11-19.ics found at
  21. # https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz
  22. # emacs-28.1/test/lisp/calendar/icalendar-resources/import-real-world-2004-11-19.ics
  23. #>>>&0 string x AFTER_VERSION=%.15s
  24. # Note: called "Internet Calendar and Scheduling format" by DROID via PUID fmt/388
  25. # skip optional verparam=;other-param like ;VALUE=TEXT and look for version 2.0 that implies iCalendar variant
  26. >>>&0 search/81 :2.0 iCalendar calendar
  27. # look for Free/Busy component
  28. >>>>15 search/278 :VFREEBUSY file, with Free/Busy component
  29. !:mime text/calendar
  30. !:apple ????iFBf
  31. # no real examples found but only example on Wikipedia page
  32. !:ext ifb
  33. # iCalendar calendar without Free/Busy component
  34. >>>>15 default x
  35. # look for ALARM component
  36. >>>>>15 search/154 :VALARM file, with ALARM component
  37. !:mime text/calendar
  38. !:apple ????iCal
  39. # found on macOS beneath /Users/$USER/Library/Calendars/ as EventAllDayAlarms.icsalarm or EventTimedAlarms.icsalarm
  40. # no isc examples found
  41. !:ext icsalarm/ics
  42. # iCalendar calendar without Free/Busy component and ALARM component
  43. >>>>>15 default x file
  44. !:mime text/calendar
  45. !:apple ????iCal
  46. # no examples found with .ical .icalender suffix
  47. !:ext ics
  48. # if no VERSION 2.0 is found then assume it is VERSION 1.0, that is older vCalendar
  49. # URL: http://fileformats.archiveteam.org/wiki/VCalendar
  50. # Note: called "VCalendar format" by DROID via fmt/387
  51. >>>&0 default x vCalendar calendar file
  52. # deprecated
  53. !:mime text/x-vcalendar
  54. !:ext vcs
  55. # GRR: without VERSION keyword violates specification but accepted by Thunderbird like
  56. # https://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.xz
  57. # emacs-28.1/test/lisp/calendar/icalendar-resources/import-with-timezone.ics
  58. >>0 default x vCalendar calendar file, without VERSION
  59. !:mime text/x-vcalendar
  60. #!:mime text/calendar
  61. # no vcs example found
  62. !:ext ics/vcs
  63. # GRR: According to newest specification CarriageReturn (0xD) and LineFeed (0xA) should be used as separator but others accepted by Thunderbird
  64. # like CRLF,LF in Sport Today.vcs created by calendar plugin of TV-Browser https://enwiki.tvbrowser.org/index.php/Calendar_Export
  65. # or LF like https://www.schulferien.org/media/ical/deutschland/ferien_nordrhein-westfalen_2023.ics?k=foo
  66. >>15 ubeshort !0x0D0A \b, without CRLF
  67. # updated by Joerg Jenderek at Apr 2015, May 2021
  68. # https://en.wikipedia.org/wiki/VCard
  69. # URL: http://fileformats.archiveteam.org/wiki/VCard
  70. # https://datatracker.ietf.org/doc/html/rfc6350
  71. # the value is case-insensitive
  72. 0 string/c begin:vcard
  73. # skip DROID fmt-395-signature-id-634.vcf
  74. >13 string !VERSION:END vCard visiting card
  75. # deprecated
  76. #!:mime text/x-vcard
  77. !:mime text/vcard
  78. !:apple ????vCrd
  79. !:ext vcf/vcard
  80. # VERSION must come right after BEGIN for 3.0 or 4.0 except in 2.1 , where it can be anywhere
  81. # Joerg_Jenderek_67.vcf
  82. >>12 search/0x113b4/c version:
  83. # VERSION 2.1 , 3.0 or 4.0
  84. >>>&0 string x \b, version %-.3s
  85. >>>&0 string !2.1
  86. >>>>13 string !VERSION: \b, 2nd line does not start with VERSION:
  87. # downcase violates RFC 6350, but some "bad" software produce such vcards
  88. >>0 string !BEGIN \b, not up case
  89. # http://ftp.mozilla.org/pub/thunderbird/candidates/
  90. # 78.10.1-candidates/build1/source/thunderbird-78.10.1.source.tar.xz
  91. # thunderbird-78.10.1/comm/mailnews/import/test/unit/resources/basic_vcard_addressbook.vcf
  92. >>11 beshort !0x0D0A \b, lines not separated by CRLF
  93. # Summary: Libtool library file
  94. # Extension: .la
  95. # Submitted by: Tomasz Trojanowski <tomek@uninet.com.pl>
  96. 0 search/80 .la\ -\ a\ libtool\ library\ file libtool library file
  97. # Summary: Libtool object file
  98. # Extension: .lo
  99. # Submitted by: Abel Cheung <abelcheung@gmail.com>
  100. 0 search/80 .lo\ -\ a\ libtool\ object\ file libtool object file
  101. # From: Daniel Novotny <dnovotny@redhat.com>
  102. # Update: Joerg Jenderek
  103. # URL: https://en.wikipedia.org/wiki/Core_dump#User-mode_memory_dumps
  104. # Reference: https://msdn.microsoft.com/en-us/library/ms680378%28VS.85%29.aspx
  105. #
  106. # "Windows Minidump" by TrID
  107. # ./misctools (version 5.25) labeled the entry as "MDMP crash report data"
  108. 0 string MDMP Mini DuMP crash report
  109. # https://filext.com/file-extension/DMP
  110. !:mime application/x-dmp
  111. !:ext dmp/mdmp
  112. # The high-order word is an internal value that is implementation specific.
  113. # The low-order word is MINIDUMP_VERSION 0xA793
  114. >4 ulelong&0x0000FFFF !0xA793 \b, version %#4.4x
  115. # NumberOfStreams 8,9,10,13
  116. >8 ulelong x \b, %d streams
  117. # StreamDirectoryRva 0x20
  118. >12 ulelong !0x20 \b, %#8.8x RVA
  119. # CheckSum 0
  120. >16 ulelong !0 \b, CheckSum %#8.8x
  121. # Reserved or TimeDateStamp
  122. >20 ledate x \b, %s
  123. # https://msdn.microsoft.com/en-us/library/windows/desktop/ms680519%28v=vs.85%29.aspx
  124. # Flags MINIDUMP_TYPE enumeration type 0 0x121 0x800
  125. >24 ulelong x \b, %#x type
  126. # >24 ulelong >0 \b; include
  127. # >>24 ulelong &0x00000001 \b data sections,
  128. # >>24 ulelong &0x00000020 \b list of unloaded modules,
  129. # >>24 ulelong &0x00000100 \b process and thread information,
  130. # >>24 ulelong &0x00000800 \b memory information,
  131. # Summary: abook addressbook file
  132. # Submitted by: Mark Schreiber <mark7@alumni.cmu.edu>
  133. 0 string #\x20abook\x20addressbook\x20file abook address book
  134. !:mime application/x-abook-addressbook