Beispiel #1
0
func printFileInformation(f *elf.File) {
	printHeader(&f.FileHeader)
	printSections(f.Sections)
	printProgs(f.Progs)
	printImportedLibraries(f.ImportedLibraries())
	printSymbols(f.Symbols())
	printImportedSymbols(f.ImportedSymbols())
}
Beispiel #2
0
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
}