[File] [PATCH] Add magic for ARM64EC COFF object files

Mark Harmstone mark at harmstone.com
Sun Oct 30 22:41:30 UTC 2022


This patch adds support for Microsoft's new pseudo-architecture ARM64EC
for COFF object files.

---
 magic/Magdir/arm  | 9 +++++++++
 magic/Magdir/coff | 1 +
 2 files changed, 10 insertions(+)

diff --git a/magic/Magdir/arm b/magic/Magdir/arm
index b40f213c..e2aef5bf 100644
--- a/magic/Magdir/arm
+++ b/magic/Magdir/arm
@@ -39,3 +39,12 @@
 # display name+variables+flags for common object formatted files
 >>0	use				display-coff
 !:strength -10
+
+# ARM64EC
+0	leshort		0xa641
+# test for unused flag bits in f_flags
+>18	uleshort&0x8E80	0
+# use little endian variant of subroutine to
+# display name+variables+flags for common object formatted files
+>>0	use				display-coff
+!:strength -10
diff --git a/magic/Magdir/coff b/magic/Magdir/coff
index 535187c2..0d1a8af7 100644
--- a/magic/Magdir/coff
+++ b/magic/Magdir/coff
@@ -39,6 +39,7 @@
 >>>>0	uleshort	0x01c0		ARM
 >>>>0	uleshort	0x01c2		ARM Thumb
 >>>>0	uleshort	0x01c4		ARMv7 Thumb
+>>>>0	uleshort	0xa641		ARM64EC
 # TODO for other COFFs
 #>>>>0	uleshort	0xABCD		COFF_TEMPLATE
 >>>>0	default		x
-- 
2.37.4



More information about the File mailing list