| 3091 | |
| 3092 | |
| 3093 | Ref<Settings> PEViewType::GetLoadSettingsForData(BinaryView* data) |
| 3094 | { |
| 3095 | Ref<BinaryView> viewRef = Parse(data); |
| 3096 | if (!viewRef || !viewRef->Init()) |
| 3097 | { |
| 3098 | m_logger->LogWarn("Failed to initialize view of type '%s'. Generating default load settings.", GetName().c_str()); |
| 3099 | viewRef = data; |
| 3100 | } |
| 3101 | |
| 3102 | Ref<Settings> settings = GetDefaultLoadSettingsForData(viewRef); |
| 3103 | |
| 3104 | // specify default load settings that can be overridden |
| 3105 | vector<string> overrides = {"loader.imageBase", "loader.platform"}; |
| 3106 | if (!viewRef->IsRelocatable()) |
| 3107 | settings->UpdateProperty("loader.imageBase", "message", "Note: File indicates image is not relocatable."); |
| 3108 | |
| 3109 | for (const auto& override : overrides) |
| 3110 | { |
| 3111 | if (settings->Contains(override)) |
| 3112 | settings->UpdateProperty(override, "readOnly", false); |
| 3113 | } |
| 3114 | |
| 3115 | // register additional settings |
| 3116 | settings->RegisterSetting("loader.pe.processCfgTable", |
| 3117 | R"({ |
| 3118 | "title" : "Process PE Control Flow Guard Table", |
| 3119 | "type" : "boolean", |
| 3120 | "default" : true, |
| 3121 | "description" : "Add function starts sourced from the Control Flow Guard (CFG) table to the core for analysis." |
| 3122 | })"); |
| 3123 | |
| 3124 | settings->RegisterSetting("loader.pe.processExceptionTable", |
| 3125 | R"({ |
| 3126 | "title" : "Process PE Exception Handling Table", |
| 3127 | "type" : "boolean", |
| 3128 | "default" : true, |
| 3129 | "description" : "Add function starts sourced from the Exception Handling table (.pdata) to the core for analysis." |
| 3130 | })"); |
| 3131 | |
| 3132 | settings->RegisterSetting("loader.pe.processSehTable", |
| 3133 | R"({ |
| 3134 | "title" : "Process PE Structured Exception Handling Table", |
| 3135 | "type" : "boolean", |
| 3136 | "default" : true, |
| 3137 | "description" : "Add function starts sourced from the Structured Exception Handling (SEH) table to the core for analysis." |
| 3138 | })"); |
| 3139 | |
| 3140 | return settings; |
| 3141 | } |
| 3142 | |
| 3143 | |
| 3144 | extern "C" |
nothing calls this directly
no test coverage detected