Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Log analysis results on completion
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpalmisc committed Jun 8, 2022
1 parent 6ac96c0 commit 43df228
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Plugin/InfoHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ void InfoHandler::applyInfoToView(SharedAnalysisInfo info, BinaryViewRef bv)
defineReference(bv, sr->address, sr->nameAddress);
}

unsigned totalMethods = 0;

// Create data variables and symbols for the analyzed classes.
for (const auto& ci : info->classes) {
defineVariable(bv, ci.listPointer, taggedPointerType);
Expand All @@ -181,6 +183,8 @@ void InfoHandler::applyInfoToView(SharedAnalysisInfo info, BinaryViewRef bv)

// Create data variables for each method in the method list.
for (const auto& mi : ci.methodList.methods) {
++totalMethods;

defineVariable(bv, mi.address, methodType);
defineSymbol(bv, mi.address, sanitizeSelector(mi.selector), "mt_");
defineVariable(bv, mi.typeAddress, stringType(mi.type.size()));
Expand All @@ -200,4 +204,10 @@ void InfoHandler::applyInfoToView(SharedAnalysisInfo info, BinaryViewRef bv)

bv->CommitUndoActions();
bv->UpdateAnalysis();

const auto log = BinaryNinja::LogRegistry::GetLogger("ObjectiveNinja");
log->LogInfo("Structure analysis complete");
log->LogInfo("Found %d classes, %d methods, %d selector references",
info->classes.size(), totalMethods, info->selectorRefs.size());
log->LogInfo("Found %d CFString instances", info->cfStrings.size());
}

0 comments on commit 43df228

Please sign in to comment.