logo

go-deblob

remove binary blobs from a directory
commit: 34c420a873460447ae42c6d075818cb3c594f53d
parent: b0d99e93cc91d4bb5bbe3cd6100096fd8aed57ad
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  7 Jan 2020 06:33:14 +0100

Add detection of Option ROMs

Diffstat:

Mgo-deblob.12++
Mgo-deblob.go2+-
Mgo-deblob_test.go1+
3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/go-deblob.1 b/go-deblob.1 @@ -36,6 +36,8 @@ ELF files by the magic-header .It .Xr ar 1 files by the magic-header +.It +x86 IBM PC BIOS Option Rom .El .Sh EXAMPLES The following code block show how it is intended to be used in Gentoo's diff --git a/go-deblob.go b/go-deblob.go @@ -35,7 +35,7 @@ func isBlob(filename string) (result bool) { return } - if bytes.HasPrefix(header, []byte("\x7fELF")) || bytes.HasPrefix(header, []byte("!<arch>\n")) { + if bytes.HasPrefix(header, []byte("\x7fELF")) || bytes.HasPrefix(header, []byte("!<arch>\n")) || bytes.HasPrefix(header, []byte("\x55\xAA")) { result = true } diff --git a/go-deblob_test.go b/go-deblob_test.go @@ -22,6 +22,7 @@ func TestIsBlob(t *testing.T) { // {"test/fixtures/hello.o", true}, {"test/fixtures/hello.ar", true}, {"test/fixtures/empty", false}, + // {"test/fixtures/option.rom", true}, } for _, test := range tests {