本文整理汇总了C++中pdvector::back方法的典型用法代码示例。如果您正苦于以下问题:C++ pdvector::back方法的具体用法?C++ pdvector::back怎么用?C++ pdvector::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pdvector
的用法示例。
在下文中一共展示了pdvector::back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: virtualFreeCB
void HybridAnalysis::virtualFreeCB(BPatch_point *, void *t) {
assert(virtualFreeAddr_ != 0);
unsigned type = (unsigned) t;
cerr << "virtualFree [" << hex << virtualFreeAddr_ << "," << virtualFreeAddr_ + (unsigned) virtualFreeSize_ << "], " << (unsigned) type << dec << endl;
Address pageSize = proc()->lowlevel_process()->getMemoryPageSize();
// Windows page-aligns everything.
unsigned addrShift = virtualFreeAddr_ % pageSize;
unsigned sizeShift = pageSize - (virtualFreeSize_ % pageSize);
virtualFreeAddr_ -= addrShift;
if (type != MEM_RELEASE)
{
virtualFreeSize_ += addrShift + sizeShift;
}
// We need to:
// 1) Remove any function with a block in the deleted range
// 2) Remove memory translation for that range
// 3) Skip trying to set permissions for any page in the range.
// DEBUG!
if (1 || type == MEM_RELEASE)
{
mapped_object *obj = proc()->lowlevel_process()->findObject(virtualFreeAddr_);
if (!obj) return;
virtualFreeAddr_ = obj->codeBase();
virtualFreeSize_ = obj->imageSize();
// DEBUG!
cerr << "Removing VirtualAlloc'ed shared object " << obj->fileName() << endl;
image *img = obj->parse_img();
proc()->lowlevel_process()->removeASharedObject(obj);
virtualFreeAddr_ = 0;
// Since removeASharedObject doesn't actually delete the object,
// or its image (even if its refCount==0), make sure the image
// goes away from global datastructure allImages
for (unsigned int i=0; i < allImages.size(); i++) {
if (img == allImages[i]) {
allImages[i] = allImages.back();
allImages.pop_back();
}
}
return;
}
std::set<func_instance *> deletedFuncs;
for (Address i = virtualFreeAddr_; i < (virtualFreeAddr_ + virtualFreeSize_); ++i) {
proc()->lowlevel_process()->findFuncsByAddr(i, deletedFuncs);
}
for (std::set<func_instance *>::iterator iter = deletedFuncs.begin();
iter != deletedFuncs.end(); ++iter)
{
BPatch_function * bpfunc = proc()->findOrCreateBPFunc(*iter, NULL);
if (!bpfunc) continue;
PatchAPI::PatchModifier::remove(bpfunc->lowlevel_func());
}
proc()->lowlevel_process()->getMemEm()->removeRegion(virtualFreeAddr_, virtualFreeSize_);
// And nuke the RT cache
proc()->lowlevel_process()->proc()->flushAddressCache_RT(virtualFreeAddr_, virtualFreeSize_);
virtualFreeAddr_ = 0;
return;
}