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

View File

@@ -1 +0,0 @@
38948683e151f6009580f20359e51270510c49d5

View File

@@ -1 +0,0 @@
5cb9029bf1147f755252018acf04c7ea947b214a

View File

@@ -1 +0,0 @@
b06cf34859cb7c700dfd8f87f8038fd2efbfa21c

View File

@@ -1 +0,0 @@
7696c03b218eb7d3c30c858963d98687f17f8d9e

View File

@@ -1 +0,0 @@
e376a20352bb547c881ad93a9529ad3fedd5fae9

View File

@@ -1 +0,0 @@
5ebef7fe292eaf725025142a43f8f667700cf003

View File

@@ -1 +0,0 @@
049149f17929322dd246d994780d0399a24cf90f

Binary file not shown.

View File

@@ -1 +0,0 @@
2d54316954f4200997856156289df2e6115d51e0

View File

@@ -1 +0,0 @@
ce46d5be85cdee1a3c0ef5bc22c8e1772d0d0d98

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