diff --git a/go.mod b/go.mod index 220fa9b..7b596c1 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module mvdan.cc/garble go 1.15 require ( - github.com/Binject/debug v0.0.0-20200928131656-23d735563ce7 + github.com/Binject/debug v0.0.0-20201021202824-cc437dcdb16e github.com/google/go-cmp v0.5.2 github.com/rogpeppe/go-internal v1.6.3-0.20201011174404-9f985d550aa7 golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 diff --git a/go.sum b/go.sum index 84eb7fe..7be540b 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/Binject/debug v0.0.0-20200928131656-23d735563ce7 h1:W9kchICcGYOJQBZNn2P6j739QbY8OKskB3SyFZ/IRIU= github.com/Binject/debug v0.0.0-20200928131656-23d735563ce7/go.mod h1:QzgxDLY/qdKlvnbnb65eqTedhvQPbaSP2NqIbcuKvsQ= +github.com/Binject/debug v0.0.0-20201021202824-cc437dcdb16e h1:IQMhZQS5d9OUmcXgv330n31ZnD97HAZE36K7JgIjvog= +github.com/Binject/debug v0.0.0-20201021202824-cc437dcdb16e/go.mod h1:QzgxDLY/qdKlvnbnb65eqTedhvQPbaSP2NqIbcuKvsQ= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= diff --git a/import_obfuscation.go b/import_obfuscation.go index 249ccfd..822c1d1 100644 --- a/import_obfuscation.go +++ b/import_obfuscation.go @@ -15,7 +15,6 @@ import ( "os" "path/filepath" "sort" - "strconv" "strings" "github.com/Binject/debug/goobj2" @@ -91,15 +90,7 @@ func extractDebugObfSrc(pkgPath string, pkg *goobj2.Package) error { return err } - // ArchiveHeader.Size incorrect, work around https://github.com/Binject/debug/issues/14 - archiveSize, err := strconv.Atoi(archiveMember.ArchiveHeader.Date) - if err != nil { - return err - } - - archiveBytes := archiveMember.ArchiveHeader.Data[:archiveSize] - - archive := bytes.NewBuffer(archiveBytes) + archive := bytes.NewBuffer(archiveMember.ArchiveHeader.Data) gzipReader, err := gzip.NewReader(archive) if err != nil { return err @@ -204,7 +195,7 @@ func obfuscateImports(objPath, tempDir, importCfgPath string) (garbledObj string // skip objects that are not used by the linker, or that do not contain // any Go symbol info - if am.IsCompilerObj() || am.IsDataObj() { + if am.IsCompilerObj() || am.IsDataObj { continue } diff --git a/main.go b/main.go index cef2e83..8589681 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,6 @@ import ( "os/exec" "path/filepath" "runtime" - "strconv" "strings" "time" "unicode" @@ -779,8 +778,6 @@ func transformCompile(args []string) ([]string, error) { ArchiveHeader: goobj2.ArchiveHeader{ Name: garbleSrcHeaderName, Size: int64(obfSrcArchive.Len()), - // Work around https://github.com/Binject/debug/issues/14 - Date: strconv.Itoa(obfSrcArchive.Len()), Data: obfSrcArchive.Bytes(), }, })