本文整理汇总了C++中Proc::setSignature方法的典型用法代码示例。如果您正苦于以下问题:C++ Proc::setSignature方法的具体用法?C++ Proc::setSignature怎么用?C++ Proc::setSignature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Proc
的用法示例。
在下文中一共展示了Proc::setSignature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decode
void FrontEnd::decode(Prog* prog, bool decodeMain, const char *pname) {
if (pname)
{prog->setName(pname);
std::cout<<"decode pname == "<<pname<<"\n";
}
else {std::cout<<"decode pname==null\n";}
if (!decodeMain)
return;
Boomerang::get()->alert_start_decode(pBF->getLimitTextLow(), pBF->getLimitTextHigh() - pBF->getLimitTextLow());
bool gotMain;
ADDRESS a;
a = getMainEntryPoint(gotMain);
std::cout<< "start: " << a << " gotmain: " << (gotMain ? "true" : "false") << "\n";
if (VERBOSE)
LOG << "start: " << a << " gotmain: " << (gotMain ? "true" : "false") << "\n";
if (a == NO_ADDRESS) {
std::vector<ADDRESS> entrypoints = getEntryPoints();
for (std::vector<ADDRESS>::iterator it = entrypoints.begin(); it != entrypoints.end(); it++)
decode(prog, *it);
return;
}
decode(prog, a);
prog->setEntryPoint(a);
if (gotMain) {
static const char *mainName[] = { "main", "WinMain", "DriverEntry" };
const char *name = pBF->SymbolByAddress(a);
std::cout<<"Proc name "<<name<<"\n";
if (name == NULL)
name = mainName[0];
for (size_t i = 0; i < sizeof(mainName)/sizeof(char*); i++) {
if (!strcmp(name, mainName[i])) {
Proc *proc = prog->findProc(a);
if (proc == NULL) {
if (VERBOSE)
LOG << "no proc found for address " << a << "\n";
return;
}
FuncType *fty = dynamic_cast<FuncType*>(Type::getNamedType(name));
if (fty == NULL)
LOG << "unable to find signature for known entrypoint " << name << "\n";
else {
std::cout<<"Sig type:"<<fty->getSignature()->getReturns()[0]->type->prints();
proc->setSignature(fty->getSignature()->clone());
proc->getSignature()->setName(name);
//proc->getSignature()->setFullSig(true); // Don't add or remove parameters
proc->getSignature()->setForced(true); // Don't add or remove parameters
}
break;
}
}
}
return;
}