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

Method GetLoadSettingsForData

view/elf/elfview.cpp:2978–3002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2976
2977
2978Ref<Settings> ElfViewType::GetLoadSettingsForData(BinaryView* data)
2979{
2980 Ref<BinaryView> viewRef = Parse(data);
2981 if (!viewRef || !viewRef->Init())
2982 {
2983 m_logger->LogWarn("Failed to initialize view of type '%s'. Generating default load settings.", GetName().c_str());
2984 viewRef = data;
2985 }
2986
2987 Ref<Settings> settings = GetDefaultLoadSettingsForData(viewRef);
2988
2989 // specify default load settings that can be overridden
2990 vector<string> overrides = {"loader.imageBase", "loader.platform"};
2991 if (!viewRef->IsRelocatable())
2992 settings->UpdateProperty("loader.imageBase", "message", "Note: File indicates image is not relocatable.");
2993
2994 for (const auto& override : overrides)
2995 {
2996 if (settings->Contains(override))
2997 settings->UpdateProperty(override, "readOnly", false);
2998 }
2999
3000
3001 return settings;
3002}
3003
3004
3005extern "C"

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