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

View File

@@ -1 +0,0 @@
a7842b0d6439c1ed3cf49515e4cf371d4235d0d8

View File

@@ -1 +0,0 @@
f15e745cae0bd0226a95100b7bfe1add9582fc58

View File

@@ -1 +0,0 @@
af2bcff37c0f24112087149e301fb261fabc4412

View File

@@ -1 +0,0 @@
8c1ae59f794d517e0511208df69360e468837145

View File

@@ -1 +0,0 @@
08d65ee8bc37fafe3f3f6eea97e9d96fa2d8199f

View File

@@ -1 +0,0 @@
8fe17831bca19203c8f9a5bdf3f17ded9af7b79b

View File

@@ -1 +0,0 @@
74cffef5c3b3ee82cf0cac64f167db5c63851204

View File

@@ -1 +0,0 @@
8791d56d91ca424d66773e6417afe1da9b4a4fe2

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