From dbushong@CSUA.Berkeley.EDU Wed Jul  7 15:00:41 1999
Return-Path: <dbushong@CSUA.Berkeley.EDU>
Received: from soda.CSUA.Berkeley.EDU (soda.CSUA.Berkeley.EDU [128.32.43.52])
	by hub.freebsd.org (Postfix) with ESMTP id 743F81544E
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  7 Jul 1999 15:00:40 -0700 (PDT)
	(envelope-from dbushong@CSUA.Berkeley.EDU)
Received: (from dbushong@localhost) 
	by soda.CSUA.Berkeley.EDU (8.8.8/) id OAA14210
        for FreeBSD-gnats-submit@freebsd.org; Wed, 7 Jul 1999 14:57:00 -0700 (PDT)
        env-from (dbushong)
Message-Id: <199907072157.OAA14210@soda.CSUA.Berkeley.EDU>
Date: Wed, 7 Jul 1999 14:57:00 -0700 (PDT)
From: dbushong@CSUA.Berkeley.EDU (David Bushong)
To: FreeBSD-gnats-submit@freebsd.org
Subject: file(1) magic entry for WarCraft II PUD files

>Number:         12554
>Category:       bin
>Synopsis:       File to go in /usr/src/usr.bin/file/Magdir/warcraft2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul  7 15:10:00 PDT 1999
>Closed-Date:    Mon Aug 30 05:39:16 PDT 1999
>Last-Modified:  Mon Aug 30 05:40:12 PDT 1999
>Originator:     David Bushong
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
none
>Environment:

        N.A.

>Description:

        This is magic for WarCraft II (a DOS/Windows RTS game from Blizzard
        Entertainment) PUD (map) files.  I came up with this while working
        on a clone for UN*X: http://www.csua.berkeley.edu/~xcraft/
        The results look like this:

timber-wolf ~/src/xcraft/server/puds [2:23pm] file crossover.pud 
crossover.pud: WarCraft II PUD, "Cross over", 128x128

timber-wolf ~/src/xcraft/server/puds [2:23pm] file nowhere.pud 
nowhere.pud: WarCraft II PUD, "Nowhere to run, nowhere to hide", 32x32

        (the magic extracts the map size and title, and has a very unique
        match for the first few bytes, so there's no danger of collision)

>How-To-Repeat:

Here's the code.  I'd suggest /usr/src/usr.bin/file/Magdir/warcraft2, but
/usr/src/usr.bin/file/Magdir/pud would probably work equally well.

#------------------------------------------------------------------------------
# warcraft2: file(1) magic for WarCraft II PUD (map) files
#
# From:  David Bushong <david@bushong.net>
#
0       string          TYPE\x10\0\0\0WAR2\ MAP         WarCraft II PUD
>Fix:

        N.A.


Enjoy.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: sheldonh 
State-Changed-When: Fri Jul 9 05:17:11 PDT 1999 
State-Changed-Why:  
Are there any precendents for game-related formats in the existing Magdir? 


From: lyndon@orthanc.ab.ca
To: freebsd-gnats-submit@freebsd.org, dbushong@CSUA.Berkeley.EDU
Cc:  
Subject: Re:bin/12554:Filetogoin/usr/src/usr.bin/file/Magdir/warcraft2
Date: 16 Jul 1999 01:06:40 -0600

 Yes there are precedents for games file formats. Look at
 /usr/src/usr.bin/file/Magdir/adventure.
 
 --lyndon
 
 The two most common elements in the universe are Hydrogen and stupidity.
 					-- Harlan Ellison
 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: David Bushong <dbushong@CSUA.Berkeley.EDU>
Cc: freebsd-gnats-submit@freebsd.org, lyndon@orthanc.ab.ca
Subject: Re: bin/12554: File to go in /usr/src/usr.bin/file/Magdir/warcraft2
Date: Mon, 19 Jul 1999 12:15:32 +0200

 Hi David,
 
 I've looked at the precedent which you offered for having game file(1)
 formats in the base system. I'm pretty sure that the Infocom file format
 is used by a game in the base system.
 
 I'll tell you what's making my skin crawl, here. I worry about having a
 hugely bloated src/usr.bin/file/Magdir in our source tree. Now that does
 seem like a counter-productive paranoia, but I can't shake it.
 
 Since file(1) already has a command-line option (-m) for specifying
 additional magic files, here's what I propose. I'd like to modify
 file(1) so that it honours an environment variable, perhaps MAGDIRS. The
 variable includes a colon-separated list of paths to additional magic
 files.
 
 The idea is that your port would include an install-time message that
 says something like "add MAGDIRS=${PREFIX}/share/misc/magic to
 /etc/profile so that file(1) will recognize WarCraft2 save files".
 
 What do you think?
 
 Ciao,
 Sheldon.
 

From: dbushong@CSUA.Berkeley.EDU (David Bushong)
To: sheldonh@uunet.co.za (Sheldon Hearn)
Cc: dbushong@CSUA.Berkeley.EDU, freebsd-gnats-submit@freebsd.org,
	lyndon@orthanc.ab.ca
Subject: Re: bin/12554: File to go in /usr/src/usr.bin/file/Magdir/warcraft2
Date: Mon, 19 Jul 1999 12:14:55 -0700 (PDT)

 That's definitely a possiblity.  I'm not overly concerned whether or not this
 makes its way into the system magic file, I just thought some people might like
 it.  Your ports idea is a good one; however, here are my thoughts on the 
 matter:
 
 I think file(1) should have as "bloated" a magic database as possible.  I think
 if file(1) recognized every possible file format on earth, that would be really
 cool.  If the ascii format magic file is already beginning to show a speed
 hit from the current amount of bloat, I think file(1) should move to a database
 format.  I assume the internal file(1) code already uses some type of tree
 based search which is efficient, so it's just a question of precompiling the
 data into a binary-format magic file.  But I digress.  The argument of "blah
 is used by the base system" is obviously pointless as there's Excel, Word,
 etc etc files in there.  "But people deal with those all the time for one
 reason or another in FreeBSD and there are programs that do stuff with them
 under FreeBSD like StarOffice".  Indeed, but those aren't in the base system.
 They are, however, very useful.  In general being able to recognize any 
 arbitrary piece of binary data (and not have it come up "troff macro file"
 like lame Unices with neutered magic files do) is a very very good thing.
 I'd like to see the magic file grow.  
 
 But that's just my opinion.
 
 (As for the bloat of it being in the source tree, I can't see it ever, ever
 approaching the size of..say.. Perl 5)
 
 > 
 > Hi David,
 > 
 > I've looked at the precedent which you offered for having game file(1)
 > formats in the base system. I'm pretty sure that the Infocom file format
 > is used by a game in the base system.
 > 
 > I'll tell you what's making my skin crawl, here. I worry about having a
 > hugely bloated src/usr.bin/file/Magdir in our source tree. Now that does
 > seem like a counter-productive paranoia, but I can't shake it.
 > 
 > Since file(1) already has a command-line option (-m) for specifying
 > additional magic files, here's what I propose. I'd like to modify
 > file(1) so that it honours an environment variable, perhaps MAGDIRS. The
 > variable includes a colon-separated list of paths to additional magic
 > files.
 > 
 > The idea is that your port would include an install-time message that
 > says something like "add MAGDIRS=${PREFIX}/share/misc/magic to
 > /etc/profile so that file(1) will recognize WarCraft2 save files".
 > 
 > What do you think?
 > 
 > Ciao,
 > Sheldon.
 > 
 
 --David Bushong
 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: dbushong@CSUA.Berkeley.EDU (David Bushong)
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/12554: File to go in /usr/src/usr.bin/file/Magdir/warcraft2 
Date: Sun, 25 Jul 1999 21:32:15 +0200

 On Mon, 19 Jul 1999 12:14:55 MST, David Bushong wrote:
 
 > I think file(1) should have as "bloated" a magic database as possible.
 > I think if file(1) recognized every possible file format on earth,
 > that would be really cool.
 
 You motivate the case for file(1) magic bloat very well. :-)
 
 So how about a deal? You gimme magic for Orcs&Humans (WarCraft I),
 WarCraft II (PC) and I'll commit them along with your one all in one go.
 That is, unless I've missed the point and your game uses the same game
 file format as the Blizzard game.
 
 Deal?
 
 Ciao,
 Sheldon.
 

From: dbushong@CSUA.Berkeley.EDU (David Bushong)
To: sheldonh@uunet.co.za (Sheldon Hearn)
Cc: dbushong@CSUA.Berkeley.EDU, freebsd-gnats-submit@freebsd.org
Subject: Re: bin/12554: File to go in /usr/src/usr.bin/file/Magdir/warcraft2
Date: Sun, 25 Jul 1999 13:36:12 -0700 (PDT)

 > On Mon, 19 Jul 1999 12:14:55 MST, David Bushong wrote:
 > 
 > > I think file(1) should have as "bloated" a magic database as possible.
 > > I think if file(1) recognized every possible file format on earth,
 > > that would be really cool.
 > 
 > You motivate the case for file(1) magic bloat very well. :-)
 > 
 > So how about a deal? You gimme magic for Orcs&Humans (WarCraft I),
 > WarCraft II (PC) and I'll commit them along with your one all in one go.
 > That is, unless I've missed the point and your game uses the same game
 > file format as the Blizzard game.
 > 
 > Deal?
 > 
 > Ciao,
 > Sheldon.
 > 
 The game I was working on, "XCraft" is a clone of WarCraft II, and thus used
 the same file format for maps (PUDs).  I do not own WarCraft I, and don't
 really know what format its maps used, however, I could probably hunt it up
 on the net and throw something together, except that I don't think anywone
 ever really cared about War I format map files (I didn't see any user made
 ones distributed, etc etc)  Now some StarCraft .scm and .scx magic might be
 useful, if only they didn't compress/encrypt their maps with no discernable
 way to determine anything about them (except for that they are SC maps)..
 here's the magic to recognize them:
 
 #------------------------------------------------------------------------------
 # starcraft: file(1) magic for StarCraft MPQ (data) files
 #
 # From:  David Bushong <david@bushong.net>
 #
 0       string          MPQ\32\ \0\0\0                  StarCraft MPQ Data
 
 which could possibly be tossed together with warcraft2 into a "blizzard" file,
 but I avoided doing that before to avoid using a company name as a file name.
 
 --David Bushong
 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: David Bushong <dbushong@CSUA.Berkeley.EDU>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/12554: file(1) Magdir addition
Date: Wed, 28 Jul 1999 10:36:31 +0200

 Hi David,
 
 I've had some good advice from David O'Brien on the issue of what to
 call the file in which your new addition goes. He suggested that, since
 is actively maintained by Christos Zoulas <christos@deshaw.com> (yes, it
 should really be in contrib), we should send the man e-mail with
 submissions and let him decide where to put them. :-)
 
 Then we can import his updates into our own version without heart-ache,
 knowing that the guy who looks after the package made the decision
 himself.
 
 Would you like to mail your contributions to Christos and keep PR 12554
 in the loop?
 
 Ciao,
 Sheldon.
 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: dbushong@CSUA.Berkeley.EDU (David Bushong)
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/12554: File to go in /usr/src/usr.bin/file/Magdir/warcraft2
Date: Tue, 17 Aug 1999 10:30:30 +0200

 Hi David,
 
 I'd like to know whether you've had any feedback from the file(1)
 maintainer regarding your submission. If you have, I'd like to close the
 PR, since you can open another PR when a new release of file(1) is
 available for import. :-)
 
 Thanks,
 Sheldon.
 
State-Changed-From-To: feedback->closed 
State-Changed-By: sheldonh 
State-Changed-When: Mon Aug 30 05:39:16 PDT 1999 
State-Changed-Why:  
Originator will filea new PR when the maintainer has included his 
submission in a new release of file(1). 
>Unformatted:
 >0x2a   string          >\0                             \b, "%s"
 >0x74   leshort         x                               \b, %d
 >>0x76  leshort         x                               \bx%d
 
 if that didn't make it through, here it is uuencoded:
 
 begin 644 warcraft2
 M(RTM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
 M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+0HC('=A<F-R869T
 M,CH@9FEL92@Q*2!M86=I8R!F;W(@5V%R0W)A9G0@24D@4%5$("AM87`I(&9I
 M;&5S"B,*(R!&<F]M.B`@1&%V:60@0G5S:&]N9R`\9&%V:61`8G5S:&]N9RYN
 M970^"B,*,`ES=')I;F<)"5194$5<>#$P7#!<,%PP5T%2,EP@34%0"0E787)#
 M<F%F="!)22!0540*/C!X,F$)<W1R:6YG"0D^7#`)"0D)7&(L("(E<R(*/C!X
 M-S0);&5S:&]R=`D)>`D)"0E<8BP@)60*/CXP>#<V"6QE<VAO<G0)"7@)"0D)
 &7&)X)60*
 `
 end
 
