MCPcopy Create free account
hub / github.com/ReversecLabs/C3 / HandleNewBuildMessage

Method HandleNewBuildMessage

Src/Core/Profiler.cpp:366–384  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

364
365////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
366json FSecure::C3::Core::Profiler::HandleNewBuildMessage(json const& message)
367{
368 auto newBuildId = message.at("BuildId").get<BuildId::UnderlyingIntegerType>();
369 auto const& command = message.at("Command");
370 auto commandBinary = TranslateStartupCommand(command);
371 auto response = json
372 {
373 {"BinaryCommand", base64::encode(commandBinary)},
374 };
375 {
376 // Add build to profiler
377 auto arch = message.at("Arch").get<std::string>();
378 std::transform(arch.begin(), arch.end(), arch.begin(), [](char c) { return std::tolower(c); });
379 auto isX64 = arch == "x64";
380 Get().m_Gateway.AddAgentBuild(newBuildId, { isX64, false, command });
381 }
382
383 return response;
384}
385
386////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
387json FSecure::C3::Core::Profiler::Gateway::CreateProfileSnapshot() const

Callers 1

HandleMessageMethod · 0.80

Calls 4

encodeFunction · 0.85
AddAgentBuildMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected