1 1.1.1.2 christos 2 1.1 christos #------------------------------------------------------------------------------ 3 1.1.1.5 christos # $File: acorn,v 1.8 2021/04/26 15:56:00 christos Exp $ 4 1.1 christos # acorn: file(1) magic for files found on Acorn systems 5 1.1 christos # 6 1.1 christos 7 1.1 christos # RISC OS Chunk File Format 8 1.1 christos # From RISC OS Programmer's Reference Manual, Appendix D 9 1.1 christos # We guess the file type from the type of the first chunk. 10 1.1 christos 0 lelong 0xc3cbc6c5 RISC OS Chunk data 11 1.1 christos >12 string OBJ_ \b, AOF object 12 1.1 christos >12 string LIB_ \b, ALF library 13 1.1 christos 14 1.1 christos # RISC OS AIF, contains "SWI OS_Exit" at offset 16. 15 1.1 christos 16 lelong 0xef000011 RISC OS AIF executable 16 1.1 christos 17 1.1 christos # RISC OS Draw files 18 1.1 christos # From RISC OS Programmer's Reference Manual, Appendix E 19 1.1 christos 0 string Draw RISC OS Draw file data 20 1.1 christos 21 1.1 christos # RISC OS new format font files 22 1.1 christos # From RISC OS Programmer's Reference Manual, Appendix E 23 1.1 christos 0 string FONT\0 RISC OS outline font data, 24 1.1 christos >5 byte x version %d 25 1.1 christos 0 string FONT\1 RISC OS 1bpp font data, 26 1.1 christos >5 byte x version %d 27 1.1 christos 0 string FONT\4 RISC OS 4bpp font data 28 1.1 christos >5 byte x version %d 29 1.1 christos 30 1.1 christos # RISC OS Music files 31 1.1 christos # From RISC OS Programmer's Reference Manual, Appendix E 32 1.1 christos 0 string Maestro\r RISC OS music file 33 1.1 christos >8 byte x version %d 34 1.1 christos 35 1.1 christos >8 byte x type %d 36 1.1 christos 37 1.1 christos # Digital Symphony data files 38 1.1 christos # From: Bernard Jungen (bern8817 (a] euphonynet.be) 39 1.1 christos 0 string \x02\x01\x13\x13\x13\x01\x0d\x10 Digital Symphony sound sample (RISC OS), 40 1.1 christos >8 byte x version %d, 41 1.1 christos >9 pstring x named "%s", 42 1.1 christos >(9.b+19) byte =0 8-bit logarithmic 43 1.1 christos >(9.b+19) byte =1 LZW-compressed linear 44 1.1 christos >(9.b+19) byte =2 8-bit linear signed 45 1.1 christos >(9.b+19) byte =3 16-bit linear signed 46 1.1 christos >(9.b+19) byte =4 SigmaDelta-compressed linear 47 1.1 christos >(9.b+19) byte =5 SigmaDelta-compressed logarithmic 48 1.1 christos >(9.b+19) byte >5 unknown format 49 1.1 christos 50 1.1 christos 0 string \x02\x01\x13\x13\x14\x12\x01\x0b Digital Symphony song (RISC OS), 51 1.1 christos >8 byte x version %d, 52 1.1 christos >9 byte =1 1 voice, 53 1.1 christos >9 byte !1 %d voices, 54 1.1 christos >10 leshort =1 1 track, 55 1.1 christos >10 leshort !1 %d tracks, 56 1.1 christos >12 leshort =1 1 pattern 57 1.1 christos >12 leshort !1 %d patterns 58 1.1 christos 59 1.1 christos 0 string \x02\x01\x13\x13\x10\x14\x12\x0e 60 1.1 christos >9 byte =0 Digital Symphony sequence (RISC OS), 61 1.1 christos >>8 byte x version %d, 62 1.1 christos >>10 byte =1 1 line, 63 1.1 christos >>10 byte !1 %d lines, 64 1.1 christos >>11 leshort =1 1 position 65 1.1 christos >>11 leshort !1 %d positions 66 1.1 christos >9 byte =1 Digital Symphony pattern data (RISC OS), 67 1.1 christos >>8 byte x version %d, 68 1.1 christos >>10 leshort =1 1 pattern 69 1.1 christos >>10 leshort !1 %d patterns 70 1.1.1.3 christos 71 1.1.1.3 christos # From: Joerg Jenderek 72 1.1.1.3 christos # URL: https://www.kyzer.me.uk/pack/xad/#PackDir 73 1.1.1.3 christos # reference: https://www.kyzer.me.uk/pack/xad/xad_PackDir.lha/PackDir.c 74 1.1.1.3 christos # GRR: line below is too general as it matches also "Git pack" in ./revision 75 1.1.1.3 christos 0 string PACK\0 76 1.1.1.3 christos # check for valid compression method 0-4 77 1.1.1.3 christos >5 ulelong <5 78 1.1.1.3 christos # https://www.riscosopen.org/wiki/documentation/show/Introduction%20To%20Filing%20Systems 79 1.1.1.3 christos # To skip "Git pack" version 0 test for root directory object like 80 1.1.1.3 christos # ADFS::RPC.$.websitezip.FONTFIX 81 1.1.1.3 christos >>9 string >ADFS\ PackDir archive (RISC OS) 82 1.1.1.3 christos # TrID labels above as "Acorn PackDir compressed Archive" 83 1.1.1.3 christos # compression mode y (0 - 4) for GIF LZW with a maximum n bits 84 1.1.1.3 christos # (y~n,0~12,1~13,2~14,3~15,4~16) 85 1.1.1.3 christos >>>5 ulelong+12 x \b, LZW %u-bits compression 86 1.1.1.4 christos # https://www.filebase.org.uk/filetypes 87 1.1.1.3 christos # !Packdir compressed archive has three hexadecimal digits code 68E 88 1.1.1.3 christos !:mime application/x-acorn-68E 89 1.1.1.3 christos !:ext pkd/bin 90 1.1.1.3 christos # null terminated root directory object like IDEFS::IDE-4.$.Apps.GRAPHICS.!XFMPdemo 91 1.1.1.3 christos >>>9 string x \b, root "%s" 92 1.1.1.3 christos # load address 0xFFFtttdd, ttt is the object filetype and dddddddddd is time 93 1.1.1.5 christos >>>>&1 ulelong x \b, load address %#x 94 1.1.1.3 christos # execution address 0xdddddddd dddddddddd is 40 bit unsigned centiseconds since 1.1.1900 UTC 95 1.1.1.5 christos >>>>&5 ulelong x \b, exec address %#x 96 1.1.1.3 christos # attributes (bits: 0~owner read,1~owner write,3~no delete,4~public read,5~public write) 97 1.1.1.5 christos >>>>&9 ulelong x \b, attributes %#x 98 1.1.1.3 christos # number of entries in this directory. for root dir 0 99 1.1.1.5 christos #>>>&13 ulelong x \b, entries %#x 100 1.1.1.3 christos # the entries start here with object name 101 1.1.1.3 christos >>>>&17 string x \b, 1st object "%s" 102 1.1.1.3 christos 103