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

Method AddEntry

view/sharedcache/core/SharedCache.cpp:229–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void SharedCache::AddEntry(CacheEntry entry)
230{
231 // Get the file accessor to associate with the virtual memory region.
232 auto fileAccessor = FileAccessorCache::Global().Open(entry.GetFilePath());
233
234 // Populate virtual memory using the entry mappings, by doing so we can now
235 // read the memory of the mapped regions of the cache entry file.
236 const auto& mappings = entry.GetMappings();
237 for (const auto& mapping : mappings)
238 {
239 m_vm->MapRegion(fileAccessor, {mapping.address, mapping.address + mapping.size}, mapping.fileOffset);
240
241 // Recalculate the base address.
242 if (mapping.address < m_baseAddress || m_baseAddress == 0)
243 m_baseAddress = mapping.address;
244 }
245
246 // We are done and can make the entry visible to the entire cache.
247 m_entries.push_back(std::move(entry));
248}
249
250bool SharedCache::ProcessEntryImage(const std::string& path, const dyld_cache_image_info& info)
251{

Callers 1

AddFileMethod · 0.80

Calls 3

MapRegionMethod · 0.80
push_backMethod · 0.80
OpenMethod · 0.45

Tested by

no test coverage detected