lif 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #------------------------------------------------------------------------------
  2. # $File: lif,v 1.11 2022/10/19 20:15:16 christos Exp $
  3. # lif: file(1) magic for lif
  4. #
  5. # (Daniel Quinlan <quinlan@yggdrasil.com>)
  6. #
  7. # Modified by: Joerg Jenderek
  8. # URL: https://www.hp9845.net/9845/projects/hpdir/
  9. # https://github.com/bug400/lifutils
  10. # Reference: https://www.hp9845.net/9845/downloads/manuals/LIF_excerpt_64941-90906_flpRef_Jan84.pdf
  11. # Note: called by TrID "HP Logical Interchange Format disk image"
  12. 0 beshort 0x8000
  13. # GRR: line above is too general as it catches also compressed DEGAS low-res bitmap *.pc1
  14. # skip many compressed DEGAS low-res bitmap *.pc1 by test for unused bytes
  15. >14 beshort =0
  16. # skip MUNCHIE.PC1 BOARD.PC1 ENEMIES.PC1 by test for low version number
  17. >>20 ubeshort <0x0100
  18. # skip DROID fmt-840-signature-id-1195.adx fmt-840-signature-id-1199.adx by test for ASCII like volume name
  19. >>>2 ubelong >0x2020201F
  20. >>>>0 use lif-file
  21. 0 name lif-file
  22. # LIF ID
  23. >0 beshort x lif file
  24. !:mime application/x-lif-disk
  25. # lif used by Tony Duell LIF utilities; enhanced version by Joachim Siebold use also dat; hpi used by hpdir
  26. !:ext lif/hpi/dat
  27. # volume label; A-Z 0-9 _ ; default are 6 spaces
  28. >2 string x "%.6s"
  29. #>2 ubelong x LABEL=%8.8x
  30. # version number; 0 for systems without extensions or 1 for model 64000
  31. >20 ubeshort x \b, version %u
  32. # LIF identifier; 010000 for system 3000
  33. >12 beshort !0x1000 \b, LIF identifier %#x
  34. # directory start address in units like: 2
  35. >8 ubelong x \b, directory
  36. >8 ubelong !2 start address %u
  37. # length of directory like: 2 4 7 10 12 14 (for model 64000) 16 18 20 24 30 50 57 77 80
  38. >16 ubelong x length %u
  39. # level 1 extensions
  40. >20 beshort =0
  41. >>24 ubequad !0 \b, for extensions %#llx...
  42. >20 beshort >0
  43. >>24 ubequad !0 \b, extensions %#llx...
  44. # word 21-126 reserved for extensions and future use; set to nil
  45. >42 ubequad !0 \b, RESERVED %#llx
  46. # lif first file name for standard directory; 0xffff... means uninitialized
  47. >8 ubelong 2
  48. >>512 string <\xff\xff \b, 1st file %-.10s