Skip to content
Permalink
Browse files Browse the repository at this point in the history
Use %#x instead of 0x%x.
  • Loading branch information
zoulasc committed Apr 26, 2021
1 parent b92d97c commit 905ca55
Show file tree
Hide file tree
Showing 55 changed files with 661 additions and 661 deletions.
10 changes: 5 additions & 5 deletions magic/Magdir/acorn
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: acorn,v 1.7 2019/04/19 00:42:27 christos Exp $
# $File: acorn,v 1.8 2021/04/26 15:56:00 christos Exp $
# acorn: file(1) magic for files found on Acorn systems
#

Expand Down Expand Up @@ -90,13 +90,13 @@
# null terminated root directory object like IDEFS::IDE-4.$.Apps.GRAPHICS.!XFMPdemo
>>>9 string x \b, root "%s"
# load address 0xFFFtttdd, ttt is the object filetype and dddddddddd is time
>>>>&1 ulelong x \b, load address 0x%x
>>>>&1 ulelong x \b, load address %#x
# execution address 0xdddddddd dddddddddd is 40 bit unsigned centiseconds since 1.1.1900 UTC
>>>>&5 ulelong x \b, exec address 0x%x
>>>>&5 ulelong x \b, exec address %#x
# attributes (bits: 0~owner read,1~owner write,3~no delete,4~public read,5~public write)
>>>>&9 ulelong x \b, attributes 0x%x
>>>>&9 ulelong x \b, attributes %#x
# number of entries in this directory. for root dir 0
#>>>&13 ulelong x \b, entries 0x%x
#>>>&13 ulelong x \b, entries %#x
# the entries start here with object name
>>>>&17 string x \b, 1st object "%s"

16 changes: 8 additions & 8 deletions magic/Magdir/amigaos
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: amigaos,v 1.18 2020/08/02 16:42:00 christos Exp $
# $File: amigaos,v 1.19 2021/04/26 15:56:00 christos Exp $
# amigaos: file(1) magic for AmigaOS binary formats:

#
Expand Down Expand Up @@ -58,17 +58,17 @@
# high_seq; unused (value 0)
>0x008 ubelong !0 \b, high_seq %u
# ht_size; hash table size; 0x48 for flopies
>0x00c ubelong !0x48 \b, hash table size 0x%x
>0x00c ubelong !0x48 \b, hash table size %#x
# bm_flag; bitmap flag, -1 means VALID
>0x138 belong !-1 \b, bitmap flag 0x%x
>0x138 belong !-1 \b, bitmap flag %#x
# bm_ext; first bitmap extension block (Hard disks only)
>0x1A0 ubelong !0 \b, bitmap extension block 0x%x
>0x1A0 ubelong !0 \b, bitmap extension block %#x
# name_len; volume name length; diskname[30]; volume name
>0x1B0 pstring >\0 \b, "%s"
# first directory cache block for FFS; otherwise 0
>0x1F8 ubelong !0 \b, directory cache block 0x%x
>0x1F8 ubelong !0 \b, directory cache block %#x
# block secondary type = ST_ROOT (value 1)
>0x1FC ubelong !1 \b, sec_type 0x%x
>0x1FC ubelong !1 \b, sec_type %#x
#
0 string RDSK Rigid Disk Block
>160 string x on %.24s
Expand Down Expand Up @@ -109,15 +109,15 @@
>>0xDC00C ubelong 0x48
>>>0xDC000 ubelong 2 (HD 1760 KiB)
# Chksum; special block checksum like: 0 0x44ccf4c0 0x51f32cac 0xe33d0e7d ...
#>>4 ubelong x \b, CRC 0x%x
#>>4 ubelong x \b, CRC %#x
# Rootblock: 0 880 (often for DD and HD) 1146049280 (IMAGINE_1_0_DISK_01.ADF TURBO_SILVER_SV.ADF)
>>8 ubelong >0 \b, probably root block %d
# bootblock code
>>12 quad !0 \b, bootable
# assembler instructions: lea exp(pc),a1; moveq 25h,d0; jsr -552(a6)
>>>12 ubequad =0x43fa003e70254eae AmigaDOS 3.0
>>>12 default x
>>>>12 ubequad !0x43fa003e70254eae 0x%llx..
>>>>12 ubequad !0x43fa003e70254eae %#llx..
# 880 KiB Double Density floppy disk (901120 bytes)
>>0x6E00C ubelong 0x48
>>>0x6E000 ubelong 2
Expand Down
12 changes: 6 additions & 6 deletions magic/Magdir/android
@@ -1,6 +1,6 @@

#------------------------------------------------------------
# $File: android,v 1.18 2021/02/23 00:51:10 christos Exp $
# $File: android,v 1.19 2021/04/26 15:56:00 christos Exp $
# Various android related magic entries
#------------------------------------------------------------

Expand All @@ -24,11 +24,11 @@
>>1028 lelong 0 \b (boot)
>>1028 lelong 1 \b (recovery)
>8 lelong >0 \b, kernel
>>12 lelong >0 \b (0x%x)
>>12 lelong >0 \b (%#x)
>16 lelong >0 \b, ramdisk
>>20 lelong >0 \b (0x%x)
>>20 lelong >0 \b (%#x)
>24 lelong >0 \b, second stage
>>28 lelong >0 \b (0x%x)
>>28 lelong >0 \b (%#x)
>36 lelong >0 \b, page size: %d
>38 string >0 \b, name: %s
>64 string >0 \b, cmdline (%s)
Expand Down Expand Up @@ -64,7 +64,7 @@
# look for backup content after line with encryption info
#>>19 search/7 \n
# data part after header for not encrypted Android Backup
#>>>&0 ubequad x \b, content 0x%16.16llx...
#>>>&0 ubequad x \b, content %#16.16llx...
# look for zlib compressed by ./compress after message with 1 space at end
#>>>&0 indirect x \b; contains
# look for tar archive block by ./archive for package name manifest
Expand Down Expand Up @@ -157,7 +157,7 @@
# partition ID:
# 0~IPL,MOVINAND,GANG;1~PIT,GPT;2~HIDDEN;3~SBL,HIDDEN;4~SBL2,HIDDEN;5~BOOT;6~kernel,RECOVER,misc;7~RECOVER
# ;11~MODEM;20~efs;21~PARAM;22~FACTORY,SYSTEM;23~DBDATAFS,USERDATA;24~CACHE;80~BOOTLOADER;81~TZSW
>>>0x08 ulelong x (0x%x)
>>>0x08 ulelong x (%#x)
# filename
>>>0x44 string >\0 "%-.64s"
#>>>0x18 ulelong >0
Expand Down
10 changes: 5 additions & 5 deletions magic/Magdir/apple
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: apple,v 1.44 2019/10/18 15:21:02 christos Exp $
# $File: apple,v 1.45 2021/04/26 15:56:00 christos Exp $
# apple: file(1) magic for Apple file formats
#
0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text
Expand Down Expand Up @@ -180,7 +180,7 @@
# minimum version needed to read this files. SFMinVers (0 , 30~3.0 )
>>>183 ubyte 30 3.0
>>>183 ubyte !30
>>>>183 ubyte !0 0x%x
>>>>183 ubyte !0 %#x
# usual tabstop start sequence "=====<"
>>>5 string x \b, tabstop ruler "%6.6s"
# tabstop ruler
Expand Down Expand Up @@ -299,7 +299,7 @@
# object is the first object (true for CoreFoundation implementation).
# From: David Remahl <dremahl@apple.com>
0 string bplist
>6 byte x \bCoreFoundation binary property list data, version 0x%c
>6 byte x \bCoreFoundation binary property list data, version %#c
>>7 byte x \b%c
>6 string 00 \b
>>8 byte&0xF0 0x00 \b
Expand Down Expand Up @@ -358,7 +358,7 @@

0 belong 0xfade0c02 Mac OS X Code Directory
>8 belong x version %x
>12 belong >0 flags 0x%x
>12 belong >0 flags %#x
>4 belong x - %d bytes

0 belong 0xfade0cc0 Mac OS X Detached Code Signature (non-executable)
Expand Down Expand Up @@ -438,7 +438,7 @@
# descSize driver size in blocks
>>4 ubeshort x \b, size %u
# descType driver system type 1 701h F8FFh FFFFh
>>6 ubeshort x \b, type 0x%x
>>6 ubeshort x \b, type %#x

# URL: https://en.wikipedia.org/wiki/Apple_Partition_Map
# Reference: https://opensource.apple.com/source/IOStorageFamily/IOStorageFamily-116/IOApplePartitionScheme.h
Expand Down
44 changes: 22 additions & 22 deletions magic/Magdir/archive
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: archive,v 1.146 2021/04/08 23:54:36 christos Exp $
# $File: archive,v 1.147 2021/04/26 15:56:00 christos Exp $
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
Expand Down Expand Up @@ -476,22 +476,22 @@
# data size in bytes like 409600
>0x40 ubelong x \b, %u bytes
# for debugging purpose size in hexadecimal
#>0x40 ubelong x (0x%8.8x)
#>0x40 ubelong x (%#8.8x)
# tag size in bytes
>0x44 ubelong >0 \b, 0x%x tag size
>0x44 ubelong >0 \b, %#x tag size
# data checksum
#>0x48 ubelong x \b, 0x%x checksum
#>0x48 ubelong x \b, %#x checksum
# tag checksum
#>0x4c ubelong x \b, 0x%x tag checksum
#>0x4c ubelong x \b, %#x tag checksum
# disk encoding
>0x50 ubyte 0 \b, GCR CLV ssdd (400k)
>0x50 ubyte 1 \b, GCR CLV dsdd (800k)
>0x50 ubyte 2 \b, MFM CAV dsdd (720k)
>0x50 ubyte 3 \b, MFM CAV dshd (1440k)
>0x50 ubyte >3 \b, 0x%x encoding
>0x50 ubyte >3 \b, %#x encoding
# format byte
>0x51 ubyte x \b, 0x%x format
#>0x54 ubequad x \b, data 0x%16.16llx
>0x51 ubyte x \b, %#x format
#>0x54 ubequad x \b, data %#16.16llx
# ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
0 string ESP ESP archive data
# ZPack
Expand Down Expand Up @@ -524,11 +524,11 @@
# compression method (0-4)
>>8 uleshort x \b, %u method
# offset of compressed data
>>10 uleshort x \b, 0x%x offset
>>10 uleshort x \b, %#x offset
#>>(10.s) uleshort x
#>>>&-6 string x \b, TEST extension %-.3s
# header flags to mark header extensions
>>12 uleshort >0 \b, 0x%x flags
>>12 uleshort >0 \b, %#x flags
# 4 bytes: decompressed length of file
>>12 uleshort &0x01
>>>14 ulelong x \b, original size: %u bytes
Expand Down Expand Up @@ -629,7 +629,7 @@
!:mime application/x-compress-ftcomp
!:ext ??_/??@/dll/drv/pk2/
# probably A596FDFF magic at the beginning
>0 ubelong !0xA596FDFF \b, at beginning 0x%x
>0 ubelong !0xA596FDFF \b, at beginning %#x
# probably orginal file name with directory like: \OS2\unpack.exe \SYSTEM\8514.DRV MAHJONGG.EXE
>41 string x "%s"

Expand Down Expand Up @@ -846,7 +846,7 @@
!:ext dz
>>2 byte x \b, version %i
>>3 byte x \b.%i
>>4 ulelong x \b, offset 0x%x
>>4 ulelong x \b, offset %#x
>>8 ulelong x \b, %u files
# ZZip archiver (.zz)
0 string ZZ\ \0\0 ZZip archive data
Expand Down Expand Up @@ -980,21 +980,21 @@
# compressed data size != compressed file size
#>7 ulelong x \b, data size %d
# attribute: 0x2~?? 0x10~symlink|target 0x20~normal
#>19 ubyte x \b, 19_0x%x
#>19 ubyte x \b, 19_%#x
# level identifier 0 1 2 3
#>20 ubyte x \b, level %d
# time stamp
#>15 ubelong x DATE 0x%8.8x
#>15 ubelong x DATE %#8.8x
# OS ID for level 1
>20 ubyte 1
# 0x20 types find for *.rom files
>>(21.b+24) ubyte <0x21 \b, 0x%x OS
>>(21.b+24) ubyte <0x21 \b, %#x OS
# ascii type like M for MSDOS
>>(21.b+24) ubyte >0x20 \b, '%c' OS
# OS ID for level 2
>20 ubyte 2
#>>23 ubyte x \b, OS ID 0x%x
>>23 ubyte <0x21 \b, 0x%x OS
#>>23 ubyte x \b, OS ID %#x
>>23 ubyte <0x21 \b, %#x OS
>>23 ubyte >0x20 \b, '%c' OS
# filename only for level 0 and 1
>20 ubyte <2
Expand Down Expand Up @@ -1589,15 +1589,15 @@
>24 belong 2 MD5 checksum
>24 belong 3 SHA-256 checksum
>24 belong 4 SHA-512 checksum
>24 belong >4 unknown 0x%x checksum
>24 belong >4 unknown %#x checksum
#>24 belong >4 checksum
# For no compression jump 0 bytes
>24 belong 0
>>0 ubyte x
# jump more bytes forward by header size
>>>&(4.S) ubyte x
# jump more bytes forward by compressed table of contents size
#>>>>&(8.Q) ubequad x \b, heap data 0x%llx
#>>>>&(8.Q) ubequad x \b, heap data %#llx
>>>>&(8.Q) ubyte x
# look for data by ./compress after message with 1 space at end
>>>>>&-3 indirect x \b, contains
Expand Down Expand Up @@ -1669,7 +1669,7 @@
# *.GHS or *.[0-9] with cns program option
>2 ubyte&0x08 0x08 \b, split file
# part of split index interesting for *.ghs
>>4 ubyte x id=0x%x
>>4 ubyte x id=%#x
# compression tag minus one equals numeric compression command line switch z[1-9]
>3 ubyte 0 \b, no compression
>3 ubyte 2 \b, fast compression (Z1)
Expand Down Expand Up @@ -1717,9 +1717,9 @@
!:mime application/x-acronis-tib
!:ext tib
# 01000000
#>20 ubelong x \b, at 20 0x%x
#>20 ubelong x \b, at 20 %#x
# 20000000
#>28 ubelong x \b, at 28 0x%x
#>28 ubelong x \b, at 28 %#x
# strings like "Generic- SD/MMC 1.00" "Unknown Disk" "Msft Virtual Disk 1.0"
# ???
# strings like "\Device\0000011e" "\Device\0000015a"
Expand Down
6 changes: 3 additions & 3 deletions magic/Magdir/asf
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: asf,v 1.1 2019/12/26 02:07:53 christos Exp $
# $File: asf,v 1.2 2021/04/26 15:56:00 christos Exp $
# asf: file(1) magic for Microsoft Advanced Systems Format (ASF) files
# http://www.staroceans.org/e-book/ASF_Specification.pdf

Expand All @@ -23,7 +23,7 @@
#>>56 lequad x Time Offset %lld
#>>64 lelong x Type-Specicic Data Length %d
#>>68 lelong x Error Correction Data Length %d
#>>72 leshort x Flags 0x%x
#>>72 leshort x Flags %#x
#>>74 lelong x Reserved %x
# ASF_Audio_Media
>>24 guid F8699E40-5B4D-11CF-A8FD-00805F5C442B \b, Audio Media (
Expand All @@ -40,7 +40,7 @@
#>>>85 leshort x \b, Format Data Size %x
>>>93 lelong x \b, Image Width %d
>>>97 lelong x \b, Image Height %d
#>>>101 leshort x \b, Reserved 0x%x
#>>>101 leshort x \b, Reserved %#x
>>>103 leshort x \b, Bits Per Pixel Count %d
#>>>105 lelong x \b, Compression ID %d
#>>>109 lelong x \b, Image Size %d
Expand Down
16 changes: 8 additions & 8 deletions magic/Magdir/audio
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: audio,v 1.120 2021/02/23 00:51:10 christos Exp $
# $File: audio,v 1.121 2021/04/26 15:56:00 christos Exp $
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
Expand Down Expand Up @@ -847,16 +847,16 @@
>>18 ubyte x \b, language ID %d
# structure for phrases/sentences?
# number of voice sample in the 1st phrase?
#>>19 uleshort x \b, 0x%x samples
#>>>21 uleshort >0 \b, at 0x%4.4x
#>>>(21.s) ubequad x 0x%llx
#>>19 uleshort x \b, %#x samples
#>>>21 uleshort >0 \b, at %#4.4x
#>>>(21.s) ubequad x %#llx
# 2nd phrase?
#>>23 uleshort x \b, 0x%x samples
#>>>25 uleshort >0 \b, at 0x%4.4x
#>>>(25.s) ubequad x 0x%llx
#>>23 uleshort x \b, %#x samples
#>>>25 uleshort >0 \b, at %#4.4x
#>>>(25.s) ubequad x %#llx
# pointer to 1st audio WAV sample
>>16 uleshort >0
>>>(16.s) ulelong >0 \b, at 0x%x
>>>(16.s) ulelong >0 \b, at %#x
# WAV length
# 1 space char after "bytes" to get phrase "bytes RIFF"
>>>>(16.s+4) ulelong >0 %u bytes
Expand Down
8 changes: 4 additions & 4 deletions magic/Magdir/c64
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: c64,v 1.8 2020/12/20 16:17:43 christos Exp $
# $File: c64,v 1.9 2021/04/26 15:56:00 christos Exp $
# c64: file(1) magic for various commodore 64 related files
#
# From: Dirk Jagdmann <doj@cubic.org>
Expand Down Expand Up @@ -28,17 +28,17 @@
0 belong 0xFF424CFF WRAptor packer (c64)

0 string C64S\x20tape\x20file T64 tape Image
>32 leshort x Version:0x%x
>32 leshort x Version:%#x
>36 leshort !0 Entries:%i
>40 string x Name:%.24s

0 string C64\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 T64 tape Image
>32 leshort x Version:0x%x
>32 leshort x Version:%#x
>36 leshort !0 Entries:%i
>40 string x Name:%.24s

0 string C64S\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 T64 tape Image
>32 leshort x Version:0x%x
>32 leshort x Version:%#x
>36 leshort !0 Entries:%i
>40 string x Name:%.24s

Expand Down

0 comments on commit 905ca55

Please sign in to comment.