#!/usr/bin/perl -w

# dump some info onbin files
# 2000-02-05 Tels v0.0.1

use lib "..";
use Cowgen::Vbr;
use Cowgen::Dromed;
use Cowgen::Gamfile;
use Cowgen::Bunch;

print "Dump some info about a *.bin file v0.0.1 2000-02-05\n\n";
print "      (c) Copyright by Tels (bloodgate.com) 1999-2000. All Rights Reserved.\n\n";
print "Usage: perl binfile.pl inputfile\n";

# get commandline parameter
$infile = shift || "door12.bin"; $infile .= ".bin" if ($infile !~ /\.bin$/);

open FILE, $infile or die "Cant open file $infile $!\n";
binmode FILE;
sysread (FILE,$buf,24); # skip
if ($buf !~ /^LGMD/)
  {
  print "File is not a Thief bin file!\n"; exit;
  }
$name = unpack("Z8",substr($buf,8,8));
sysread (FILE,$buf,24);
close FILE;
@p = unpack ("ffffff",$buf);
$h = $p[5]-$p[2]; $l= $p[4]-$p[1]; $w = $p[3]-$p[0];
print "Model $name: (w,l,h) = ($w,$l,$h)\n";
exit;

print "Done.\n";

# EOF

1;

