func printFileInformation(f *elf.File) { printHeader(&f.FileHeader) printSections(f.Sections) printProgs(f.Progs) printImportedLibraries(f.ImportedLibraries()) printSymbols(f.Symbols()) printImportedSymbols(f.ImportedSymbols()) }
func canary(file *elf.File) string { if symbols, e := file.Symbols(); e == nil { for _, sym := range symbols { if bytes.HasPrefix([]byte(sym.Name), []byte(STACK_CHK)) { return ENABLED } } } if importedSymbols, e := file.ImportedSymbols(); e == nil { for _, imp := range importedSymbols { if bytes.HasPrefix([]byte(imp.Name), []byte(STACK_CHK)) { return ENABLED } } } return DISABLED }