Bugfix: binfmt-detect-cli returns false negative for CLR with x64. (#35)

This change is released under the MIT license.

Former-commit-id: c34130e9e7920253cc218f9eb2ecf0e8e8bdac96
This commit is contained in:
kou1okada 2022-05-03 21:26:31 +09:00 committed by GitHub
parent dfeaaac794
commit 1a7e884b09

View File

@ -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