diff --git a/Workflow.cpp b/Workflow.cpp index 035ecc4..65f4c1d 100644 --- a/Workflow.cpp +++ b/Workflow.cpp @@ -105,8 +105,6 @@ void Workflow::inlineMethodCalls(AnalysisContextRef ac) if (GlobalState::viewIsIgnored(bv)) return; - auto messageHandler = GlobalState::messageHandler(bv); - const auto log = BinaryNinja::LogRegistry::GetLogger(PluginLoggerName); // Ignore the view if it has an unsupported architecture. @@ -141,6 +139,8 @@ void Workflow::inlineMethodCalls(AnalysisContextRef ac) CFStringArchitectureHook* currentHook = new CFStringArchitectureHook(bv->GetDefaultArchitecture()); bv->GetDefaultArchitecture()->Register(currentHook); + auto messageHandler = GlobalState::messageHandler(bv); + try { auto file = std::make_shared(bv); @@ -188,6 +188,7 @@ void Workflow::inlineMethodCalls(AnalysisContextRef ac) GlobalState::storeAnalysisInfo(bv, info); } } + auto messageHandler = GlobalState::messageHandler(bv); if (!messageHandler->hasMessageSendFunctions()) { log->LogError("Cannot perform Objective-C IL cleanup; no objc_msgSend candidates found");