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