cVector build_condensation(const WorkSpaceGraph &graph) { vVector top_sort = topolog_sort< WorkSpaceGraph >(graph); in_sort.clear(); out_sort.clear(); used.clear(); std::for_each(top_sort.rbegin(), top_sort.rend(), [&cond, &used, &in_sort, this] (const Vertex &v) { if (used.find(v) == used.end()) { this->dfs< Transposed >(v); cond.push_back(vSet(in_sort.begin(), in_sort.end())); in_sort.clear(); } }); return cond; }
void AddExcludes(pxnode pExcludes, cVector<cDetectExclude>& excludes, const char* pszProfile) { if (!pExcludes) return; for (pxnode pExclude = pExcludes->first_child; pExclude; pExclude = pExclude->next) { if (pExclude->type != SBVT_STRING || !pExclude->pdata) continue; cStrObj path; path.assign(pExclude->pdata, cCP_UNICODE, pExclude->data_size); bool bFound = false; for (tDWORD i = 0; i < excludes.size(); ++i) { cDetectExclude& exclude = excludes[i]; if (exclude.m_bEnable && (exclude.m_nTriggers & cDetectExclude::fObjectMask) && exclude.m_Object.m_strMask == path) { if (exclude.m_aTaskList.find(pszProfile) == exclude.m_aTaskList.npos) exclude.m_aTaskList.push_back(pszProfile); bFound = true; break; } } if (bFound) continue; cDetectExclude exclude; exclude.m_nTriggers |= cDetectExclude::fTaskList; exclude.m_Object.m_bRecurse = (!path.empty() && (path[path.length()-1] == '\\')) ? cTRUE : cFALSE; exclude.m_Object.m_strMask = path; exclude.m_aTaskList.push_back(pszProfile); excludes.push_back(exclude); } }