bool RoseBin_DataFlowAnalysis::exceptionCall(SgAsmX86Instruction* call) { // this function returns true, if the function that is being called is the _malloc function // this is good to know, so that the malloc analysis can be performed even if there is no ret // (tps - 05/23/08): Since the new disassembler does not know function names, this analysis // does not work. // todo : as long as there are no function names -- the malloc analysis will not work. bool exception=false; if (call==NULL) return exception; if (call->get_kind() != x86_call) return exception; SgAsmOperandList* opList = call->get_operandList(); ROSE_ASSERT(opList); SgAsmExpressionPtrList ptrList = opList->get_operands(); // get the first (and only) element string comment = call->get_comment(); if (ptrList.size()!=0) { SgAsmExpression* expr = *(ptrList.begin()); string replace = expr->get_replacement(); if (replace=="_malloc" || replace=="malloc@plt" || comment=="malloc") exception=true; } // cerr << "Found call --- comment = " << comment << " exception = " << exception << endl; return exception; }