From a40cfed391d3836e6661bae2689a687730d5e510 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Thu, 1 Nov 2012 04:26:40 +0000 Subject: [PATCH] use name+use to eliminate bi-endian copies. --- magic/Magdir/dump | 106 +++++++++++---------------------- magic/Magdir/mach | 145 +++++----------------------------------------- 2 files changed, 49 insertions(+), 202 deletions(-) diff --git a/magic/Magdir/dump b/magic/Magdir/dump index 9a1d2bee..a297c57a 100644 --- a/magic/Magdir/dump +++ b/magic/Magdir/dump @@ -1,11 +1,11 @@ #------------------------------------------------------------------------------ -# $File$ +# $File: dump,v 1.11 2009/09/19 16:28:09 christos Exp $ # dump: file(1) magic for dump file format--for new and old dump filesystems # # We specify both byte orders in order to recognize byte-swapped dumps. # -24 belong 60012 new-fs dump file (big endian), +0 name new-dump-be >4 bedate x Previous dump %s, >8 bedate x This dump %s, >12 belong >0 Volume %ld, @@ -24,7 +24,7 @@ >824 string >\0 Host %s, >888 belong >0 Flags %x -24 belong 60011 old-fs dump file (big endian), +0 name old-dump-be #>4 bedate x Previous dump %s, #>8 bedate x This dump %s, >12 belong >0 Volume %ld, @@ -43,57 +43,7 @@ >824 string >\0 Host %s, >888 belong >0 Flags %x -24 lelong 60012 new-fs dump file (little endian), ->4 ledate x This dump %s, ->8 ledate x Previous dump %s, ->12 lelong >0 Volume %ld, ->692 lelong 0 Level zero, type: ->692 lelong >0 Level %d, type: ->0 lelong 1 tape header, ->0 lelong 2 beginning of file record, ->0 lelong 3 map of inodes on tape, ->0 lelong 4 continuation of file record, ->0 lelong 5 end of volume, ->0 lelong 6 map of inodes deleted, ->0 lelong 7 end of medium (for floppy), ->676 string >\0 Label %s, ->696 string >\0 Filesystem %s, ->760 string >\0 Device %s, ->824 string >\0 Host %s, ->888 lelong >0 Flags %x - -24 lelong 60011 old-fs dump file (little endian), -#>4 ledate x Previous dump %s, -#>8 ledate x This dump %s, ->12 lelong >0 Volume %ld, ->692 lelong 0 Level zero, type: ->692 lelong >0 Level %d, type: ->0 lelong 1 tape header, ->0 lelong 2 beginning of file record, ->0 lelong 3 map of inodes on tape, ->0 lelong 4 continuation of file record, ->0 lelong 5 end of volume, ->0 lelong 6 map of inodes deleted, ->0 lelong 7 end of medium (for floppy), ->676 string >\0 Label %s, ->696 string >\0 Filesystem %s, ->760 string >\0 Device %s, ->824 string >\0 Host %s, ->888 lelong >0 Flags %x - -18 leshort 60011 old-fs dump file (16-bit, assuming PDP-11 endianness), ->2 medate x Previous dump %s, ->6 medate x This dump %s, ->10 leshort >0 Volume %ld, ->0 leshort 1 tape header. ->0 leshort 2 beginning of file record. ->0 leshort 3 map of inodes on tape. ->0 leshort 4 continuation of file record. ->0 leshort 5 end of volume. ->0 leshort 6 map of inodes deleted. ->0 leshort 7 end of medium (for floppy). - -24 belong 0x19540119 new-fs dump file (ufs2, big endian), +0 name ufs2-dump-be >896 beqdate x Previous dump %s, >904 beqdate x This dump %s, >12 belong >0 Volume %ld, @@ -112,21 +62,33 @@ >824 string >\0 Host %s, >888 belong >0 Flags %x -24 lelong 0x19540119 new-fs dump file (ufs2, little endian), ->896 leqdate x This dump %s, ->904 leqdate x Previous dump %s, ->12 lelong >0 Volume %ld, ->692 lelong 0 Level zero, type: ->692 lelong >0 Level %d, type: ->0 lelong 1 tape header, ->0 lelong 2 beginning of file record, ->0 lelong 3 map of inodes on tape, ->0 lelong 4 continuation of file record, ->0 lelong 5 end of volume, ->0 lelong 6 map of inodes deleted, ->0 lelong 7 end of medium (for floppy), ->676 string >\0 Label %s, ->696 string >\0 Filesystem %s, ->760 string >\0 Device %s, ->824 string >\0 Host %s, ->888 lelong >0 Flags %x +24 belong 60012 new-fs dump file (big endian), +>0 use new-dump-be + +24 belong 60011 old-fs dump file (big endian), +>0 use old-dump-be + +24 lelong 60012 new-fs dump file (little endian), +>0 use \^new-dump-be + +24 lelong 60011 old-fs dump file (little endian), +>0 use \^old-dump-be + + +24 belong 0x19540119 new-fs dump file (ufs2, big endian), +>0 use ufs2-dump-be + +24 lelong 0x19540119 new-fs dump file (ufs2, little endian), +>0 use \^ufs2-dump-be + +18 leshort 60011 old-fs dump file (16-bit, assuming PDP-11 endianness), +>2 medate x Previous dump %s, +>6 medate x This dump %s, +>10 leshort >0 Volume %ld, +>0 leshort 1 tape header. +>0 leshort 2 beginning of file record. +>0 leshort 3 map of inodes on tape. +>0 leshort 4 continuation of file record. +>0 leshort 5 end of volume. +>0 leshort 6 map of inodes deleted. +>0 leshort 7 end of medium (for floppy). diff --git a/magic/Magdir/mach b/magic/Magdir/mach index ed7d5f16..071c863d 100644 --- a/magic/Magdir/mach +++ b/magic/Magdir/mach @@ -1,131 +1,14 @@ #------------------------------------------------------------ -# $File: mach,v 1.10 2012/10/31 16:32:01 christos Exp $ +# $File: mach,v 1.11 2012/10/31 16:48:13 christos Exp $ # Mach has two magic numbers, 0xcafebabe and 0xfeedface. # Unfortunately the first, cafebabe, is shared with # Java ByteCode, so they are both handled in the file "cafebabe". # The "feedface" ones are handled herein. #------------------------------------------------------------ -0 lelong&0xfffffffe 0xfeedface Mach-O + +0 name mach-o-bed >0 byte 0xcf 64-bit ->4 lelong <0 ->>4 lelong x architecture=%ld ->4 lelong 1 ->>8 lelong 0 vax ->>8 lelong 1 vax11/780 ->>8 lelong 2 vax11/785 ->>8 lelong 3 vax11/750 ->>8 lelong 4 vax11/730 ->>8 lelong 5 uvaxI ->>8 lelong 6 uvaxII ->>8 lelong 7 vax8200 ->>8 lelong 8 vax8500 ->>8 lelong 9 vax8600 ->>8 lelong 10 vax8650 ->>8 lelong 11 vax8800 ->>8 lelong 12 uvaxIII ->4 lelong 2 romp ->4 lelong 3 architecture=3 ->4 lelong 4 ns32032 ->4 lelong 5 ns32332 ->4 lelong 6 m68k ->4 lelong 7 ->>8 lelong 3 i386 ->>8 lelong 4 i486 ->>8 lelong 132 i486sx ->>8 lelong 5 i586 ->>8 lelong 8 pentium_3 ->>8 lelong 9 pentiumM ->>8 lelong 10 pentiumIV ->>8 lelong 11 itanium ->>8 lelong 12 xeon ->>8 lelong 14 pentiumIV_M ->>8 lelong 15 itanium2 ->>8 lelong 21 pentiumpro ->>8 lelong 23 pentiumIII ->>8 lelong 24 pentium_3_M ->>8 lelong 25 pentiumV ->>8 lelong 26 xeon_mp ->>8 lelong 40 pentium_3_xeon ->>8 lelong 113 celeron ->>8 lelong 119 celeron_mobile ->4 lelong 8 mips ->>8 lelong 1 R2300 ->>8 lelong 2 R2600 ->>8 lelong 3 R2800 ->>8 lelong 4 R2000a ->>8 lelong 5 R2000 ->>8 lelong 6 R3000a ->>8 lelong 7 R3000 ->4 lelong 9 ns32532 ->4 lelong 10 mc98000 ->4 lelong 11 hppa ->>8 lelong 0 7100 ->>8 lelong 1 7100LC ->4 lelong 12 ->>8 lelong 0 arm ->>8 lelong 1 arm_v4t ->>8 lelong 2 arm_v6 ->>8 lelong 3 arm_v5tej ->>8 lelong 4 arm_xscale ->>8 lelong 5 arm_v7 ->>8 lelong 6 arm_v7f ->>8 lelong 7 arm_v7k ->4 lelong 13 ->>8 lelong 0 mc88000 ->>8 lelong 1 mc88100 ->>8 lelong 2 mc88110 ->4 lelong 14 sparc ->4 lelong 15 i860g ->4 lelong 16 alpha ->4 lelong 17 rs6000 ->4 lelong 18 ->>8 lelong 0 ppc ->>8 lelong 1 ppc_601 ->>8 lelong 2 ppc_602 ->>8 lelong 3 ppc_603 ->>8 lelong 4 ppc_603e ->>8 lelong 5 ppc_603ev ->>8 lelong 6 ppc_604 ->>8 lelong 7 ppc_604e ->>8 lelong 8 ppc_620 ->>8 lelong 9 ppc_650 ->>8 lelong 10 ppc_7400 ->>8 lelong 11 ppc_7450 ->>8 lelong 100 ppc_970 ->4 lelong 16777223 ->>8 lelong 3 x86_64 ->>8 lelong 4 x86_64_arch1 ->4 lelong 16777234 ->>8 lelong 0 ppc64 ->>8 lelong 1 ppc64_601 ->>8 lelong 2 ppc64_602 ->>8 lelong 3 ppc64_603 ->>8 lelong 4 ppc64_603e ->>8 lelong 5 ppc64_603ev ->>8 lelong 6 ppc64_604 ->>8 lelong 7 ppc64_604e ->>8 lelong 8 ppc64_620 ->>8 lelong 9 ppc64_650 ->>8 lelong 10 ppc64_7400 ->>8 lelong 11 ppc64_7450 ->>8 lelong 100 ppc64_970 ->4 lelong >16777234 ->>4 lelong x architecture=%ld ->12 lelong 1 object ->12 lelong 2 executable ->12 lelong 3 fixed virtual memory shared library ->12 lelong 4 core ->12 lelong 5 preload executable ->12 lelong 6 dynamically linked shared library ->12 lelong 7 dynamic linker ->12 lelong 8 bundle ->12 lelong 9 dynamically linked shared library stub ->12 lelong >9 ->>12 lelong x filetype=%ld -# -0 belong&0xfffffffe 0xfeedface Mach-O ->3 byte 0xcf 64-bit >4 belong <0 >>4 belong x architecture=%ld >4 belong 1 @@ -146,13 +29,8 @@ >4 belong 3 architecture=3 >4 belong 4 ns32032 >4 belong 5 ns32332 ->4 belong 6 for m68k architecture -# from NeXTstep 3.0 -# i.e. mc680x0_all, ignore -# >>8 belong 1 (mc68030) ->>8 belong 2 (mc68040) ->>8 belong 3 (mc68030 only) ->4 belong 7 i386 +>4 belong 6 m68k +>4 belong 7 >>8 belong 3 i386 >>8 belong 4 i486 >>8 belong 132 i486sx @@ -199,7 +77,7 @@ >>8 belong 1 mc88100 >>8 belong 2 mc88110 >4 belong 14 sparc ->4 belong 15 i860 +>4 belong 15 i860g >4 belong 16 alpha >4 belong 17 rs6000 >4 belong 18 @@ -240,9 +118,16 @@ >12 belong 3 fixed virtual memory shared library >12 belong 4 core >12 belong 5 preload executable ->12 belong 6 dynamically linked shared library ->12 belong 7 dynamic linker +>12 belong 6 dynamically linked shared library +>12 belong 7 dynamic linker >12 belong 8 bundle >12 belong 9 dynamically linked shared library stub >12 belong >9 >>12 belong x filetype=%ld + +# +0 lelong&0xfffffffe 0xfeedface Mach-O +>0 use \^mach-o-be + +0 belong&0xfffffffe 0xfeedface Mach-O +>0 use mach-o-be -- 2.40.0