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

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
9b313d01ee142e7d1875bd5bef1ba6acbc3ff837

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
a83a2fb7137e6231ced1265a42a263204fe8c4ad

View File

@@ -1 +0,0 @@
86b909780d48becd3f74d947fc2ec270f7352a38

View File

@@ -1 +0,0 @@
ac6545a25eea8a7b0747d43887e0185988602061

View File

@@ -1 +0,0 @@
ea11fb0fa49a90f4dfc6609af1d6bd0890c6116c

View File

@@ -1 +0,0 @@
bdd7033d6fd8db48fb6b3dac4cb99d3e2b8c5614

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
005ded256b66953691adaf841c9f4522040f1677

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
4b4a99955f3571e7df2e556bf781ec623fe7e539

View File

@@ -1 +0,0 @@
554003cc1a98656400d2ea45d6dc9157d40d4dc0