1327e51cbSPeter Avalos 2327e51cbSPeter Avalos#------------------------------------------------------------------------------ 3*614728caSSascha Wildner# $File: intel,v 1.20 2021/04/26 15:56:00 christos Exp $ 4327e51cbSPeter Avalos# intel: file(1) magic for x86 Unix 5327e51cbSPeter Avalos# 6327e51cbSPeter Avalos# Various flavors of x86 UNIX executable/object (other than Xenix, which 7327e51cbSPeter Avalos# is in "microsoft"). DOS is in "msdos"; the ambitious soul can do 8327e51cbSPeter Avalos# Windows as well. 9327e51cbSPeter Avalos# 10327e51cbSPeter Avalos# Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and 11327e51cbSPeter Avalos# whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere 12327e51cbSPeter Avalos# as well, if, as, and when IBM makes it portable. 13327e51cbSPeter Avalos# 14327e51cbSPeter Avalos# The `versions' should be un-commented if they work for you. 15327e51cbSPeter Avalos# (Was the problem just one of endianness?) 16327e51cbSPeter Avalos# 17327e51cbSPeter Avalos0 leshort 0502 basic-16 executable 18327e51cbSPeter Avalos>12 lelong >0 not stripped 1982c5fa3eSPeter Avalos#>22 leshort >0 - version %d 20327e51cbSPeter Avalos0 leshort 0503 basic-16 executable (TV) 21327e51cbSPeter Avalos>12 lelong >0 not stripped 2282c5fa3eSPeter Avalos#>22 leshort >0 - version %d 23327e51cbSPeter Avalos0 leshort 0510 x86 executable 24327e51cbSPeter Avalos>12 lelong >0 not stripped 25327e51cbSPeter Avalos0 leshort 0511 x86 executable (TV) 26327e51cbSPeter Avalos>12 lelong >0 not stripped 27327e51cbSPeter Avalos0 leshort =0512 iAPX 286 executable small model (COFF) 28327e51cbSPeter Avalos>12 lelong >0 not stripped 2982c5fa3eSPeter Avalos#>22 leshort >0 - version %d 30327e51cbSPeter Avalos0 leshort =0522 iAPX 286 executable large model (COFF) 31327e51cbSPeter Avalos>12 lelong >0 not stripped 3282c5fa3eSPeter Avalos#>22 leshort >0 - version %d 33c30bd091SSascha Wildner# updated by Joerg Jenderek at Oct 2015 34c30bd091SSascha Wildner# https://de.wikipedia.org/wiki/Common_Object_File_Format 35c30bd091SSascha Wildner# http://www.delorie.com/djgpp/doc/coff/filhdr.html 36c30bd091SSascha Wildner# ./msdos (version 5.25) labeled the next entry as "MS Windows COFF Intel 80386 object file" 37c30bd091SSascha Wildner# ./intel (version 5.25) label labeled the next entry as "80386 COFF executable" 38327e51cbSPeter Avalos# SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan 39c30bd091SSascha Wildner0 leshort =0514 40970935fdSSascha Wildner# use subroutine to display name+flags+variables for common object formatted files 41c30bd091SSascha Wildner>0 use display-coff 42c30bd091SSascha Wildner#>12 lelong >0 not stripped 43c30bd091SSascha Wildner# no hint found, that at offset 22 is version 44c30bd091SSascha Wildner#>22 leshort >0 - version %d 456fca56fbSSascha Wildner0 leshort 0x0200 466fca56fbSSascha Wildner>0 use display-coff 476fca56fbSSascha Wildner0 leshort 0x8664 486fca56fbSSascha Wildner>0 use display-coff 49327e51cbSPeter Avalos 50327e51cbSPeter Avalos# rom: file(1) magic for BIOS ROM Extensions found in intel machines 51327e51cbSPeter Avalos# mapped into memory between 0xC0000 and 0xFFFFF 526fca56fbSSascha Wildner# From: Alex Myczko <alex@aiei.ch> 53c30bd091SSascha Wildner# updated by Joerg Jenderek 54c30bd091SSascha Wildner# https://en.wikipedia.org/wiki/Option_ROM 55327e51cbSPeter Avalos0 beshort 0x55AA BIOS (ia32) ROM Ext. 56c30bd091SSascha Wildner!:mime application/octet-stream 57c30bd091SSascha Wildner!:ext rom/bin 58327e51cbSPeter Avalos>5 string USB USB 59327e51cbSPeter Avalos>7 string LDR UNDI image 60327e51cbSPeter Avalos>30 string IBM IBM comp. Video 61327e51cbSPeter Avalos>26 string Adaptec Adaptec 62327e51cbSPeter Avalos>28 string Adaptec Adaptec 63327e51cbSPeter Avalos>42 string PROMISE Promise 64327e51cbSPeter Avalos>2 byte x (%d*512) 65ff91a668SPeter Avalos 66ff91a668SPeter Avalos# Flash descriptors for Intel SPI flash roms. 67ff91a668SPeter Avalos# From Dr. Jesus <j@hug.gs> 68ff91a668SPeter Avalos0 lelong 0x0ff0a55a Intel serial flash for ICH/PCH ROM <= 5 or 3400 series A-step 69ff91a668SPeter Avalos16 lelong 0x0ff0a55a Intel serial flash for PCH ROM 70c990e5baSDaniel Fojt 71c990e5baSDaniel Fojt# From: Joerg Jenderek 72c990e5baSDaniel Fojt# URL: https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface 73c990e5baSDaniel Fojt# Reference: https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf 74c990e5baSDaniel Fojt# Note: generated for example by `cat /sys/firmware/acpi/tables/DSDT MyDSDT.aml` 75c990e5baSDaniel Fojt0 string DSDT 76c990e5baSDaniel Fojt>0 use acpi-table 77c990e5baSDaniel Fojt# not tested or other file format 78c990e5baSDaniel Fojt0 string APIC 79c990e5baSDaniel Fojt>0 use acpi-table 80c990e5baSDaniel Fojt#0 string ASF! 81c990e5baSDaniel Fojt#>0 use acpi-table 82c990e5baSDaniel Fojt0 string FACP 83c990e5baSDaniel Fojt>0 use acpi-table 84c990e5baSDaniel Fojt#0 string FACS 85c990e5baSDaniel Fojt#>0 use acpi-table 86c990e5baSDaniel Fojt0 string MCFG 87c990e5baSDaniel Fojt>0 use acpi-table 88c990e5baSDaniel Fojt0 string SLIC 89c990e5baSDaniel Fojt>0 use acpi-table 90c990e5baSDaniel Fojt0 string SSDT 91c990e5baSDaniel Fojt>0 use acpi-table 92c990e5baSDaniel Fojt0 name acpi-table 93c990e5baSDaniel Fojt# skip ASCII text starting with DSDT by looking for valid "low" revision 94c990e5baSDaniel Fojt>8 ubyte <17 ACPI Machine Language file 95c990e5baSDaniel Fojt# assume that ACPI tables size are lower than 16 MiB 96c990e5baSDaniel Fojt#>4 ulelong <0x01000000 97c990e5baSDaniel Fojt# DSDT for Differentiated System Description Table 98c990e5baSDaniel Fojt>>0 string x '%.4s' 99c990e5baSDaniel Fojt#!:mime application/octet-stream 100c990e5baSDaniel Fojt!:mime application/x-intel-aml 101c990e5baSDaniel Fojt!:ext aml 102c990e5baSDaniel Fojt# the manufacture model ID like: VBOXBIOS BXDSDT 103c990e5baSDaniel Fojt>>16 string >\0 %.8s 104c990e5baSDaniel Fojt# OEM revision of DSDT for supplied OEM Table ID like: 0 1 2 20090511 105c990e5baSDaniel Fojt>>>24 ulelong x %x 106c990e5baSDaniel Fojt# OEM ID like: INTEL VBOX (VirtualBox) BXDSDT (qemu) MEDION or \030\001\0\0 for s3pt.aml 107c990e5baSDaniel Fojt>>10 ubyte >040 by %c 108c990e5baSDaniel Fojt>>>11 ubyte >040 \b%c 109c990e5baSDaniel Fojt>>>>12 ubyte >040 \b%c 110c990e5baSDaniel Fojt>>>>>13 ubyte >040 \b%c 111c990e5baSDaniel Fojt>>>>>>14 ubyte >040 \b%c 112c990e5baSDaniel Fojt>>>>>>>15 ubyte >040 \b%c 113c990e5baSDaniel Fojt# This field also sets the global integer width for the AML interpreter. 114c990e5baSDaniel Fojt# Values less than two will cause the interpreter to use 32-bit. 115c990e5baSDaniel Fojt# Values of two and greater will cause the interpreter to use full 64-bit. 116c990e5baSDaniel Fojt# 16 for asf!.aml, 67 fo rsdp.aml 117c990e5baSDaniel Fojt>>8 ubyte x \b, revision %u 118c990e5baSDaniel Fojt# length, in bytes, of the entire DSDT (including the header) 119c990e5baSDaniel Fojt>>4 ulelong x \b, %u bytes 120c990e5baSDaniel Fojt# entire table must sum to zero 121*614728caSSascha Wildner#>>9 ubyte x \b, checksum %#x 122c990e5baSDaniel Fojt# vendor ID for the ASL Compiler like: INTL MSFT ... 123c990e5baSDaniel Fojt>>28 string >\0 \b, created by %.4s 124c990e5baSDaniel Fojt# revision number of the ASL Compiler like: 20051117 20140724 20190703 20200110 ... 125c990e5baSDaniel Fojt>>>32 ulelong x %x 126c990e5baSDaniel Fojt 127