From 1a7e884b09f46d63092727078452129457a09a58 Mon Sep 17 00:00:00 2001 From: kou1okada Date: Tue, 3 May 2022 21:26:31 +0900 Subject: [PATCH] Bugfix: binfmt-detect-cli returns false negative for CLR with x64. (#35) This change is released under the MIT license. Former-commit-id: c34130e9e7920253cc218f9eb2ecf0e8e8bdac96 --- debian/detector/binfmt-detector-cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/detector/binfmt-detector-cli.c b/debian/detector/binfmt-detector-cli.c index 5554583f7f..b79cf9a831 100644 --- a/debian/detector/binfmt-detector-cli.c +++ b/debian/detector/binfmt-detector-cli.c @@ -80,7 +80,7 @@ int main(int argc, char **argv) if (read < 1) exit(EXIT_FAILURE); pe_magic = dotnet_header.pe.pe_magic[0] | dotnet_header.pe.pe_magic[1] << 8; - if (dotnet_header.pesig[0] != 'P' || dotnet_header.pesig[1] != 'E' || pe_magic != 0x10B) exit(EXIT_FAILURE); + if (dotnet_header.pesig[0] != 'P' || dotnet_header.pesig[1] != 'E' || (pe_magic != 0x10B && pe_magic != 0x20B)) exit(EXIT_FAILURE); rva = dotnet_header.datadir.pe_cli_header.rva[0] | dotnet_header.datadir.pe_cli_header.rva[1] << 8 | dotnet_header.datadir.pe_cli_header.rva[2] << 16