Skip to content

Commit d4f7a4b

Browse files
committed
Expose AnalysisState through the API
1 parent 4403757 commit d4f7a4b

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

binaryninjaapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6109,6 +6109,7 @@ namespace BinaryNinja {
61096109

61106110
AnalysisInfo GetAnalysisInfo();
61116111
BNAnalysisProgress GetAnalysisProgress();
6112+
BNAnalysisState GetAnalysisState();
61126113
Ref<BackgroundTask> GetBackgroundAnalysisTask();
61136114

61146115
/*! Returns the virtual address of the Function that occurs after the virtual address `addr`

binaryninjacore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5068,6 +5068,7 @@ extern "C"
50685068
BINARYNINJACOREAPI BNAnalysisInfo* BNGetAnalysisInfo(BNBinaryView* view);
50695069
BINARYNINJACOREAPI void BNFreeAnalysisInfo(BNAnalysisInfo* info);
50705070
BINARYNINJACOREAPI BNAnalysisProgress BNGetAnalysisProgress(BNBinaryView* view);
5071+
BINARYNINJACOREAPI BNAnalysisState BNGetAnalysisState(BNBinaryView* view);
50715072
BINARYNINJACOREAPI BNBackgroundTask* BNGetBackgroundAnalysisTask(BNBinaryView* view);
50725073

50735074
BINARYNINJACOREAPI uint64_t BNGetNextFunctionStartAfterAddress(BNBinaryView* view, uint64_t addr);

binaryview.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3823,6 +3823,12 @@ BNAnalysisProgress BinaryView::GetAnalysisProgress()
38233823
}
38243824

38253825

3826+
BNAnalysisState BinaryView::GetAnalysisState()
3827+
{
3828+
return BNGetAnalysisState(m_object);
3829+
}
3830+
3831+
38263832
Ref<BackgroundTask> BinaryView::GetBackgroundAnalysisTask()
38273833
{
38283834
BNBackgroundTask* task = BNGetBackgroundAnalysisTask(m_object);

python/binaryview.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3371,6 +3371,11 @@ def analysis_progress(self) -> AnalysisProgress:
33713371
result = core.BNGetAnalysisProgress(self.handle)
33723372
return AnalysisProgress(result.state, result.count, result.total)
33733373

3374+
@property
3375+
def analysis_state(self) -> AnalysisState:
3376+
"""State of current analysis (read-only)"""
3377+
return core.BNGetAnalysisState(self.handle)
3378+
33743379
@property
33753380
def linear_disassembly(self) -> Iterator['lineardisassembly.LinearDisassemblyLine']:
33763381
"""Iterator for all lines in the linear disassembly of the view"""

0 commit comments

Comments
 (0)