Subject: bin/36122: additions/corrections for some magic(5) files in /src/dist/file/dist/magic/magdir
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Charlie Root <marm.mm@t-online.de>
List: netbsd-bugs
Date: 04/03/2007 12:45:00
>Number:         36122
>Category:       bin
>Synopsis:       additions/corrections for some magic(5) files in /src/dist/file/dist/magic/magdir
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 03 12:45:00 +0000 2007
>Originator:     Martin Moeller
>Release:        NetBSD 2.0
>Organization:
>Environment:
System: NetBSD netbsd 2.0 NetBSD 2.0 (GENERIC) #0: Wed Dec 1 10:58:25 UTC 2004 builds@build:/big/builds/ab/netbsd-2-0-RELEASE/i386/200411300000Z-obj/big/builds/ab/netbsd-2-0-RELEASE/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
Some magic(5) files in /src/dist/file/magic/magdir either contain some minor bugs or could assert more information about a file in my view.. The attached patch would correct/add the following things (for the versions of the files described in brackets).

(0): /src/dist/file/magic/magdir/images (MAIN, 1.1.1.10)
(0.0) Test Corrections
(0.0.0)	PC bitmap data:
		Old Message: PC bitmap data
		New Message:

		Reason: 'BM' is to unreliable. Only subtests should assert a
			message


(0.0.0.0) OS/2 2.x format:
		- The Width is actually incorrectly detected, because the offset
		  and datatype is incorrect
		- The datatype used to detect the Height is incorrect, so images		  with a Height > (2**16)-1 are incorrectly detected

		Old Message: OS/2 2.x format
		New Message: OS/2 2.x Bitmap

		Reason: needs to be adjusted due to change of above message.
			OS/2 2.x format is too unprecise without 'PC bitmap data'

(0.0.0.1) OS/2 1.x format:
		Old Message: OS/2 1.x format
		New Message: Windows 2.x / OS/2 1.x Bitmap

		Reason: Windows 2.x used the same Bitmap format as OS/2 1.

(0.0.0.2) Windows 3.x format:
		Old Message: Windows 3.x format
		New Message: Windows 3.x Bitmap

		Reason: same as in (0.0.0.0) for Windows 3.x Bitmaps

(0.1) Test Enhancements
(0.1.0) PC bitmap data
(0.1.0.0) Windows 2.x /  OS/2 1.x Bitmaps:
				- Color Depth
				- Presence of a Colormap

(0.1.0.1) OS/2 2.x Bitmaps:	- Color Depth
				- Type of Compression
				- Number of Entries in Colormap
				- Halftoning Method

(0.1.0.2) Windows 3.x Bitmaps:	- Type of Compression
				- Number of Entries in Colormap
(0.2) Test Additions
(0.2.0) PC bitmap data
(0.2.0.0) Windows 4.x Bitmaps:
(0.2.0.1) Windows 5.x Bitmaps:	- Width, Height, Color Depth
				- Type of Compression
				- Number of Entries in Colormap
				- Color Space used

(0.3) Test Movings
	- ATARI ST compressed bitmap format --> magdir/atari
	- PC icon data --> magdir/os2
	- PC pointer image data --> magdir/os2
	- PC color icon data --> magdir/os2
	- PC color pointer image data --> magdir/os2
	- PC bitmap array data --> magdir/os2

(1) /src/dist/file/magic/magdir/motorola (MAIN, 1.1.1.2)
(1.0) Test Movings
	- ATARI ST relocatable PRG --> magdir/atari
	- Atari 68xxx CPX file --> magdir/atari

(1.1) Test Deletions
	- Atari ST/TT ... program format (same test as ATARI ST relocatable PRG)

(2) /src/dist/file/magic/magdir/os2 (MAIN, 1.1.1.3)
(2.0) Test Enhancements
(2.0.0) PC bitmap array data:	- Detection of OS/2 Bitmap Array Version 1.x/2.x				  added
(2.1) Test Additions
	- OS/2 1.x/2.x Fonts

(2.2) Test Corrections
(2.2.0) PC icon data:
	Old Message: PC icon data
	New Message: OS/2 Monochrome Icon

	Reason: This File Format only seems to be used in OS/2.
(2.2.1) PC pointer image data
		- Test used invalid magic 'PI', new 'PT'
	Old Message: PC pointer image data
	New Message: OS/2 Monochrome Pointer

	Reason: same as above
(2.2.2) PC color icon data
	Old Message: PC color icon data
	New Message: OS/2 Color Icon

	Reason: same as above
(2.2.3) PC color pointer image data
	Old Message: PC color pointer image data
	New Message: OS/2 Color Pointer

	Reason: same as above

(3) /src/dist/file/magic/magdir/archive (MAIN, 1.6)
(3.0) Test Movings
	- Atari MSA archive --> magdir/atari

(4) /src/dist/file/magic/magdir/atari (New File)
The file contains all tests I could found regarding the Atari. This magic(5) file also contains some stability informations for all tests contained.
(4.0) Test Additions
	- Animatic Film Format
	- ComputerEyes Raw Data Format
	- CyberPaint Sequence Format
	- Imagic Film/Picture Format
	- NEOchrome Animation Format
	- Atari/GEM IMG File Format variations
	- STOS *.MBK File Format

(4.1) Test Enhancements
(4.1.0) ATARI ST relocatable PRG:
		- process load flags
		- whether program image contains a Self-Extracting Archive (from 		  Atari ST/TT ... program format (MAIN, 1.1.1.2))

(5) /src/dist/file/magic/magdir/audio (MAIN, 1.11)
(5.0) Test Movings
	- Atari ST audio files --> magdir/atari

(6) /src/dist/file/magic/magdir/console (MAIN, 1.1.1.6)
(6.0) Test Movings
	- Atari Lynx Cartridge dump --> magdir/atari

(7) /src/dist/file/magic/magdir/filesystems (MAIN, 1.4)
(7.0) Test Movings
	- Minix-ST kernel floppy --> magdir/atari
	- Atari-ST floppy 360K --> magdir/atari
	- Atari-ST floppy 720K --> magdir/atari

(8) /src/dist/file/magic/magdir/fonts (MAIN, 1.1.1.3)
(8.0) Test Corrections
(8.0.0) X11 Speedo font data:
		Old Message: X11 Speedo font data
		New Message: Bitstream Speedo font data

		Reason: Speedo Fonts are not only X11-related (e.g. also used in OS/2)
	
>How-To-Repeat:
(0.0.0.1) OS/2 2.x Bitmaps:
	Run file(1) on a OS/2 2.x Bitmap, e.g.
	http://wvnvaxa.wvnet.edu/vmswww/images/test4os2v2.bmp.

(8.0.0) X11 Speedo font data:
	Run file(1) on a X11 Speedo Font, e.g.
	http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/xsrc/xorg/font/bitstream-speedo/font0419.spd?rev=1.1.1.1
	/usr/X11R6/lib/X11/fonts/Speedo/font0419.spd

Hopefully I didn't forgot anything.

>Fix:
Apply the following patch:

--- magdir/atari.old	1970-01-01 01:00:00.000000000 +0100
+++ magdir/atari	2007-04-03 14:15:25.000000000 +0200
@@ -0,0 +1,231 @@
+
+#------------------------------------------------------------------------------
+# atari: file(1) magic for atari file formats
+#
+#	Possible States:
+#		untested	-	no tests were done
+#		experimental	-	few tests were done, no statement about the stability could be given
+#		unstable	-	many tests were done, SOME tests failed
+#		stable		-	many tests were done, ALL tests were successful
+
+#    No definition of few/many is given and is thus developer-dependent.
+
+#------------------------------------
+# Atari/GEM Image File Formats:
+#
+#	* Atari STAD compressed bitmap format (untested)
+#	* Animatic Film Format (untested)
+#	* ComputerEyes Raw Data Format (untested)
+#	* CyberPaint Sequence Format (untested)
+#	* Image Film/Picture Format (untested)
+#	* NEOchrome Animation Format (untested)
+#	* GEM IMG File Format variations (XIMG, STTT) (untested)
+#	* STOS *.MBK File Format (untested)
+
+# pM8x: ATARI STAD compressed bitmap format
+#
+# from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
+# p M 8 5/6 xx yy zz data...
+# Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
+# bytes either run horizontally (pM85) or vertically (pM86). yy is the
+# most frequent byte, xx and zz are runlength escape codes, where xx is
+# used for runs of yy.
+#
+0	string	pM85		Atari ST STAD bitmap image data (hor)
+>5	byte	0x00		(white background)
+>5	byte	0xFF		(black background)
+0	string	pM86		Atari ST STAD bitmap image data (vert)
+>5	byte	0x00		(white background)
+>5	byte	0xFF		(black background)
+
+# Martin Moeller (marm.mm@t-online.de, Sun Apr  1, 2007)
+#
+# Further Atari ST Graphics File Formats:
+#
+# References: http://www.fileformat.info/format/atari/
+# (untested -> experimental)
+
+# Animatic Film Format:
+48	belong	0x27182818	Animatic Film Format
+>0	beshort	x		\b, %d Frames,
+>34	beshort	x		%d VBlanks Delay Per Frame,
+>36	beshort	=0		forward play direction,
+>36	beshort =1		backward play direction,
+>40	beshort	x		%d x
+>42	beshort x		%d pixels per frame
+
+# ComputerEyes Raw Data Format
+# Magic Number is 0x45594553 ('EYES') @ Offset 0
+0	belong	0x45594553	ComputerEyes Raw Data Format,
+>4	beshort	=0		low-resolution data (320x200, 3 planes)
+>4	beshort =1		high-resolution data (640x400, 1 plane)
+
+# CyberPaint Sequence Format
+0	beshort 0xFEDB		CyberPaint Sequence Format,
+>2	beshort	x		Version %d,
+>4	belong	x		%d Frames,
+>8	beshort	x		%d VBlanks Delay Per Frame
+0	beshort	0xFEDC		CyberPaint Sequence Format,
+>2	beshort x		Version %d,
+>4	belong	x		%d Frames,
+>8	beshort	x		%d VBlanks Delay Per Frame
+
+# Image Film/Picture Format:
+0	string	IMDC		Image Film/Picture Format,
+>4	beshort	0		Low Resolution,
+>4	beshort 1		Medium Resolution,
+>4	beshort 2		High Resolution,
+>50	beshort	x		%d bytes Image Data,
+>64	byte	0		uncompressed
+>64	byte	1		compressed
+
+# NEOchrome Animation Format:
+0	belong	0xBABEEBEA	NEOchromeAnimation Format,
+>4	beshort	x		%d x
+>6	beshort	x		%d,
+>14	beshort	x		%d Frames,
+>16	beshort	x		%d VBlanks Delay Per Frame
+
+# Atari/GEM IMG File Format variations
+#
+# Reference: http/www.atarimax.com/freenet/freenet_material/6.16and32-BitComputersSupportArea/8.OnlineMagazines/showarticle.php?306
+#
+#	All Integers are in Big Endian Byte Order.
+#
+#	typedef signed short word;
+#
+#	typedef struct {
+#		word version;
+#		word header_length;	/* SizeOf Header in Words */
+#		word num_planes;
+#		word pattern_length;	/* RLE Compression Pattern Size*/
+#		word pixel_width;	/* in microns */	
+#		word pixel_height;	/* in microns */
+#		word scanline_width;	/* in pixels */
+#		word num_scanlines;
+#	} IMGHeader;
+#
+
+0	beshort	0x0002
+>20	beshort 0
+>>16	string	XIMG		GEM XIMG Image
+
+0	beshort	0x0001
+>20	beshort	0x0010
+>>16	string	STTT		GEM STTT Image
+
+#0	beshort	0x0001
+#>16	beshort 0x80		GEM IMG File Format, with HyperPaint Header Extension
+
+# STOS *.MBK File Format used in STOS Basic
+#
+# Reference: http://www.umich.edu/~archive/atari/Graphics/picfmts.doc
+18	belong	0x19861987	STOS .MBK File
+>34	beshort	x		%d Low Resolution Frames,
+>36	beshort	x		%d Medium Resolution Frames,
+>38	beshort	x		%d High Resolution Frames
+
+#-----------------------------------------
+# Atari/GEM Executable File Formats:
+#
+#	* ATARI ST relocatable PRG (experimental)
+
+# ATARI ST relocatable PRG
+#
+# from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001
+# (according to Roland Waldi, Oct 21, 1987)
+# besides the magic 0x601a, the text segment size is checked to be
+# not larger than 1 MB (which is a lot on ST).
+# The additional 0x601b distinction I took from Doug Lee's magic.
+#
+# Martin Moeller (marm.mm@t-online, Sun Apr  1, 2007)
+#
+# References:	http://www.wotsit.org/getfile.asp?file=atariexe&sc=228743528
+#		http://www.fortunecity.com/skycraper/apple/308/html/chap2.htm
+#
+
+0	beshort			0x601A		Atari ST M68K contiguous executable/object file
+>2	belong			x		(txt=%ld,
+>6	belong			x		dat=%ld,
+>10	belong			x		bss=%ld,
+>14	belong			x		sym=%ld)
+>22	belong			&0x01		\b, PF_FASTLOAD
+>22	belong			&0x02		\b, PF_TTRAMLOAD
+>22	belong			&0x04		\b, PF_TTRAMMEM
+>22	belong&0x30		0		\b, PF_PRIVATE
+>22	belong&0x30		1		\b, PF_GLOBAL
+>22	belong&0x30		2		\b, PF_SUPERVISOR
+>22	belong&0x30		3		\b, PF_READABLE
+>26	beshort			!0		\b, no relocation needed
+>30	string		SFX			\b, [Self-Extracting LZH SFX archive]
+>38	string		SFX			\b, [Self-Extracting LZH SFX archive]
+>44	string		ZIP!			\b, [Self-Extracting LZH ZIP archive]
+
+0	beshort			0x601B		Atari ST M68K non-contig executable
+>2	belong			x		(txt=%ld,
+>6	belong			x		dat=%ld,
+>10	belong			x		bss=%ld,
+>14	belong			x		sym=%ld)
+>22	belong			&0x01		\b, PF_FASTLOAD
+>22	belong			&0x02		\b, PF_TTRAMLOAD
+>22	belong			&0x04		\b, PF_TTRAMMEM
+>22	belong&0x30		0		\b, PF_PRIVATE
+>22	belong&0x30		1		\b, PF_GLOBAL
+>22	belong&0x30		2		\b, PF_SUPERVISOR
+>22	belong&0x30		3		\b, PF_READABLE
+>26	beshort			!0		\b, no relocation needed
+# From NetBSD /src/dist/file/magic/magdir/motorola, MAIN, revision #1.1.1.2
+>30	string		SFX			\b, [Self-Extracting LZH SFX archive]
+>38	string		SFX			\b, [Self-Extracting LZH SFX archive]
+>44	string		ZIP!			\b, [Self-Extracting LZH ZIP archive]
+
+#0       beshort         0x0064          Atari 68xxx CPX file
+#>8      beshort         x               (version %04lx)
+
+#-------------------------------
+# Atari Audio File Formats:
+#
+#	* SNDH Atari ST music (untested)
+#	* sc68 Atari ST music (untested)
+
+# Atari ST audio files by Dirk Jagdmann <doj@cubic.org>
+0	string		ICE!		SNDH Atari ST music
+0	string		SC68\ Music-file\ /\ (c)\ (BeN)jami	sc68 Atari ST music
+
+#--------------------------------
+# Atari Achive File Formats:
+#
+#	* Atari MSA archive (untested)
+
+# Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
+0       beshort 0x0e0f          Atari MSA archive data
+>2      beshort x       	\b, %d sectors per track
+>4      beshort 0       	\b, 1 sided
+>4      beshort 1       	\b, 2 sided
+>6      beshort x       	\b, starting track: %d
+>8      beshort x       	\b, ending track: %d
+
+#-------------------------------
+# Atari Filesystem Formats:
+#
+#	* Minix-ST kernel floppy (untested)
+
+# Minix-ST kernel floppy
+0x800	belong		0x46fc2700	Atari-ST Minix kernel image
+>19	string		\240\5\371\5\0\011\0\2\0	\b, 720k floppy
+>19	string		\320\2\370\5\0\011\0\1\0	\b, 360k floppy
+
+19	string		\320\2\370\5\0\011\0\1\0	Atari-ST floppy 360k
+19      string		\240\5\371\5\0\011\0\2\0	Atari-ST floppy 720k
+
+#---------------------------------------
+# Atari Video Console File Formats:
+#
+#	* Atari Lynx cartridge dump (EXE/BLL header) (untested)
+
+# Atari Lynx cartridge dump (EXE/BLL header)
+# From: "Stefan A. Haubenthal" <polluks@web.de>
+
+0	beshort		0x8008		Lynx cartridge,
+>2	beshort		x		RAM start $%04x
+>6	string		BS93
--- magdir/os2.old	2007-03-04 15:55:01.000000000 +0100
+++ magdir/os2		2007-04-03 14:10:02.000000000 +0200
@@ -45,3 +45,36 @@
 
 # OS/2 INI (this is a guess)
 0  string   \xff\xff\xff\xff\x14\0\0\0  OS/2 INI
+
+# Martin Moeller (marm.mm@t-online.de, Sun Apr 1, 2007)
+# 
+# Further Types of OS/2 Bitmaps:
+
+# Bitmap Arrays contain multiple OS/2 Bitmap Files
+0	string	BA
+# Size == sizeof(BITMAPARRAYFILEHEADER) == 40?
+>2	lelong	40	OS/2 Bitmap Array containing Version 1.x Bitmap Data
+# Size == sizeof(BITMAPARRAYFILEHEADER2) == 92?
+>2	lelong	92	OS/2 Bitmap Array, containing OS/2 Bitmap Version 2.x Bitmap Data
+
+# OS/2 (Color) Icon
+#0	string	CI	OS/2 Color Icon
+# OS/2 (Color) Pointer
+#0	string	CP	OS/2 Color Pointer
+# OS/2 (Monochrome) Icon
+#0	string	IC	OS/2 Monochrome Icon
+# OS/2 (Monochrome) Pointer
+#0	string	IP	OS/2 Monochrome Pointer
+
+# OS/2 Font File Formats
+#
+# Header:
+#	Offset	Size	Member Name	Explanation
+#	  0	 4	ulIdentify	Identification Number
+#	  4	 4	  ulSize	SizeOf(Header)
+#	  8	 12	achSignature	Identifies Format of the Font File
+
+0	lelong	0xFFFFFFFF
+>4	lelong	20
+>>8	string	OS/2\ FONT	OS/2 1.x Font
+>>8	string	OS/2\ FONT\ 2	OS/2 2.x Font
--- magdir/archive.old	2007-03-04 16:22:09.000000000 +0100
+++ magdir/archive	2007-04-02 01:37:17.000000000 +0200
@@ -651,14 +651,6 @@
 # Felix von Leitner <felix-file@fefe.de>
 0	string	d8:announce	BitTorrent file
 
-# Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
-0       beshort 0x0e0f          Atari MSA archive data
->2      beshort x       	\b, %d sectors per track
->4      beshort 0       	\b, 1 sided
->4      beshort 1       	\b, 2 sided
->6      beshort x       	\b, starting track: %d
->8      beshort x       	\b, ending track: %d
-
 # Alternate ZIP string (amc@arwen.cs.berkeley.edu)
 0	string	PK00PK\003\004	Zip archive data
 
--- magdir/audio.old	2007-03-04 16:22:09.000000000 +0100
+++ magdir/audio	2007-04-02 01:37:47.000000000 +0200
@@ -508,10 +508,6 @@
 # licq.conf
 1	string	[licq]			LICQ configuration file
 
-# Atari ST audio files by Dirk Jagdmann <doj@cubic.org>
-0	string		ICE!		SNDH Atari ST music
-0	string		SC68\ Music-file\ /\ (c)\ (BeN)jami	sc68 Atari ST music
-
 # musepak support From: "Jiri Pejchal" <jiri.pejchal@gmail.com>
 0       string          MP+     Musepack audio
 >3      byte            255     \b, SV pre8
--- magdir/console.old	2007-03-04 15:54:57.000000000 +0100
+++ magdir/console	2007-04-02 01:36:26.000000000 +0200
@@ -154,13 +154,6 @@
 0       string          XIP0            XIP, Microsoft Xbox data
 0       string          XTF0            XTF, Microsoft Xbox data
 
-# Atari Lynx cartridge dump (EXE/BLL header)
-# From: "Stefan A. Haubenthal" <polluks@web.de>
-
-0	beshort		0x8008		Lynx cartridge,
->2	beshort		x		RAM start $%04x
->6	string		BS93
-
 # Opera file system that is used on the 3DO console
 # From: Serge van den Boom <svdb@stack.nl>
 0	string		\x01ZZZZZ\x01	3DO "Opera" file system
--- magdir/filesystems.old	2007-03-04 16:22:09.000000000 +0100
+++ magdir/filesystems		2007-04-02 01:42:19.000000000 +0200
@@ -1005,12 +1005,6 @@
 >0x64	beshort		&0x2004		v2 dirs)
 
 ############################################################################
-# Minix-ST kernel floppy
-0x800	belong		0x46fc2700	Atari-ST Minix kernel image
->19	string		\240\5\371\5\0\011\0\2\0	\b, 720k floppy
->19	string		\320\2\370\5\0\011\0\1\0	\b, 360k floppy
-
-############################################################################
 # Hmmm, is this a better way of detecting _standard_ floppy images ?
 19	string		\320\2\360\3\0\011\0\1\0	DOS floppy 360k
 >0x1FE	leshort		0xAA55		\b, x86 hard disk boot sector
@@ -1024,9 +1018,6 @@
 19	string		\100\013\371\5\0\011\0\2\0	DOS floppy 1440k, mkdosfs
 >0x1FE	leshort		0xAA55		\b, x86 hard disk boot sector
 
-19	string		\320\2\370\5\0\011\0\1\0	Atari-ST floppy 360k
-19	string		\240\5\371\5\0\011\0\2\0	Atari-ST floppy 720k
-
 #  Valid media descriptor bytes for MS-DOS:
 #
 #     Byte   Capacity   Media Size and Type
--- magdir/fonts.old	2003-09-25 19:59:22.000000000 +0200
+++ magdir/fonts	2007-04-02 01:45:09.000000000 +0200
@@ -23,7 +23,7 @@
 0	string		\001fcp			X11 Portable Compiled Font data
 >12	byte		0x02			\b, LSB first
 >12	byte		0x0a			\b, MSB first
-0	string		D1.0\015		X11 Speedo font data
+0	string		D1.0\015		Speedo font data
 
 #------------------------------------------------------------------------------
 # FIGlet fonts and controlfiles
--- magdir/images.old	2007-03-04 15:54:58.000000000 +0100
+++ magdir/images	2007-04-02 01:40:08.000000000 +0200
@@ -153,24 +153,101 @@
 
 
 # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
-0	string		BM		PC bitmap data
->14	leshort		12		\b, OS/2 1.x format
->>18	leshort		x		\b, %d x
->>20	leshort		x		%d
->14	leshort		64		\b, OS/2 2.x format
+# (Martin Moeller, marm.mm@t-online.de, Sun Apr  1, 2007)
+#
+# Further Informations:
+#
+# http://www.fileformat.info/format/bmp/egff.htm: Windows Bitmap File Formats
+# http://www.fileformat.info/format/os2bmp/egff.htm: OS/2 Bitmap File Formats
+0	string		BM
+>14	lelong		12		Windows 2.x / OS/2 1.x Bitmap
 >>18	leshort		x		\b, %d x
->>20	leshort		x		%d
->14	leshort		40		\b, Windows 3.x format
+>>20	leshort		x		%d x
+>>24	leshort		x		%d
+>>10	lelong		>26		\b, Colormap Present
+
+>14	lelong		64		OS/2 2.x Bitmap
+>>18	lelong		x		\b, %d x
+>>22	lelong		x		%d x
+>>28	leshort		x		%d
+>>30	lelong		0		\b, uncompressed
+>>30	lelong		1		\b, 8-Bit RLE Compression
+>>30	lelong		2		\b, 4-Bit RLE Compression
+>>30	lelong		3		\b, Huffman 1D Compression
+>>30	lelong		4		\b, 24-Bit RLE Compression
+# InfoHeader.ClrUsed == 0 {
+>>46	lelong		0
+>>>10	lelong		>78
+>>>>28	leshort		x		\b, 2**%d Entries in Colormap
+# }; InfoHeader.ClrUsed >0
+>>46	lelong		>0		\b, %d Entries in Colormap
+>>66	lelong		0		\b, no halftoning used
+>>66	lelong		1		\b, error diffusion halftoning
+>>66	lelong		2		\b, PANDA halftoning
+>>66	lelong		3		\b, super-circle halftoning
+
+>14	lelong		40		Windows 3.x Bitmap
+>>18	lelong		x		\b, %d x
+>>22	lelong		x		%d x
+>>28	leshort		x		%d
+>>30	lelong		0		\b, uncompressed
+>>30	lelong		1		\b, 8-Bit RLE Compression
+>>30	lelong		2		\b, 4-Bit RLE Compression
+>>30	lelong		3		\b, uncompressed, Bitfield Encoding
+>>30	lelong		4		\b, JPEG Compression
+>>30	lelong		5		\b, PNG Compression
+# InfoHeader.ClrUsed == 0 {
+>>46	lelong		0
+>>>30	lelong		3
+# Bitfield Encoding is used, RGB Mask (12 Bytes) needs to be skipped
+>>>>10	lelong		>66
+>>>>>28	leshort		x		\b, 2**%d Entries in Colormap
+>>>30	lelong		^3
+# No Bitfield Encoding is used, Colormap follows after Info Header
+>>>>10	lelong		>54
+>>>>>28	leshort		x		\b, 2**%d Entries in Colormap
+# }; InfoHeader.ClrUsed >0
+>>46	lelong		>0		\b, %d Entries in Colormap
+
+>14	lelong		108		Windows 4.x Bitmap
 >>18	lelong		x		\b, %d x
 >>22	lelong		x		%d x
 >>28	leshort		x		%d
-# Too simple - MPi
-#0	string		IC		PC icon data
-#0	string		PI		PC pointer image data
-#0	string		CI		PC color icon data
-#0	string		CP		PC color pointer image data
-# Conflicts with other entries [BABYL]
-#0	string		BA		PC bitmap array data
+>>30	lelong		0		\b, uncompressed
+>>30	lelong		1		\b, 8-Bit RLE Compression
+>>30	lelong		2		\b, 4-Bit RLE Compression
+>>30	lelong		3		\b, uncompressed, Bitfield Encoding
+>>30	lelong		4		\b, JPEG Compression
+>>30	lelong		5		\b, PNG Compression
+# InfoHeader.ClrUsed == 0 {
+>>46	lelong		0
+>>>10	lelong		>122
+>>>>28	leshort		x		\b, 2**%d Entries in Colormap
+# }; InfoHeader.ClrUsed >0
+>>46	lelong		>0		\b, %d Entries in Colormap
+>>70	lelong		0		\b, Calibrated RGB Color Space
+
+>14	lelong		124		Windows 5.x Bitmap
+>>18	lelong		x		\b, %d x
+>>22	lelong		x		%d x
+>>28	leshort		x		%d
+>>30	lelong		0		\b, uncompressed
+>>30	lelong		1		\b, 8-Bit RLE Compression
+>>30	lelong		2		\b, 4-Bit RLE Compression
+>>30	lelong		3		\b, uncompressed, Bitfield Encoding
+>>30	lelong		4		\b, JPEG Compression
+>>30	lelong		5		\b, PNG Compression
+# InfoHeader.ClrUsed == 0 {
+>>46	lelong		0
+>>>10	lelong		>138
+>>>>28	leshort		x		\b, 2**%d Entries in Colormap
+# }; InfoHeader.ClrUsed >0 
+>>46	lelong		>0		\b, %d Entries in Colormap
+>>70	lelong		0		\b, Calibrated RGB Color Space
+>>70	lelong		1		\b, sRGB Color Space
+>>70	lelong		2		\b, Default Windows Color Space
+>>70	lelong		3		\b, Profile Linked
+>>70	lelong		4		\b, Profile Embedded
 
 # XPM icons (Greg Roelofs, newt@uchicago.edu)
 # note possible collision with C/REXX entry in c-lang; currently commented out
@@ -291,22 +368,6 @@
 0	string	PDS_			PDS image data
 0	string	LBLSIZE=		PDS (VICAR) image data
 
-# pM8x: ATARI STAD compressed bitmap format
-#
-# from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
-# p M 8 5/6 xx yy zz data...
-# Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
-# bytes either run horizontally (pM85) or vertically (pM86). yy is the
-# most frequent byte, xx and zz are runlength escape codes, where xx is
-# used for runs of yy.
-#
-0	string	pM85		Atari ST STAD bitmap image data (hor)
->5	byte	0x00		(white background)
->5	byte	0xFF		(black background)
-0	string	pM86		Atari ST STAD bitmap image data (vert)
->5	byte	0x00		(white background)
->5	byte	0xFF		(black background)
-
 # XXX:
 # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
 # magic.
--- magdir/motorola.old	2003-05-25 23:29:01.000000000 +0200
+++ magdir/motorola	2007-04-02 01:40:32.000000000 +0200
@@ -30,41 +30,3 @@
 #
 # Motorola S-Records, from Gerd Truschinski <gt@freebsd.first.gmd.de>
 0   string      S0          Motorola S-Record; binary data in text format
-
-# ATARI ST relocatable PRG
-#
-# from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001
-# (according to Roland Waldi, Oct 21, 1987)
-# besides the magic 0x601a, the text segment size is checked to be
-# not larger than 1 MB (which is a lot on ST).
-# The additional 0x601b distinction I took from Doug Lee's magic.
-0	belong&0xFFFFFFF0	0x601A0000	Atari ST M68K contiguous executable
->2	belong			x		(txt=%ld,
->6	belong			x		dat=%ld,
->10	belong			x		bss=%ld,
->14	belong			x		sym=%ld)
-0	belong&0xFFFFFFF0	0x601B0000	Atari ST M68K non-contig executable
->2	belong			x		(txt=%ld,
->6	belong			x		dat=%ld,
->10	belong			x		bss=%ld,
->14	belong			x		sym=%ld)
-
-# Atari ST/TT... program format (sent by Wolfram Kleff <kleff@cs.uni-bonn.de>)
-0       beshort         0x601A          Atari 68xxx executable,
->2      belong          x               text len %lu,
->6      belong          x               data len %lu,
->10     belong          x               BSS len %lu,
->14     belong          x               symboltab len %lu,
->18     belong          0
->22     belong          &0x01           fastload flag,
->22     belong          &0x02           may be loaded to alternate RAM,
->22     belong          &0x04           malloc may be from alternate RAM,
->22     belong          x               flags: 0x%lX,
->26     beshort         0               no relocation tab
->26     beshort         !0              + relocation tab
->30     string          SFX             [Self-Extracting LZH SFX archive]
->38     string          SFX             [Self-Extracting LZH SFX archive]
->44     string          ZIP!            [Self-Extracting ZIP SFX archive]
-
-0       beshort         0x0064          Atari 68xxx CPX file
->8      beshort         x               (version %04lx)