firmware 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #------------------------------------------------------------------------------
  2. # $File: firmware,v 1.7 2023/03/11 18:52:03 christos Exp $
  3. # firmware: file(1) magic for firmware files
  4. #
  5. # https://github.com/MatrixEditor/frontier-smart-api/blob/main/docs/firmware-2.0.md#11-header-structure
  6. # examples: https://github.com/cweiske/frontier-silicon-firmwares
  7. 0 lelong 0x00001176
  8. >4 lelong 0x7c Frontier Silicon firmware download
  9. >>8 lelong x \b, MeOS version %x
  10. >>12 string/32/T x \b, version %s
  11. >>40 string/64/T x \b, customization %s
  12. # HPE iLO firmware update image
  13. # From: Alexandre Iooss <erdnaxe@crans.org>
  14. # URL: https://www.sstic.org/2018/presentation/backdooring_your_server_through_its_bmc_the_hpe_ilo4_case/
  15. # iLO1 (ilo1*.bin) or iLO2 (ilo2_*.bin) images
  16. 0 string \x20\x36\xc1\xce\x60\x37\x62\xf0\x3f\x06\xde\x00\x00\x03\x7f\x00
  17. >16 ubeshort =0xCFDD HPE iLO2 firmware update image
  18. >16 ubeshort =0x6444 HPE iLO1 firmware update image
  19. # iLO3 images (ilo3_*.bin) start directly with image name
  20. 0 string iLO3\x20v\x20 HPE iLO3 firmware update image,
  21. >7 string x version %s
  22. # iLO4 images (ilo4_*.bin) start with a signature and a certificate
  23. 0 string --=</Begin\x20HP\x20Signed
  24. >75 string label_HPBBatch
  25. >>5828 string iLO\x204
  26. >>>5732 string HPIMAGE\x00 HPE iLO4 firmware update image,
  27. >>>6947 string x version %s
  28. # iLO5 images (ilo5_*.bin) start with a signature
  29. >75 string label_HPE-HPB-BMC-ILO5-4096
  30. >>880 string HPIMAGE\x00 HPE iLO5 firmware update image,
  31. >>944 string x version %s
  32. # IBM POWER Secure Boot Container
  33. # from https://github.com/open-power/skiboot/blob/master/libstb/container.h
  34. 0 belong 0x17082011 POWER Secure Boot Container,
  35. >4 beshort x version %u
  36. >6 bequad x container size %llu
  37. # These are always zero
  38. # >14 bequad x target HRMOR %llx
  39. # >22 bequad x stack pointer %llx
  40. >4096 ustring \xFD7zXZ\x00 XZ compressed
  41. 0 belong 0x1bad1bad POWER boot firmware
  42. >256 belong 0x48002030 (PHYP entry point)
  43. # ARM Cortex-M vector table
  44. # From: Alexandre Iooss <erdnaxe@crans.org>
  45. # URL: https://developer.arm.com/documentation/100701/0200/Exception-properties
  46. # Match stack MSB
  47. 3 byte 0x20
  48. # Function pointers must be in Thumb-mode and before 0x20000000 (4*5 bits match)
  49. >4 ulelong&0xE0000001 1
  50. >>8 ulelong&0xE0000001 1
  51. >>>12 ulelong&0xE0000001 1
  52. >>>>44 ulelong&0xE0000001 1
  53. >>>>>56 ulelong&0xE0000001 1
  54. # Match Cortex-M reserved sections (0x00000000 or 0xFFFFFFFF)
  55. >>>>>>28 ulelong+1 <2
  56. >>>>>>>32 ulelong+1 <2
  57. >>>>>>>>36 ulelong+1 <2
  58. >>>>>>>>>40 ulelong+1 <2
  59. >>>>>>>>>>52 ulelong+1 <2 ARM Cortex-M firmware
  60. >>>>>>>>>>>0 ulelong >0 \b, initial SP at 0x%08x
  61. >>>>>>>>>>>4 ulelong^1 x \b, reset at 0x%08x
  62. >>>>>>>>>>>8 ulelong^1 x \b, NMI at 0x%08x
  63. >>>>>>>>>>>12 ulelong^1 x \b, HardFault at 0x%08x
  64. >>>>>>>>>>>44 ulelong^1 x \b, SVCall at 0x%08x
  65. >>>>>>>>>>>56 ulelong^1 x \b, PendSV at 0x%08x
  66. # ESP-IDF partition table entry
  67. # From: Alexandre Iooss <erdnaxe@crans.org>
  68. # URL: https://github.com/espressif/esp-idf/blob/v5.0/components/esp_partition/include/esp_partition.h
  69. 0 string \xAA\x50
  70. >2 ubyte <2 ESP-IDF partition table entry
  71. >>12 string/16 x \b, label: "%s"
  72. >>2 ubyte 0
  73. >>>3 ubyte 0x00 \b, factory app
  74. >>>3 ubyte 0x10 \b, OTA_0 app
  75. >>>3 ubyte 0x11 \b, OTA_1 app
  76. >>>3 ubyte 0x12 \b, OTA_2 app
  77. >>>3 ubyte 0x13 \b, OTA_3 app
  78. >>>3 ubyte 0x14 \b, OTA_4 app
  79. >>>3 ubyte 0x15 \b, OTA_5 app
  80. >>>3 ubyte 0x16 \b, OTA_6 app
  81. >>>3 ubyte 0x17 \b, OTA_7 app
  82. >>>3 ubyte 0x18 \b, OTA_8 app
  83. >>>3 ubyte 0x19 \b, OTA_9 app
  84. >>>3 ubyte 0x1A \b, OTA_10 app
  85. >>>3 ubyte 0x1B \b, OTA_11 app
  86. >>>3 ubyte 0x1C \b, OTA_12 app
  87. >>>3 ubyte 0x1D \b, OTA_13 app
  88. >>>3 ubyte 0x1E \b, OTA_14 app
  89. >>>3 ubyte 0x1F \b, OTA_15 app
  90. >>>3 ubyte 0x20 \b, test app
  91. >>2 ubyte 1
  92. >>>3 ubyte 0x00 \b, OTA selection data
  93. >>>3 ubyte 0x01 \b, PHY init data
  94. >>>3 ubyte 0x02 \b, NVS data
  95. >>>3 ubyte 0x03 \b, coredump data
  96. >>>3 ubyte 0x04 \b, NVS keys
  97. >>>3 ubyte 0x05 \b, emulated eFuse data
  98. >>>3 ubyte 0x06 \b, undefined data
  99. >>>3 ubyte 0x80 \b, ESPHTTPD partition
  100. >>>3 ubyte 0x81 \b, FAT partition
  101. >>>3 ubyte 0x82 \b, SPIFFS partition
  102. >>>3 ubyte 0xFF \b, any data
  103. >>4 ulelong x \b, offset: 0x%X
  104. >>8 ulelong x \b, size: 0x%X
  105. >>28 ulelong&0x1 1 \b, encrypted
  106. # ESP-IDF application image
  107. # From: Alexandre Iooss <erdnaxe@crans.org>
  108. # URL: https://github.com/espressif/esp-idf/blob/v5.0/components/bootloader_support/include/esp_app_format.h
  109. # Note: Concatenation of esp_image_header_t, esp_image_segment_header_t and esp_app_desc_t
  110. # First segment contains esp_app_desc_t
  111. 0 ubyte 0xE9
  112. >32 ulelong 0xABCD5432 ESP-IDF application image
  113. >>12 uleshort 0x0000 for ESP32
  114. >>12 uleshort 0x0002 for ESP32-S2
  115. >>12 uleshort 0x0005 for ESP32-C3
  116. >>12 uleshort 0x0009 for ESP32-S3
  117. >>12 uleshort 0x000A for ESP32-H2 Beta1
  118. >>12 uleshort 0x000C for ESP32-C2
  119. >>12 uleshort 0x000D for ESP32-C6
  120. >>12 uleshort 0x000E for ESP32-H2 Beta2
  121. >>12 uleshort 0x0010 for ESP32-H2
  122. >>80 string/32 x \b, project name: "%s"
  123. >>48 string/32 x \b, version %s
  124. >>128 string/16 x \b, compiled on %s
  125. >>>112 string/16 x %s
  126. >>144 string/32 x \b, IDF version: %s
  127. >>4 ulelong x \b, entry address: 0x%08X