/
githubmirror
/
x64dbg
Обзор
Документация
Войти
/
githubmirror
/
x64dbg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
development
src/dbg/analysis/controlflowanalysis.h
74 строки
2 KB
Duncan Ogilvie
Start reducing TitanEngine.h
28 авг 2025, 18:56
28 авг 2025, 18:56
e1e954b
Код
Авторство
О чём код?
#ifndef _CONTROLFLOWANALYSIS_H #define _CONTROLFLOWANALYSIS_H #include "_global.h" #include "analysis.h" #include "addrinfo.h" #include <functional> #include <unordered_set> class ControlFlowAnalysis : public Analysis { public: ControlFlowAnalysis(duint base, duint size, bool exceptionDirectory); void Analyse() override; void SetMarkers() override; private: struct BasicBlock { duint start; duint end; duint left; duint right; duint function; BasicBlock() : BasicBlock(0, 0, 0, 0) { } BasicBlock(duint start, duint end, duint left, duint right) : start(start), end(end), left(std::min(left, right)), right(std::min(left, right)), function(0) { } String toString() const { return StringUtils::sprintf("start:%p,end:%p,left:%p,right:%p,func:%p", start, end, left, right, function); } }; typedef std::unordered_set<duint> UintSet; duint mModuleBase = 0; UintSet mBlockStarts; UintSet mFunctionStarts; std::unordered_map<duint, BasicBlock> mBlocks; //start of block -> block std::unordered_map<duint, UintSet> mParentMap; //start child -> parents std::unordered_map<duint, UintSet> mFunctions; //function start -> function block starts std::vector<Range> mFunctionRanges; //function start -> function range TODO: smarter stuff with overlapping ranges void BasicBlockStarts(); void BasicBlocks(); void Functions(); void FunctionRanges(); void insertBlock(const BasicBlock & block); const BasicBlock* findBlock(duint start) const; void insertParent(duint child, duint parent); const UintSet* findParents(duint child) const; duint findFunctionStart(const BasicBlock* block, const UintSet* parents) const; static String blockToString(const BasicBlock* block); duint getReferenceOperand() const; #ifdef _WIN64 std::vector<RUNTIME_FUNCTION> mRuntimeFunctions; #endif // _WIN64 }; #endif //_CONTROLFLOWANALYSIS_H