| 33 | } |
| 34 | |
| 35 | Ref<Settings> SharedCacheViewType::GetLoadSettingsForData(BinaryView* data) |
| 36 | { |
| 37 | Ref<BinaryView> viewRef = Parse(data); |
| 38 | if (!viewRef || !viewRef->Init()) |
| 39 | { |
| 40 | LogWarn("Failed to initialize view of type '%s'. Generating default load settings.", GetName().c_str()); |
| 41 | viewRef = data; |
| 42 | } |
| 43 | |
| 44 | Ref<Settings> settings = GetDefaultLoadSettingsForData(viewRef); |
| 45 | |
| 46 | // specify default load settings that can be overridden |
| 47 | std::vector<std::string> overrides = {"loader.imageBase", "loader.platform"}; |
| 48 | settings->UpdateProperty("loader.imageBase", "message", "Note: File indicates image is not relocatable."); |
| 49 | |
| 50 | for (const auto& override : overrides) |
| 51 | { |
| 52 | if (settings->Contains(override)) |
| 53 | settings->UpdateProperty(override, "readOnly", false); |
| 54 | } |
| 55 | |
| 56 | settings->RegisterSetting("loader.dsc.processCFStrings", |
| 57 | R"({ |
| 58 | "title" : "Process CFString Metadata", |
| 59 | "type" : "boolean", |
| 60 | "default" : true, |
| 61 | "description" : "Processes CoreFoundation strings, applying string values from encoded metadata" |
| 62 | })"); |
| 63 | |
| 64 | settings->RegisterSetting("loader.dsc.autoLoadPattern", |
| 65 | R"({ |
| 66 | "title" : "Image Auto-Load Regex Pattern", |
| 67 | "type" : "string", |
| 68 | "default" : ".*libsystem_c.dylib", |
| 69 | "description" : "A regex pattern to auto load matching images at the end of view init, defaults to the system_c image only." |
| 70 | })"); |
| 71 | |
| 72 | settings->RegisterSetting("loader.dsc.processObjC", |
| 73 | R"({ |
| 74 | "title" : "Process Objective-C Metadata", |
| 75 | "type" : "boolean", |
| 76 | "default" : true, |
| 77 | "description" : "Processes Objective-C metadata, applying class and method names from encoded metadata" |
| 78 | })"); |
| 79 | |
| 80 | settings->RegisterSetting("loader.dsc.regionFilter", |
| 81 | R"({ |
| 82 | "title" : "Region Regex Filter", |
| 83 | "type" : "string", |
| 84 | "default" : ".*LINKEDIT.*", |
| 85 | "description" : "Regex filter for region names to skip loading, by default this filters out the link edit region which is not necessary to be applied to the view." |
| 86 | })"); |
| 87 | |
| 88 | settings->RegisterSetting("loader.dsc.autoLoadObjCStubRequirements", |
| 89 | R"({ |
| 90 | "title" : "Auto-Load Objective-C Stub Requirements", |
| 91 | "type" : "boolean", |
| 92 | "default" : true, |
nothing calls this directly
no test coverage detected