当前位置: 首页>>代码示例>>C++>>正文


C++ Proc::getSignature方法代码示例

本文整理汇总了C++中Proc::getSignature方法的典型用法代码示例。如果您正苦于以下问题:C++ Proc::getSignature方法的具体用法?C++ Proc::getSignature怎么用?C++ Proc::getSignature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Proc的用法示例。


在下文中一共展示了Proc::getSignature方法的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;
}
开发者ID:PhuongLam94,项目名称:Boomerang-Production,代码行数:62,代码来源:frontend.cpp


注:本文中的Proc::getSignature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。