binfmt-detector-cli: rewrite to support PE32+ binaries (#38)

Rewrite with hard-coded offsets into the PE file format to discern
if a binary is PE32 or PE32+, and then to determine if it contains
a "CLR Data Directory" entry that looks valid.

Tested with PE32 and PE32+ compiled Mono binaries, PE32 and PE32+ native
binaries, and a random assortment of garbage files.

Former-commit-id: 9e7ac86ec84f653a2f79b87183efd5b0ebda001b
This commit is contained in:
Pat Tullmann
2023-10-16 11:16:47 -07:00
committed by GitHub
parent bb231c5b06
commit 0cb742dafb
4772 changed files with 11391249 additions and 2669 deletions

View File

@ -1 +0,0 @@
702ea1484df1dc64f75660db4b87e265c6f2cdf2

View File

@ -1 +0,0 @@
a6e6d3d64681f34a72bf59ad0eef70be46b01f20

View File

@ -1 +0,0 @@
4e1f982e2673dddfdd0c47a50ef2984d447b3cdc

View File

@ -1 +0,0 @@
fe31f9514d37e66e313bd837ff1e30df0c258cd8