| 1661 | |
| 1662 | |
| 1663 | Ref<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 | } |
nothing calls this directly
no test coverage detected