MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / SetLogEnabled

Method SetLogEnabled

workflow.cpp:251–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249
250
251bool WorkflowMachine::SetLogEnabled(bool enable, bool global)
252{
253 rapidjson::Document request(rapidjson::kObjectType);
254 rapidjson::Document::AllocatorType& allocator = request.GetAllocator();
255 request.AddMember("command", "log", allocator);
256 request.AddMember("enable", enable, allocator);
257 request.AddMember("global", global, allocator);
258 rapidjson::StringBuffer buffer;
259 rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
260 request.Accept(writer);
261
262 string jsonResult;
263 if (m_function)
264 jsonResult = BNPostWorkflowRequestForFunction(m_function->GetObject(), buffer.GetString());
265 else
266 jsonResult = BNPostWorkflowRequestForBinaryView(m_view->GetObject(), buffer.GetString());
267
268 rapidjson::Document response(rapidjson::kObjectType);
269 response.Parse(jsonResult.c_str());
270 if (response.HasMember("commandStatus") && response["commandStatus"].HasMember("accepted"))
271 return response["commandStatus"]["accepted"].GetBool();
272
273 return false;
274}
275
276
277std::optional<bool> WorkflowMachine::QueryOverride(const string& activity)

Callers

nothing calls this directly

Calls 6

AddMemberMethod · 0.80
c_strMethod · 0.80
HasMemberMethod · 0.80
GetObjectMethod · 0.45
GetStringMethod · 0.45
ParseMethod · 0.45

Tested by

no test coverage detected