diff options
| author | Brian Potchik <brian@vector35.com> | 2017-12-04 13:12:06 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2017-12-04 13:12:06 -0500 |
| commit | 448ffe2842b2b1e0d21f905403489d3f865672d8 (patch) | |
| tree | 42033a41bef73de159ed5566445ac9db2521d6c8 /functionrecognizer.cpp | |
| parent | 7dee9c4f68147bd88d1c60577912c3a91c510331 (diff) | |
Add MediumLevelIL Function Recognizer.
Diffstat (limited to 'functionrecognizer.cpp')
| -rw-r--r-- | functionrecognizer.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/functionrecognizer.cpp b/functionrecognizer.cpp index 32c7245c..34f1db80 100644 --- a/functionrecognizer.cpp +++ b/functionrecognizer.cpp @@ -38,11 +38,22 @@ bool FunctionRecognizer::RecognizeLowLevelILCallback(void* ctxt, BNBinaryView* d } +bool FunctionRecognizer::RecognizeMediumLevelILCallback(void* ctxt, BNBinaryView* data, BNFunction* func, BNMediumLevelILFunction* il) +{ + FunctionRecognizer* recog = (FunctionRecognizer*)ctxt; + Ref<BinaryView> dataObj = new BinaryView(BNNewViewReference(data)); + Ref<Function> funcObj = new Function(BNNewFunctionReference(func)); + Ref<MediumLevelILFunction> ilObj = new MediumLevelILFunction(BNNewMediumLevelILFunctionReference(il)); + return recog->RecognizeMediumLevelIL(dataObj, funcObj, ilObj); +} + + void FunctionRecognizer::RegisterGlobalRecognizer(FunctionRecognizer* recog) { BNFunctionRecognizer reg; reg.context = recog; reg.recognizeLowLevelIL = RecognizeLowLevelILCallback; + reg.recognizeMediumLevelIL = RecognizeMediumLevelILCallback; BNRegisterGlobalFunctionRecognizer(®); } @@ -52,6 +63,7 @@ void FunctionRecognizer::RegisterArchitectureFunctionRecognizer(Architecture* ar BNFunctionRecognizer reg; reg.context = recog; reg.recognizeLowLevelIL = RecognizeLowLevelILCallback; + reg.recognizeMediumLevelIL = RecognizeMediumLevelILCallback; BNRegisterArchitectureFunctionRecognizer(arch->GetObject(), ®); } @@ -60,3 +72,9 @@ bool FunctionRecognizer::RecognizeLowLevelIL(BinaryView*, Function*, LowLevelILF { return false; } + + +bool FunctionRecognizer::RecognizeMediumLevelIL(BinaryView*, Function*, MediumLevelILFunction*) +{ + return false; +} |
