head 1.1; branch 1.1.1; access; symbols netbsd-11-0-RC4:1.1.1.12 netbsd-11-0-RC3:1.1.1.12 netbsd-11-0-RC2:1.1.1.12 netbsd-11-0-RC1:1.1.1.12 perseant-exfatfs-base-20250801:1.1.1.12 netbsd-11:1.1.1.12.0.4 netbsd-11-base:1.1.1.12 netbsd-10-1-RELEASE:1.1.1.11 perseant-exfatfs-base-20240630:1.1.1.12 perseant-exfatfs:1.1.1.12.0.2 perseant-exfatfs-base:1.1.1.12 netbsd-8-3-RELEASE:1.1.1.6 netbsd-9-4-RELEASE:1.1.1.8 netbsd-10-0-RELEASE:1.1.1.11 netbsd-10-0-RC6:1.1.1.11 netbsd-10-0-RC5:1.1.1.11 netbsd-10-0-RC4:1.1.1.11 netbsd-10-0-RC3:1.1.1.11 netbsd-10-0-RC2:1.1.1.11 netbsd-10-0-RC1:1.1.1.11 FILE5_45:1.1.1.12 netbsd-10:1.1.1.11.0.2 netbsd-10-base:1.1.1.11 FILE5_43:1.1.1.11 netbsd-9-3-RELEASE:1.1.1.8 cjep_sun2x-base1:1.1.1.10 cjep_sun2x:1.1.1.10.0.4 cjep_sun2x-base:1.1.1.10 cjep_staticlib_x-base1:1.1.1.10 netbsd-9-2-RELEASE:1.1.1.8 cjep_staticlib_x:1.1.1.10.0.2 cjep_staticlib_x-base:1.1.1.10 FILE5_40:1.1.1.10 netbsd-9-1-RELEASE:1.1.1.8 FILE5_39:1.1.1.9 phil-wifi-20200421:1.1.1.8 phil-wifi-20200411:1.1.1.8 is-mlppp:1.1.1.8.0.4 is-mlppp-base:1.1.1.8 phil-wifi-20200406:1.1.1.8 netbsd-8-2-RELEASE:1.1.1.6 netbsd-9-0-RELEASE:1.1.1.8 netbsd-9-0-RC2:1.1.1.8 FILE5_38:1.1.1.8 netbsd-9-0-RC1:1.1.1.8 phil-wifi-20191119:1.1.1.8 netbsd-9:1.1.1.8.0.2 netbsd-9-base:1.1.1.8 phil-wifi-20190609:1.1.1.8 netbsd-8-1-RELEASE:1.1.1.6 FILE5_37:1.1.1.8 netbsd-8-1-RC1:1.1.1.6 pgoyette-compat-merge-20190127:1.1.1.6.8.2 pgoyette-compat-20190127:1.1.1.8 pgoyette-compat-20190118:1.1.1.8 pgoyette-compat-1226:1.1.1.8 pgoyette-compat-1126:1.1.1.8 pgoyette-compat-1020:1.1.1.8 FILE5_35:1.1.1.8 pgoyette-compat-0930:1.1.1.7 pgoyette-compat-0906:1.1.1.7 netbsd-7-2-RELEASE:1.1.1.4 pgoyette-compat-0728:1.1.1.7 netbsd-8-0-RELEASE:1.1.1.6 phil-wifi:1.1.1.7.0.2 phil-wifi-base:1.1.1.7 pgoyette-compat-0625:1.1.1.7 netbsd-8-0-RC2:1.1.1.6 pgoyette-compat-0521:1.1.1.7 pgoyette-compat-0502:1.1.1.7 pgoyette-compat-0422:1.1.1.7 netbsd-8-0-RC1:1.1.1.6 FILE5_33:1.1.1.7 pgoyette-compat-0415:1.1.1.6 pgoyette-compat-0407:1.1.1.6 pgoyette-compat-0330:1.1.1.6 pgoyette-compat-0322:1.1.1.6 pgoyette-compat-0315:1.1.1.6 netbsd-7-1-2-RELEASE:1.1.1.4 pgoyette-compat:1.1.1.6.0.8 pgoyette-compat-base:1.1.1.6 netbsd-7-1-1-RELEASE:1.1.1.4 matt-nb8-mediatek:1.1.1.6.0.6 matt-nb8-mediatek-base:1.1.1.6 FILE5_32:1.1.1.6 perseant-stdc-iso10646:1.1.1.6.0.4 perseant-stdc-iso10646-base:1.1.1.6 netbsd-8:1.1.1.6.0.2 netbsd-8-base:1.1.1.6 FILE5_31:1.1.1.6 prg-localcount2-base3:1.1.1.5 prg-localcount2-base2:1.1.1.5 prg-localcount2-base1:1.1.1.5 prg-localcount2:1.1.1.5.0.2 prg-localcount2-base:1.1.1.5 pgoyette-localcount-20170426:1.1.1.5 bouyer-socketcan-base1:1.1.1.5 pgoyette-localcount-20170320:1.1.1.5 netbsd-7-1:1.1.1.4.0.12 netbsd-7-1-RELEASE:1.1.1.4 netbsd-7-1-RC2:1.1.1.4 FILE5_30:1.1.1.5 netbsd-7-nhusb-base-20170116:1.1.1.4 bouyer-socketcan:1.1.1.4.0.10 bouyer-socketcan-base:1.1.1.4 pgoyette-localcount-20170107:1.1.1.4 netbsd-7-1-RC1:1.1.1.4 pgoyette-localcount-20161104:1.1.1.4 netbsd-7-0-2-RELEASE:1.1.1.4 localcount-20160914:1.1.1.4 netbsd-7-nhusb:1.1.1.4.0.8 netbsd-7-nhusb-base:1.1.1.4 pgoyette-localcount-20160806:1.1.1.4 pgoyette-localcount-20160726:1.1.1.4 pgoyette-localcount:1.1.1.4.0.6 pgoyette-localcount-base:1.1.1.4 netbsd-7-0-1-RELEASE:1.1.1.4 netbsd-7-0:1.1.1.4.0.4 netbsd-7-0-RELEASE:1.1.1.4 netbsd-7-0-RC3:1.1.1.4 netbsd-7-0-RC2:1.1.1.4 netbsd-7-0-RC1:1.1.1.4 FILE5_22:1.1.1.4 FILE5_20:1.1.1.4 netbsd-6-0-6-RELEASE:1.1.1.2 netbsd-6-1-5-RELEASE:1.1.1.2 netbsd-7:1.1.1.4.0.2 netbsd-7-base:1.1.1.4 FILE5_19:1.1.1.4 yamt-pagecache-base9:1.1.1.3 yamt-pagecache-tag8:1.1.1.2 netbsd-6-1-4-RELEASE:1.1.1.2 netbsd-6-0-5-RELEASE:1.1.1.2 tls-earlyentropy:1.1.1.3.0.8 tls-earlyentropy-base:1.1.1.4 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.3 riastradh-drm2-base3:1.1.1.3 netbsd-6-1-3-RELEASE:1.1.1.2 netbsd-6-0-4-RELEASE:1.1.1.2 FILE5_16:1.1.1.3 netbsd-6-1-2-RELEASE:1.1.1.2 netbsd-6-0-3-RELEASE:1.1.1.2 netbsd-6-1-1-RELEASE:1.1.1.2 riastradh-drm2-base2:1.1.1.3 riastradh-drm2-base1:1.1.1.3 riastradh-drm2:1.1.1.3.0.6 riastradh-drm2-base:1.1.1.3 netbsd-6-1:1.1.1.2.0.16 netbsd-6-0-2-RELEASE:1.1.1.2 netbsd-6-1-RELEASE:1.1.1.2 khorben-n900:1.1.1.3.0.4 netbsd-6-1-RC4:1.1.1.2 netbsd-6-1-RC3:1.1.1.2 agc-symver:1.1.1.3.0.2 agc-symver-base:1.1.1.3 FILE5_14:1.1.1.3 netbsd-6-1-RC2:1.1.1.2 netbsd-6-1-RC1:1.1.1.2 yamt-pagecache-base8:1.1.1.2 FILE_5_12:1.1.1.2 netbsd-6-0-1-RELEASE:1.1.1.2 yamt-pagecache-base7:1.1.1.2 matt-nb6-plus-nbase:1.1.1.2 yamt-pagecache-base6:1.1.1.2 netbsd-6-0:1.1.1.2.0.12 netbsd-6-0-RELEASE:1.1.1.2 netbsd-6-0-RC2:1.1.1.2 tls-maxphys:1.1.1.2.0.10 tls-maxphys-base:1.1.1.4 matt-nb6-plus:1.1.1.2.0.8 matt-nb6-plus-base:1.1.1.2 netbsd-6-0-RC1:1.1.1.2 yamt-pagecache-base5:1.1.1.2 yamt-pagecache-base4:1.1.1.2 FILE5_11:1.1.1.2 netbsd-6:1.1.1.2.0.6 netbsd-6-base:1.1.1.2 yamt-pagecache-base3:1.1.1.2 yamt-pagecache-base2:1.1.1.2 yamt-pagecache:1.1.1.2.0.4 yamt-pagecache-base:1.1.1.2 FILE5_09:1.1.1.2 cherry-xenmp:1.1.1.2.0.2 cherry-xenmp-base:1.1.1.2 FILE5_07:1.1.1.2 bouyer-quota2-nbase:1.1.1.1 bouyer-quota2:1.1.1.1.0.4 bouyer-quota2-base:1.1.1.1 matt-mips64-premerge-20101231:1.1.1.1 matt-premerge-20091211:1.1.1.1 jym-xensuspend-base:1.1.1.1 jym-xensuspend:1.1.1.1.0.2 jym-xensuspend-nbase:1.1.1.1 FILE5_03:1.1.1.1 CHRISTOS:1.1.1; locks; strict; comment @# @; 1.1 date 2009.05.08.16.35.09; author christos; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2009.05.08.16.35.09; author christos; state Exp; branches 1.1.1.1.2.1; next 1.1.1.2; 1.1.1.2 date 2011.05.12.20.47.02; author christos; state Exp; branches 1.1.1.2.4.1 1.1.1.2.10.1; next 1.1.1.3; 1.1.1.3 date 2013.03.23.15.49.18; author christos; state Exp; branches 1.1.1.3.8.1; next 1.1.1.4; 1.1.1.4 date 2014.06.13.01.48.25; author christos; state Exp; branches 1.1.1.4.6.1 1.1.1.4.10.1; next 1.1.1.5; commitid jtTYsE5FmJU6MiEx; 1.1.1.5 date 2017.02.10.17.42.58; author christos; state Exp; branches; next 1.1.1.6; commitid HAP3kn9Hn6ovMqFz; 1.1.1.6 date 2017.05.24.23.59.57; author christos; state Exp; branches 1.1.1.6.8.1; next 1.1.1.7; commitid WbyOU2LBE5qOyHSz; 1.1.1.7 date 2018.04.15.19.32.47; author christos; state Exp; branches 1.1.1.7.2.1; next 1.1.1.8; commitid unKSwpX2g9VqBzyA; 1.1.1.8 date 2018.10.18.23.54.09; author christos; state Exp; branches; next 1.1.1.9; commitid e8WctwerBeEm4vWA; 1.1.1.9 date 2020.06.15.00.18.48; author christos; state Exp; branches; next 1.1.1.10; commitid HMbuXSjPojU5LfcC; 1.1.1.10 date 2021.04.09.18.58.02; author christos; state Exp; branches; next 1.1.1.11; commitid W9ddLLbSkHHinEOC; 1.1.1.11 date 2022.09.24.20.07.54; author christos; state Exp; branches; next 1.1.1.12; commitid Nf6F9kcpc0EPC9VD; 1.1.1.12 date 2023.08.18.18.36.50; author christos; state Exp; branches; next ; commitid IX26ghc1E2S0AiBE; 1.1.1.1.2.1 date 2009.05.08.16.35.09; author jym; state dead; branches; next 1.1.1.1.2.2; 1.1.1.1.2.2 date 2009.05.13.18.51.56; author jym; state Exp; branches; next ; 1.1.1.2.4.1 date 2014.05.22.15.44.59; author yamt; state Exp; branches; next ; commitid tYJXbWAuFvTh7yBx; 1.1.1.2.10.1 date 2013.06.23.06.26.32; author tls; state Exp; branches; next 1.1.1.2.10.2; commitid OnlO1cBgtQRcIHUw; 1.1.1.2.10.2 date 2014.08.19.23.46.47; author tls; state Exp; branches; next ; commitid jTnpym9Qu0o4R1Nx; 1.1.1.3.8.1 date 2014.08.10.07.07.10; author tls; state Exp; branches; next ; commitid b1wUlsZGswrdGMLx; 1.1.1.4.6.1 date 2017.03.20.06.52.19; author pgoyette; state Exp; branches; next ; commitid jjw7cAwgyKq7RfKz; 1.1.1.4.10.1 date 2017.04.21.16.51.24; author bouyer; state Exp; branches; next ; commitid dUG7nkTKALCadqOz; 1.1.1.6.8.1 date 2018.04.22.07.20.08; author pgoyette; state Exp; branches; next 1.1.1.6.8.2; commitid W6xykws0Zbl4kpzA; 1.1.1.6.8.2 date 2018.10.20.06.58.20; author pgoyette; state Exp; branches; next ; commitid mTSoqZEZ4arHnFWA; 1.1.1.7.2.1 date 2019.06.10.21.44.46; author christos; state Exp; branches; next ; commitid jtc8rnCzWiEEHGqB; desc @@ 1.1 log @Initial revision @ text @ #------------------------------------------------------------------------------ # intel: file(1) magic for x86 Unix # # Various flavors of x86 UNIX executable/object (other than Xenix, which # is in "microsoft"). DOS is in "msdos"; the ambitious soul can do # Windows as well. # # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and # whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere # as well, if, as, and when IBM makes it portable. # # The `versions' should be un-commented if they work for you. # (Was the problem just one of endianness?) # 0 leshort 0502 basic-16 executable >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort 0503 basic-16 executable (TV) >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort 0510 x86 executable >12 lelong >0 not stripped 0 leshort 0511 x86 executable (TV) >12 lelong >0 not stripped 0 leshort =0512 iAPX 286 executable small model (COFF) >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort =0522 iAPX 286 executable large model (COFF) >12 lelong >0 not stripped #>22 leshort >0 - version %ld # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan 0 leshort =0514 80386 COFF executable >12 lelong >0 not stripped >22 leshort >0 - version %ld # rom: file(1) magic for BIOS ROM Extensions found in intel machines # mapped into memory between 0xC0000 and 0xFFFFF # From Gürkan Sengün , www.linuks.mine.nu 0 beshort 0x55AA BIOS (ia32) ROM Ext. >5 string USB USB >7 string LDR UNDI image >30 string IBM IBM comp. Video >26 string Adaptec Adaptec >28 string Adaptec Adaptec >42 string PROMISE Promise >2 byte x (%d*512) @ 1.1.1.1 log @from ftp.astron.com @ text @@ 1.1.1.2 log @from ftp.astron.com. - many security related fixes - no MAXPATHLEN limits - fixed missing text specification on ascii magic - new ``pascal'' style string formats - whitespace comparison fix - more magic @ text @a2 1 # $File: intel,v 1.10 2011/03/30 19:51:00 christos Exp $ a47 5 # Flash descriptors for Intel SPI flash roms. # From Dr. Jesus 0 lelong 0x0ff0a55a Intel serial flash for ICH/PCH ROM <= 5 or 3400 series A-step 16 lelong 0x0ff0a55a Intel serial flash for PCH ROM @ 1.1.1.2.4.1 log @sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") @ text @d3 1 a3 1 # $File: intel,v 1.11 2013/02/06 14:18:52 christos Exp $ d40 1 a40 1 # From Gurkan Sengun , www.linuks.mine.nu @ 1.1.1.2.10.1 log @resync from head @ text @d3 1 a3 1 # $File: intel,v 1.11 2013/02/06 14:18:52 christos Exp $ d40 1 a40 1 # From Gurkan Sengun , www.linuks.mine.nu @ 1.1.1.2.10.2 log @Rebase to HEAD as of a few days ago. @ text @d3 1 a3 1 # $File: intel,v 1.12 2014/04/30 21:41:02 christos Exp $ d19 1 a19 1 #>22 leshort >0 - version %d d22 1 a22 1 #>22 leshort >0 - version %d d29 1 a29 1 #>22 leshort >0 - version %d d32 1 a32 1 #>22 leshort >0 - version %d d36 1 a36 1 >22 leshort >0 - version %d @ 1.1.1.3 log @import file-5.14 changes are "name" + "use" keyword features, bug fixes @ text @d3 1 a3 1 # $File: intel,v 1.11 2013/02/06 14:18:52 christos Exp $ d40 1 a40 1 # From Gurkan Sengun , www.linuks.mine.nu @ 1.1.1.3.8.1 log @Rebase. @ text @d3 1 a3 1 # $File: intel,v 1.12 2014/04/30 21:41:02 christos Exp $ d19 1 a19 1 #>22 leshort >0 - version %d d22 1 a22 1 #>22 leshort >0 - version %d d29 1 a29 1 #>22 leshort >0 - version %d d32 1 a32 1 #>22 leshort >0 - version %d d36 1 a36 1 >22 leshort >0 - version %d @ 1.1.1.4 log @import file-5.19 2014-06-09 9:04 Christos Zoulas * Misc buffer overruns and missing buffer size tests in cdf parsing (Francisco Alonso, Jan Kaluza) 2014-06-02 14:50 Christos Zoulas * Enforce limit of 8K on regex searches that have no limits * Allow the l modifier for regex to mean line count. Default to byte count. If line count is specified, assume a max of 80 characters per line to limit the byte count. * Don't allow conversions to be used for dates, allowing the mask field to be used as an offset. 2014-05-30 12:51 Christos Zoulas * Make the range operator limit the length of the regex search. 2014-05-14 19:23 Christos Zoulas * PR/347: Windows fixes * PR/352: Hangul word processor recognition * PR/354: Encoding irregularities in text files 2014-05-06 6:12 Christos Zoulas * Fix uninitialized title in CDF files (Jan Kaluza) 2014-05-04 14:55 Christos Zoulas * PR/351: Fix compilation of empty files 2014-04-30 17:39 Christos Zoulas * Fix integer formats: We don't specify 'l' or 'h' and 'hh' specifiers anymore, only 'll' for quads and nothing for the rest. This is so that magic writing is simpler. 2014-04-01 15:25 Christos Zoulas * PR/341: Jan Kaluza, fix memory leak * PR/342: Jan Kaluza, fix out of bounds read 2014-03-28 15:25 Christos Zoulas * Fix issue with long formats not matching fmtcheck @ text @d3 1 a3 1 # $File: intel,v 1.12 2014/04/30 21:41:02 christos Exp $ d19 1 a19 1 #>22 leshort >0 - version %d d22 1 a22 1 #>22 leshort >0 - version %d d29 1 a29 1 #>22 leshort >0 - version %d d32 1 a32 1 #>22 leshort >0 - version %d d36 1 a36 1 >22 leshort >0 - version %d @ 1.1.1.4.10.1 log @Sync with HEAD @ text @d3 1 a3 1 # $File: intel,v 1.14 2015/11/10 00:13:27 christos Exp $ a32 5 # updated by Joerg Jenderek at Oct 2015 # https://de.wikipedia.org/wiki/Common_Object_File_Format # http://www.delorie.com/djgpp/doc/coff/filhdr.html # ./msdos (version 5.25) labeled the next entry as "MS Windows COFF Intel 80386 object file" # ./intel (version 5.25) label labeled the next entry as "80386 COFF executable" d34 3 a36 6 0 leshort =0514 # use subroutine to display name+flags+variables for common object formated files >0 use display-coff #>12 lelong >0 not stripped # no hint found, that at offset 22 is version #>22 leshort >0 - version %d a40 2 # updated by Joerg Jenderek # https://en.wikipedia.org/wiki/Option_ROM a41 2 !:mime application/octet-stream !:ext rom/bin @ 1.1.1.4.6.1 log @Sync with HEAD @ text @d3 1 a3 1 # $File: intel,v 1.14 2015/11/10 00:13:27 christos Exp $ a32 5 # updated by Joerg Jenderek at Oct 2015 # https://de.wikipedia.org/wiki/Common_Object_File_Format # http://www.delorie.com/djgpp/doc/coff/filhdr.html # ./msdos (version 5.25) labeled the next entry as "MS Windows COFF Intel 80386 object file" # ./intel (version 5.25) label labeled the next entry as "80386 COFF executable" d34 3 a36 6 0 leshort =0514 # use subroutine to display name+flags+variables for common object formated files >0 use display-coff #>12 lelong >0 not stripped # no hint found, that at offset 22 is version #>22 leshort >0 - version %d a40 2 # updated by Joerg Jenderek # https://en.wikipedia.org/wiki/Option_ROM a41 2 !:mime application/octet-stream !:ext rom/bin @ 1.1.1.5 log @2017-02-10 12:24 Christos Zoulas * release 5.30 2017-02-07 23:27 Christos Zoulas * If we exceeded the offset in a search return no match (Christoph Biedl) * Be more lenient on corrupt CDF files (Christoph Biedl) 2017-02-04 16:46 Christos Zoulas * pacify ubsan sign extension (oss-fuzz/524) 2017-02-01 12:42 Christos Zoulas * off by one in cdf parsing (PR/593) * report debugging sections in elf (PR/591) 2016-11-06 10:52 Christos Zoulas * Allow @@@@@@ in extensions * Add missing overflow check in der magic (Jonas Wagner) 2016-10-25 10:40 Christos Zoulas * release 5.29 2016-10-24 11:20 Christos Zoulas * der getlength overflow (Jonas Wagner) * multiple magic file load failure (Christoph Biedl) 2016-10-17 11:26 Christos Zoulas * CDF parsing improvements (Guy Helmer) 2016-07-20 7:26 Christos Zoulas * Add support for signed indirect offsets 2016-07-18 7:41 Christos Zoulas * cat /dev/null | file - should print empty (Christoph Biedl) 2016-07-05 15:20 Christos Zoulas * Bump string size from 64 to 96. 2016-06-13 20:20 Christos Zoulas * PR/556: Fix separators on annotations. 2016-06-13 19:40 Christos Zoulas * release 5.28 * fix leak on allocation failure 2016-06-01 1:20 Christos Zoulas * PR/555: Avoid overflow for offset > nbytes * PR/550: Segv on DER parsing: - use the correct variable for length - set offset to 0 on failure. 2016-05-13 12:00 Christos Zoulas * release 5.27 2016-04-18 9:35 Christos Zoulas * Errors comparing DER entries or computing offsets are just indications of malformed non-DER files. Don't print them. * Offset comparison was off-by-one. * Fix compression code (Werner Fink) * Put new bytes constant in the right file (not the generated one) 2016-04-16 18:34 Christos Zoulas * release 5.26 2016-03-31 13:50 Christos Zoulas * make the number of bytes read from files configurable. 2016-03-21 13:40 Christos Zoulas * Add bounds checks for DER code (discovered by Thomas Jarosch) * Change indirect recursion limit to indirect use count and bump from 15 to 50 to prevent abuse. 2016-03-13 20:39 Christos Zoulas * Add -00 which prints filename\0description\0 2016-03-01 13:28 Christos Zoulas * Fix ID3 indirect parsing 2016-01-19 10:18 Christos Zoulas * add DER parsing capability 2015-11-13 10:35 Christos Zoulas * provide dprintf(3) for the OS's that don't have it. 2015-11-11 16:25 Christos Zoulas * redo the compression code report decompression errors 2015-11-10 23:25 Christos Zoulas * REG_STARTEND code is not working as expected, delete it. 2015-11-09 16:05 Christos Zoulas * Add zlib support if we have it. 2015-11-05 11:22 Christos Zoulas * PR/492: compression forking was broken with magic_buffer. 2015-09-16 9:50 Christos Zoulas * release 5.25 2015-09-11 13:25 Christos Zoulas * add a limit to the length of regex searches 2015-09-08 9:50 Christos Zoulas * fix problems with --parameter (Christoph Biedl) 2015-07-11 10:35 Christos Zoulas * Windows fixes PR/466 (Jason Hood) 2015-07-09 10:35 Christos Zoulas * release 5.24 2015-06-11 8:52 Christos Zoulas * redo long option encoding to fix off-by-one in 5.23 2015-06-10 13:50 Christos Zoulas * release 5.23 2015-06-09 16:10 Christos Zoulas * Fix issue with regex range for magic with offset * Always return true from mget with USE (success to mget not match indication). Fixes mime evaluation after USE magic * PR/459: Don't insert magic entries to the list if there are parsing errors for them. 2015-06-03 16:00 Christos Zoulas * PR/455: Add utf-7 encoding 2015-06-03 14:30 Christos Zoulas * PR/455: Implement -Z, look inside, but don't report on compression * PR/454: Fix allocation error on bad magic. 2015-05-29 10:30 Christos Zoulas * handle MAGIC_CONTINUE everywhere, not just in softmagic 2015-05-21 14:30 Christos Zoulas * don't print descriptions for NAME types when mime. 2015-04-09 15:59 Christos Zoulas * Add --extension to list the known extensions for this file type Idea by Andrew J Roazen 2015-02-14 12:23 Christos Zoulas * Bump file search buffer size to 1M. 2015-01-09 14:35 Christos Zoulas * Fix multiple issues with date formats reported by Christoph Biedl: - T_LOCAL meaning was reversed - Arithmetic did not work Also stop adjusting daylight savings for gmt printing. 2015-01-05 13:00 Christos Zoulas * PR/411: Fix memory corruption from corrupt cdf file. @ text @d3 1 a3 1 # $File: intel,v 1.14 2015/11/10 00:13:27 christos Exp $ a32 5 # updated by Joerg Jenderek at Oct 2015 # https://de.wikipedia.org/wiki/Common_Object_File_Format # http://www.delorie.com/djgpp/doc/coff/filhdr.html # ./msdos (version 5.25) labeled the next entry as "MS Windows COFF Intel 80386 object file" # ./intel (version 5.25) label labeled the next entry as "80386 COFF executable" d34 3 a36 6 0 leshort =0514 # use subroutine to display name+flags+variables for common object formated files >0 use display-coff #>12 lelong >0 not stripped # no hint found, that at offset 22 is version #>22 leshort >0 - version %d a40 2 # updated by Joerg Jenderek # https://en.wikipedia.org/wiki/Option_ROM a41 2 !:mime application/octet-stream !:ext rom/bin @ 1.1.1.6 log @Import file-5.31; mostly oss-fuzz found bugs. @ text @d3 1 a3 1 # $File: intel,v 1.15 2017/03/17 21:35:28 christos Exp $ d39 2 a40 2 0 leshort =0514 # use subroutine to display name+flags+variables for common object formated files @ 1.1.1.6.8.1 log @Sync with HEAD @ text @d3 1 a3 1 # $File: intel,v 1.16 2017/11/14 15:48:36 christos Exp $ d48 1 a48 1 # From: Alex Myczko @ 1.1.1.6.8.2 log @Sync with head @ text @d3 1 a3 1 # $File: intel,v 1.17 2018/08/01 10:34:03 christos Exp $ a44 4 0 leshort 0x0200 >0 use display-coff 0 leshort 0x8664 >0 use display-coff @ 1.1.1.7 log @2018-04-15 14:52 Christos Zoulas * release 5.33 2018-02-24 14:50 Christos Zoulas * extend the support for ${x?:} expansions for magic descriptions 2018-02-21 16:25 Christos Zoulas * add support for ${x?:} in mime types to handle pie binaries. 2017-11-03 9:23 Christos Zoulas * add support for negative offsets (offsets from the end of file) 2017-09-26 8:22 Christos Zoulas * close the file on error when writing magic (Steve Grubb) 2017-09-24 12:02 Christos Zoulas * seccomp support (Paul Moore) 2017-09-02 11:53 Christos Zoulas * release 5.32 2017-08-28 16:37 Christos Zoulas * Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski) 2017-08-27 03:55 Christos Zoulas * Fix always true condition (Thomas Jarosch) 2017-05-24 17:30 Christos Zoulas * pickier parsing of numeric values in magic files. 2017-05-23 17:55 Christos Zoulas * PR/615 add magic_getflags() @ text @d3 1 a3 1 # $File: intel,v 1.16 2017/11/14 15:48:36 christos Exp $ d48 1 a48 1 # From: Alex Myczko @ 1.1.1.7.2.1 log @Sync with HEAD @ text @d3 1 a3 1 # $File: intel,v 1.17 2018/08/01 10:34:03 christos Exp $ a44 4 0 leshort 0x0200 >0 use display-coff 0 leshort 0x8664 >0 use display-coff @ 1.1.1.8 log @2018-10-18 19:32 Christos Zoulas * release 5.35 2018-09-10 20:38 Christos Zoulas * Add FreeBSD ELF core file support (John Baldwin) 2018-08-20 18:40 Christos Zoulas * PR/30: Allow all parameter values to be set (don't treat 0 specially) * handle default annotations on the softmagic match instead at the end. 2018-07-25 10:17 Christos Zoulas * PR/23: Recognize JSON files 2018-07-25 10:17 Christos Zoulas * PR/18: file --mime-encoding should not print mime-type 2018-07-25 8:50 Christos Zoulas * release 5.34 2018-06-22 16:38 Christos Zoulas * Add Quad indirect offsets 2018-05-24 14:10 Christos Zoulas * Enable parsing of ELF dynamic sections to handle PIE better @ text @d3 1 a3 1 # $File: intel,v 1.17 2018/08/01 10:34:03 christos Exp $ a44 4 0 leshort 0x0200 >0 use display-coff 0 leshort 0x8664 >0 use display-coff @ 1.1.1.9 log @Import 5.39: * Remove unused subtype_mime (Steve Grubb) * Remove unused check in okstat (Steve Grubb) * Fix mime-type in elf binaries by making sure $x is set * Fix indirect negative offsets broken by OFFNEGATIVE * Fix GUID equality check * PR/165: Handle empty array and strings in JSON * PR/162: Add --exclude-quiet * Fix memory leak in ascmagic (Steve Grubb) * Fix string comparison length with ignore whitespace * Fix mingwin 64 compilation * PR/159: whitelist getpid needed for file_pipe2file() * Indicate negative offsets with a flag OFFNEGATIVE so that -0 works. * Introduce "offset" magic type that can be used to detect the file size, and bail on short files. * document DER better in the magic man page. * fix memory leaks (SonarQube) * rewrite confusing loops (SonarQube) * fix bogus test (SonarQube) * pass a sized buffer to file_fmttime() (SonarQube) * Don't allow * in printf formats, or the code itself (Christoph Biedl) * Introduce a printf output size checker to avoid DoS attacks * Avoid memory leak on error (oss-fuzz) * Check length of string on DER before derefercing and add new types * Add missing DER string (oss-fuzz) * Add missing DER types, and debugging * PR/140: Avoid abort with hand-crafted magic file (gockelhahn) * PR/139: Avoid DoS in printf with hand-crafted magic file (gockelhahn) * PR/138: Avoid crash with hand-crafted magic file (gockelhahn) * PR/136: Fix static build by adding a libmagic.pc (Fabrice Fontaine) * add guid support native support via the "guid" type. @ text @d3 1 a3 1 # $File: intel,v 1.18 2020/04/18 16:19:03 christos Exp $ a69 57 # From: Joerg Jenderek # URL: https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface # Reference: https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf # Note: generated for example by `cat /sys/firmware/acpi/tables/DSDT MyDSDT.aml` 0 string DSDT >0 use acpi-table # not tested or other file format 0 string APIC >0 use acpi-table #0 string ASF! #>0 use acpi-table 0 string FACP >0 use acpi-table #0 string FACS #>0 use acpi-table 0 string MCFG >0 use acpi-table 0 string SLIC >0 use acpi-table 0 string SSDT >0 use acpi-table 0 name acpi-table # skip ASCII text starting with DSDT by looking for valid "low" revision >8 ubyte <17 ACPI Machine Language file # assume that ACPI tables size are lower than 16 MiB #>4 ulelong <0x01000000 # DSDT for Differentiated System Description Table >>0 string x '%.4s' #!:mime application/octet-stream !:mime application/x-intel-aml !:ext aml # the manufacture model ID like: VBOXBIOS BXDSDT >>16 string >\0 %.8s # OEM revision of DSDT for supplied OEM Table ID like: 0 1 2 20090511 >>>24 ulelong x %x # OEM ID like: INTEL VBOX (VirtualBox) BXDSDT (qemu) MEDION or \030\001\0\0 for s3pt.aml >>10 ubyte >040 by %c >>>11 ubyte >040 \b%c >>>>12 ubyte >040 \b%c >>>>>13 ubyte >040 \b%c >>>>>>14 ubyte >040 \b%c >>>>>>>15 ubyte >040 \b%c # This field also sets the global integer width for the AML interpreter. # Values less than two will cause the interpreter to use 32-bit. # Values of two and greater will cause the interpreter to use full 64-bit. # 16 for asf!.aml, 67 fo rsdp.aml >>8 ubyte x \b, revision %u # length, in bytes, of the entire DSDT (including the header) >>4 ulelong x \b, %u bytes # entire table must sum to zero #>>9 ubyte x \b, checksum 0x%x # vendor ID for the ASL Compiler like: INTL MSFT ... >>28 string >\0 \b, created by %.4s # revision number of the ASL Compiler like: 20051117 20140724 20190703 20200110 ... >>>32 ulelong x %x @ 1.1.1.10 log @2021-03-30 20:21 Christos Zoulas * release 5.40 2021-02-05 16:31 Christos Zoulas * PR/234: Add limit to the number of bytes to scan for encoding * PR/230: Fix /T (trim flag) for regex 2021-02-01 12:31 Christos Zoulas * PR/77: Trim trailing separator. 2020-12-17 15:44 Christos Zoulas * PR/211: Convert system read errors from corrupt ELF files into human readable error messages 2020-12-08 16:24 Christos Zoulas * fix multithreaded decompression file descriptor issue by using close-on-exec (Denys Vlasenko) 2020-06-27 11:58 Christos Zoulas * Exclude surrogate pairs from utf-8 detection (Michael Liu) 2020-06-25 12:53 Christos Zoulas * Include # to the list of ignored format chars (Werner Fink) @ text @d3 1 a3 1 # $File: intel,v 1.19 2020/12/12 20:01:47 christos Exp $ d40 1 a40 1 # use subroutine to display name+flags+variables for common object formatted files @ 1.1.1.11 log @Import file-5.43+; last was file-5.40 2022-09-20 17:12 Christos Zoulas * fixed various clustefuzz issues 2022-09-19 15:54 Christos Zoulas * Fix error detection for decompression code (Vincent Mihalkovic) 2022-09-15 13:50 Christos Zoulas * Add MAGIC_NO_COMPRESS_FORK and use it to produce a more meaningful error message if we are sandboxing. 2022-09-15 10:45 Christos Zoulas * Add built-in lzip decompression support (Michal Gorny) 2022-09-14 10:35 Christos Zoulas * Add built-in zstd decompression support (Martin Rodriguez Reboredo) 2022-09-13 14:55 Christos Zoulas * release 5.43 2022-09-10 9:17 Christos Zoulas * Add octal indirect magic (Michal Gorny) 2022-08-17 11:43 Christos Zoulas * PR/374: avoid infinite loop in non-wide code (piru) * PR/373: Obey MAGIC_CONTINUE with multiple magic files (vismarli) 2022-07-26 11:10 Christos Zoulas * Fix bug with large flist (Florian Weimer) 2022-07-07 13:21 Christos Zoulas * PR/364: Detect non-nul-terminated core filenames from QEMU (mam-ableton) 2022-07-04 15:45 Christos Zoulas * PR/359: Add support for http://ndjson.org/ (darose) * PR/362: Fix wide printing (ro-ee) * PR/358: Fix width for -f - (jpalus) * PR/356: Fix JSON constant parsing (davewhite) 2022-06-10 9:40 Christos Zoulas * release 5.42 2022-05-31 14:50 Christos Zoulas * PR/348: add missing cases to prevent file from aborting on random magic files. 2022-05-27 21:05 Christos Zoulas * PR/351: octalify filenames when not raw before printing. 2022-04-18 17:51 Christos Zoulas * fix regex cacheing bug (Dirk Mueller) * merge file_regcomp and file_regerror() to simplify the code and reduce memory requirements for storing regexes (Dirk Mueller) 2022-03-19 12:56 Christos Zoulas * cache regex (Dirk Mueller) * detect filesystem full by flushing output (Dirk Mueller) 2021-11-19 12:36 Christos Zoulas * implement running decompressor programs using posix_spawnp(2) instead of vfork(2) 2021-10-24 11:51 Christos Zoulas * Add support for msdos dates and times 2021-10-20 9:55 Christos Zoulas * use the system byte swapping functions if available (Werner Fink) 2021-10-18 11:57 Christos Zoulas * release 5.41 2021-09-23 03:51 Christos Zoulas * Avinash Sonawane: Fix tzname detection 2021-09-03 09:17 Christos Zoulas * Fix relationship tests with "search" magic, don't short circuit logic 2021-07-13 01:06 Christos Zoulas * Fix memory leak in compile mode 2021-07-01 03:51 Christos Zoulas * PR/272: kiefermat: Only set returnval = 1 when we printed something (in all cases print or !print). This simplifies the logic and fixes the issue in the PR with -k and --mime-type there was no continuation printed before the default case. 2021-06-30 13:07 Christos Zoulas * PR/270: Don't translate unprintable characters in %s magic formats when -r * PR/269: Avoid undefined behavior with clang (adding offset to NULL) 2021-05-09 18:38 Christos Zoulas * Add a new flag (f) that requires that the match is a full word, not a partial word match. * Add varint types (unused) 2021-04-19 17:17 Christos Zoulas * PR/256: mutableVoid: If the file is less than 3 bytes, use the file length to determine type * PR/259: aleksandr.v.novichkov: mime printing through indirect magic is not taken into account, use match directly so that it does. 2021-04-04 17:02 Christos Zoulas * count the total bytes found not the total byte positions in order to determine encoding (Anatol Belski) @ text @d3 1 a3 1 # $File: intel,v 1.22 2022/04/02 14:47:42 christos Exp $ d46 1 a46 10 # no F_EXEC flag bit implies Intel ia64 COFF object file without optional header >18 leshort ^0x0002 # skip some DEGAS high-res uncompressed bitmap *.pi3 handled by ./images like # GEMINI03.PI3 MODEM2.PI3 POWERFIX.PI3 sigirl1.pi3 vanna5.pi3 # by test for valid starting character (often point 0x2E) of 1st section name >>20 ubyte >0x1F >>>0 use display-coff # F_EXEC flag bit implies Intel ia64 COFF executable >18 leshort &0x0002 >>0 use display-coff d55 2 a56 12 # URL: http://fileformats.archiveteam.org/wiki/BIOS # Reference: http://www.lejabeach.com/sisubb/BIOS_Disassembly_Ninjutsu_Uncovered.pdf 0 beshort 0x55AA # skip misidentified raspberry pi pieeprom-*.bin by check for # unlikely high ROM size (0xF0*512=240*512) and not observed start instruction 0x0F >2 ubeshort !0xF00F # skip 2 byte sized eof.bin with start magic >>0 use rom-x86 0 name rom-x86 >0 beshort x BIOS (ia32) ROM Ext. #!:mime application/octet-stream !:mime application/x-ibm-rom d58 2 a59 23 ################################################################################ # not Plug aNd Play ($PnP) like 00000000 (ide_xtp.bin kvmvapic.bin V7VGA.ROM) 000000fc (MCT-VGA.bin) # 55aaf00f (pieeprom-*.bin) 55aa40e9 (Trm3x5.bin) 24506f4f (sgabios-bin.rom) # 55aa4be9 (vgabios-stdvga.rom vgabios-cirrus-bin.rom vgabios-vmware-bin.rom) >(26.s) ubelong !0x24506e50 #>(26.s) ubelong !0x24506e50 NOT PNP=%8.8x # also not PCI (PCIR) implies "old" ISA cards or foo like: 8a168404 (MCT-VGA.bin) # 55aaf00f (pieeprom*.bin) >>(24.s) ubelong !0x50434952 #>>(24.s) ubelong !0x50434952 ISA CARD=%8.8x # "old" identification strings used in file version 5.41 and earlier # probably an USB controller >>>5 string USB USB # probably https://en.wikipedia.org/wiki/Preboot_Execution_Environment >>>7 string LDR UNDI image # probably another Adaptec SCSI controller >>>26 string Adaptec Adaptec # http://minuszerodegrees.net/rom/bin/adaptec_aha1542cp_bios_908501-00.bin # already done by PNP variant #>>>28 string Adaptec Adaptec # probably Promise SCSI controller >>>42 string PROMISE Promise # old test for IBM compatible Video cards; INTERNAL FACTS WHY IS THIS WORKING? d61 4 a64 148 # display exact text for IBM compatible Video cards with longer text >>33 ubyte !0 >>>30 string x "%s" # http://minuszerodegrees.net/rom/bin/unknown/MCT-VGA-16%20-%20TDVGA%203588%20BIOS%20Version%20V1.04A.zip # "IBM COMPATIBLETDVGA 3588 BIOS Version V1.04A2+" "MCT-VGA-16 - TDVGA 3588 BIOS Version V1.04A.bin" # "IBM VGA Compatible\001" NVidia44.bin # "IBM EGA ROM Video Seven BIOS Code, Version 1.04" V7VGA.ROM # "IBM" vgabios-stdvga.rom # "IBM" vgabios-vmware-bin.rom: # "IBM" vgabios-cirrus-bin.rom # "IBM" vgabios-virtio-bin.rom ################################################################################ # ROM size in 512B blocks must be interpreted as unsigned for ROM of network cards # like: efi-eepro100.rom efi-rtl8139.rom pxe-e1000.rom >2 ubyte x (%u*512) # file name file size calculated size remark # eof.bin 2 - with start magic nothing is shown here # orchid.bin 188 0 =0*512 on window 95 CD in Drivers\audio\orchid3d # multiboot.bin 1024 1024 =2*512 QEMU emulator # loader1.bin 512 2048 =4*512 # ide_xtp.bin 8192 8192 =16*512 # kvmvapic.bin 9216 9216 =18*512 # V7VGA.ROM 18832 16384 =32*512 # adaptec1542.bin 32768 16384 =32*512 # MCT-VGA.bin 32768 24576 =48*512 # 2975BIOS.BIN 32768 32256 =63*512 # efi-e1000.rom 196608 64000 =125*512 # efi-rtl8139.rom 176640 66048 =129*512 # pieeprom*.bin 524288 122880 =240*512 ################################################################################ # initialization vector with executable code; often near JuMP instruction E9 yy zz >3 ubyte =0xE9 jmp # jmp offset like: 008fh 0093h 009fh 00afh 0143h 3ad7h 5417h 54ech 594dh 895fh >>4 uleshort x %#4.4x # for initialization vector samples without 3 byte jump instruction >3 ubyte !0xE9 instruction # eb4b3734h NVidia44.bin # 00003234h V7VGA.ROM # 060e0731h kvmvapic.bin # cb000000h linuxboot-bin.rom # e80d0fcbh PXE-Intel.rom # b8004875h orchid.bin >>3 ubelong x %#8.8x # For misidetified raspberry pi pieeprom-*.bin like: 0xf00f #>2 ubeshort x \b, AT 2 %#4.4x ################################################################################ # new sections for BIOS (ia32) ROM Extension # 4 bytes ASCII Signature "$PnP" for Plug aNd Play expansion header >(26.s) string =$PnP \b; #>(26.s) string =$PnP FOUND $PnP # at 1Ah possible offset to expansion header structure; new for Plug aNd Play >>26 uleshort x at %#x PNP # Plug and Play vendor+device ID like: 0 0x000f1000 (2975BIOS.BIN) 0x31121095 (4243.bin) 0x04904215 (adaptec1542.bin) #>>(26.s+0x0A) ulelong !0 NOT-nullID=%8.8x >>(26.s+0x0A) uleshort !0 # show PnP Vendor identification in human readable text form instead of numeric # For adaptec_ava1515_bios_585201-00.bin reverted endian! BUT IS THIS ALWAYS TRUE? >>>(26.s+0x0C) use \^PCI-vendor >>>(26.s+0x0A) ubeshort x device=%#4.4x # 3 byte Device type code; probably the same meaning as in PCI section? # OK for storage controller SCSI (2975BIOS.BIN adaptec1542.bin) # and network controller ethernet (efi-e1000.rom efi-rtl8139.rom) >>(26.s+0x12) use PCI-class # structure revision like: 01h >>(26.s+4) ubyte !1 \b, revision %u # PnP Header structure length in multiple of 16 bytes like: 2 >>(26.s+5) uleshort !2 \b, length %u*16 # offset to next header; 0 if none >>(26.s+7) uleshort !0 \b, at %#x next header # reserved byte; seems to be zero >>(26.s+8) ubyte !0 \b, reserved %#x # 8-bit checksum for this header; calculated and patched by patch2pnprom >>(26.s+9) ubyte !0 \b, CRC %#x # pointer to optional manufacturer string; like: 0 (4243.bin) 59h 5ch 60h c7h 14eh 27ch 296h 324h 3662h >>(26.s+0x0E) uleshort >0 \b, at %#x >>>(26.s+0x0C) uleshort x # manufacturer ASCII-Z string like "http://ipxe.org" "Plop - Elmar Hanlhofer www.plop.at" "QEMU" >>>>(&0.s) string x "%s" # pointer to optional product string; like: 0 (2975BIOS.BIN) 6ch 70h 7ch d9h 160h 281h 29bh 329h >>(26.s+0x10) uleshort >0 \b, at %#x >>>(26.s+0x0E) uleshort x # often human readable product ASCII-Z string like "iPXE" "Plop Boot Manager" # "multiboot loader" "Intel UNDI, PXE-2.0 (build 082)" >>>>(&0.s) string x "%s" # PnP Device indicators; contains bits that identify the device as being capable of bootable #>>(26.s+0x15) ubyte x \b, INDICATORS %#x # device is a display device >>(26.s+0x15) ubyte &0x01 \b, display # device is an input device >>(26.s+0x15) ubyte &0x02 \b, input # device is an IPL device >>(26.s+0x15) ubyte &0x04 \b, IPL #>>(26.s+0x15) ubyte &0x08 reserved # ROM is only required if this device is selected as a boot device >>(26.s+0x15) ubyte &0x10 \b, bootable # indicates ROM is read cacheable >>(26.s+0x15) ubyte &0x20 \b, cacheable # ROM may be shadowed in RAM >>(26.s+0x15) ubyte &0x40 \b, shadowable # ROM supports the device driver initialization model >>(26.s+0x15) ubyte &0x80 \b, InitialModel # boot connection vector; an offset to a routine that hook into INT 9h, INT 10h, or INT 13h # 0 means disabled 0x0429 (4650_sr5.bin) 0x0072 (adaptec1542.bin) >>(26.s+0x16) uleshort !0 \b, boot vector offset %#x # disconnect vector; offset to routine that do cleanup from an unsuccessful boot attempt >>(26.s+0x18) uleshort !0 \b, disconnect offset %#x # bootstrap entry point/vector (BEV); offset to a routine (like RPL) that hook into INT 19h # 0 means disabled 0x3c (multiboot.bin) 0x358 (efi-rtl8139.rom) 0xae7 (PXE-Intel.rom) >>(26.s+0x1A) uleshort !0 \b, bootstrap offset %#x # 2nd reserved area; seems to be zero >>(26.s+0x1C) uleshort !0 \b, 2nd reserved %#x # static resource information vector; 0 means disabled >>(26.s+0x1E) uleshort !0 \b, static offset %#4.4x ################################################################################ # 4 bytes ASCII Signature "PCIR" for PCI Data Structure #>(24.s) string =PCIR FOUND PCIR >(24.s) string =PCIR \b; # pointer to PCI data structure like: 1Ch 38h 104h 8E44h >>24 uleshort x at %#x PCI # Vendor identification (ID) https://pci-ids.ucw.cz/v2.2/pci.ids #>>(24.s+4) uleshort x ID=%4.4x # show Vendor identification in human readable text form instead of numeric >>(24.s+4) use PCI-vendor # device identification (ID) >>(24.s+6) uleshort x device=%#4.4x # Base+sub class code https://wiki.osdev.org/PCI >>(24.s+0x0D) use PCI-class # pointer to vital product data (VPD); 0 indicates no VPD; WHAT EXACTLY iS VPD? >>(24.s+8) uleshort !0 \b, at %#x VPD # PCI data structure length like: 24h 28h >>(24.s+0xA) uleshort >0x28 \b, length %u # PCI data structure revision like: 0 3 >>(24.s+0xC) ubyte >0 \b, revison %u # image length (hexadecimal) in multiple of 512 bytes like: 54 56 68 6a 76 78 7c 7d 7e 7f 80 81 83 # Apparently this gives the same information as given by byte at offset 2 but as 16-bit #>>(24.s+0x10) uleshort x \b, length %u*512 # revision level of code/data like: 0 1 201h 502h >>(24.s+0xC) ubyte >1 \b, code revison %#x # code type: 0~Intel x86/PC-AT compatible 1~Open firmware standard for PCI42 FF~Reserved >>(24.s+0x14) ubyte >0 \b, code type %#x # last image indicator; bit 7 indicates "last image"; bits 0-6 are reserved >>(24.s+0x15) ubyte >0 >>>(24.s+0x15) ubyte =0x80 \b, last ROM # THIS SHOULD NOT HAPPEN! >>>(24.s+0x15) ubyte !0x80 \b, indicator %x # 3rd reserved area; seems to be zero in most cases but not for # efi-e1000.rom efi-rtl8139.rom >>(24.s+0x16) ubeshort !0 \b, 3rd reserved %#x d121 1 a121 1 #>>9 ubyte x \b, checksum %#x @ 1.1.1.12 log @Update to file-5.45 (Last was file-5.44) 2023-07-27 15:45 Christos Zoulas * release 5.45 2023-07-17 11:53 Christos Zoulas * PR/465: psrok1: Avoid muslc asctime_r crash 2023-05-21 13:05 Christos Zoulas * add SIMH tape format support 2023-02-09 12:50 Christos Zoulas * bump the max size of the elf section notes to be read to 128K and make it configurable 2023-01-08 1:08 Christos Zoulas * PR/415: Fix decompression with program returning empty 2022-12-26 1:47 Christos Zoulas * PR/408: fix -p with seccomp * PR/412: fix MinGW compilation @ text @d3 1 a3 1 # $File: intel,v 1.23 2022/10/31 13:22:26 christos Exp $ d144 1 a144 1 # For misidentified raspberry pi pieeprom-*.bin like: 0xf00f d233 1 a233 1 >>(24.s+0xC) ubyte >0 \b, revision %u d238 1 a238 1 >>(24.s+0xC) ubyte >1 \b, code revision %#x @ 1.1.1.1.2.1 log @file intel was added on branch jym-xensuspend on 2009-05-13 18:51:56 +0000 @ text @d1 47 @ 1.1.1.1.2.2 log @Sync with HEAD. Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html @ text @a0 47 #------------------------------------------------------------------------------ # intel: file(1) magic for x86 Unix # # Various flavors of x86 UNIX executable/object (other than Xenix, which # is in "microsoft"). DOS is in "msdos"; the ambitious soul can do # Windows as well. # # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and # whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere # as well, if, as, and when IBM makes it portable. # # The `versions' should be un-commented if they work for you. # (Was the problem just one of endianness?) # 0 leshort 0502 basic-16 executable >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort 0503 basic-16 executable (TV) >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort 0510 x86 executable >12 lelong >0 not stripped 0 leshort 0511 x86 executable (TV) >12 lelong >0 not stripped 0 leshort =0512 iAPX 286 executable small model (COFF) >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort =0522 iAPX 286 executable large model (COFF) >12 lelong >0 not stripped #>22 leshort >0 - version %ld # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan 0 leshort =0514 80386 COFF executable >12 lelong >0 not stripped >22 leshort >0 - version %ld # rom: file(1) magic for BIOS ROM Extensions found in intel machines # mapped into memory between 0xC0000 and 0xFFFFF # From Gürkan Sengün , www.linuks.mine.nu 0 beshort 0x55AA BIOS (ia32) ROM Ext. >5 string USB USB >7 string LDR UNDI image >30 string IBM IBM comp. Video >26 string Adaptec Adaptec >28 string Adaptec Adaptec >42 string PROMISE Promise >2 byte x (%d*512) @