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

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
be19f563bcddb129ae222c37216715e0e0a10575

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
bf289b1375fed392f0c03be550495fbabf4d638e

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
ab3e3e87ab2deafb54cb4bfa7436d7cddffa68e8

View File

@@ -1 +0,0 @@
bf147e5cbc1722bd3ccb74c57a5b3c5bb87699d7

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
3796ed17fda790a48251d9997e1cc573fb1e0052

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
cc3c5b28406a1f074ed1402d484cb30c695c3cc9