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

Method GetLoadSettingsForData

view/pe/coffview.cpp:1663–1714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1661
1662
1663Ref<Settings> COFFViewType::GetLoadSettingsForData(BinaryView* data)
1664{
1665 Ref<BinaryView> viewRef = Parse(data);
1666 if (!viewRef || !viewRef->Init())
1667 {
1668 m_logger->LogWarn("Failed to initialize view of type '%s'. Generating default load settings.", GetName().c_str());
1669 viewRef = data;
1670 }
1671
1672 Ref<Settings> settings = GetDefaultLoadSettingsForData(viewRef);
1673
1674 // specify default load settings that can be overridden
1675 vector<string> overrides = {"loader.imageBase", "loader.platform"};
1676 if (!viewRef->IsRelocatable())
1677 settings->UpdateProperty("loader.imageBase", "message", "Note: File indicates image is not relocatable.");
1678
1679 for (const auto& override : overrides)
1680 {
1681 if (settings->Contains(override))
1682 settings->UpdateProperty(override, "readOnly", false);
1683 }
1684
1685 // TODO: additional settings
1686
1687 // register additional settings
1688 // settings->RegisterSetting("loader.coff.processCfgTable",
1689 // R"({
1690 // "title" : "Process PE Control Flow Guard Table",
1691 // "type" : "boolean",
1692 // "default" : true,
1693 // "description" : "Add function starts sourced from the Control Flow Guard (CFG) table to the core for analysis."
1694 // })");
1695
1696 // settings->RegisterSetting("loader.coff.processExceptionTable",
1697 // R"({
1698 // "title" : "Process COFF Exception Handling Table",
1699 // "type" : "boolean",
1700 // "default" : true,
1701 // "description" : "Add function starts sourced from the Exception Handling table (.pdata) to the core for analysis."
1702 // })");
1703
1704 // settings->RegisterSetting("loader.coff.processSehTable",
1705 // R"({
1706 // "title" : "Process COFF Structured Exception Handling Table",
1707 // "type" : "boolean",
1708 // "default" : true,
1709 // "description" : "Add function starts sourced from the Structured Exception Handling (SEH) table to the core for analysis."
1710 // })");
1711
1712
1713 return settings;
1714}

Callers

nothing calls this directly

Calls 6

LogWarnMethod · 0.80
c_strMethod · 0.80
IsRelocatableMethod · 0.80
UpdatePropertyMethod · 0.80
InitMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected