mirror of
https://github.com/burrowers/garble.git
synced 2025-09-26 20:01:16 +08:00
support reversing asm filenames
Which can be helpful when debugging assembly build errors such as the one from #948. I could not get an obfuscated binary to ever print or show its assembly positions or filenames, so this has no test.
This commit is contained in:
@@ -152,7 +152,8 @@ type listedPackage struct {
|
||||
Standard bool
|
||||
|
||||
Dir string
|
||||
CompiledGoFiles []string
|
||||
CompiledGoFiles []string // all .go files to build
|
||||
SFiles []string // all .s (asm) files to build
|
||||
Imports []string
|
||||
|
||||
Error *packageError // to report package loading errors to the user
|
||||
|
@@ -68,6 +68,14 @@ One can reverse a captured panic stack trace as follows:
|
||||
// Package paths are obfuscated, too.
|
||||
addHashedWithPackage(lpkg.ImportPath)
|
||||
|
||||
// Assembly filenames are obfuscated in a simple way.
|
||||
// Mirroring [transformer.transformAsm]; note the lack of a test
|
||||
// as so far this has only mattered for build errors with positions.
|
||||
for _, name := range lpkg.SFiles {
|
||||
newName := hashWithPackage(lpkg, name) + ".s"
|
||||
replaces = append(replaces, newName, name)
|
||||
}
|
||||
|
||||
files, err := parseFiles(lpkg, lpkg.Dir, lpkg.CompiledGoFiles)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user