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 /python | |
| parent | 7dee9c4f68147bd88d1c60577912c3a91c510331 (diff) | |
Add MediumLevelIL Function Recognizer.
Diffstat (limited to 'python')
| -rw-r--r-- | python/functionrecognizer.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/python/functionrecognizer.py b/python/functionrecognizer.py index 8514a2ee..4ac304ca 100644 --- a/python/functionrecognizer.py +++ b/python/functionrecognizer.py @@ -36,6 +36,7 @@ class FunctionRecognizer(object): self._cb = core.BNFunctionRecognizer() self._cb.context = 0 self._cb.recognizeLowLevelIL = self._cb.recognizeLowLevelIL.__class__(self._recognize_low_level_il) + self._cb.recognizeMediumLevelIL = self._cb.recognizeMediumLevelIL.__class__(self._recognize_medium_level_il) @classmethod def register_global(cls): @@ -62,3 +63,17 @@ class FunctionRecognizer(object): def recognize_low_level_il(self, data, func, il): return False + + def _recognize_medium_level_il(self, ctxt, data, func, il): + try: + file_metadata = filemetadata.FileMetadata(handle = core.BNGetFileForView(data)) + view = binaryview.BinaryView(file_metadata = file_metadata, handle = core.BNNewViewReference(data)) + func = function.Function(view, handle = core.BNNewFunctionReference(func)) + il = mediumlevelil.MediumLevelILFunction(func.arch, handle = core.BNNewMediumLevelILFunctionReference(il)) + return self.recognize_medium_level_il(view, func, il) + except: + log.log_error(traceback.format_exc()) + return False + + def recognize_medium_level_il(self, data, func, il): + return False |
