Ejemplo n.º 1
0
void EdgeKiller::onModuleUnload(
        S2EExecutionState* state,
        const ModuleDescriptor &module
        )
{
    DECLARE_PLUGINSTATE(EdgeKillerState, state);

    //Remove all the polling entries that belong to the module
    EdgeKillerState::EdgeEntries &entries =
            plgState->getEntries();

    EdgeKillerState::EdgeEntries::iterator it1, it2;

    it1 = entries.begin();
    while(it1 != entries.end()) {
        const EdgeKillerState::Edge &e = *it1;
        if (module.Contains(e.source)) {
            it2 = it1;
            ++it2;
            entries.erase(it1);
            it1 = it2;
        }else {
            ++it1;
        }
    }
}
Ejemplo n.º 2
0
void FunctionMonitorState::disconnect(const ModuleDescriptor &desc, CallDescriptorsMap &descMap)
{
    CallDescriptorsMap::iterator it = descMap.begin();
    while (it != descMap.end()) {
        uint64_t addr = (*it).first;
        const CallDescriptor &call = (*it).second;
        if (desc.Contains(addr) && desc.Pid == call.pid) {
            CallDescriptorsMap::iterator it2 = it;
            ++it;
            descMap.erase(it2);
        }else {
            ++it;
        }
    }
}