xenix 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #------------------------------------------------------------------------------
  2. # $File: xenix,v 1.14 2021/04/26 15:56:00 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 8086 relocatable (Microsoft)
  31. #!:mime application/octet-stream
  32. !:mime application/x-object
  33. !:ext obj/o/a
  34. # T-module name often source name like "hello.c" or "jmppm32.asm" in JMPPM32.OBJ or
  35. # "kbhit" in KBHITS.OBJ or "CAUSEWAY_KERNAL" in CWAPI.OBJ
  36. >>>>>3 pstring x \b, "%s"
  37. # data length probably lower 256 according to TrID obj_omf.trid.xml
  38. >>>>>1 uleshort x \b, 1st record data length %u
  39. # checksum
  40. #>>>>>(3.b+4) ubyte x \b, checksum %#2.2x
  41. # second recordtype: 96h~LNAMES 88h~COMENT 8CH~EXTDEF
  42. >>>>>(1.s+3) ubyte x \b, 2nd record type %#x
  43. >>>>>(1.s+4) uleshort x \b, 2nd record data length %u
  44. 0 leshort 0xff65 x.out
  45. >2 string __.SYMDEF randomized
  46. >0 byte x archive
  47. 0 leshort 0x206 Microsoft a.out
  48. >8 leshort 1 Middle model
  49. >0x1e leshort &0x10 overlay
  50. >0x1e leshort &0x2 separate
  51. >0x1e leshort &0x4 pure
  52. >0x1e leshort &0x800 segmented
  53. >0x1e leshort &0x400 standalone
  54. >0x1e leshort &0x8 fixed-stack
  55. >0x1c byte &0x80 byte-swapped
  56. >0x1c byte &0x40 word-swapped
  57. >0x10 lelong >0 not-stripped
  58. >0x1e leshort ^0xc000 pre-SysV
  59. >0x1e leshort &0x4000 V2.3
  60. >0x1e leshort &0x8000 V3.0
  61. >0x1c byte &0x4 86
  62. >0x1c byte &0xb 186
  63. >0x1c byte &0x9 286
  64. >0x1c byte &0xa 386
  65. >0x1f byte <0x040 small model
  66. >0x1f byte =0x048 large model
  67. >0x1f byte =0x049 huge model
  68. >0x1e leshort &0x1 executable
  69. >0x1e leshort ^0x1 object file
  70. >0x1e leshort &0x40 Large Text
  71. >0x1e leshort &0x20 Large Data
  72. >0x1e leshort &0x120 Huge Objects Enabled
  73. >0x10 lelong >0 not stripped
  74. 0 leshort 0x140 old Microsoft 8086 x.out
  75. >0x3 byte &0x4 separate
  76. >0x3 byte &0x2 pure
  77. >0 byte &0x1 executable
  78. >0 byte ^0x1 relocatable
  79. >0x14 lelong >0 not stripped
  80. 0 lelong 0x206 b.out
  81. >0x1e leshort &0x10 overlay
  82. >0x1e leshort &0x2 separate
  83. >0x1e leshort &0x4 pure
  84. >0x1e leshort &0x800 segmented
  85. >0x1e leshort &0x400 standalone
  86. >0x1e leshort &0x1 executable
  87. >0x1e leshort ^0x1 object file
  88. >0x1e leshort &0x4000 V2.3
  89. >0x1e leshort &0x8000 V3.0
  90. >0x1c byte &0x4 86
  91. >0x1c byte &0xb 186
  92. >0x1c byte &0x9 286
  93. >0x1c byte &0x29 286
  94. >0x1c byte &0xa 386
  95. >0x1e leshort &0x4 Large Text
  96. >0x1e leshort &0x2 Large Data
  97. >0x1e leshort &0x102 Huge Objects Enabled
  98. 0 leshort 0x580 XENIX 8086 relocatable or 80286 small model