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