Loading symbol_inject/cmd/symbol_inject.go +9 −0 Original line number Diff line number Diff line Loading @@ -94,4 +94,13 @@ func main() { os.Remove(*output) os.Exit(5) } if file.IsMachoFile { err = symbol_inject.CodeSignMachoFile(*output) if err != nil { fmt.Fprintln(os.Stderr, err.Error()) os.Remove(*output) os.Exit(6) } } } symbol_inject/macho.go +7 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ import ( "debug/macho" "fmt" "io" "os/exec" "sort" "strings" ) Loading @@ -40,7 +41,7 @@ func extractMachoSymbols(machoFile *macho.File) (*File, error) { return symbols[i].Value < symbols[j].Value }) file := &File{} file := &File{IsMachoFile: true} for _, section := range machoFile.Sections { file.Sections = append(file.Sections, &Section{ Loading Loading @@ -95,3 +96,8 @@ func dumpMachoSymbols(r io.ReaderAt) error { return nil } func CodeSignMachoFile(path string) error { cmd := exec.Command("/usr/bin/codesign", "--force", "-s", "-", path) return cmd.Run() } symbol_inject/symbol_inject.go +4 −3 Original line number Diff line number Diff line Loading @@ -164,6 +164,7 @@ type File struct { r io.ReaderAt Symbols []*Symbol Sections []*Section IsMachoFile bool } type Symbol struct { Loading Loading
symbol_inject/cmd/symbol_inject.go +9 −0 Original line number Diff line number Diff line Loading @@ -94,4 +94,13 @@ func main() { os.Remove(*output) os.Exit(5) } if file.IsMachoFile { err = symbol_inject.CodeSignMachoFile(*output) if err != nil { fmt.Fprintln(os.Stderr, err.Error()) os.Remove(*output) os.Exit(6) } } }
symbol_inject/macho.go +7 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ import ( "debug/macho" "fmt" "io" "os/exec" "sort" "strings" ) Loading @@ -40,7 +41,7 @@ func extractMachoSymbols(machoFile *macho.File) (*File, error) { return symbols[i].Value < symbols[j].Value }) file := &File{} file := &File{IsMachoFile: true} for _, section := range machoFile.Sections { file.Sections = append(file.Sections, &Section{ Loading Loading @@ -95,3 +96,8 @@ func dumpMachoSymbols(r io.ReaderAt) error { return nil } func CodeSignMachoFile(path string) error { cmd := exec.Command("/usr/bin/codesign", "--force", "-s", "-", path) return cmd.Run() }
symbol_inject/symbol_inject.go +4 −3 Original line number Diff line number Diff line Loading @@ -164,6 +164,7 @@ type File struct { r io.ReaderAt Symbols []*Symbol Sections []*Section IsMachoFile bool } type Symbol struct { Loading