1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*ae316d1dSXin LI# $File: hitachi-sh,v 1.11 2024/02/18 14:15:22 christos Exp $ 4b6cee71dSXin LI# hitach-sh: file(1) magic for Hitachi Super-H 5b6cee71dSXin LI# 6b6cee71dSXin LI# Super-H COFF 7b6cee71dSXin LI# 83e41d09dSXin LI# updated by Joerg Jenderek at Oct 2015 93e41d09dSXin LI# https://en.wikipedia.org/wiki/COFF 103e41d09dSXin LI# https://de.wikipedia.org/wiki/Common_Object_File_Format 113e41d09dSXin LI# http://www.delorie.com/djgpp/doc/coff/filhdr.html 12b6cee71dSXin LI# below test line conflicts with 2nd NTFS filesystem sector 13b6cee71dSXin LI# 2nd NTFS filesystem sector often starts with 0x05004e00 for unicode string 5 NTLDR 143e41d09dSXin LI# and Portable Gaming Notation Compressed format (*.WID http://pgn.freeservers.com/) 153e41d09dSXin LI0 beshort 0x0500 163e41d09dSXin LI# test for unused flag bits (0x8000,0x0800,0x0400,0x0200,x0080) in f_flags 173e41d09dSXin LI>18 ubeshort&0x8E80 0 183e41d09dSXin LI# use big endian variant of subroutine to display name+variables+flags 1943a5ec4eSXin LI# for common object formatted files 203e41d09dSXin LI>>0 use \^display-coff 2148c779cdSXin LI!:strength -10 223e41d09dSXin LI 233e41d09dSXin LI0 leshort 0x0550 243e41d09dSXin LI# test for unused flag bits in f_flags 253e41d09dSXin LI>18 uleshort&0x8E80 0 263e41d09dSXin LI# use little endian variant of subroutine to 2743a5ec4eSXin LI# display name+variables+flags for common object formatted files 283e41d09dSXin LI>>0 use display-coff 2948c779cdSXin LI!:strength -10 30b6cee71dSXin LI 31*ae316d1dSXin LI# Hitachi SH COFF object file 32*ae316d1dSXin LI0 leshort 0x01a2 33*ae316d1dSXin LI>16 leshort 0 34*ae316d1dSXin LI>>0 use display-coff 35*ae316d1dSXin LI0 leshort 0x01a3 36*ae316d1dSXin LI>16 leshort 0 37*ae316d1dSXin LI>>0 use display-coff 38*ae316d1dSXin LI0 leshort 0x01a4 39*ae316d1dSXin LI>16 leshort 0 40*ae316d1dSXin LI>>0 use display-coff 41*ae316d1dSXin LI0 leshort 0x01a6 42*ae316d1dSXin LI>16 leshort 0 43*ae316d1dSXin LI>>0 use display-coff 44*ae316d1dSXin LI0 leshort 0x01a8 45*ae316d1dSXin LI>16 leshort 0 46*ae316d1dSXin LI>>0 use display-coff 47