diff --git a/libr/bin/format/coff/coff.c b/libr/bin/format/coff/coff.c index e911d1fcc8..4b3e094f5b 100644 --- a/libr/bin/format/coff/coff.c +++ b/libr/bin/format/coff/coff.c @@ -9,6 +9,9 @@ bool r_coff_supported_arch(const ut8 *buf) { ut16 arch = *(ut16*)buf; switch (arch) { + case COFF_FILE_MACHINE_MIPS16: + case COFF_FILE_MACHINE_MIPSFPU: + case COFF_FILE_MACHINE_MIPSFPU16: case COFF_FILE_MACHINE_AMD64: case COFF_FILE_MACHINE_I386: case COFF_FILE_MACHINE_H8300: @@ -16,8 +19,13 @@ bool r_coff_supported_arch(const ut8 *buf) { case COFF_FILE_MACHINE_R4000: case COFF_FILE_MACHINE_AMD29KBE: case COFF_FILE_MACHINE_AMD29KLE: + case COFF_FILE_MACHINE_SH3: + case COFF_FILE_MACHINE_SH3DSP: + case COFF_FILE_MACHINE_SH4: + case COFF_FILE_MACHINE_SH5: + case COFF_FILE_MACHINE_THUMB: + case COFF_FILE_MACHINE_ARM: case COFF_FILE_MACHINE_ARM64: - case COFF_FILE_MACHINE_ARM: case COFF_FILE_MACHINE_ARMNT: return true; default: diff --git a/libr/bin/p/bin_coff.c b/libr/bin/p/bin_coff.c index 448d4aec39..0bfcdb9575 100644 --- a/libr/bin/p/bin_coff.c +++ b/libr/bin/p/bin_coff.c @@ -549,6 +549,14 @@ static RBinInfo *info(RBinFile *bf) { } switch (obj->hdr.f_magic) { + case COFF_FILE_MACHINE_R4000: + case COFF_FILE_MACHINE_MIPS16: + case COFF_FILE_MACHINE_MIPSFPU: + case COFF_FILE_MACHINE_MIPSFPU16: + ret->machine = strdup ("mips"); + ret->arch = strdup ("mips"); + ret->bits = 32; + break; case COFF_FILE_MACHINE_I386: ret->machine = strdup ("i386"); ret->arch = strdup ("x86"); @@ -559,6 +567,11 @@ static RBinInfo *info(RBinFile *bf) { ret->arch = strdup ("arm"); ret->bits = 64; break; + case COFF_FILE_MACHINE_THUMB: + ret->machine = strdup ("arm"); + ret->arch = strdup ("arm"); + ret->bits = 16; + break; case COFF_FILE_MACHINE_ARM: ret->machine = strdup ("ARM"); ret->arch = strdup ("arm"); @@ -586,6 +599,14 @@ static RBinInfo *info(RBinFile *bf) { ret->arch = strdup ("arm"); ret->bits = 32; break; + case COFF_FILE_MACHINE_SH3: + case COFF_FILE_MACHINE_SH3DSP: + case COFF_FILE_MACHINE_SH4: + case COFF_FILE_MACHINE_SH5: + ret->machine = strdup ("sh"); + ret->arch = strdup ("sh"); + ret->bits = 32; + break; case COFF_FILE_TI_COFF: switch (obj->target_id) { case COFF_FILE_MACHINE_TMS320C54: