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

View File

@@ -1 +0,0 @@
3e604108a8d81bc0997f4ac09c67441a2fb5abc4

View File

@@ -1 +0,0 @@
9b79bd26fa0108549e6a2a4c6d5431bd40fcfb31

View File

@@ -1 +0,0 @@
8a91611828a0d7d298f678e6c2b92c4f0198cbab

View File

@@ -1 +0,0 @@
ce4b83251d144de91ce47f46f44a146534db1efd

View File

@@ -1 +0,0 @@
2eeb19362bf190b91be7cfe369df6c328e23772c