xenix 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #------------------------------------------------------------------------------
  2. # $File: xenix,v 1.15 2022/10/19 20:15:16 christos Exp $
  3. # xenix: file(1) magic for Microsoft Xenix
  4. #
  5. # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small
  6. # model" lifted from "magic.xenix", with comment "derived empirically;
  7. # treat as folklore until proven"
  8. #
  9. # "small model", "large model", "huge model" stuff lifted from XXX
  10. #
  11. # XXX - "x.out" collides with PDP-11 archives
  12. #
  13. 0 string core core file (Xenix)
  14. # URL: http://www.polarhome.com/service/man/?qf=86rel&tf=2&of=Xenix
  15. # http://fileformats.archiveteam.org/wiki/OMF
  16. # Reference: http://www.azillionmonkeys.com/qed/Omfg.pdf
  17. # Update: Joerg Jenderek
  18. # recordtype~TranslatorHEADerRecord
  19. 0 byte 0x80
  20. # GRR: line above is too general as it catches also Extensible storage engine DataBase,
  21. # all lif files like forth.lif hpcc88.lif lex90b.lif ( See ./lif)
  22. # and all compressed DEGAS low-res bitmaps like: MUNCHIE.PC1 PIDER1.PC1
  23. # skip examples like GENA.SND Switch.Snd by looking for record length maximal 1024-3
  24. >1 uleshort <1022
  25. # skip examples like GAME.PICTURE Strange.Pic by looking for positive record length
  26. >>1 uleshort >0
  27. # skip examples like Xtable.Data FRACTAL.GEN SHR.VIEW by looking for positive string length
  28. >>>3 ubyte >0
  29. # skip examples like OMBRE.6 with "UUUUUU" name by looking for valid high second record type
  30. >>>>(1.s+3) ubyte >0x6D
  31. # skip few Atari DEGAS bitmap TPDEMO.PC2 RECIPE.PC2 with invalid "high" second record type FEh FFh
  32. >>>>>(1.s+3) ubyte <0xF2 8086 relocatable (Microsoft)
  33. #!:mime application/octet-stream
  34. !:mime application/x-object
  35. !:ext obj/o/a
  36. # T-module name often source name like "hello.c" or "jmppm32.asm" in JMPPM32.OBJ or
  37. # "kbhit" in KBHITS.OBJ or "CAUSEWAY_KERNAL" in CWAPI.OBJ
  38. >>>>>>3 pstring x \b, "%s"
  39. # data length probably lower 256 according to TrID obj_omf.trid.xml
  40. >>>>>>1 uleshort x \b, 1st record data length %u
  41. # checksum
  42. #>>>>>>(3.b+4) ubyte x \b, checksum %#2.2x
  43. # second recordtype: 96h~LNAMES 88h~COMENT 8CH~EXTDEF
  44. # highest F1h~Library End Record
  45. >>>>>>(1.s+3) ubyte x \b, 2nd record type %#x
  46. >>>>>>(1.s+4) uleshort x \b, 2nd record data length %u
  47. 0 leshort 0xff65 x.out
  48. >2 string __.SYMDEF randomized
  49. >0 byte x archive
  50. 0 leshort 0x206 Microsoft a.out
  51. >8 leshort 1 Middle model
  52. >0x1e leshort &0x10 overlay
  53. >0x1e leshort &0x2 separate
  54. >0x1e leshort &0x4 pure
  55. >0x1e leshort &0x800 segmented
  56. >0x1e leshort &0x400 standalone
  57. >0x1e leshort &0x8 fixed-stack
  58. >0x1c byte &0x80 byte-swapped
  59. >0x1c byte &0x40 word-swapped
  60. >0x10 lelong >0 not-stripped
  61. >0x1e leshort ^0xc000 pre-SysV
  62. >0x1e leshort &0x4000 V2.3
  63. >0x1e leshort &0x8000 V3.0
  64. >0x1c byte &0x4 86
  65. >0x1c byte &0xb 186
  66. >0x1c byte &0x9 286
  67. >0x1c byte &0xa 386
  68. >0x1f byte <0x040 small model
  69. >0x1f byte =0x048 large model
  70. >0x1f byte =0x049 huge model
  71. >0x1e leshort &0x1 executable
  72. >0x1e leshort ^0x1 object file
  73. >0x1e leshort &0x40 Large Text
  74. >0x1e leshort &0x20 Large Data
  75. >0x1e leshort &0x120 Huge Objects Enabled
  76. >0x10 lelong >0 not stripped
  77. 0 leshort 0x140 old Microsoft 8086 x.out
  78. >0x3 byte &0x4 separate
  79. >0x3 byte &0x2 pure
  80. >0 byte &0x1 executable
  81. >0 byte ^0x1 relocatable
  82. >0x14 lelong >0 not stripped
  83. 0 lelong 0x206 b.out
  84. >0x1e leshort &0x10 overlay
  85. >0x1e leshort &0x2 separate
  86. >0x1e leshort &0x4 pure
  87. >0x1e leshort &0x800 segmented
  88. >0x1e leshort &0x400 standalone
  89. >0x1e leshort &0x1 executable
  90. >0x1e leshort ^0x1 object file
  91. >0x1e leshort &0x4000 V2.3
  92. >0x1e leshort &0x8000 V3.0
  93. >0x1c byte &0x4 86
  94. >0x1c byte &0xb 186
  95. >0x1c byte &0x9 286
  96. >0x1c byte &0x29 286
  97. >0x1c byte &0xa 386
  98. >0x1e leshort &0x4 Large Text
  99. >0x1e leshort &0x2 Large Data
  100. >0x1e leshort &0x102 Huge Objects Enabled
  101. 0 leshort 0x580 XENIX 8086 relocatable or 80286 small model
  102. # GRR: line above is too general as it catches also all 8086 relocatable (Microsoft) with 1st record data length 5 C0M.OBJ C0T.OBJ C0S.OBJ