coff32probe.c (355B)
1 #include <stdio.h> 2 3 #include <scc/mach.h> 4 #include <scc/coff32.h> 5 6 #include "../libmach.h" 7 #include "fun.h" 8 9 int 10 coff32probe(unsigned char *buf, char **name) 11 { 12 struct arch *ap; 13 14 for (ap = coff32archs; ap->name; ap++) { 15 if (ap->magic[0] == buf[0] && ap->magic[1] == buf[1]) { 16 if (name) 17 *name = ap->name; 18 return ap->type; 19 } 20 } 21 return -1; 22 }