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

Method QueryDevicesForBoard

firmwareninja.cpp:448–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446
447
448std::vector<FirmwareNinjaDevice> FirmwareNinja::QueryDevicesForBoard(const std::string& board)
449{
450 std::vector<FirmwareNinjaDevice> result;
451 BNFirmwareNinjaDevice* devices;
452 auto platform = m_view->GetDefaultPlatform();
453 if (!platform)
454 return result;
455
456 auto arch = platform->GetArchitecture();
457 if (!arch)
458 return result;
459
460 int count = BNFirmwareNinjaQueryBoardDevices(m_object, arch->GetObject(), board.c_str(), &devices);
461 if (count <= 0)
462 return result;
463
464 result.reserve(count);
465 for (size_t i = 0; i < count; i++)
466 result.push_back({
467 devices[i].name,
468 devices[i].start,
469 devices[i].end,
470 devices[i].info
471 });
472
473 BNFirmwareNinjaFreeDevices(devices, count);
474 return result;
475}
476
477
478std::vector<BNFirmwareNinjaSection> FirmwareNinja::FindSections(float highCodeEntropyThreshold,

Callers

nothing calls this directly

Calls 5

GetDefaultPlatformMethod · 0.80
c_strMethod · 0.80
push_backMethod · 0.80
GetArchitectureMethod · 0.45
GetObjectMethod · 0.45

Tested by

no test coverage detected