static void idaapi graph_unmatch(void *obj,uint32 n) { slist_t * sl = NULL, * tmp = ((deng_t *)obj)->ulist; if (ui_access_sig(tmp, n)->nfile == 2) { msg ("parsing second function...\n"); sl = parse_second_fct(ui_access_sig(tmp, n)->startEA, tmp->file, ((deng_t *)obj)->opt); if (!sl) { msg("Error: FCT2 parsing failed.\n"); return; } sl->sigs[0]->nfile = 2; } else { msg ("parsing first function...\n"); sl = parse_fct(ui_access_sig(tmp, n)->startEA, dto.graph.s_showpref); if (!sl) { msg("Error: FCT1 parsing failed.\n"); return; } sl->sigs[0]->nfile = 1; } pgraph_display_one(sl); msg ("done!\n"); return; }
static uint32 idaapi graph_list(slist_t * sl,uint32 n, options_t * opt) { slist_t * sl1 = NULL; slist_t * sl2 = NULL; msg ("parsing second function...\n"); sl2 = parse_second_fct(ui_access_sig(sl, n)->msig->startEA, sl->file, opt); if (!sl2) { msg("Error: FCT2 parsing failed.\n"); return 0; } msg ("parsing first function...\n"); sl1 = parse_fct(ui_access_sig(sl, n)->startEA, dto.graph.s_showpref); if (!sl1) { msg("Error: FCT1 parsing failed.\n"); siglist_free(sl2); return 0; } sl1->sigs[0]->nfile = 1; sl2->sigs[0]->nfile = 2; msg ("diffing functions...\n"); generate_diff(NULL, sl1, sl2, NULL, false, NULL); pgraph_display(sl1, sl2); msg ("done!\n"); return 1; }
static void run_second_instance(const char * options) { slist_t * sl; char file[QMAXPATH]; ea_t ea = BADADDR; unsigned char opt = 0; long id; unsigned int v; bool cont; char tmp[QMAXPATH*4]; qsscanf(options, "%lu:%" PRIea_t ":%u:%s", &id, &ea, &v, file); opt = (unsigned char)v; if (id) { if (ipc_init(file, 2, id)) { do { cont = ipc_recv_cmd(tmp, sizeof(tmp)); if (cont) { run_second_instance(tmp); ipc_recv_cmd_end(); } }while(cont); } } else { if (ea == BADADDR) { sl = parse_idb (); } else sl = parse_fct(ea, opt); if (!sl) return; siglist_save(sl, file); siglist_free(sl); } }