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

Binary file not shown.

View File

@ -1 +0,0 @@
fda0b23237512ee638ff7f71d934b0c6ecc2ca4e

Binary file not shown.

View File

@ -1 +0,0 @@
b0ba3c261fe2fa1392dc649a3da36ccb1eb213ba

Binary file not shown.

View File

@ -1 +0,0 @@
477b92f02d4eed63e750f3a1300f658f6d35cd73

View File

@ -1 +0,0 @@
704d3e02dbd43691d785ec24bee712fe05eaec9f

Binary file not shown.

View File

@ -1 +0,0 @@
fda0b23237512ee638ff7f71d934b0c6ecc2ca4e

Binary file not shown.

View File

@ -1 +0,0 @@
589327cb425c2811156435a75cd5c0cc003ae1dc

View File

@ -1 +0,0 @@
2efc1ea1e0c2812227e15dd0ad8fcdbea7f9ce41

View File

@ -1 +0,0 @@
4125684e199f5d268ed0a450a8808ff84971bfb3

View File

@ -1 +0,0 @@
15aa5fd2fac93ca81f4540b20092ec9ab2c7e7c9

Some files were not shown because too many files have changed in this diff Show More