[6578] in SIPB bug reports

home help back first fref pref prev next nref lref last post

magic for apple{single,double} formats

daemon@ATHENA.MIT.EDU (John Hawkinson)
Tue Nov 18 22:06:02 1997

Date: Tue, 18 Nov 1997 22:05:50 -0500
To: christos@astron.com, moraes@deshaw.com
Cc: lcs@MIT.EDU, bug-sipb@MIT.EDU
From: John Hawkinson <jhawk@MIT.EDU>

Attached is a patch for a magic addition to support AppleDouble and
AppleSingle, Apple binary disk formats, by way of Larry C. Stone
<lcs@mit.edu>.

It occurs to me belatedly that there may be some other custom Apple
file formats that may be found useful to file, and that there may be
magic information on them from the A/UX (Apple's Unix for Macintosh)
distribution.  I've thusly attached the magic file from A/UX 2.01.
I note that the AppleDouble magic entry from it is slightly less-specific
than Larry's but I don't really know what to conclude, nor do I have
the specification for the file-format available to me (or at least,
not to my knowledge).

I admit to lameness in failing to extract the redundant or useful
magic entries from the A/UX magic file, perhaps if the file
maintainers have spare time? :-)

Larry is also correct that the Magdir/Header text is a little
inaccurate. I corrected it for our local installation but not
in a generic fashion...

Also at the end are some patches that jhawk@bbnplanet.com (hat switch)
had been batching to send to you the next time I sent updates.

I see that file 3.23 came out. These patches are against 3.22, but there
don't seem to be any real conflicts. jhawk@bbnplanet.com had submitted to you
some stuff on 22 July that seems completely missing in 3.23. I'll resend that
to you on the assumption it got dropped, as I think the additions were sane.

--jhawk

Larry's message:

[6550]  daemon@ATHENA.MIT.EDU (Larry Stone) SIPB bug reports 10/31/97 16:14 (16 lines)
Subject: new data for file(1)
Date: Fri, 31 Oct 97 16:12:24 EST
From: Larry Stone <lcs@MIT.EDU>
To: bug-sipb@MIT.EDU

The file command doesn't know about AppleSingle and AppleDouble files,
which are an exchange file format and thus likely to show up on Unix.
These always contain binary data, although they may also have a text
data fork.  Here are two lines to add to the appropriate magic subfile:

0       long    0x00051600              AppleSingle encoded Macintosh file
0       long    0x00051607              AppleDouble encoded Macintosh file

Also, I notice the header in share/magic says to edit the source files
in a non-existent directory, which should be updated to src/file-3.22/Magdir.

        -- Larry
--[6550]-- (nref = [6552])

My patch:

*** Magdir/apple	1997/10/31 21:47:40
--- Magdir/apple	1997/10/31 21:50:32
***************
*** 1,6 ****
  
  #------------------------------------------------------------------------------
! # apple:  file(1) magic for Apple II file formats
  #
  0	string		FiLeStArTfIlEsTaRt	binscii (apple ][) text
  0	string		\x0aGL			Binary II (apple ][) data
--- 1,6 ----
  
  #------------------------------------------------------------------------------
! # apple:  file(1) magic for Apple file formats
  #
  0	string		FiLeStArTfIlEsTaRt	binscii (apple ][) text
  0	string		\x0aGL			Binary II (apple ][) data
***************
*** 8,10 ****
--- 8,12 ----
  0	string		SIT!			StuffIt (macintosh) text
  0	string		NuFile			NuFile archive (apple ][) data
  0	string		N\xf5F\xe9l\xe5		NuFile archive (apple ][) data
+ 0	long	0x00051600			AppleSingle encoded Macintosh file
+ 0	long	0x00051607			AppleDouble encoded Macintosh file

The A/UX magic file:

# pragma ident "@(#)file:magic	1.6 90/07/28 "
#
# Copyright 1987, 1988, 1989, 1990 Apple Computer, Inc.
# All Rights Reserved.
#
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF APPLE COMPUTER, INC.
# The copyright notice above does not evidence any actual or
# intended publication of such source code.
#
# Copyright 1985-87 UniSoft Corporation
#
# file cmd's magic file
#
# Basically, the fields of this file are as follows:
# byte offset, value type, optional operator (= by default), value
# to match (numeric or string), and string to be printed.  Numeric
# values may be decimal, octal, or hex.  Also note that the last
# string may have 1 printf format spec.
# The '>' in occassional column 1's is magic: it forces file to
# continue scanning and matching additional lines.  The first line
# afterwards not so marked terminates the search.
#
0	short		070707		cpio archive
0	string		070707		ASCII cpio archive
0	long		0177555		old archive
0	long		0177545		4.0 archive
0	long		0100554		apl workspace
0	short		017037		packed text
0	short		017436		V/68 packed text
0	string		<ar>		5.0 archive
0	string		!<arch>		5.2 archive
0	short		0407		4.0 executable
>16	long		>0		not stripped
>2	short		>0		- version %ld
0	short		0401		unix-rt ldp
0	short		0405		old overlay
0	short		0410		4.0 pure executable
>16	long		>0		not stripped
>2	short		>0		- version %ld
0	short		0411		4.0 separate I&D
>16	long		>0		not stripped
>2	short		>0		- version %ld
0	short		0437		pdp11 kernel overlay
0	long		0407		UniPlus 5.0 executable
>16	long		>0		not stripped
0	long		0410		UniPlus 5.0 pure executable
>16	long		>0		not stripped
0	short		0520		COFF object
>12	long		>0		not stripped
>168	string		.lowmem		toolbox
>20	short		0407		executable
>20	short		0410		pure executable
>20	short		0413		paged executable
>20	short		0421		standalone executable
0	short		0570		5.0 executable
>12	long		>0		not stripped
>22	short		>0		- version %ld
0	short		0575		5.0 pure executable
>12	long		>0		not stripped
>22	short		>0		- version %ld
0	short		0502		basic-16 executable
>12	long		>0		not stripped
0	short		0503		basic-16 executable (TV)
>12	long		>0		not stripped
0	short		0510		x86 executable
>12	long		>0		not stripped
0	short		0511		x86 executable (TV)
>12	long		>0		not stripped
0	short		0550		3b20d executable
>12	long		>0		not stripped
0	short		0551		3b20d executable (TV)
>12	long		>0		not stripped
0	short		0560		3b5 executable
>12	long		>0		not stripped
0	short		0561		3b5 executable (TV)
>12	long		>0		not stripped
0	long		0x51600		Apple-single format resource file
>224	string		APPL		(Application)
>224	string		ZSYS		(System)
>224	string		INIT		(INIT)
>224	string		cdev		(Control Panel)
>224	string		PRES		(Chooser, serial printer)
>224	string		PRER		(Chooser, non-serial printer)
>224	string		RDEV		(Chooser)
0	long		0x51607		Apple-double format resource file
0	string		#!/bin/sh	executable sh script
0	string		#!/bin/ksh	executable ksh script
0	string		#!/bin/csh	executable csh script
0	string		#!		executable script
0	short		017635		compressed data
0	string		%!		PostScript
>2	string		PS-Adobe-1.0	Adobe 1.0 conventions
>2	string		PS-Adobe-2.0	Adobe 2.0 conventions
>2	string		PS-Adobe-2.1	Adobe 2.1 conventions

more cisco elf mods from my work hat:

*** Magdir/elf	1997/07/08 04:29:58	1.2
--- Magdir/elf	1997/08/20 16:12:46	1.4
***************
*** 70,76 ****
--- 70,78 ----
  >>18	beshort		18		SPARC32PLUS,
  >>18	beshort		20		PowerPC or cisco 4500,
  >>18	beshort		21		cisco 7500,
+ >>18	beshort		24		cisco SVIP,
  >>18	beshort		25		cisco 7200,
+ >>18	beshort		36		cisco 12000,
  >>18	beshort		0x9026		Alpha,
  >>20	belong		0		invalid version
  >>20	belong		1		version 1

home help back first fref pref prev next nref lref last post