rpi 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #------------------------------------------------------------------------------
  2. # $File: rpi,v 1.3 2022/04/02 14:39:34 christos Exp $
  3. # rpi: file(1) magic for Raspberry Pi images
  4. -44 lelong 0
  5. >4 lelong 0
  6. >>8 lelong 1
  7. >>12 lelong 4
  8. >>>16 string 283x
  9. >>>>20 lelong 1
  10. >>>>>24 lelong 4
  11. >>>>>>28 string DTOK
  12. >>>>>>>32 lelong 44
  13. >>>>>>>>36 lelong 4
  14. >>>>>>>>>40 string RPTL Raspberry PI kernel image
  15. -56 lelong 0
  16. >4 lelong 0
  17. >>8 lelong 1
  18. >>12 lelong 4
  19. >>>16 string 283x
  20. >>>>20 lelong 1
  21. >>>>>24 lelong 4
  22. >>>>>>28 string DTOK
  23. >>>>>>>32 lelong 1
  24. >>>>>>>>36 lelong 4
  25. >>>>>>>>>40 string DDTK8
  26. >>>>>>>>>>48 lelong 4
  27. >>>>>>>>>>>52 string RPTL Raspberry PI kernel image
  28. # From: Joerg Jenderek
  29. # URL: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html
  30. # #raspberry-pi-4-boot-eeprom
  31. # Reference: https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-config
  32. # Note: start with same magic as for BIOS (ia32) ROM Extension handled by ./intel
  33. # masked with MAGIC_MASK and then compared with MAGIC
  34. 0 belong&0xFFffF00F 0x55aaF00F Raspberry PI EEPROM
  35. #!:mime application/octet-stream
  36. !:mime application/x-raspberry-eeprom
  37. # like: pieeprom-2020-09-03.bin
  38. !:ext bin
  39. # a 32 bit offset to the next section like: 000184d4 000184c8 00018534 ... 0000bb84 0000bbd4 0000bbd4
  40. >4 ubelong x \b, offset %8.8x
  41. #>(4.L) ubelong x NEXT=%8.8x
  42. # self.length
  43. >8 ubelong !0 \b, length %x
  44. # self.filename
  45. >12 string >0 \b, "%s"
  46. # length is zero
  47. >8 ubelong =0
  48. # if length is zero then 2nd section magic here can be zero; this means sections parsing done
  49. >>8 ubelong !0 \b, 2nd MAGIC=%8.8x