diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2024-09-16 13:59:58 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2024-09-16 13:59:58 -0400 |
| commit | 6c2517cd64cb318a2ab126b4aec2eb60bd9facf5 (patch) | |
| tree | 82b5f04fd5c218928de7125b5c5588c4256271ba /docs/dev/batch.md | |
| parent | c5d68d1775b4ace7df812085913694079406960d (diff) | |
update single function analysis to use analysis_hold in batch processing
Diffstat (limited to 'docs/dev/batch.md')
| -rw-r--r-- | docs/dev/batch.md | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/docs/dev/batch.md b/docs/dev/batch.md index e9419999..e46bc573 100644 --- a/docs/dev/batch.md +++ b/docs/dev/batch.md @@ -78,25 +78,19 @@ Notice that we have far fewer functions in `/bin/ls` this time. By shortcutting ### Single Function Analysis -A common workflow is to analyze a single (or small number) of functions in a particular binaries. If we both the [maxFunctionSize](https://docs.binary.ninja/getting-started.html#analysis.limits.maxFunctionSize) setting in conjunction with the [analysis_skipped](https://api.binary.ninja/binaryninja.function-module.html#binaryninja.function.Function.analysis_skipped) function property we can select specific functions to analyze: +A common workflow is to analyze a single (or small number) of functions in a particular binaries. This can be done using the analysis hold feature. If we both the [maxFunctionSize](https://docs.binary.ninja/getting-started.html#analysis.limits.maxFunctionSize) setting in conjunction with the [analysis_skipped](https://api.binary.ninja/binaryninja.function-module.html#binaryninja.function.Function.analysis_skipped) function property we can select specific functions to analyze: ```python from binaryninja import load -with load("/bin/ls", options={'analysis.limits.maxFunctionSize': 1}) as bv: +with load("/bin/ls", options={'analysis.initialAnalysisHold': True}) as bv: fn = bv.entry_function # Alternatively, use add_user_function at a particular address to first # create the function if fn: - if fn.mlil: - print("Entry function has MLIL") - else: - print(f"No MLIL entry function") - fn.analysis_skipped = False - bv.update_analysis_and_wait() - if fn.mlil: - print("Entry function has MLIL") - else: - print(f"No MLIL entry function") + if fn.hlil_if_available: + print("This will not fire because analysis hold has analyzed nothing so no HLIL exists.") + if fn.hlil: + print("This will work because HLIL is explicitly being requested via the API and will override the hold.") ``` ### Running Plugins |
