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

BIN
external/helix-binaries/Microsoft.Data.Edm.dll vendored Executable file

Binary file not shown.

View File

@@ -1 +0,0 @@
6f797250b687221674a33462f05c741ff07bacbc

Binary file not shown.

View File

@@ -1 +0,0 @@
300cf23dfe669d71e8cdbcb125454909f2657f24

Binary file not shown.

View File

@@ -1 +0,0 @@
6422e36e91bccb63b4c7062dc498913f2bef8adb

Binary file not shown.

View File

@@ -1 +0,0 @@
3a53c45dc0cfa0f36154025d4618fbf40bccba56

BIN
external/helix-binaries/Newtonsoft.Json.dll vendored Executable file

Binary file not shown.

View File

@@ -1 +0,0 @@
e2118f9b9c68453083213592eee7791980c67f4e

BIN
external/helix-binaries/System.Spatial.dll vendored Executable file

Binary file not shown.

View File

@@ -1 +0,0 @@
eb219984377baa73ec720dac5e01dff6825c6fa8