From 64dcffa715049351327851c8b5a6f3430a32ff39 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Sun, 4 Apr 2021 18:24:34 +0000 Subject: [PATCH] Add arm-coff (Mark Harmstone) --- magic/Magdir/arm | 41 +++++++++++++++++++++++++++++++++++++++++ magic/Magdir/coff | 7 ++++++- magic/Makefile.am | 3 ++- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 magic/Magdir/arm diff --git a/magic/Magdir/arm b/magic/Magdir/arm new file mode 100644 index 000000000..8869d1928 --- /dev/null +++ b/magic/Magdir/arm @@ -0,0 +1,41 @@ +#------------------------------------------------------------------------------ +# $File: arm,v 1.1 2021/04/04 18:24:34 christos Exp $ +# arm: file(1) magic for ARM COFF +# +# https://docs.microsoft.com/en-us/windows/win32/debug/pe-format + +# Aarch64 +0 leshort 0xaa64 +# 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 formated files +>>0 use display-coff +!:strength -10 + +# ARM +0 leshort 0x01c0 +# 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 formated files +>>0 use display-coff +!:strength -10 + +# ARM Thumb +0 leshort 0x01c2 +# 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 formated files +>>0 use display-coff +!:strength -10 + +# ARMv7 Thumb +0 leshort 0x01c4 +# 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 formated files +>>0 use display-coff +!:strength -10 diff --git a/magic/Magdir/coff b/magic/Magdir/coff index 18e7b665e..5063bc19e 100644 --- a/magic/Magdir/coff +++ b/magic/Magdir/coff @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: coff,v 1.4 2021/02/10 00:37:02 christos Exp $ +# $File: coff,v 1.5 2021/04/04 18:24:34 christos Exp $ # coff: file(1) magic for Common Object Files not specific to known cpu types or manufactures # # COFF @@ -34,6 +34,11 @@ # https://msdn.microsoft.com/en-us/library/windows/desktop/ms680313(v=vs.85).aspx >>>>0 uleshort 0x0200 Intel ia64 >>>>0 uleshort 0x8664 Intel amd64 +# ARM COFF (./arm) +>>>>0 uleshort 0xaa64 Aarch64 +>>>>0 uleshort 0x01c0 ARM +>>>>0 uleshort 0x01c2 ARM Thumb +>>>>0 uleshort 0x01c4 ARMv7 Thumb # TODO for other COFFs #>>>>0 uleshort 0xABCD COFF_TEMPLATE >>>>0 default x diff --git a/magic/Makefile.am b/magic/Makefile.am index 0eb5865b7..75d39bbde 100644 --- a/magic/Makefile.am +++ b/magic/Makefile.am @@ -1,5 +1,5 @@ # -# $File: Makefile.am,v 1.166 2021/03/14 16:24:18 christos Exp $ +# $File: Makefile.am,v 1.167 2021/04/04 18:24:34 christos Exp $ # MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic @@ -29,6 +29,7 @@ $(MAGIC_FRAGMENT_DIR)/application \ $(MAGIC_FRAGMENT_DIR)/applix \ $(MAGIC_FRAGMENT_DIR)/apt \ $(MAGIC_FRAGMENT_DIR)/archive \ +$(MAGIC_FRAGMENT_DIR)/arm \ $(MAGIC_FRAGMENT_DIR)/asf \ $(MAGIC_FRAGMENT_DIR)/assembler \ $(MAGIC_FRAGMENT_DIR)/asterix \