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 @@
5ce231a848402d0a10bc987398fc39259a1bd2bd

View File

@@ -1 +0,0 @@
a16031098f5961fa32e242a826b6e2ac8570a9be

View File

@@ -1 +0,0 @@
249a328f586bdc3fd7ee4d95a6fd9ddfd81c1ffa

View File

@@ -1 +0,0 @@
8faef2b094b0bed53f09078672652ea21e471d49

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
5a7cb145fe67a85a4b67a9a745322356d536e2fc

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
f7b46a806cdf4516448e4b4de7d4b2bb27abbd71

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
07c191a3223718ceed1e5a3f54fb0fb15d7b0a3a

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
f55a895731715e77a5dc226ffcc110f8f049bbf9

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
f7fffe59740623cfc5d3e3e3af4e52630cc2e41e