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

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View File

@@ -1 +0,0 @@
3eefc1538a2a585a5e43ec2755cea229caa48b9f

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

View File

@@ -1 +0,0 @@
ff66008eab94dbfe13e9bc90183aca14609927f1

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
6b8e53c33c8b2f8109e42b46a87bf39e91893c97

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
672a8fa9fcab430df8874712c03d5594bf9bb065

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
1836a1f27d173f7b8e9ad375c24d9c34b43fc6d3

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
4c73d086958f94da084c33cd2530c0a2a819e361

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
fda239c5180b4ef8faf34dca61ab7461d2a8366c

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
07a3c46e17aed107177859626d0ca573363b0821

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
63f3e793e95c338fe7b364780a6492b962cb5f5b

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
8cdade866c50ba78d20e7913ee0c9d88b0d1e0ed

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