static int lookup_sym(symtab_t s, unsigned char type, char *name, unsigned long *val) { if (s->dyn && !lookup2(s->dyn, type, name, val)) return 0; if (s->st && !lookup2(s->st, type, name, val)) return 0; return -1; }
static int lookup_sym(symtab_t s, unsigned char type, char *name, unsigned long *val) { if (s->dyn && !lookup2(s->dyn, type, name, val)) { //log("lookup_sym: 0\n"); return 0; } if (s->st && !lookup2(s->st, type, name, val)) { //log("lookup_sym: 1\n"); return 0; } //log("lookup_sym: fail\n"); return -1; }
int main() { int x; struct list_head *pp; pthread_t t; if (x) pp = lookup1(7); else pp = lookup2(7); pthread_create(&t, NULL, f, NULL); return ((int) pp); }
int main (void) { if (lookup1(2) != 2) abort (); if (lookup2(2) != 3) abort (); if (lookup3(2) != 4) abort (); return 0; }
static IMAGE_THUNK_DATA *lookup(IMAGE_DOS_HEADER *dh, const char *nm) { char *base = (char *)dh; IMAGE_IMPORT_DESCRIPTOR *id = imports(dh); if (!id) return 0; while (id->Name) { if (id->FirstThunk && id->OriginalFirstThunk) { IMAGE_THUNK_DATA *d = lookup2(base, (IMAGE_THUNK_DATA*)(id->FirstThunk + base), (IMAGE_THUNK_DATA*)(id->OriginalFirstThunk + base), nm); dbg(" import %s\n", id->Name + base); if (d) return d; } id++; } return 0; }