如何使用 RTN_FindByName 查找函数?

问题描述

我正在努力寻找具有原型 mul(float,float)函数时,我尝试使用 RTN_FindByName,但输出仍然为空。

VOID Arg1Before(CHAR * name,ADDRINT size)
{
    TraceFile << name << "(" << size << ")" << endl;
}
VOID MulAfter(ADDRINT ret)
{
    TraceFile << "  returns " << ret << endl;
}
VOID Image(IMG img,VOID *v)
{
// Instrument the mul() and div() functions.  Print the input argument
// of each mul() or div(),and the return value of mul().
//
//  Find the mul() function.
RTN mulRtn = RTN_FindByName(img,MUL);
if (RTN_Valid(mulRtn))
{
    RTN_Open(mulRtn);
    // Instrument mul() to print the input argument value and the return value.
    RTN_InsertCall(mulRtn,IPOINT_BEFORE,(AFUNPTR)Arg1Before,IARG_ADDRINT,MUL,IARG_FUNCARG_ENTRYPOINT_VALUE,IARG_END);
    RTN_InsertCall(mulRtn,IPOINT_AFTER,(AFUNPTR)MulAfter,IARG_FUNCRET_EXITPOINT_VALUE,IARG_END);
    RTN_Close(mulRtn);
}
}

在那里,MUL一个常量,它是 "mul"。显然,我已经包括了 pin.H。问题是我的 traceFile 仍然是空的

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)