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

Method ApplyMappings

view/sharedcache/core/SlideInfo.cpp:233–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void SlideInfoProcessor::ApplyMappings(MappedFileAccessor& accessor, const std::vector<SlideMappingInfo>& mappings) const
234{
235 // TODO: HACK: to prevent applying slide info twice we use check to see if the accessor has been written to
236 // TODO: prior to this function, because this is currently the ONLY place where writes happen this is safe
237 // TODO: but if we add more places that write to the accessor than we will need to likely need to be more specific
238 // TODO: and/or have the backing file accessor store some additional state.
239 if (accessor.IsDirty())
240 return;
241
242 // Apply the slide information to the mapped file.
243 for (const auto& mapping : mappings)
244 {
245 switch (mapping.slideInfoVersion)
246 {
247 case 2:
248 ApplySlideInfoV2(accessor, mapping);
249 break;
250 case 3:
251 ApplySlideInfoV3(accessor, mapping);
252 break;
253 case 5:
254 ApplySlideInfoV5(accessor, mapping);
255 break;
256 default:
257 m_logger->LogError(
258 "Cannot apply slide info version: %d @ %llx", mapping.slideInfoVersion, mapping.mappingInfo.address);
259 break;
260 }
261 }
262}
263
264std::vector<SlideMappingInfo> SlideInfoProcessor::ProcessEntry(MappedFileAccessor& accessor, const CacheEntry& entry) const
265{

Callers

nothing calls this directly

Calls 5

ApplySlideInfoV2Function · 0.85
ApplySlideInfoV3Function · 0.85
ApplySlideInfoV5Function · 0.85
IsDirtyMethod · 0.80
LogErrorMethod · 0.80

Tested by

no test coverage detected