1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*43a5ec4eSXin LI# $File: intel,v 1.20 2021/04/26 15:56:00 christos Exp $ 4b6cee71dSXin LI# intel: file(1) magic for x86 Unix 5b6cee71dSXin LI# 6b6cee71dSXin LI# Various flavors of x86 UNIX executable/object (other than Xenix, which 7b6cee71dSXin LI# is in "microsoft"). DOS is in "msdos"; the ambitious soul can do 8b6cee71dSXin LI# Windows as well. 9b6cee71dSXin LI# 10b6cee71dSXin LI# Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and 11b6cee71dSXin LI# whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere 12b6cee71dSXin LI# as well, if, as, and when IBM makes it portable. 13b6cee71dSXin LI# 14b6cee71dSXin LI# The `versions' should be un-commented if they work for you. 15b6cee71dSXin LI# (Was the problem just one of endianness?) 16b6cee71dSXin LI# 17b6cee71dSXin LI0 leshort 0502 basic-16 executable 18b6cee71dSXin LI>12 lelong >0 not stripped 19b6cee71dSXin LI#>22 leshort >0 - version %d 20b6cee71dSXin LI0 leshort 0503 basic-16 executable (TV) 21b6cee71dSXin LI>12 lelong >0 not stripped 22b6cee71dSXin LI#>22 leshort >0 - version %d 23b6cee71dSXin LI0 leshort 0510 x86 executable 24b6cee71dSXin LI>12 lelong >0 not stripped 25b6cee71dSXin LI0 leshort 0511 x86 executable (TV) 26b6cee71dSXin LI>12 lelong >0 not stripped 27b6cee71dSXin LI0 leshort =0512 iAPX 286 executable small model (COFF) 28b6cee71dSXin LI>12 lelong >0 not stripped 29b6cee71dSXin LI#>22 leshort >0 - version %d 30b6cee71dSXin LI0 leshort =0522 iAPX 286 executable large model (COFF) 31b6cee71dSXin LI>12 lelong >0 not stripped 32b6cee71dSXin LI#>22 leshort >0 - version %d 333e41d09dSXin LI# updated by Joerg Jenderek at Oct 2015 343e41d09dSXin LI# https://de.wikipedia.org/wiki/Common_Object_File_Format 353e41d09dSXin LI# http://www.delorie.com/djgpp/doc/coff/filhdr.html 363e41d09dSXin LI# ./msdos (version 5.25) labeled the next entry as "MS Windows COFF Intel 80386 object file" 373e41d09dSXin LI# ./intel (version 5.25) label labeled the next entry as "80386 COFF executable" 38b6cee71dSXin LI# SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan 393e41d09dSXin LI0 leshort =0514 40*43a5ec4eSXin LI# use subroutine to display name+flags+variables for common object formatted files 413e41d09dSXin LI>0 use display-coff 423e41d09dSXin LI#>12 lelong >0 not stripped 433e41d09dSXin LI# no hint found, that at offset 22 is version 443e41d09dSXin LI#>22 leshort >0 - version %d 4548c779cdSXin LI0 leshort 0x0200 4648c779cdSXin LI>0 use display-coff 4748c779cdSXin LI0 leshort 0x8664 4848c779cdSXin LI>0 use display-coff 49b6cee71dSXin LI 50b6cee71dSXin LI# rom: file(1) magic for BIOS ROM Extensions found in intel machines 51b6cee71dSXin LI# mapped into memory between 0xC0000 and 0xFFFFF 5258a0f0d0SEitan Adler# From: Alex Myczko <alex@aiei.ch> 533e41d09dSXin LI# updated by Joerg Jenderek 543e41d09dSXin LI# https://en.wikipedia.org/wiki/Option_ROM 55b6cee71dSXin LI0 beshort 0x55AA BIOS (ia32) ROM Ext. 563e41d09dSXin LI!:mime application/octet-stream 573e41d09dSXin LI!:ext rom/bin 58b6cee71dSXin LI>5 string USB USB 59b6cee71dSXin LI>7 string LDR UNDI image 60b6cee71dSXin LI>30 string IBM IBM comp. Video 61b6cee71dSXin LI>26 string Adaptec Adaptec 62b6cee71dSXin LI>28 string Adaptec Adaptec 63b6cee71dSXin LI>42 string PROMISE Promise 64b6cee71dSXin LI>2 byte x (%d*512) 65b6cee71dSXin LI 66b6cee71dSXin LI# Flash descriptors for Intel SPI flash roms. 67b6cee71dSXin LI# From Dr. Jesus <j@hug.gs> 68b6cee71dSXin LI0 lelong 0x0ff0a55a Intel serial flash for ICH/PCH ROM <= 5 or 3400 series A-step 69b6cee71dSXin LI16 lelong 0x0ff0a55a Intel serial flash for PCH ROM 702726a701SXin LI 712726a701SXin LI# From: Joerg Jenderek 722726a701SXin LI# URL: https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface 732726a701SXin LI# Reference: https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf 742726a701SXin LI# Note: generated for example by `cat /sys/firmware/acpi/tables/DSDT MyDSDT.aml` 752726a701SXin LI0 string DSDT 762726a701SXin LI>0 use acpi-table 772726a701SXin LI# not tested or other file format 782726a701SXin LI0 string APIC 792726a701SXin LI>0 use acpi-table 802726a701SXin LI#0 string ASF! 812726a701SXin LI#>0 use acpi-table 822726a701SXin LI0 string FACP 832726a701SXin LI>0 use acpi-table 842726a701SXin LI#0 string FACS 852726a701SXin LI#>0 use acpi-table 862726a701SXin LI0 string MCFG 872726a701SXin LI>0 use acpi-table 882726a701SXin LI0 string SLIC 892726a701SXin LI>0 use acpi-table 902726a701SXin LI0 string SSDT 912726a701SXin LI>0 use acpi-table 922726a701SXin LI0 name acpi-table 932726a701SXin LI# skip ASCII text starting with DSDT by looking for valid "low" revision 942726a701SXin LI>8 ubyte <17 ACPI Machine Language file 952726a701SXin LI# assume that ACPI tables size are lower than 16 MiB 962726a701SXin LI#>4 ulelong <0x01000000 972726a701SXin LI# DSDT for Differentiated System Description Table 982726a701SXin LI>>0 string x '%.4s' 992726a701SXin LI#!:mime application/octet-stream 1002726a701SXin LI!:mime application/x-intel-aml 1012726a701SXin LI!:ext aml 1022726a701SXin LI# the manufacture model ID like: VBOXBIOS BXDSDT 1032726a701SXin LI>>16 string >\0 %.8s 1042726a701SXin LI# OEM revision of DSDT for supplied OEM Table ID like: 0 1 2 20090511 1052726a701SXin LI>>>24 ulelong x %x 1062726a701SXin LI# OEM ID like: INTEL VBOX (VirtualBox) BXDSDT (qemu) MEDION or \030\001\0\0 for s3pt.aml 1072726a701SXin LI>>10 ubyte >040 by %c 1082726a701SXin LI>>>11 ubyte >040 \b%c 1092726a701SXin LI>>>>12 ubyte >040 \b%c 1102726a701SXin LI>>>>>13 ubyte >040 \b%c 1112726a701SXin LI>>>>>>14 ubyte >040 \b%c 1122726a701SXin LI>>>>>>>15 ubyte >040 \b%c 1132726a701SXin LI# This field also sets the global integer width for the AML interpreter. 1142726a701SXin LI# Values less than two will cause the interpreter to use 32-bit. 1152726a701SXin LI# Values of two and greater will cause the interpreter to use full 64-bit. 1162726a701SXin LI# 16 for asf!.aml, 67 fo rsdp.aml 1172726a701SXin LI>>8 ubyte x \b, revision %u 1182726a701SXin LI# length, in bytes, of the entire DSDT (including the header) 1192726a701SXin LI>>4 ulelong x \b, %u bytes 1202726a701SXin LI# entire table must sum to zero 121*43a5ec4eSXin LI#>>9 ubyte x \b, checksum %#x 1222726a701SXin LI# vendor ID for the ASL Compiler like: INTL MSFT ... 1232726a701SXin LI>>28 string >\0 \b, created by %.4s 1242726a701SXin LI# revision number of the ASL Compiler like: 20051117 20140724 20190703 20200110 ... 1252726a701SXin LI>>>32 ulelong x %x 1262726a701SXin LI 127