head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.14
	netbsd-11-0-RC3:1.1.1.14
	netbsd-11-0-RC2:1.1.1.14
	netbsd-11-0-RC1:1.1.1.14
	perseant-exfatfs-base-20250801:1.1.1.14
	netbsd-11:1.1.1.14.0.6
	netbsd-11-base:1.1.1.14
	netbsd-10-1-RELEASE:1.1.1.14
	perseant-exfatfs-base-20240630:1.1.1.14
	perseant-exfatfs:1.1.1.14.0.4
	perseant-exfatfs-base:1.1.1.14
	netbsd-8-3-RELEASE:1.1.1.9
	netbsd-9-4-RELEASE:1.1.1.11
	netbsd-10-0-RELEASE:1.1.1.14
	netbsd-10-0-RC6:1.1.1.14
	netbsd-10-0-RC5:1.1.1.14
	netbsd-10-0-RC4:1.1.1.14
	netbsd-10-0-RC3:1.1.1.14
	netbsd-10-0-RC2:1.1.1.14
	netbsd-10-0-RC1:1.1.1.14
	FILE5_45:1.1.1.14
	netbsd-10:1.1.1.14.0.2
	netbsd-10-base:1.1.1.14
	FILE5_43:1.1.1.14
	netbsd-9-3-RELEASE:1.1.1.11
	cjep_sun2x-base1:1.1.1.13
	cjep_sun2x:1.1.1.13.0.4
	cjep_sun2x-base:1.1.1.13
	cjep_staticlib_x-base1:1.1.1.13
	netbsd-9-2-RELEASE:1.1.1.11
	cjep_staticlib_x:1.1.1.13.0.2
	cjep_staticlib_x-base:1.1.1.13
	FILE5_40:1.1.1.13
	netbsd-9-1-RELEASE:1.1.1.11
	FILE5_39:1.1.1.12
	phil-wifi-20200421:1.1.1.11
	phil-wifi-20200411:1.1.1.11
	is-mlppp:1.1.1.11.0.4
	is-mlppp-base:1.1.1.11
	phil-wifi-20200406:1.1.1.11
	netbsd-8-2-RELEASE:1.1.1.9
	netbsd-9-0-RELEASE:1.1.1.11
	netbsd-9-0-RC2:1.1.1.11
	FILE5_38:1.1.1.11
	netbsd-9-0-RC1:1.1.1.11
	phil-wifi-20191119:1.1.1.11
	netbsd-9:1.1.1.11.0.2
	netbsd-9-base:1.1.1.11
	phil-wifi-20190609:1.1.1.11
	netbsd-8-1-RELEASE:1.1.1.9
	FILE5_37:1.1.1.11
	netbsd-8-1-RC1:1.1.1.9
	pgoyette-compat-merge-20190127:1.1.1.9.8.1
	pgoyette-compat-20190127:1.1.1.10
	pgoyette-compat-20190118:1.1.1.10
	pgoyette-compat-1226:1.1.1.10
	pgoyette-compat-1126:1.1.1.10
	pgoyette-compat-1020:1.1.1.10
	FILE5_35:1.1.1.10
	pgoyette-compat-0930:1.1.1.10
	pgoyette-compat-0906:1.1.1.10
	netbsd-7-2-RELEASE:1.1.1.6
	pgoyette-compat-0728:1.1.1.10
	netbsd-8-0-RELEASE:1.1.1.9
	phil-wifi:1.1.1.10.0.2
	phil-wifi-base:1.1.1.10
	pgoyette-compat-0625:1.1.1.10
	netbsd-8-0-RC2:1.1.1.9
	pgoyette-compat-0521:1.1.1.10
	pgoyette-compat-0502:1.1.1.10
	pgoyette-compat-0422:1.1.1.10
	netbsd-8-0-RC1:1.1.1.9
	FILE5_33:1.1.1.10
	pgoyette-compat-0415:1.1.1.9
	pgoyette-compat-0407:1.1.1.9
	pgoyette-compat-0330:1.1.1.9
	pgoyette-compat-0322:1.1.1.9
	pgoyette-compat-0315:1.1.1.9
	netbsd-7-1-2-RELEASE:1.1.1.6
	pgoyette-compat:1.1.1.9.0.8
	pgoyette-compat-base:1.1.1.9
	netbsd-7-1-1-RELEASE:1.1.1.6
	matt-nb8-mediatek:1.1.1.9.0.6
	matt-nb8-mediatek-base:1.1.1.9
	FILE5_32:1.1.1.9
	perseant-stdc-iso10646:1.1.1.9.0.4
	perseant-stdc-iso10646-base:1.1.1.9
	netbsd-8:1.1.1.9.0.2
	netbsd-8-base:1.1.1.9
	FILE5_31:1.1.1.9
	prg-localcount2-base3:1.1.1.8
	prg-localcount2-base2:1.1.1.8
	prg-localcount2-base1:1.1.1.8
	prg-localcount2:1.1.1.8.0.2
	prg-localcount2-base:1.1.1.8
	pgoyette-localcount-20170426:1.1.1.8
	bouyer-socketcan-base1:1.1.1.8
	pgoyette-localcount-20170320:1.1.1.8
	netbsd-7-1:1.1.1.6.0.8
	netbsd-7-1-RELEASE:1.1.1.6
	netbsd-7-1-RC2:1.1.1.6
	FILE5_30:1.1.1.8
	netbsd-7-nhusb-base-20170116:1.1.1.6
	bouyer-socketcan:1.1.1.7.0.4
	bouyer-socketcan-base:1.1.1.7
	pgoyette-localcount-20170107:1.1.1.7
	netbsd-7-1-RC1:1.1.1.6
	pgoyette-localcount-20161104:1.1.1.7
	netbsd-7-0-2-RELEASE:1.1.1.6
	localcount-20160914:1.1.1.7
	netbsd-7-nhusb:1.1.1.6.0.6
	netbsd-7-nhusb-base:1.1.1.6
	pgoyette-localcount-20160806:1.1.1.7
	pgoyette-localcount-20160726:1.1.1.7
	pgoyette-localcount:1.1.1.7.0.2
	pgoyette-localcount-base:1.1.1.7
	netbsd-7-0-1-RELEASE:1.1.1.6
	netbsd-7-0:1.1.1.6.0.4
	netbsd-7-0-RELEASE:1.1.1.6
	netbsd-7-0-RC3:1.1.1.6
	netbsd-7-0-RC2:1.1.1.6
	netbsd-7-0-RC1:1.1.1.6
	FILE5_22:1.1.1.7
	FILE5_20:1.1.1.7
	netbsd-6-0-6-RELEASE:1.1.1.3
	netbsd-6-1-5-RELEASE:1.1.1.3
	netbsd-7:1.1.1.6.0.2
	netbsd-7-base:1.1.1.6
	FILE5_19:1.1.1.6
	yamt-pagecache-base9:1.1.1.5
	yamt-pagecache-tag8:1.1.1.3
	netbsd-6-1-4-RELEASE:1.1.1.3
	netbsd-6-0-5-RELEASE:1.1.1.3
	tls-earlyentropy:1.1.1.5.0.2
	tls-earlyentropy-base:1.1.1.6
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.5
	riastradh-drm2-base3:1.1.1.5
	netbsd-6-1-3-RELEASE:1.1.1.3
	netbsd-6-0-4-RELEASE:1.1.1.3
	FILE5_16:1.1.1.5
	netbsd-6-1-2-RELEASE:1.1.1.3
	netbsd-6-0-3-RELEASE:1.1.1.3
	netbsd-6-1-1-RELEASE:1.1.1.3
	riastradh-drm2-base2:1.1.1.4
	riastradh-drm2-base1:1.1.1.4
	riastradh-drm2:1.1.1.4.0.6
	riastradh-drm2-base:1.1.1.4
	netbsd-6-1:1.1.1.3.0.14
	netbsd-6-0-2-RELEASE:1.1.1.3
	netbsd-6-1-RELEASE:1.1.1.3
	khorben-n900:1.1.1.4.0.4
	netbsd-6-1-RC4:1.1.1.3
	netbsd-6-1-RC3:1.1.1.3
	agc-symver:1.1.1.4.0.2
	agc-symver-base:1.1.1.4
	FILE5_14:1.1.1.4
	netbsd-6-1-RC2:1.1.1.3
	netbsd-6-1-RC1:1.1.1.3
	yamt-pagecache-base8:1.1.1.3
	FILE_5_12:1.1.1.3
	netbsd-6-0-1-RELEASE:1.1.1.3
	yamt-pagecache-base7:1.1.1.3
	matt-nb6-plus-nbase:1.1.1.3
	yamt-pagecache-base6:1.1.1.3
	netbsd-6-0:1.1.1.3.0.10
	netbsd-6-0-RELEASE:1.1.1.3
	netbsd-6-0-RC2:1.1.1.3
	tls-maxphys:1.1.1.3.0.8
	tls-maxphys-base:1.1.1.6
	matt-nb6-plus:1.1.1.3.0.6
	matt-nb6-plus-base:1.1.1.3
	netbsd-6-0-RC1:1.1.1.3
	yamt-pagecache-base5:1.1.1.3
	yamt-pagecache-base4:1.1.1.3
	FILE5_11:1.1.1.3
	netbsd-6:1.1.1.3.0.4
	netbsd-6-base:1.1.1.3
	yamt-pagecache-base3:1.1.1.3
	yamt-pagecache-base2:1.1.1.3
	yamt-pagecache:1.1.1.3.0.2
	yamt-pagecache-base:1.1.1.3
	FILE5_09:1.1.1.3
	cherry-xenmp:1.1.1.2.0.2
	cherry-xenmp-base:1.1.1.2
	FILE5_07:1.1.1.2
	bouyer-quota2-nbase:1.1.1.1
	bouyer-quota2:1.1.1.1.0.4
	bouyer-quota2-base:1.1.1.1
	matt-mips64-premerge-20101231:1.1.1.1
	matt-premerge-20091211:1.1.1.1
	jym-xensuspend-base:1.1.1.1
	jym-xensuspend:1.1.1.1.0.2
	jym-xensuspend-nbase:1.1.1.1
	FILE5_03:1.1.1.1
	CHRISTOS:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2009.05.08.16.35.09;	author christos;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2009.05.08.16.35.09;	author christos;	state Exp;
branches
	1.1.1.1.2.1;
next	1.1.1.2;

1.1.1.2
date	2011.05.12.20.47.04;	author christos;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2011.09.16.20.37.50;	author christos;	state Exp;
branches
	1.1.1.3.2.1
	1.1.1.3.8.1;
next	1.1.1.4;

1.1.1.4
date	2013.03.23.15.49.19;	author christos;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2013.12.01.19.28.19;	author christos;	state Exp;
branches
	1.1.1.5.2.1;
next	1.1.1.6;
commitid	RVQIxe3FpM3lSsfx;

1.1.1.6
date	2014.06.13.01.48.25;	author christos;	state Exp;
branches;
next	1.1.1.7;
commitid	jtTYsE5FmJU6MiEx;

1.1.1.7
date	2014.10.10.20.08.22;	author christos;	state Exp;
branches
	1.1.1.7.2.1
	1.1.1.7.4.1;
next	1.1.1.8;
commitid	pfOzhE33qnut2HTx;

1.1.1.8
date	2017.02.10.17.42.59;	author christos;	state Exp;
branches;
next	1.1.1.9;
commitid	HAP3kn9Hn6ovMqFz;

1.1.1.9
date	2017.05.24.23.59.57;	author christos;	state Exp;
branches
	1.1.1.9.8.1;
next	1.1.1.10;
commitid	WbyOU2LBE5qOyHSz;

1.1.1.10
date	2018.04.15.19.32.47;	author christos;	state Exp;
branches
	1.1.1.10.2.1;
next	1.1.1.11;
commitid	unKSwpX2g9VqBzyA;

1.1.1.11
date	2019.05.22.17.19.57;	author christos;	state Exp;
branches;
next	1.1.1.12;
commitid	VXeNRYYruN1MWdoB;

1.1.1.12
date	2020.06.15.00.18.48;	author christos;	state Exp;
branches;
next	1.1.1.13;
commitid	HMbuXSjPojU5LfcC;

1.1.1.13
date	2021.04.09.18.58.02;	author christos;	state Exp;
branches;
next	1.1.1.14;
commitid	W9ddLLbSkHHinEOC;

1.1.1.14
date	2022.09.24.20.07.54;	author christos;	state Exp;
branches;
next	;
commitid	Nf6F9kcpc0EPC9VD;

1.1.1.1.2.1
date	2009.05.08.16.35.09;	author jym;	state dead;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2009.05.13.18.51.59;	author jym;	state Exp;
branches;
next	;

1.1.1.3.2.1
date	2014.05.22.15.44.59;	author yamt;	state Exp;
branches;
next	;
commitid	tYJXbWAuFvTh7yBx;

1.1.1.3.8.1
date	2013.06.23.06.26.32;	author tls;	state Exp;
branches;
next	1.1.1.3.8.2;
commitid	OnlO1cBgtQRcIHUw;

1.1.1.3.8.2
date	2014.08.19.23.46.47;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.1.1.5.2.1
date	2014.08.10.07.07.10;	author tls;	state Exp;
branches;
next	;
commitid	b1wUlsZGswrdGMLx;

1.1.1.7.2.1
date	2017.03.20.06.52.20;	author pgoyette;	state Exp;
branches;
next	;
commitid	jjw7cAwgyKq7RfKz;

1.1.1.7.4.1
date	2017.04.21.16.51.24;	author bouyer;	state Exp;
branches;
next	;
commitid	dUG7nkTKALCadqOz;

1.1.1.9.8.1
date	2018.04.22.07.20.08;	author pgoyette;	state Exp;
branches;
next	;
commitid	W6xykws0Zbl4kpzA;

1.1.1.10.2.1
date	2019.06.10.21.44.46;	author christos;	state Exp;
branches;
next	;
commitid	jtc8rnCzWiEEHGqB;


desc
@@


1.1
log
@Initial revision
@
text
@
#------------------------------------------------------------------------------
# riff:  file(1) magic for RIFF format
# See
#
#	http://www.seanet.com/users/matts/riffmci/riffmci.htm
#
# AVI section extended by Patrik Rådman <patrik+file-magic@@iki.fi>
#
0	string		RIFF		RIFF (little-endian) data
# RIFF Palette format
>8	string		PAL		\b, palette
>>16	leshort		x		\b, version %d
>>18	leshort		x		\b, %d entries
# RIFF Device Independent Bitmap format
>8	string		RDIB		\b, device-independent bitmap
>>16	string		BM		
>>>30	leshort		12		\b, OS/2 1.x format
>>>>34	leshort		x		\b, %d x
>>>>36	leshort		x		%d
>>>30	leshort		64		\b, OS/2 2.x format
>>>>34	leshort		x		\b, %d x
>>>>36	leshort		x		%d
>>>30	leshort		40		\b, Windows 3.x format
>>>>34	lelong		x		\b, %d x
>>>>38	lelong		x		%d x
>>>>44	leshort		x		%d
# RIFF MIDI format
>8	string		RMID		\b, MIDI
# RIFF Multimedia Movie File format
>8	string		RMMP		\b, multimedia movie
# RIFF wrapper for MP3
>8	string		RMP3		\b, MPEG Layer 3 audio
# Microsoft WAVE format (*.wav)
>8	string		WAVE		\b, WAVE audio
!:mime	audio/x-wav
>>20	leshort		1		\b, Microsoft PCM
>>>34	leshort		>0		\b, %d bit
>>20	leshort		2		\b, Microsoft ADPCM
>>20	leshort		6		\b, ITU G.711 A-law
>>20	leshort		7		\b, ITU G.711 mu-law
>>20	leshort		17		\b, IMA ADPCM
>>20	leshort		20		\b, ITU G.723 ADPCM (Yamaha)
>>20	leshort		49		\b, GSM 6.10
>>20	leshort		64		\b, ITU G.721 ADPCM
>>20	leshort		80		\b, MPEG
>>20	leshort		85		\b, MPEG Layer 3
>>22	leshort		=1		\b, mono
>>22	leshort		=2		\b, stereo
>>22	leshort		>2		\b, %d channels
>>24	lelong		>0		%d Hz
# Corel Draw Picture
>8	string		CDRA		\b, Corel Draw Picture
!:mime	image/x-coreldraw
# AVI == Audio Video Interleave
>8	string		AVI\040		\b, AVI
!:mime	video/x-msvideo
>>12    string          LIST
>>>20   string          hdrlavih
>>>>&36 lelong          x               \b, %lu x
>>>>&40 lelong          x               %lu,
>>>>&4  lelong          >1000000        <1 fps,
>>>>&4  lelong          1000000         1.00 fps,
>>>>&4  lelong          500000          2.00 fps,
>>>>&4  lelong          333333          3.00 fps,
>>>>&4  lelong          250000          4.00 fps,
>>>>&4  lelong          200000          5.00 fps,
>>>>&4  lelong          166667          6.00 fps,
>>>>&4  lelong          142857          7.00 fps,
>>>>&4  lelong          125000          8.00 fps,
>>>>&4  lelong          111111          9.00 fps,
>>>>&4  lelong          100000          10.00 fps,
# ]9.9,10.1[
>>>>&4  lelong          <101010
>>>>>&-4        lelong  >99010
>>>>>>&-4       lelong  !100000         ~10 fps,
>>>>&4  lelong          83333           12.00 fps,
# ]11.9,12.1[
>>>>&4  lelong          <84034
>>>>>&-4        lelong  >82645
>>>>>>&-4       lelong  !83333          ~12 fps,
>>>>&4  lelong          66667           15.00 fps,
# ]14.9,15.1[
>>>>&4  lelong          <67114
>>>>>&-4        lelong  >66225
>>>>>>&-4       lelong  !66667          ~15 fps,
>>>>&4  lelong          50000           20.00 fps,
>>>>&4  lelong          41708           23.98 fps,
>>>>&4  lelong          41667           24.00 fps,
# ]23.9,24.1[
>>>>&4  lelong          <41841
>>>>>&-4        lelong  >41494
>>>>>>&-4       lelong  !41708
>>>>>>>&-4      lelong  !41667          ~24 fps,
>>>>&4  lelong          40000           25.00 fps,
# ]24.9,25.1[
>>>>&4  lelong          <40161
>>>>>&-4        lelong  >39841
>>>>>>&-4       lelong  !40000          ~25 fps,
>>>>&4  lelong          33367           29.97 fps,
>>>>&4  lelong          33333           30.00 fps,
# ]29.9,30.1[
>>>>&4  lelong          <33445
>>>>>&-4        lelong  >33223
>>>>>>&-4       lelong  !33367
>>>>>>>&-4      lelong  !33333          ~30 fps,
>>>>&4  lelong          <32224          >30 fps,
##>>>>&4  lelong          x               (%lu)
##>>>>&20 lelong          x               %lu frames,
# Note: The tests below assume that the AVI has 1 or 2 streams,
#       "vids" optionally followed by "auds".
#       (Should cover 99.9% of all AVIs.)
# assuming avih length = 56
>>>88   string  LIST
>>>>96  string  strlstrh
>>>>>108        string  vids    video:
>>>>>>&0        lelong  0               uncompressed
# skip past vids strh
>>>>>>(104.l+108)       string  strf
>>>>>>>(104.l+132)      lelong          1       RLE 8bpp
>>>>>>>(104.l+132)      string/c        cvid    Cinepak
>>>>>>>(104.l+132)      string/c        i263    Intel I.263
>>>>>>>(104.l+132)      string/c        iv32    Indeo 3.2
>>>>>>>(104.l+132)      string/c        iv41    Indeo 4.1
>>>>>>>(104.l+132)      string/c        iv50    Indeo 5.0
>>>>>>>(104.l+132)      string/c        mp42    Microsoft MPEG-4 v2
>>>>>>>(104.l+132)      string/c        mp43    Microsoft MPEG-4 v3
>>>>>>>(104.l+132)      string/c        fmp4    FFMpeg MPEG-4
>>>>>>>(104.l+132)      string/c        mjpg    Motion JPEG
>>>>>>>(104.l+132)      string/c        div3    DivX 3
>>>>>>>>112             string/c        div3    Low-Motion
>>>>>>>>112             string/c        div4    Fast-Motion
>>>>>>>(104.l+132)      string/c        divx    DivX 4
>>>>>>>(104.l+132)      string/c        dx50    DivX 5
>>>>>>>(104.l+132)      string/c        xvid    XviD
>>>>>>>(104.l+132)	string/c	h264	H.264
>>>>>>>(104.l+132)      string/c        wmv3    Windows Media Video 9
>>>>>>>(104.l+132)      string/c        h264    X.264 or H.264
>>>>>>>(104.l+132)      lelong  0
##>>>>>>>(104.l+132)      string  x       (%.4s)
# skip past first (video) LIST
>>>>(92.l+96)   string  LIST
>>>>>(92.l+104) string  strlstrh
>>>>>>(92.l+116)        string          auds    \b, audio:
# auds strh length = 56:
>>>>>>>(92.l+172)       string          strf
>>>>>>>>(92.l+180)      leshort 0x0001  uncompressed PCM
>>>>>>>>(92.l+180)      leshort 0x0002  ADPCM
>>>>>>>>(92.l+180)      leshort 0x0006  aLaw
>>>>>>>>(92.l+180)      leshort 0x0007  uLaw
>>>>>>>>(92.l+180)      leshort 0x0050  MPEG-1 Layer 1 or 2
>>>>>>>>(92.l+180)      leshort 0x0055  MPEG-1 Layer 3
>>>>>>>>(92.l+180)      leshort 0x2000  Dolby AC3
>>>>>>>>(92.l+180)      leshort 0x0161  DivX
##>>>>>>>>(92.l+180)      leshort x       (0x%.4x)
>>>>>>>>(92.l+182)      leshort 1       (mono,
>>>>>>>>(92.l+182)      leshort 2       (stereo,
>>>>>>>>(92.l+182)      leshort >2      (%d channels,
>>>>>>>>(92.l+184)      lelong  x       %d Hz)
# auds strh length = 64:
>>>>>>>(92.l+180)       string          strf
>>>>>>>>(92.l+188)      leshort 0x0001  uncompressed PCM
>>>>>>>>(92.l+188)      leshort 0x0002  ADPCM
>>>>>>>>(92.l+188)      leshort 0x0055  MPEG-1 Layer 3
>>>>>>>>(92.l+188)      leshort 0x2000  Dolby AC3
>>>>>>>>(92.l+188)      leshort 0x0161  DivX
##>>>>>>>>(92.l+188)      leshort x       (0x%.4x)
>>>>>>>>(92.l+190)      leshort 1       (mono,
>>>>>>>>(92.l+190)      leshort 2       (stereo,
>>>>>>>>(92.l+190)      leshort >2      (%d channels,
>>>>>>>>(92.l+192)      lelong  x       %d Hz)
# Animated Cursor format
>8	string		ACON		\b, animated cursor
# SoundFont 2 <mpruett@@sgi.com>
>8	string		sfbk		SoundFont/Bank
# MPEG-1 wrapped in a RIFF, apparently
>8      string          CDXA            \b, wrapped MPEG-1 (CDXA)
>8	string		4XMV		\b, 4X Movie file 

#
# XXX - some of the below may only appear in little-endian form.
#
# Also "MV93" appears to be for one form of Macromedia Director
# files, and "GDMF" appears to be another multimedia format.
#
0	string		RIFX		RIFF (big-endian) data
# RIFF Palette format
>8	string		PAL		\b, palette
>>16	beshort		x		\b, version %d
>>18	beshort		x		\b, %d entries
# RIFF Device Independent Bitmap format
>8	string		RDIB		\b, device-independent bitmap
>>16	string		BM		
>>>30	beshort		12		\b, OS/2 1.x format
>>>>34	beshort		x		\b, %d x
>>>>36	beshort		x		%d
>>>30	beshort		64		\b, OS/2 2.x format
>>>>34	beshort		x		\b, %d x
>>>>36	beshort		x		%d
>>>30	beshort		40		\b, Windows 3.x format
>>>>34	belong		x		\b, %d x
>>>>38	belong		x		%d x
>>>>44	beshort		x		%d
# RIFF MIDI format
>8	string		RMID		\b, MIDI
# RIFF Multimedia Movie File format
>8	string		RMMP		\b, multimedia movie
# Microsoft WAVE format (*.wav)
>8	string		WAVE		\b, WAVE audio
>>20	leshort		1		\b, Microsoft PCM
>>>34	leshort		>0		\b, %d bit
>>22	beshort		=1		\b, mono
>>22	beshort		=2		\b, stereo
>>22	beshort		>2		\b, %d channels
>>24	belong		>0		%d Hz
# Corel Draw Picture
>8	string		CDRA		\b, Corel Draw Picture
# AVI == Audio Video Interleave
>8	string		AVI\040		\b, AVI
# Animated Cursor format
>8	string		ACON		\b, animated cursor
# Notation Interchange File Format (big-endian only)
>8	string		NIFF		\b, Notation Interchange File Format
# SoundFont 2 <mpruett@@sgi.com>
>8	string		sfbk		SoundFont/Bank
@


1.1.1.1
log
@from ftp.astron.com
@
text
@@


1.1.1.2
log
@from ftp.astron.com.
- many security related fixes
- no MAXPATHLEN limits
- fixed missing text specification on ascii magic
- new ``pascal'' style string formats
- whitespace comparison fix
- more magic
@
text
@a2 1
# $File: riff,v 1.21 2011/02/10 01:52:51 christos Exp $
a41 1
>>20	leshort		8		\b, Microsoft DTS
a47 1
>>20	leshort		0x2001		\b, DTS
a225 28

#------------------------------------------------------------------------------
# Sony Wave64
# see http://www.vcs.de/fileadmin/user_upload/MBS/PDF/Whitepaper/Informations_about_Sony_Wave64.pdf
# 128 bit RIFF-GUID { 66666972-912E-11CF-A5D6-28DB04C10000 } in little-endian 
0	string	riff\x2E\x91\xCF\x11\xA5\xD6\x28\xDB\x04\xC1\x00\x00		Sony Wave64 RIFF data
# 128 bit + total file size (64 bits) so 24 bytes
# then WAVE-GUID { 65766177-ACF3-11D3-8CD1-00C04F8EDB8A }
>24	string		wave\xF3\xAC\xD3\x11\x8C\xD1\x00\xC0\x4F\x8E\xDB\x8A		\b, WAVE 64 audio
!:mime	audio/x-w64
# FMT-GUID { 20746D66-ACF3-11D3-8CD1-00C04F8EDB8A }
>>40	search/256	fmt\x20\xF3\xAC\xD3\x11\x8C\xD1\x00\xC0\x4F\x8E\xDB\x8A		\b
>>>&10	leshort		=1		\b, mono
>>>&10	leshort		=2		\b, stereo
>>>&10	leshort		>2		\b, %d channels
>>>&12	lelong		>0		%d Hz

#------------------------------------------------------------------------------
# MBWF/RF64
# see EBU – TECH 3306 http://tech.ebu.ch/docs/tech/tech3306-2009.pdf
0	string	RF64\xff\xff\xff\xffWAVEds64		MBWF/RF64 audio
!:mime	audio/x-wav
>40	search/256	fmt\x20		\b
>>&6	leshort		=1		\b, mono
>>&6	leshort		=2		\b, stereo
>>&6	leshort		>2		\b, %d channels
>>&8	lelong		>0		%d Hz

@


1.1.1.3
log
@from ftp.astron.com:
- elf seeking fixes
- improvements in cdf parsing
- waitpid only for our child
- magic fixes and additions
@
text
@d3 1
a3 1
# $File: riff,v 1.22 2011/09/06 11:00:06 christos Exp $
a181 2
# AMV-type AVI file: http://wiki.multimedia.cx/index.php?title=AMV
>8	string		AMV\040		\b, AMV 
@


1.1.1.3.2.1
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d3 1
a3 1
# $File: riff,v 1.24 2013/11/19 23:58:17 christos Exp $
d9 1
a9 1
# AVI section extended by Patrik Radman <patrik+file-magic@@iki.fi>
a57 2
>8	string		CDR6		\b, Corel Draw Picture, version 6
!:mime	image/x-coreldraw
a222 1
>8	string		CDR6		\b, Corel Draw Picture, version 6
d250 1
a250 1
# see EBU TECH 3306 http://tech.ebu.ch/docs/tech/tech3306-2009.pdf
@


1.1.1.3.8.1
log
@resync from head
@
text
@d3 1
a3 1
# $File: riff,v 1.23 2013/02/06 14:18:52 christos Exp $
d9 1
a9 1
# AVI section extended by Patrik Radman <patrik+file-magic@@iki.fi>
d250 1
a250 1
# see EBU TECH 3306 http://tech.ebu.ch/docs/tech/tech3306-2009.pdf
@


1.1.1.3.8.2
log
@Rebase to HEAD as of a few days ago.
@
text
@d3 1
a3 1
# $File: riff,v 1.27 2014/04/30 21:41:02 christos Exp $
a8 40

# audio format tag. Assume limits: max 1024 bit, 128 channels, 1 MHz
0   name    riff-wave
>0	leshort		1		\b, Microsoft PCM
>>14	leshort		>0
>>>14	leshort		<1024	\b, %d bit
>0	leshort		2		\b, Microsoft ADPCM
>0	leshort		6		\b, ITU G.711 A-law
>0	leshort		7		\b, ITU G.711 mu-law
>0	leshort		8		\b, Microsoft DTS
>0	leshort		17		\b, IMA ADPCM
>0	leshort		20		\b, ITU G.723 ADPCM (Yamaha)
>0	leshort		49		\b, GSM 6.10
>0	leshort		64		\b, ITU G.721 ADPCM
>0	leshort		80		\b, MPEG
>0	leshort		85		\b, MPEG Layer 3
>0	leshort		0x2001		\b, DTS
>2	leshort		=1		\b, mono
>2	leshort		=2		\b, stereo
>2	leshort		>2
>>2	leshort		<128	\b, %d channels
>4	lelong		>0
>>4	lelong		<1000000	%d Hz

# try to find "fmt "
0   name    riff-walk
>0  string  fmt\x20
>>4 lelong  <0x80
>>>8 use    riff-wave
>0  string  LIST
>>&(4.l+4)  use riff-walk
>0  string  DISP
>>&(4.l+4)  use riff-walk
>0  string  bext
>>&(4.l+4)  use riff-walk
>0  string  Fake
>>&(4.l+4)  use riff-walk
>0  string  fact
>>&(4.l+4)  use riff-walk

d38 17
a54 2
>>12    string  >\0
>>>12   use     riff-walk
a57 3
>8	string		CDR6		\b, Corel Draw Picture, version 6
!:mime	image/x-coreldraw
>8	string		NUNDROOT	\b, Steinberg CuBase
d63 2
a64 2
>>>>&36 lelong          x               \b, %u x
>>>>&40 lelong          x               %u,
a222 1
>8	string		CDR6		\b, Corel Draw Picture, version 6
@


1.1.1.4
log
@import file-5.14
changes are "name" + "use" keyword features, bug fixes
@
text
@d3 1
a3 1
# $File: riff,v 1.23 2013/02/06 14:18:52 christos Exp $
d9 1
a9 1
# AVI section extended by Patrik Radman <patrik+file-magic@@iki.fi>
d250 1
a250 1
# see EBU TECH 3306 http://tech.ebu.ch/docs/tech/tech3306-2009.pdf
@


1.1.1.5
log
@from ftp.astron.com, this is a bug fix release:
       * always leave magic file loaded, don't unload for magic_check, etc.
       * fix default encoding to binary instead of unknown which broke recently
       * handle empty and one byte files, less specially so that
         --mime-encoding does not break completely.
       * fix erroneous non-zero exit code from non-existant file and message
       * add CDF MSI file detection (Guy Helmer)
@
text
@d3 1
a3 1
# $File: riff,v 1.24 2013/11/19 23:58:17 christos Exp $
a57 2
>8	string		CDR6		\b, Corel Draw Picture, version 6
!:mime	image/x-coreldraw
a222 1
>8	string		CDR6		\b, Corel Draw Picture, version 6
@


1.1.1.5.2.1
log
@Rebase.
@
text
@d3 1
a3 1
# $File: riff,v 1.27 2014/04/30 21:41:02 christos Exp $
a8 40

# audio format tag. Assume limits: max 1024 bit, 128 channels, 1 MHz
0   name    riff-wave
>0	leshort		1		\b, Microsoft PCM
>>14	leshort		>0
>>>14	leshort		<1024	\b, %d bit
>0	leshort		2		\b, Microsoft ADPCM
>0	leshort		6		\b, ITU G.711 A-law
>0	leshort		7		\b, ITU G.711 mu-law
>0	leshort		8		\b, Microsoft DTS
>0	leshort		17		\b, IMA ADPCM
>0	leshort		20		\b, ITU G.723 ADPCM (Yamaha)
>0	leshort		49		\b, GSM 6.10
>0	leshort		64		\b, ITU G.721 ADPCM
>0	leshort		80		\b, MPEG
>0	leshort		85		\b, MPEG Layer 3
>0	leshort		0x2001		\b, DTS
>2	leshort		=1		\b, mono
>2	leshort		=2		\b, stereo
>2	leshort		>2
>>2	leshort		<128	\b, %d channels
>4	lelong		>0
>>4	lelong		<1000000	%d Hz

# try to find "fmt "
0   name    riff-walk
>0  string  fmt\x20
>>4 lelong  <0x80
>>>8 use    riff-wave
>0  string  LIST
>>&(4.l+4)  use riff-walk
>0  string  DISP
>>&(4.l+4)  use riff-walk
>0  string  bext
>>&(4.l+4)  use riff-walk
>0  string  Fake
>>&(4.l+4)  use riff-walk
>0  string  fact
>>&(4.l+4)  use riff-walk

d38 17
a54 2
>>12    string  >\0
>>>12   use     riff-walk
a59 1
>8	string		NUNDROOT	\b, Steinberg CuBase
d65 2
a66 2
>>>>&36 lelong          x               \b, %u x
>>>>&40 lelong          x               %u,
@


1.1.1.6
log
@import file-5.19

2014-06-09   9:04  Christos Zoulas <christos@@zoulas.com>

	* Misc buffer overruns and missing buffer size tests in cdf parsing
	  (Francisco Alonso, Jan Kaluza)

2014-06-02  14:50  Christos Zoulas <christos@@zoulas.com>

	* Enforce limit of 8K on regex searches that have no limits
	* Allow the l modifier for regex to mean line count. Default
	  to byte count. If line count is specified, assume a max
	  of 80 characters per line to limit the byte count.
	* Don't allow conversions to be used for dates, allowing
	  the mask field to be used as an offset.

2014-05-30  12:51  Christos Zoulas <christos@@zoulas.com>

	* Make the range operator limit the length of the
	  regex search.

2014-05-14  19:23  Christos Zoulas <christos@@zoulas.com>

	* PR/347: Windows fixes
	* PR/352: Hangul word processor recognition
	* PR/354: Encoding irregularities in text files

2014-05-06  6:12  Christos Zoulas <christos@@zoulas.com>

	* Fix uninitialized title in CDF files (Jan Kaluza)

2014-05-04  14:55  Christos Zoulas <christos@@zoulas.com>

	* PR/351: Fix compilation of empty files

2014-04-30  17:39  Christos Zoulas <christos@@zoulas.com>

	* Fix integer formats: We don't specify 'l' or
	  'h' and 'hh' specifiers anymore, only 'll' for
	  quads and nothing for the rest. This is so that
	  magic writing is simpler.

2014-04-01  15:25  Christos Zoulas <christos@@zoulas.com>

	* PR/341: Jan Kaluza, fix memory leak
	* PR/342: Jan Kaluza, fix out of bounds read

2014-03-28  15:25  Christos Zoulas <christos@@zoulas.com>

	* Fix issue with long formats not matching fmtcheck
@
text
@d3 1
a3 1
# $File: riff,v 1.27 2014/04/30 21:41:02 christos Exp $
a8 40

# audio format tag. Assume limits: max 1024 bit, 128 channels, 1 MHz
0   name    riff-wave
>0	leshort		1		\b, Microsoft PCM
>>14	leshort		>0
>>>14	leshort		<1024	\b, %d bit
>0	leshort		2		\b, Microsoft ADPCM
>0	leshort		6		\b, ITU G.711 A-law
>0	leshort		7		\b, ITU G.711 mu-law
>0	leshort		8		\b, Microsoft DTS
>0	leshort		17		\b, IMA ADPCM
>0	leshort		20		\b, ITU G.723 ADPCM (Yamaha)
>0	leshort		49		\b, GSM 6.10
>0	leshort		64		\b, ITU G.721 ADPCM
>0	leshort		80		\b, MPEG
>0	leshort		85		\b, MPEG Layer 3
>0	leshort		0x2001		\b, DTS
>2	leshort		=1		\b, mono
>2	leshort		=2		\b, stereo
>2	leshort		>2
>>2	leshort		<128	\b, %d channels
>4	lelong		>0
>>4	lelong		<1000000	%d Hz

# try to find "fmt "
0   name    riff-walk
>0  string  fmt\x20
>>4 lelong  <0x80
>>>8 use    riff-wave
>0  string  LIST
>>&(4.l+4)  use riff-walk
>0  string  DISP
>>&(4.l+4)  use riff-walk
>0  string  bext
>>&(4.l+4)  use riff-walk
>0  string  Fake
>>&(4.l+4)  use riff-walk
>0  string  fact
>>&(4.l+4)  use riff-walk

d38 17
a54 2
>>12    string  >\0
>>>12   use     riff-walk
a59 1
>8	string		NUNDROOT	\b, Steinberg CuBase
d65 2
a66 2
>>>>&36 lelong          x               \b, %u x
>>>>&40 lelong          x               %u,
@


1.1.1.7
log
@import file-5.20; bug fixes and better image magic descriptions.
@
text
@d3 1
a3 1
# $File: riff,v 1.30 2014/09/23 17:02:12 christos Exp $
a47 20
>0  string  VP8
>>11		byte		0x9d
>>>12		byte		0x01
>>>>13		byte		0x2a	\b, VP8 encoding
>>>>>14		leshort&0x3fff	x	\b, %d
>>>>>16		leshort&0x3fff	x	\bx%d, Scaling:
>>>>>14		leshort&0xc000	0x0000	\b [none]
>>>>>14		leshort&0xc000	0x1000	\b [5/4]
>>>>>14		leshort&0xc000	0x2000	\b [5/3]
>>>>>14		leshort&0xc000	0x3000	\b [2]
>>>>>14		leshort&0xc000	0x0000	\bx[none]
>>>>>14		leshort&0xc000	0x1000	\bx[5/4]
>>>>>14		leshort&0xc000	0x2000	\bx[5/3]
>>>>>14		leshort&0xc000	0x3000	\bx[2]
>>>>>15		byte&0x80	=0x00	\b, YUV color
>>>>>15		byte&0x80	=0x80	\b, bad color specification
>>>>>15		byte&0x40	=0x40	\b, no clamping required
>>>>>15		byte&0x40	=0x00	\b, decoders should clamp
#>0  string  x		we got %s
#>>&(4.l+4)  use riff-walk
a211 2
>8      string          WEBP            \b, Web/P image
>>12	use		riff-walk
d287 1
@


1.1.1.7.4.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
# $File: riff,v 1.31 2015/02/14 17:30:03 christos Exp $
a232 1
!:mime	image/webp
@


1.1.1.7.2.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
# $File: riff,v 1.31 2015/02/14 17:30:03 christos Exp $
a232 1
!:mime	image/webp
@


1.1.1.8
log
@2017-02-10  12:24  Christos Zoulas <christos@@zoulas.com>

	* release 5.30

2017-02-07  23:27  Christos Zoulas <christos@@zoulas.com>

	* If we exceeded the offset in a search return no match
	  (Christoph Biedl)
	* Be more lenient on corrupt CDF files (Christoph Biedl)

2017-02-04  16:46  Christos Zoulas <christos@@zoulas.com>

	* pacify ubsan sign extension (oss-fuzz/524)

2017-02-01  12:42  Christos Zoulas <christos@@zoulas.com>

	* off by one in cdf parsing (PR/593)
	* report debugging sections in elf (PR/591)

2016-11-06  10:52  Christos Zoulas <christos@@zoulas.com>

	* Allow @@@@@@ in extensions
	* Add missing overflow check in der magic (Jonas Wagner)

2016-10-25  10:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.29

2016-10-24  11:20  Christos Zoulas <christos@@zoulas.com>

	* der getlength overflow (Jonas Wagner)
	* multiple magic file load failure (Christoph Biedl)

2016-10-17  11:26  Christos Zoulas <christos@@zoulas.com>

	* CDF parsing improvements (Guy Helmer)

2016-07-20   7:26  Christos Zoulas <christos@@zoulas.com>

	* Add support for signed indirect offsets

2016-07-18   7:41  Christos Zoulas <christos@@zoulas.com>

	* cat /dev/null | file - should print empty (Christoph Biedl)

2016-07-05  15:20  Christos Zoulas <christos@@zoulas.com>

	* Bump string size from 64 to 96.

2016-06-13  20:20  Christos Zoulas <christos@@zoulas.com>

	* PR/556: Fix separators on annotations.

2016-06-13  19:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.28
	* fix leak on allocation failure

2016-06-01   1:20  Christos Zoulas <christos@@zoulas.com>

	* PR/555: Avoid overflow for offset > nbytes
	* PR/550: Segv on DER parsing:
	    - use the correct variable for length
	    - set offset to 0 on failure.

2016-05-13  12:00  Christos Zoulas <christos@@zoulas.com>

	* release 5.27

2016-04-18   9:35  Christos Zoulas <christos@@zoulas.com>

	* Errors comparing DER entries or computing offsets
	  are just indications of malformed non-DER files.
	  Don't print them.
	* Offset comparison was off-by-one.
	* Fix compression code (Werner Fink)
	* Put new bytes constant in the right file (not the generated one)

2016-04-16  18:34  Christos Zoulas <christos@@zoulas.com>

	* release 5.26

2016-03-31  13:50  Christos Zoulas <christos@@zoulas.com>

	* make the number of bytes read from files configurable.

2016-03-21  13:40  Christos Zoulas <christos@@zoulas.com>

	* Add bounds checks for DER code (discovered by Thomas Jarosch)
	* Change indirect recursion limit to indirect use count and
	  bump from 15 to 50 to prevent abuse.

2016-03-13  20:39  Christos Zoulas <christos@@zoulas.com>

	* Add -00 which prints filename\0description\0

2016-03-01  13:28  Christos Zoulas <christos@@zoulas.com>

	* Fix ID3 indirect parsing

2016-01-19  10:18  Christos Zoulas <christos@@zoulas.com>

	* add DER parsing capability

2015-11-13  10:35  Christos Zoulas <christos@@zoulas.com>

	* provide dprintf(3) for the OS's that don't have it.

2015-11-11  16:25  Christos Zoulas <christos@@zoulas.com>

	* redo the compression code report decompression errors

2015-11-10  23:25  Christos Zoulas <christos@@zoulas.com>

	* REG_STARTEND code is not working as expected, delete it.

2015-11-09  16:05  Christos Zoulas <christos@@zoulas.com>

	* Add zlib support if we have it.

2015-11-05  11:22  Christos Zoulas <christos@@zoulas.com>

	* PR/492: compression forking was broken with magic_buffer.

2015-09-16   9:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.25

2015-09-11  13:25  Christos Zoulas <christos@@zoulas.com>

	* add a limit to the length of regex searches

2015-09-08   9:50  Christos Zoulas <christos@@zoulas.com>

	* fix problems with --parameter (Christoph Biedl)

2015-07-11  10:35  Christos Zoulas <christos@@zoulas.com>

	* Windows fixes PR/466 (Jason Hood)

2015-07-09  10:35  Christos Zoulas <christos@@zoulas.com>

	* release 5.24

2015-06-11   8:52  Christos Zoulas <christos@@zoulas.com>

	* redo long option encoding to fix off-by-one in 5.23

2015-06-10  13:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.23

2015-06-09  16:10  Christos Zoulas <christos@@zoulas.com>

	* Fix issue with regex range for magic with offset
	* Always return true from mget with USE (success to mget not match
	  indication). Fixes mime evaluation after USE magic
	* PR/459: Don't insert magic entries to the list if there are parsing
	  errors for them.

2015-06-03  16:00  Christos Zoulas <christos@@zoulas.com>

	* PR/455: Add utf-7 encoding

2015-06-03  14:30  Christos Zoulas <christos@@zoulas.com>

	* PR/455: Implement -Z, look inside, but don't report on compression
	* PR/454: Fix allocation error on bad magic.

2015-05-29  10:30  Christos Zoulas <christos@@zoulas.com>

	* handle MAGIC_CONTINUE everywhere, not just in softmagic

2015-05-21  14:30  Christos Zoulas <christos@@zoulas.com>

	* don't print descriptions for NAME types when mime.

2015-04-09  15:59  Christos Zoulas <christos@@zoulas.com>

	* Add --extension to list the known extensions for this file type
	  Idea by Andrew J Roazen

2015-02-14  12:23  Christos Zoulas <christos@@zoulas.com>

	* Bump file search buffer size to 1M.

2015-01-09  14:35  Christos Zoulas <christos@@zoulas.com>

	* Fix multiple issues with date formats reported by Christoph Biedl:
		- T_LOCAL meaning was reversed
		- Arithmetic did not work
	  Also stop adjusting daylight savings for gmt printing.

2015-01-05  13:00  Christos Zoulas <christos@@zoulas.com>

	* PR/411: Fix memory corruption from corrupt cdf file.
@
text
@d3 1
a3 1
# $File: riff,v 1.31 2015/02/14 17:30:03 christos Exp $
a232 1
!:mime	image/webp
@


1.1.1.9
log
@Import file-5.31; mostly oss-fuzz found bugs.
@
text
@d3 1
a3 1
# $File: riff,v 1.32 2017/03/17 21:35:28 christos Exp $
d78 1
a78 1
>>16	string		BM
d229 1
a229 1
>8	string		4XMV		\b, 4X Movie file
d231 1
a231 1
>8	string		AMV\040		\b, AMV
d249 1
a249 1
>>16	string		BM
d287 1
a287 1
# 128 bit RIFF-GUID { 66666972-912E-11CF-A5D6-28DB04C10000 } in little-endian
@


1.1.1.9.8.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
# $File: riff,v 1.33 2017/10/06 01:11:24 christos Exp $
a7 1
#	http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf
d73 3
a75 25
# Update: Joerg Jenderek
# URL: https://en.wikipedia.org/wiki/Resource_Interchange_File_Format
# Reference: http://worms2d.info/Palette_file
>8	string		PAL\ 		\b, palette
!:mime	application/x-riff
# color palette by Microsoft Corporation
!:ext	pal
# file size =  chunk size + 8 in most cases
>>4	ulelong+8	x		\b, %u bytes
# Extended PAL Format
>>12	string		plth		\b, extended
# Simple PAL Format
>>12	string		data		
# data chunk size = color entries * 4 + 4 + sometimes extra (4) appended bytes
>>>16	ulelong		x		\b, data size %u
# palVersion is always 0x0300
#>>>20	leshort		x		\b, version 0x%4.4x
# palNumEntries specifies the number of palette color entries
>>>22	uleshort	x		\b, %u entries
# after palPalEntry sized (number of color entries * 4 ) vector
>>>(22.s*4)	ubequad	x		
# jump relative 22 ( 8 + 16) bytes forward points after end of file or to
# appended extra bytes like in http://safecolours.rigdenage.com/set(ms).zip/Protan(MS).pal
>>>>&16		ubelong	x		\b, extra bytes
>>>>>&-4	ubelong	>0		0x%8.8x
@


1.1.1.10
log
@2018-04-15  14:52  Christos Zoulas <christos@@zoulas.com>

	* release 5.33

2018-02-24  14:50  Christos Zoulas <christos@@zoulas.com>

	* extend the support for ${x?:} expansions for magic descriptions

2018-02-21  16:25  Christos Zoulas <christos@@zoulas.com>

	* add support for ${x?:} in mime types to handle
	  pie binaries.

2017-11-03   9:23  Christos Zoulas <christos@@zoulas.com>

	* add support for negative offsets (offsets from the end of file)

2017-09-26   8:22  Christos Zoulas <christos@@zoulas.com>

	* close the file on error when writing magic (Steve Grubb)

2017-09-24  12:02  Christos Zoulas <christos@@zoulas.com>

	* seccomp support (Paul Moore)

2017-09-02  11:53  Christos Zoulas <christos@@zoulas.com>

	* release 5.32

2017-08-28  16:37  Christos Zoulas <christos@@zoulas.com>

	* Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski)

2017-08-27  03:55  Christos Zoulas <christos@@zoulas.com>

	* Fix always true condition (Thomas Jarosch)

2017-05-24  17:30  Christos Zoulas <christos@@zoulas.com>

	* pickier parsing of numeric values in magic files.

2017-05-23  17:55  Christos Zoulas <christos@@zoulas.com>

	* PR/615 add magic_getflags()
@
text
@d3 1
a3 1
# $File: riff,v 1.33 2017/10/06 01:11:24 christos Exp $
a7 1
#	http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf
d73 3
a75 25
# Update: Joerg Jenderek
# URL: https://en.wikipedia.org/wiki/Resource_Interchange_File_Format
# Reference: http://worms2d.info/Palette_file
>8	string		PAL\ 		\b, palette
!:mime	application/x-riff
# color palette by Microsoft Corporation
!:ext	pal
# file size =  chunk size + 8 in most cases
>>4	ulelong+8	x		\b, %u bytes
# Extended PAL Format
>>12	string		plth		\b, extended
# Simple PAL Format
>>12	string		data		
# data chunk size = color entries * 4 + 4 + sometimes extra (4) appended bytes
>>>16	ulelong		x		\b, data size %u
# palVersion is always 0x0300
#>>>20	leshort		x		\b, version 0x%4.4x
# palNumEntries specifies the number of palette color entries
>>>22	uleshort	x		\b, %u entries
# after palPalEntry sized (number of color entries * 4 ) vector
>>>(22.s*4)	ubequad	x		
# jump relative 22 ( 8 + 16) bytes forward points after end of file or to
# appended extra bytes like in http://safecolours.rigdenage.com/set(ms).zip/Protan(MS).pal
>>>>&16		ubelong	x		\b, extra bytes
>>>>>&-4	ubelong	>0		0x%8.8x
@


1.1.1.10.2.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
# $File: riff,v 1.34 2019/04/19 00:42:27 christos Exp $
d7 1
a7 1
#	https://www.seanet.com/users/matts/riffmci/riffmci.htm
d76 1
a76 1
# Reference: https://worms2d.info/Palette_file
d253 1
a253 1
# AMV-type AVI file: https://wiki.multimedia.cx/index.php?title=AMV
d325 1
a325 1
# see EBU TECH 3306 https://tech.ebu.ch/docs/tech/tech3306-2009.pdf
@


1.1.1.11
log
@2019-05-14  22:26  Christos Zoulas <christos@@zoulas.com>

	* release 5.37

2019-05-09  22:27  Christos Zoulas <christos@@zoulas.com>

	* Make sure that continuation separators are printed
	  with -k within softmagic

2019-05-06  22:27  Christos Zoulas <christos@@zoulas.com>

	* Change SIGPIPE saving and restoring during compression to use
	  sigaction(2) instead of signal(3) and cache it. (Denys Vlasenko)
	* Cache stat(2) calls more to reduce number of calls (Denys Vlasenko)

2019-05-06  17:25  Christos Zoulas <christos@@zoulas.com>

	* PR/77: Handle --mime-type and -k correctly.

2019-05-03  15:26  Christos Zoulas <christos@@zoulas.com>

	* Switch decompression code to use vfork() because
	  tools like rpmdiff and rpmbuild call libmagic
	  with large process footprints (Denys Vlasenko)

2019-04-07  14:05  Christos Zoulas <christos@@zoulas.com>

	* PR/75: --enable-zlib, did not work.

2019-02-27  11:54  Christos Zoulas <christos@@zoulas.com>

	* Improve regex efficiency (Michael Schroeder) by:
		1. Prefixing regex searches with regular search
		   for keywords where possible
		2. Using memmem(3) where available
@
text
@d3 1
a3 1
# $File: riff,v 1.34 2019/04/19 00:42:27 christos Exp $
d7 1
a7 1
#	https://www.seanet.com/users/matts/riffmci/riffmci.htm
d76 1
a76 1
# Reference: https://worms2d.info/Palette_file
d253 1
a253 1
# AMV-type AVI file: https://wiki.multimedia.cx/index.php?title=AMV
d325 1
a325 1
# see EBU TECH 3306 https://tech.ebu.ch/docs/tech/tech3306-2009.pdf
@


1.1.1.12
log
@Import 5.39:

   * Remove unused subtype_mime (Steve Grubb)
   * Remove unused check in okstat (Steve Grubb)
   * Fix mime-type in elf binaries by making sure $x is set
   * Fix indirect negative offsets broken by OFFNEGATIVE
   * Fix GUID equality check
   * PR/165: Handle empty array and strings in JSON
   * PR/162: Add --exclude-quiet
   * Fix memory leak in ascmagic (Steve Grubb)
   * Fix string comparison length with ignore whitespace
   * Fix mingwin 64 compilation
   * PR/159: whitelist getpid needed for file_pipe2file()
   * Indicate negative offsets with a flag OFFNEGATIVE
     so that -0 works.
   * Introduce "offset" magic type that can be used to
     detect the file size, and bail on short files.
   * document DER better in the magic man page.
   * fix memory leaks (SonarQube)
   * rewrite confusing loops (SonarQube)
   * fix bogus test (SonarQube)
   * pass a sized buffer to file_fmttime() (SonarQube)
   * Don't allow * in printf formats, or the code itself (Christoph Biedl)
   * Introduce a printf output size checker to avoid DoS attacks
   * Avoid memory leak on error (oss-fuzz)
   * Check length of string on DER before derefercing and add new types
   * Add missing DER string (oss-fuzz)
   * Add missing DER types, and debugging
   * PR/140: Avoid abort with hand-crafted magic file (gockelhahn)
   * PR/139:  Avoid DoS in printf with hand-crafted magic file (gockelhahn)
   * PR/138: Avoid crash with hand-crafted magic file (gockelhahn)
   * PR/136: Fix static build by adding a libmagic.pc (Fabrice Fontaine)
   * add guid support native support via the "guid" type.
@
text
@d3 1
a3 1
# $File: riff,v 1.35 2020/06/05 17:15:03 christos Exp $
a122 5
# Update:	Joerg Jenderek
# lower case for Corel Draw version 8 Bidi
>8	string/c	cdr
# skip Corel CCX Clipart
>>8	string		!CDRXcont
d124 4
a127 21
>>>0	use     corel-draw
# URL:		http://fileformats.archiveteam.org/wiki/CCX_(Corel)
# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/c/ccx-corel.trid.xml 
>>8	string		=CDRXcont	\b, Corel Clipart
!:mime	application/x-corel-ccx
!:ext	ccx
# 3rd chunk data {Corel\040Binary\040Meta\040File}
#>>>20	string		x		\b, 3rd '%-s'
>>>4	ulelong+8	x		\b, %u bytes
# From:		Joerg Jenderek
# URL:		https://en.wikipedia.org/wiki/CorelDRAW
# Reference:	http://fileformats.archiveteam.org/wiki/CorelDRAW
# Picture templates created by newer software start with RIFF type CDT
>8	string		CDT
>>0	use		corel-draw
# Picture templates with version 4.4
>8	string		CDST
>>0	use		corel-draw
# pattern created by newer software start with RIFF type PAT
>8	string		PAT
>>0	use		corel-draw
d258 1
a258 81
# From:		Joerg Jenderek
# URL:		https://en.wikipedia.org/wiki/CorelDRAW
# Reference:	http://fileformats.archiveteam.org/wiki/CorelDRAW
# Note:		Since version 3 CorelDraw Pictures are RIFF based
# but data chunks remain proprietary.
# Since version 14 til 15 packed as "content/riffData.cdr" and
# since 16 "content/root.dat" in ZIP container
# TODO:		distinguish templates with version 12.5 from Designer illustration 12
#	display information of RIFF based Corel Draw pictures, templates and patterns
0	name   	corel-draw
# display second chunk for debugging
#>8	string		x		\b, [8]=%.8s
>0	string		x		\b, Corel Draw
#!:mime	image/x-coreldraw
!:mime	application/vnd.corel-draw
# used by newer pictures templates
>>8	string		CDT
# used by templates with newer versions since 16
>>>12	string		=fver		Picture template (root.dat)
!:ext	dat
# used by templates with older versions with vrsn tag
>>>12	string		!fver
# used by templates with older versions 14-15
>>>>11	string		>E		Picture template (riffData.cdr)
!:ext	cdr
# used by templates with older versions 11-13
>>>>11	string		<F		Picture template
!:ext	cdt/cdrt
# used by older templates with version 4.4
>>8	string		CDST		Picture template
!:ext	cdt
# used by templates with version 12.5
>>8	string		DESC		Picture template
!:ext	cdt
# used by newer patterns with version 22
>>8	string		PAT		Pattern
!:ext	dat
# remaining older templates, patterns, drawings
>>8	default		x
# pattern with old version 4.y
>>>26	ulelong		=0x0000206C	Pattern
!:ext	pat
# pattern with newer versions
>>>26	ulelong		=0x00000D2C	Pattern
!:ext	pat
# remaining older templates or pictures
>>>26	default		x
# used by older versions 5 - 15
>>>>12	string		=vrsn
# 4th chunk size unequal 282Ch only found for CDR
>>>>>26	ulelong		!0x0000282c	Picture
!:ext	cdr
>>>>>26	default		x		Picture or template
!:ext	cdr/cdt
# used by newer versions since 16
>>>>12	string		=fver		Picture (root.dat)
!:ext	dat
# version marked by 1 ASCII char: space~3, ... , F~15,  ... , N~22, ... R~22 template
>11	string		x		\b, version
>11	string		>\040		'%-.1s'
>0	use		corel-version
>4	ulelong+8	x		\b, %u bytes
#
#	display numeric version of RIFF based Corel after 3rd RIFF tag
0	name   	corel-version
# for debugging purpose; vrsn for short content; fver for 16 byte size
#>12	string		x		\b, TAG "%-4.4s"
# 1st data chunk length 2 implies short content version
>16	ulelong		2
# vrsn chunk short content interpreted by MajorVersion * 100 + MinorVersion
>>20	uleshort/100	x		%u
>>20	uleshort%100	>0		\b.%u
# for debugging purpose display next chunk like: DISP LIST
#>>22	string		x		\b, 4th "%-4.4s"
#>>26	ulelong		x		\b, 4th SIZE 0x%x
# for debugging purpose display 5th chunk like: LIST DISP ccmm osfp
#>>(26.l+30)	string	x		\b, 5th "%-4.4s"
# 1st data chunk length 10h implies 16 byte content with version info
>16	ulelong		0x10
>>34	ubyte		x		%u
>>>33	ubyte		>0		\b.%u
d295 3
a297 6
# Corel Draw Picture big endian not tested by real examples
#>8	string		CDRA		\b, Corel Draw Picture
#>8	string		CDR6		\b, Corel Draw Picture, version 6
>8	string		CDR
>>0	use     \^corel-draw

@


1.1.1.13
log
@2021-03-30  20:21  Christos Zoulas <christos@@zoulas.com>

	* release 5.40

2021-02-05  16:31  Christos Zoulas <christos@@zoulas.com>

	* PR/234: Add limit to the number of bytes to scan for encoding
	* PR/230: Fix /T (trim flag) for regex

2021-02-01  12:31  Christos Zoulas <christos@@zoulas.com>
	* PR/77: Trim trailing separator.

2020-12-17  15:44  Christos Zoulas <christos@@zoulas.com>

	* PR/211: Convert system read errors from corrupt ELF
	  files into human readable error messages

2020-12-08  16:24  Christos Zoulas <christos@@zoulas.com>

	* fix multithreaded decompression file descriptor issue
	  by using close-on-exec (Denys Vlasenko)

2020-06-27  11:58  Christos Zoulas <christos@@zoulas.com>

	* Exclude surrogate pairs from utf-8 detection (Michael Liu)

2020-06-25  12:53  Christos Zoulas <christos@@zoulas.com>

	* Include # to the list of ignored format chars (Werner Fink)
@
text
@d3 1
a3 1
# $File: riff,v 1.42 2020/07/17 19:18:56 christos Exp $
a8 1
#	https://www.iana.org/assignments/wave-avi-codec-registry/wave-avi-codec-registry.xml
d13 1
a13 1
>0	leshort		0x01		\b, Microsoft PCM
d16 10
a25 103
>0	leshort		0x02		\b, Microsoft ADPCM
>0	leshort		0x03		\b, IEEE Float
>0	leshort		0x04		\b, Compaq VSELP
>0	leshort		0x05		\b, IBM CVSD
>0	leshort		0x06		\b, ITU G.711 A-law
>0	leshort		0x07		\b, ITU G.711 mu-law
>0	leshort		0x08		\b, Microsoft DTS
>0	leshort		0x10		\b, OKI ADPCM
>0	leshort		0x11		\b, IMA ADPCM
>0	leshort		0x12		\b, MediaSpace ADPCM
>0	leshort		0x13		\b, Sierra ADPCM
>0	leshort		0x14		\b, ITU G.723 ADPCM (Yamaha)
>0	leshort		0x15		\b, DSP Solutions DIGISTD
>0	leshort		0x16		\b, DSP Solutions DIGIFIX
>0	leshort		0x17		\b, Dialogic OKI ADPCM
>0	leshort		0x18		\b, MediaVision ADPCM
>0	leshort		0x19		\b, HP CU
>0	leshort		0x20		\b, Yamaha ADPCM
>0	leshort		0x21		\b, Speech Compression SONARC
>0	leshort		0x22		\b, DSP Group True Speech
>0	leshort		0x23		\b, Echo Speech EchoSC1
>0	leshort		0x24		\b, AudioFile AF36
>0	leshort		0x25		\b, APTX
>0	leshort		0x26		\b, AudioFile AF10
>0	leshort		0x27		\b, Prosody 1612
>0	leshort		0x28		\b, LRC
>0	leshort		0x30		\b, Dolby AC2
>0	leshort		0x31		\b, GSM 6.10
>0	leshort		0x32		\b, MSN Audio
>0	leshort		0x33		\b, Antex ADPCME
>0	leshort		0x34		\b, Control Res VQLPC
>0	leshort		0x35		\b, Digireal
>0	leshort		0x36		\b, DigiADPCM
>0	leshort		0x37		\b, Control Res CR10
>0	leshort		0x38		\b, NMS VBXADPCM
>0	leshort		0x39		\b, Roland RDAC
>0	leshort		0x3A		\b, Echo Speech EchoSC3
>0	leshort		0x3B		\b, Rockwell ADPCM
>0	leshort		0x3C		\b, Rockwell Digitalk
>0	leshort		0x3D		\b, Xebec
>0	leshort		0x40		\b, ITU G.721 ADPCM
>0	leshort		0x41		\b, ITU G.728 CELP
>0	leshort		0x42		\b, MSG723
>0	leshort		0x50		\b, MPEG
>0	leshort		0x52		\b, RT24
>0	leshort		0x53		\b, PAC
>0	leshort		0x55		\b, MPEG Layer 3
>0	leshort		0x59		\b, Lucent G.723
>0	leshort		0x60		\b, Cirrus
>0	leshort		0x61		\b, ESPCM
>0	leshort		0x62		\b, Voxware
>0	leshort		0x63		\b, Canopus Atrac
>0	leshort		0x64		\b, ITU G.726 ADPCM
>0	leshort		0x65		\b, ITU G.722 ADPCM
>0	leshort		0x66		\b, DSAT
>0	leshort		0x67		\b, DSAT Display
>0	leshort		0x69		\b, Voxware Byte Aligned
>0	leshort		0x70		\b, Voxware AC8
>0	leshort		0x71		\b, Voxware AC10
>0	leshort		0x72		\b, Voxware AC16
>0	leshort		0x73		\b, Voxware AC20
>0	leshort		0x74		\b, Voxware MetaVoice
>0	leshort		0x75		\b, Voxware MetaSound
>0	leshort		0x76		\b, Voxware RT29HW
>0	leshort		0x77		\b, Voxware VR12
>0	leshort		0x78		\b, Voxware VR18
>0	leshort		0x79		\b, Voxware TQ40
>0	leshort		0x80		\b, Softsound
>0	leshort		0x81		\b, Voxware TQ60
>0	leshort		0x82		\b, MSRT24
>0	leshort		0x83		\b, ITU G.729A
>0	leshort		0x84		\b, MVI MV12
>0	leshort		0x85		\b, DF G.726
>0	leshort		0x86		\b, DF GSM610
>0	leshort		0x88		\b, ISIAudio
>0	leshort		0x89		\b, Onlive
>0	leshort		0x91		\b, SBC24
>0	leshort		0x92		\b, Dolby AC3 S/PDIF
>0	leshort		0x97		\b, ZyXEL ADPCM
>0	leshort		0x98		\b, Philips LPCBB
>0	leshort		0x99		\b, Packed
>0	leshort		0x100		\b, Rhetorex ADPCM
>0	leshort		0x101		\b, BeCubed Software IRAT
>0	leshort		0x111		\b, Vivo G.723
>0	leshort		0x112		\b, Vivo Siren
>0	leshort		0x123		\b, Digital G.723
>0	leshort		0x200		\b, Creative ADPCM
>0	leshort		0x202		\b, Creative FastSpeech8
>0	leshort		0x203		\b, Creative FastSpeech10
>0	leshort		0x220		\b, Quarterdeck
>0	leshort		0x300		\b, FM Towns Snd
>0	leshort		0x400		\b, BTV Digital
>0	leshort		0x680		\b, VME VMPCM
>0	leshort		0x1000		\b, OLIGSM
>0	leshort		0x1001		\b, OLIADPCM
>0	leshort		0x1002		\b, OLICELP
>0	leshort		0x1003		\b, OLISBC
>0	leshort		0x1004		\b, OLIOPR
>0	leshort		0x1100		\b, LH Codec
>0	leshort		0x1400		\b, Norris
>0	leshort		0x1401		\b, ISIAudio
>0	leshort		0x1500		\b, Soundspace Music Compression
>0	leshort		0x2000		\b, AC3 DVM
d37 1
a37 1
>>4 lelong  >15
a76 1
# WAVE/AVI codec registry: https://www.iana.org/assignments/wave-avi-codec-registry/wave-avi-codec-registry.xml
a99 1
# URL: http://fileformats.archiveteam.org/wiki/RDIB
a100 1
!:ext	rdi/dib
a112 1
# URL:	http://fileformats.archiveteam.org/wiki/RIFF_MIDI
a113 4
# http://extension.nirsoft.net/rmi
!:mime	audio/mid
#!:mime	audio/x-rmid
!:ext	rmi
a114 1
# URL:	http://fileformats.archiveteam.org/wiki/RIFF_Multimedia_Movie
a115 2
!:mime	video/x-mmm
!:ext	mmm
a117 1
#!:mime	audio/x-rmp3
a118 1
# URL:		http://fileformats.archiveteam.org/wiki/WAV
a119 1
#!:mime	audio/vnd.wave
a120 3
# https://www.macdisk.com/macsigen.php
#!:apple	????WAVE
!:ext	wav/wave
a149 11
# From:		Joerg Jenderek
# URL:		https://en.wikipedia.org/wiki/Corel_Designer
# Reference:	http://fileformats.archiveteam.org/wiki/Corel_Designer
>8	string		DES
>>8	string		!DESC
>>>0	use		corel-des
# Corel Draw templates with version 12.5 or Corel Designer illustration 12
>>8	string		=DESC
# MORE TESTS NEEDED HERE!
#>>>0	use		corel-des
#>>>0	use		corel-draw
a151 1
# Reference:	http://fileformats.archiveteam.org/wiki/AVI
a152 1
# https://reposcope.com/mimetype/video/x-msvideo
a153 3
# https://www.iana.org/assignments/wave-avi-codec-registry/wave-avi-codec-registry.xml
#!:mime	video/vnd.avi
!:ext	avi/divx
a216 11
>>>>>>>(104.l+132)      string/c        anim    Intel RDX
>>>>>>>(104.l+132)      string/c        aur2    AuraVision Aura 2
>>>>>>>(104.l+132)      string/c        aura    AuraVision Aura
>>>>>>>(104.l+132)      string/c        bt20    Brooktree MediaStream
>>>>>>>(104.l+132)      string/c        btcv    Brooktree Composite Video
>>>>>>>(104.l+132)      string/c        cc12    Intel YUV12
>>>>>>>(104.l+132)      string/c        cdvc    Canopus DV
>>>>>>>(104.l+132)      string/c        cham    Winnov Caviara Cham
>>>>>>>(104.l+132)      string/c        cljr    Proprietary YUV 4 pixels
>>>>>>>(104.l+132)      string/c        cmyk    Common Data Format in Printing
>>>>>>>(104.l+132)      string/c        cpla    Weitek 4:2:0 YUV Planar
a217 19
>>>>>>>(104.l+132)      string/c        cwlt    Microsoft Color WLT DIB
>>>>>>>(104.l+132)      string/c        cyuv    Creative Labs YUV
>>>>>>>(104.l+132)      string/c        d261    H.261
>>>>>>>(104.l+132)      string/c        d263    H.263
>>>>>>>(104.l+132)      string/c        duck    TrueMotion 1.0
>>>>>>>(104.l+132)      string/c        dve2    DVE-2 Videoconferencing
>>>>>>>(104.l+132)      string/c        fljp    Field Encoded Motion JPEG
>>>>>>>(104.l+132)      string/c        fvf1    Fractal Video Frame
>>>>>>>(104.l+132)      string/c        gwlt    Microsoft Greyscale WLT DIB
>>>>>>>(104.l+132)      string/c        h260    H.260
>>>>>>>(104.l+132)      string/c        h261    H.261
>>>>>>>(104.l+132)      string/c        h262    H.262
>>>>>>>(104.l+132)      string/c        h263    H.263
>>>>>>>(104.l+132)      string/c        h264    H.264
>>>>>>>(104.l+132)      string/c        h265    H.265
>>>>>>>(104.l+132)      string/c        h266    H.266
>>>>>>>(104.l+132)      string/c        h267    H.267
>>>>>>>(104.l+132)      string/c        h268    H.268
>>>>>>>(104.l+132)      string/c        h269    H.269
d219 3
a221 29
>>>>>>>(104.l+132)      string/c        i420    Intel Indeo 4
>>>>>>>(104.l+132)      string/c        ian     Intel RDX
>>>>>>>(104.l+132)      string/c        iclb    CellB Videoconferencing Codec
>>>>>>>(104.l+132)      string/c        ilvc    Intel Layered Video
>>>>>>>(104.l+132)      string/c        ilvr    ITU-T H.263+
>>>>>>>(104.l+132)      string/c        iraw    Intel YUV Uncompressed
>>>>>>>(104.l+132)      string/c        iv30    Intel Indeo 3
>>>>>>>(104.l+132)      string/c        iv31    Intel Indeo 3.1
>>>>>>>(104.l+132)      string/c        iv32    Intel Indeo 3.2
>>>>>>>(104.l+132)      string/c        iv33    Intel Indeo 3.3
>>>>>>>(104.l+132)      string/c        iv34    Intel Indeo 3.4
>>>>>>>(104.l+132)      string/c        iv35    Intel Indeo 3.5
>>>>>>>(104.l+132)      string/c        iv36    Intel Indeo 3.6
>>>>>>>(104.l+132)      string/c        iv37    Intel Indeo 3.7
>>>>>>>(104.l+132)      string/c        iv38    Intel Indeo 3.8
>>>>>>>(104.l+132)      string/c        iv39    Intel Indeo 3.9
>>>>>>>(104.l+132)      string/c        iv40    Intel Indeo 4.0
>>>>>>>(104.l+132)      string/c        iv41    Intel Indeo 4.1
>>>>>>>(104.l+132)      string/c        iv42    Intel Indeo 4.2
>>>>>>>(104.l+132)      string/c        iv43    Intel Indeo 4.3
>>>>>>>(104.l+132)      string/c        iv44    Intel Indeo 4.4
>>>>>>>(104.l+132)      string/c        iv45    Intel Indeo 4.5
>>>>>>>(104.l+132)      string/c        iv46    Intel Indeo 4.6
>>>>>>>(104.l+132)      string/c        iv47    Intel Indeo 4.7
>>>>>>>(104.l+132)      string/c        iv48    Intel Indeo 4.8
>>>>>>>(104.l+132)      string/c        iv49    Intel Indeo 4.9
>>>>>>>(104.l+132)      string/c        iv50    Intel Indeo 5.0
>>>>>>>(104.l+132)      string/c        mpeg    MPEG 1 Video Frame
>>>>>>>(104.l+132)      string/c        mjpg    Motion JPEG
a223 56
>>>>>>>(104.l+132)      string/c        mrca    MR Codec
>>>>>>>(104.l+132)      string/c        mrle    Run Length Encoding
>>>>>>>(104.l+132)      string/c        msvc    Microsoft Video 1
>>>>>>>(104.l+132)      string/c        phmo    Photomotion
>>>>>>>(104.l+132)      string/c        qpeq    QPEG 1.1 Format Video
>>>>>>>(104.l+132)      string/c        rgbt    RGBT
>>>>>>>(104.l+132)      string/c        rle4    Run Length Encoded 4
>>>>>>>(104.l+132)      string/c        rle8    Run Length Encoded 8
>>>>>>>(104.l+132)      string/c        rt21    Intel Indeo 2.1
>>>>>>>(104.l+132)      string/c        rvx     Intel RDX
>>>>>>>(104.l+132)      string/c        sdcc    Sun Digital Camera Codec
>>>>>>>(104.l+132)      string/c        sfmc    Crystal Net SFM Codec
>>>>>>>(104.l+132)      string/c        smsc    SMSC
>>>>>>>(104.l+132)      string/c        smsd    SMSD
>>>>>>>(104.l+132)      string/c        splc    Splash Studios ACM Audio Codec
>>>>>>>(104.l+132)      string/c        sqz2    Microsoft VXtreme Video Codec
>>>>>>>(104.l+132)      string/c        sv10    Sorenson Video R1
>>>>>>>(104.l+132)      string/c        tlms    TeraLogic Motion Intraframe Codec A
>>>>>>>(104.l+132)      string/c        tlst    TeraLogic Motion Intraframe Codec B
>>>>>>>(104.l+132)      string/c        tm20    TrueMotion 2.0
>>>>>>>(104.l+132)      string/c        tmic    TeraLogic Motion Intraframe Codec 2
>>>>>>>(104.l+132)      string/c        tmot    TrueMotion Video Compression
>>>>>>>(104.l+132)      string/c        tr20    TrueMotion RT 2.0
>>>>>>>(104.l+132)      string/c        ulti    Ultimotion
>>>>>>>(104.l+132)      string/c        uyvy    UYVY 4:2:2 byte ordering
>>>>>>>(104.l+132)      string/c        v422    24-bit YUV 4:2:2 format
>>>>>>>(104.l+132)      string/c        v655    16-bit YUV 4:2:2 format
>>>>>>>(104.l+132)      string/c        vcr1    ATI VCR 1.0
>>>>>>>(104.l+132)      string/c        vcr2    ATI VCR 2.0
>>>>>>>(104.l+132)      string/c        vcr3    ATI VCR 3.0
>>>>>>>(104.l+132)      string/c        vcr4    ATI VCR 4.0
>>>>>>>(104.l+132)      string/c        vcr5    ATI VCR 5.0
>>>>>>>(104.l+132)      string/c        vcr6    ATI VCR 6.0
>>>>>>>(104.l+132)      string/c        vcr7    ATI VCR 7.0
>>>>>>>(104.l+132)      string/c        vcr8    ATI VCR 8.0
>>>>>>>(104.l+132)      string/c        vcr9    ATI VCR 9.0
>>>>>>>(104.l+132)      string/c        vdct    Video Maker Pro DIB
>>>>>>>(104.l+132)      string/c        vids    YUV 4:2:2 CCIR 601 for V422
>>>>>>>(104.l+132)      string/c        vivo    Vivo H.263
>>>>>>>(104.l+132)      string/c        vixl    VIXL
>>>>>>>(104.l+132)      string/c        vlv1    VLCAP.DRV
>>>>>>>(104.l+132)      string/c        wbvc    W9960
>>>>>>>(104.l+132)      string/c        x263    mmioFOURCC('X','2','6','3')
>>>>>>>(104.l+132)      string/c        xlv0    XL Video Decoder
>>>>>>>(104.l+132)      string/c        y211    YUV 2:1:1 Packed
>>>>>>>(104.l+132)      string/c        y411    YUV 4:1:1 Packed
>>>>>>>(104.l+132)      string/c        y41b    YUV 4:1:1 Planar
>>>>>>>(104.l+132)      string/c        y41p    PC1 4:1:1
>>>>>>>(104.l+132)      string/c        y41t    PC1 4:1:1 with transparency
>>>>>>>(104.l+132)      string/c        y42b    YUV 4:2:2 Planar
>>>>>>>(104.l+132)      string/c        y42t    PC1 4:2:2 with transparency
>>>>>>>(104.l+132)      string/c        yc12    Intel YUV12 Codec
>>>>>>>(104.l+132)      string/c        yuv8    Winnov Caviar YUV8
>>>>>>>(104.l+132)      string/c        yuv9    YUV9
>>>>>>>(104.l+132)      string/c        yuy2    YUY2 4:2:2 byte ordering packed
>>>>>>>(104.l+132)      string/c        yuyv    BI_YUYV, Canopus
d225 1
a267 11
# From:		Joerg Jenderek
# URL:		http://fileformats.archiveteam.org/wiki/VDR_(VirtualDub)
# Reference:	http://sourceforge.net/projects/virtualdub/files/virtualdub-win/
#		1.10.4.35491/VirtualDub-1.10.4-src.7z/src/vdremote/Main.cpp
# VirtualDub link handler
>8	string		VDRM		\b, VirtualDub link
!:mime	video/x-vdr
!:ext	vdr
>>12	string		PATH		\b, PATH
# remote-path to video file
>>16	pstring/l	x		%s
a268 3
# Update:	Joerg Jenderek
# URL:		http://fileformats.archiveteam.org/wiki/Windows_Animated_Cursor
# Reference:	https://www.gdgsoft.com/anituner/help/aniformat.htm
a269 10
!:mime	application/x-navi-animation
# http://extension.nirsoft.net/ani
#!:mime	image/ani
!:ext	ani
# INAM tag followed by length of title
>>24	string		INAM
>>>28	pstring/l	x		"%s"
# IART tag followed by length of author
>>>(28.l+32)	ubelong	0x49415254
>>>>&0	pstring/l	x		%s
d271 1
a271 4
# URL:	http://fileformats.archiveteam.org/wiki/SoundFont_2.0
>8	string		sfbk		\b, SoundFont/Bank
!:mime	audio/x-sfbk
!:ext	sf2
a272 1
# URL:	http://file.fyicenter.com/17_Video_.DAT_File_Extension_for_VCD_Files.html
a273 3
!:mime	video/x-cdxa
!:ext	mpg/dat
# URL:	http://fileformats.archiveteam.org/wiki/4X_IMA_ADPCM
a274 2
!:mime	video/x-4xmv
!:ext	4xm/4xa
a276 5
# http://fileformats.archiveteam.org/wiki/MTV_Video_(.AMV)
!:mime	video/x-amv
!:ext	amv
#!:ext	amv/mtv
# URL:	http://fileformats.archiveteam.org/wiki/WebP
a278 1
!:ext	webp
a280 11
# URL:		http://fileformats.archiveteam.org/wiki/RIFF_MIDS
>8      string          MIDS            \b, MIDI Stream
!:mime	audio/x-mids
!:ext	mds
# From:		Joerg Jenderek
# URL:		http://mark0.net/soft-trid-e.html
# Reference:	http://fileformats.archiveteam.org/wiki/Trd_(TRID)
>8      string          TRID            \b, TrID defs package
!:mime	application/x-trid-trd
!:ext	trd
# From:		Joerg Jenderek
a360 30
#	display information of RIFF based Corel Design formats
0	name   	corel-des
# display second chunk for debugging
#>8	string		x		\b, [8]=%.8s
>12	string		x		\b, Corel DESIGNER
!:mime	image/x-corel-des
#!:mime	application/x-vnd.corel.designer.document
# used by Corel Designer with newer versions since 16
>12	string		=fver		graphics (root.dat)
!:ext	dat
# used by Corel Designer templates with older versions with vrsn tag
>12	string		!fver
# used by Corel Designer with versions 14-15
>>11	string		>D		graphics (riffData.cdr)
!:ext	cdr
# used by Corel Designer with versions 10-12
>>11	string		<E		graphics
!:ext	des
# version indicated by last ASCII char of second chunk tag
>11	string		x		\b, version '%-.1s'
# but vrsn short content is not always version indicator
# exceptions: 'A'~11.4 'B'~12 'C'~12.5
>11	string		>D
>>0	use		corel-version
# for debugging purpose display next chunk like: DISP LIST
#>>22	string		x		\b, 4th "%-4.4s"
#>>26	ulelong		x		\b, 4th SIZE 0x%x
# for debugging purpose display 5th chunk like: LIST osfp
#>>(26.l+30)	string	x		\b, 5th "%-4.4s"
>4	ulelong+8	x		\b, %u bytes
@


1.1.1.14
log
@Import file-5.43+; last was file-5.40

2022-09-20  17:12  Christos Zoulas <christos@@zoulas.com>

	* fixed various clustefuzz issues

2022-09-19  15:54  Christos Zoulas <christos@@zoulas.com>

	* Fix error detection for decompression code (Vincent Mihalkovic)

2022-09-15  13:50  Christos Zoulas <christos@@zoulas.com>

	* Add MAGIC_NO_COMPRESS_FORK and use it to produce a more
	  meaningful error message if we are sandboxing.

2022-09-15  10:45  Christos Zoulas <christos@@zoulas.com>

	* Add built-in lzip decompression support (Michal Gorny)

2022-09-14  10:35  Christos Zoulas <christos@@zoulas.com>

	* Add built-in zstd decompression support (Martin Rodriguez Reboredo)

2022-09-13  14:55  Christos Zoulas <christos@@zoulas.com>

	* release 5.43

2022-09-10   9:17  Christos Zoulas <christos@@zoulas.com>

	* Add octal indirect magic (Michal Gorny)

2022-08-17  11:43  Christos Zoulas <christos@@zoulas.com>

	* PR/374: avoid infinite loop in non-wide code (piru)
	* PR/373: Obey MAGIC_CONTINUE with multiple magic files (vismarli)

2022-07-26  11:10  Christos Zoulas <christos@@zoulas.com>

	* Fix bug with large flist (Florian Weimer)

2022-07-07  13:21  Christos Zoulas <christos@@zoulas.com>

        * PR/364: Detect non-nul-terminated core filenames from QEMU
	  (mam-ableton)

2022-07-04  15:45  Christos Zoulas <christos@@zoulas.com>

	* PR/359: Add support for http://ndjson.org/ (darose)
	* PR/362: Fix wide printing (ro-ee)
	* PR/358: Fix width for -f - (jpalus)
	* PR/356: Fix JSON constant parsing (davewhite)

2022-06-10   9:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.42

2022-05-31  14:50   Christos Zoulas <christos@@zoulas.com>

	* PR/348: add missing cases to prevent file from aborting on
	  random magic files.

2022-05-27  21:05   Christos Zoulas <christos@@zoulas.com>

	* PR/351: octalify filenames when not raw before printing.

2022-04-18  17:51   Christos Zoulas <christos@@zoulas.com>

	* fix regex cacheing bug (Dirk Mueller)
	* merge file_regcomp and file_regerror() to simplify the code
	  and reduce memory requirements for storing regexes (Dirk Mueller)

2022-03-19  12:56   Christos Zoulas <christos@@zoulas.com>

	* cache regex (Dirk Mueller)
	* detect filesystem full by flushing output (Dirk Mueller)

2021-11-19  12:36   Christos Zoulas <christos@@zoulas.com>

	* implement running decompressor programs using
	  posix_spawnp(2) instead of vfork(2)

2021-10-24  11:51   Christos Zoulas <christos@@zoulas.com>

	* Add support for msdos dates and times

2021-10-20   9:55   Christos Zoulas <christos@@zoulas.com>

	* use the system byte swapping functions if available (Werner Fink)

2021-10-18  11:57  Christos Zoulas <christos@@zoulas.com>

	* release 5.41

2021-09-23  03:51  Christos Zoulas <christos@@zoulas.com>

	* Avinash Sonawane: Fix tzname detection

2021-09-03  09:17  Christos Zoulas <christos@@zoulas.com>

	* Fix relationship tests with "search" magic, don't short circuit
	  logic

2021-07-13  01:06  Christos Zoulas <christos@@zoulas.com>

	* Fix memory leak in compile mode

2021-07-01  03:51  Christos Zoulas <christos@@zoulas.com>

	* PR/272: kiefermat: Only set returnval = 1 when we printed something
	  (in all cases print or !print). This simplifies the logic and fixes
	  the issue in the PR with -k and --mime-type there was no continuation
	  printed before the default case.

2021-06-30  13:07  Christos Zoulas <christos@@zoulas.com>

	* PR/270: Don't translate unprintable characters in %s magic formats
	  when -r
	* PR/269: Avoid undefined behavior with clang (adding offset to NULL)

2021-05-09  18:38  Christos Zoulas <christos@@zoulas.com>

	* Add a new flag (f) that requires that the match is a full word,
	   not a partial word match.
	* Add varint types (unused)

2021-04-19  17:17  Christos Zoulas <christos@@zoulas.com>

	* PR/256: mutableVoid: If the file is less than 3 bytes, use the file
	  length to determine type
	* PR/259: aleksandr.v.novichkov: mime printing through indirect magic
	  is not taken into account, use match directly so that it does.

2021-04-04  17:02  Christos Zoulas <christos@@zoulas.com>

	* count the total bytes found not the total byte positions
	  in order to determine encoding (Anatol Belski)
@
text
@d3 1
a3 1
# $File: riff,v 1.45 2022/07/24 23:47:49 christos Exp $
a163 58
# RecorderGear TR500 call recorder digits (BCD)
0	name	tr500-call-recorder-digits
>0	byte&0xF0	0x00	\b0
>0	byte&0xF0	0x10	\b1
>0	byte&0xF0	0x20	\b2
>0	byte&0xF0	0x30	\b3
>0	byte&0xF0	0x40	\b4
>0	byte&0xF0	0x50	\b5
>0	byte&0xF0	0x60	\b6
>0	byte&0xF0	0x70	\b7
>0	byte&0xF0	0x80	\b8
>0	byte&0xF0	0x90	\b9
>0	byte&0xF0	0xb0	\b*
>0	byte&0xF0	0xc0	\b#
>0	byte&0x0F	0	\b0
>0	byte&0x0F	1	\b1
>0	byte&0x0F	2	\b2
>0	byte&0x0F	3	\b3
>0	byte&0x0F	4	\b4
>0	byte&0x0F	5	\b5
>0	byte&0x0F	6	\b6
>0	byte&0x0F	7	\b7
>0	byte&0x0F	8	\b8
>0	byte&0x0F	9	\b9
>0	byte&0x0F	0xb	\b*
>0	byte&0x0F	0xc	\b#

# TR500 call recorder extended header
# From: David Korth <gerbilsoft@@gerbilsoft.com>
# Contains dialed/incoming phone number and timestamp.
# TODO: Verify byte 15.
0	name	tr500-call-recorder-header
>15	byte	2	(outgoing call: 
>15	byte	4	(incoming call: 
>1	byte	0xFF	\bno number
>1	byte	!0xFF
>>1	use	tr500-call-recorder-digits
>>2	byte	!0xFF
>>>2	use	tr500-call-recorder-digits
>>3	byte	!0xFF
>>>3	use	tr500-call-recorder-digits
>>4	byte	!0xFF
>>>4	use	tr500-call-recorder-digits
>>5	byte	!0xFF
>>>5	use	tr500-call-recorder-digits
>>6	byte	!0xFF
>>>6	use	tr500-call-recorder-digits
>>7	byte	!0xFF
>>>7	use	tr500-call-recorder-digits
>>8	byte	!0xFF
>>>8	use	tr500-call-recorder-digits
>9	byte	x	\b, 20%02x
>10	byte	x	\b/%02x
>11	byte	x	\b/%02x
>12	byte	x	%02x
>13	byte	x	\b:%02x
>14	byte	x	\b:%02x)

d185 1
a185 1
#>>>20	leshort		x		\b, version %#4.4x
d193 1
a193 1
>>>>>&-4	ubelong	>0		%#8.8x
a233 5
# TR500 call recorder extended header
>>16	ulelong		0x1E4
>>>20	leshort		0x11
>>>>256	byte		4
>>>>>256 use		tr500-call-recorder-header
a272 21
# From:		Joerg Jenderek
# URL:		http://fileformats.archiveteam.org/wiki/MIDI_Instrument_Definition_File
# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/i/idf.trid.xml
#		ftp://curscott.servebeer.com/Download/Apps/_Microsoft/
#  		Visual%20Studio%206.0%20Professional%20MSDN/
#		SAMPLES/VC98/SDK/GRAPHICS/AUDIO/IDFEDIT/GLOBALS.H 
# Note:		called "MIDI Instrument Definition File" by TrID
>8	string		IDF\ LIST	\b, MIDI Instrument Definition File
!:mime	audio/x-idf
!:ext	idf
# 3rd chunk size like: 254 284 286 670
#>>0x10	ulelong		x		\b, 3th SIZE %u
# for debugging purpose display next chunk like: MMAPhdr
#>>0x14	string		x		\b, 4th "%-8.8s"
#>>0x1C	ulelong		x		\b, 4th SIZE 0x%x
# probably MIDI instrument name like: "Universal-MIDI-Instrument" "instrument name" "General MIDI"
>>0x30	string		x		"%s"
# look for inst TAG
>>0x31	search/256	inst		by
# probably manufacture name like: "Unspecified Company" "NVidia Corporation"
>>>&0x24	string	x		"%s"
d489 1
a489 1
##>>>>>>>>(92.l+180)      leshort x       (%#.4x)
d501 1
a501 1
##>>>>>>>>(92.l+188)      leshort x       (%#.4x)
d642 1
a642 1
#>>26	ulelong		x		\b, 4th SIZE %#x
d675 1
a675 1
#>>26	ulelong		x		\b, 4th SIZE %#x
a678 1

@


1.1.1.1.2.1
log
@file riff was added on branch jym-xensuspend on 2009-05-13 18:51:59 +0000
@
text
@d1 225
@


1.1.1.1.2.2
log
@Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
@
text
@a0 225

#------------------------------------------------------------------------------
# riff:  file(1) magic for RIFF format
# See
#
#	http://www.seanet.com/users/matts/riffmci/riffmci.htm
#
# AVI section extended by Patrik Rådman <patrik+file-magic@@iki.fi>
#
0	string		RIFF		RIFF (little-endian) data
# RIFF Palette format
>8	string		PAL		\b, palette
>>16	leshort		x		\b, version %d
>>18	leshort		x		\b, %d entries
# RIFF Device Independent Bitmap format
>8	string		RDIB		\b, device-independent bitmap
>>16	string		BM		
>>>30	leshort		12		\b, OS/2 1.x format
>>>>34	leshort		x		\b, %d x
>>>>36	leshort		x		%d
>>>30	leshort		64		\b, OS/2 2.x format
>>>>34	leshort		x		\b, %d x
>>>>36	leshort		x		%d
>>>30	leshort		40		\b, Windows 3.x format
>>>>34	lelong		x		\b, %d x
>>>>38	lelong		x		%d x
>>>>44	leshort		x		%d
# RIFF MIDI format
>8	string		RMID		\b, MIDI
# RIFF Multimedia Movie File format
>8	string		RMMP		\b, multimedia movie
# RIFF wrapper for MP3
>8	string		RMP3		\b, MPEG Layer 3 audio
# Microsoft WAVE format (*.wav)
>8	string		WAVE		\b, WAVE audio
!:mime	audio/x-wav
>>20	leshort		1		\b, Microsoft PCM
>>>34	leshort		>0		\b, %d bit
>>20	leshort		2		\b, Microsoft ADPCM
>>20	leshort		6		\b, ITU G.711 A-law
>>20	leshort		7		\b, ITU G.711 mu-law
>>20	leshort		17		\b, IMA ADPCM
>>20	leshort		20		\b, ITU G.723 ADPCM (Yamaha)
>>20	leshort		49		\b, GSM 6.10
>>20	leshort		64		\b, ITU G.721 ADPCM
>>20	leshort		80		\b, MPEG
>>20	leshort		85		\b, MPEG Layer 3
>>22	leshort		=1		\b, mono
>>22	leshort		=2		\b, stereo
>>22	leshort		>2		\b, %d channels
>>24	lelong		>0		%d Hz
# Corel Draw Picture
>8	string		CDRA		\b, Corel Draw Picture
!:mime	image/x-coreldraw
# AVI == Audio Video Interleave
>8	string		AVI\040		\b, AVI
!:mime	video/x-msvideo
>>12    string          LIST
>>>20   string          hdrlavih
>>>>&36 lelong          x               \b, %lu x
>>>>&40 lelong          x               %lu,
>>>>&4  lelong          >1000000        <1 fps,
>>>>&4  lelong          1000000         1.00 fps,
>>>>&4  lelong          500000          2.00 fps,
>>>>&4  lelong          333333          3.00 fps,
>>>>&4  lelong          250000          4.00 fps,
>>>>&4  lelong          200000          5.00 fps,
>>>>&4  lelong          166667          6.00 fps,
>>>>&4  lelong          142857          7.00 fps,
>>>>&4  lelong          125000          8.00 fps,
>>>>&4  lelong          111111          9.00 fps,
>>>>&4  lelong          100000          10.00 fps,
# ]9.9,10.1[
>>>>&4  lelong          <101010
>>>>>&-4        lelong  >99010
>>>>>>&-4       lelong  !100000         ~10 fps,
>>>>&4  lelong          83333           12.00 fps,
# ]11.9,12.1[
>>>>&4  lelong          <84034
>>>>>&-4        lelong  >82645
>>>>>>&-4       lelong  !83333          ~12 fps,
>>>>&4  lelong          66667           15.00 fps,
# ]14.9,15.1[
>>>>&4  lelong          <67114
>>>>>&-4        lelong  >66225
>>>>>>&-4       lelong  !66667          ~15 fps,
>>>>&4  lelong          50000           20.00 fps,
>>>>&4  lelong          41708           23.98 fps,
>>>>&4  lelong          41667           24.00 fps,
# ]23.9,24.1[
>>>>&4  lelong          <41841
>>>>>&-4        lelong  >41494
>>>>>>&-4       lelong  !41708
>>>>>>>&-4      lelong  !41667          ~24 fps,
>>>>&4  lelong          40000           25.00 fps,
# ]24.9,25.1[
>>>>&4  lelong          <40161
>>>>>&-4        lelong  >39841
>>>>>>&-4       lelong  !40000          ~25 fps,
>>>>&4  lelong          33367           29.97 fps,
>>>>&4  lelong          33333           30.00 fps,
# ]29.9,30.1[
>>>>&4  lelong          <33445
>>>>>&-4        lelong  >33223
>>>>>>&-4       lelong  !33367
>>>>>>>&-4      lelong  !33333          ~30 fps,
>>>>&4  lelong          <32224          >30 fps,
##>>>>&4  lelong          x               (%lu)
##>>>>&20 lelong          x               %lu frames,
# Note: The tests below assume that the AVI has 1 or 2 streams,
#       "vids" optionally followed by "auds".
#       (Should cover 99.9% of all AVIs.)
# assuming avih length = 56
>>>88   string  LIST
>>>>96  string  strlstrh
>>>>>108        string  vids    video:
>>>>>>&0        lelong  0               uncompressed
# skip past vids strh
>>>>>>(104.l+108)       string  strf
>>>>>>>(104.l+132)      lelong          1       RLE 8bpp
>>>>>>>(104.l+132)      string/c        cvid    Cinepak
>>>>>>>(104.l+132)      string/c        i263    Intel I.263
>>>>>>>(104.l+132)      string/c        iv32    Indeo 3.2
>>>>>>>(104.l+132)      string/c        iv41    Indeo 4.1
>>>>>>>(104.l+132)      string/c        iv50    Indeo 5.0
>>>>>>>(104.l+132)      string/c        mp42    Microsoft MPEG-4 v2
>>>>>>>(104.l+132)      string/c        mp43    Microsoft MPEG-4 v3
>>>>>>>(104.l+132)      string/c        fmp4    FFMpeg MPEG-4
>>>>>>>(104.l+132)      string/c        mjpg    Motion JPEG
>>>>>>>(104.l+132)      string/c        div3    DivX 3
>>>>>>>>112             string/c        div3    Low-Motion
>>>>>>>>112             string/c        div4    Fast-Motion
>>>>>>>(104.l+132)      string/c        divx    DivX 4
>>>>>>>(104.l+132)      string/c        dx50    DivX 5
>>>>>>>(104.l+132)      string/c        xvid    XviD
>>>>>>>(104.l+132)	string/c	h264	H.264
>>>>>>>(104.l+132)      string/c        wmv3    Windows Media Video 9
>>>>>>>(104.l+132)      string/c        h264    X.264 or H.264
>>>>>>>(104.l+132)      lelong  0
##>>>>>>>(104.l+132)      string  x       (%.4s)
# skip past first (video) LIST
>>>>(92.l+96)   string  LIST
>>>>>(92.l+104) string  strlstrh
>>>>>>(92.l+116)        string          auds    \b, audio:
# auds strh length = 56:
>>>>>>>(92.l+172)       string          strf
>>>>>>>>(92.l+180)      leshort 0x0001  uncompressed PCM
>>>>>>>>(92.l+180)      leshort 0x0002  ADPCM
>>>>>>>>(92.l+180)      leshort 0x0006  aLaw
>>>>>>>>(92.l+180)      leshort 0x0007  uLaw
>>>>>>>>(92.l+180)      leshort 0x0050  MPEG-1 Layer 1 or 2
>>>>>>>>(92.l+180)      leshort 0x0055  MPEG-1 Layer 3
>>>>>>>>(92.l+180)      leshort 0x2000  Dolby AC3
>>>>>>>>(92.l+180)      leshort 0x0161  DivX
##>>>>>>>>(92.l+180)      leshort x       (0x%.4x)
>>>>>>>>(92.l+182)      leshort 1       (mono,
>>>>>>>>(92.l+182)      leshort 2       (stereo,
>>>>>>>>(92.l+182)      leshort >2      (%d channels,
>>>>>>>>(92.l+184)      lelong  x       %d Hz)
# auds strh length = 64:
>>>>>>>(92.l+180)       string          strf
>>>>>>>>(92.l+188)      leshort 0x0001  uncompressed PCM
>>>>>>>>(92.l+188)      leshort 0x0002  ADPCM
>>>>>>>>(92.l+188)      leshort 0x0055  MPEG-1 Layer 3
>>>>>>>>(92.l+188)      leshort 0x2000  Dolby AC3
>>>>>>>>(92.l+188)      leshort 0x0161  DivX
##>>>>>>>>(92.l+188)      leshort x       (0x%.4x)
>>>>>>>>(92.l+190)      leshort 1       (mono,
>>>>>>>>(92.l+190)      leshort 2       (stereo,
>>>>>>>>(92.l+190)      leshort >2      (%d channels,
>>>>>>>>(92.l+192)      lelong  x       %d Hz)
# Animated Cursor format
>8	string		ACON		\b, animated cursor
# SoundFont 2 <mpruett@@sgi.com>
>8	string		sfbk		SoundFont/Bank
# MPEG-1 wrapped in a RIFF, apparently
>8      string          CDXA            \b, wrapped MPEG-1 (CDXA)
>8	string		4XMV		\b, 4X Movie file 

#
# XXX - some of the below may only appear in little-endian form.
#
# Also "MV93" appears to be for one form of Macromedia Director
# files, and "GDMF" appears to be another multimedia format.
#
0	string		RIFX		RIFF (big-endian) data
# RIFF Palette format
>8	string		PAL		\b, palette
>>16	beshort		x		\b, version %d
>>18	beshort		x		\b, %d entries
# RIFF Device Independent Bitmap format
>8	string		RDIB		\b, device-independent bitmap
>>16	string		BM		
>>>30	beshort		12		\b, OS/2 1.x format
>>>>34	beshort		x		\b, %d x
>>>>36	beshort		x		%d
>>>30	beshort		64		\b, OS/2 2.x format
>>>>34	beshort		x		\b, %d x
>>>>36	beshort		x		%d
>>>30	beshort		40		\b, Windows 3.x format
>>>>34	belong		x		\b, %d x
>>>>38	belong		x		%d x
>>>>44	beshort		x		%d
# RIFF MIDI format
>8	string		RMID		\b, MIDI
# RIFF Multimedia Movie File format
>8	string		RMMP		\b, multimedia movie
# Microsoft WAVE format (*.wav)
>8	string		WAVE		\b, WAVE audio
>>20	leshort		1		\b, Microsoft PCM
>>>34	leshort		>0		\b, %d bit
>>22	beshort		=1		\b, mono
>>22	beshort		=2		\b, stereo
>>22	beshort		>2		\b, %d channels
>>24	belong		>0		%d Hz
# Corel Draw Picture
>8	string		CDRA		\b, Corel Draw Picture
# AVI == Audio Video Interleave
>8	string		AVI\040		\b, AVI
# Animated Cursor format
>8	string		ACON		\b, animated cursor
# Notation Interchange File Format (big-endian only)
>8	string		NIFF		\b, Notation Interchange File Format
# SoundFont 2 <mpruett@@sgi.com>
>8	string		sfbk		SoundFont/Bank
@


