summaryrefslogtreecommitdiff
path: root/view/sharedcache
diff options
context:
space:
mode:
Diffstat (limited to 'view/sharedcache')
-rw-r--r--view/sharedcache/core/SharedCache.cpp2
-rw-r--r--view/sharedcache/workflow/SharedCacheWorkflow.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp
index e4689086..0198ac48 100644
--- a/view/sharedcache/core/SharedCache.cpp
+++ b/view/sharedcache/core/SharedCache.cpp
@@ -368,7 +368,7 @@ void SharedCache::ProcessEntryRegions(const CacheEntry& entry)
mappingRegion.start = mapping.address;
mappingRegion.size = mapping.size;
mappingRegion.name = fmt::format("{}::_data_{}", entry.GetFileName(), lastMappingIndex++);
- mappingRegion.flags = SegmentReadable;
+ mappingRegion.flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentDenyWrite);
mappingRegion.type = CacheRegionType::DyldData;
// Add the dyld data mapping as a region to the cache.
diff --git a/view/sharedcache/workflow/SharedCacheWorkflow.cpp b/view/sharedcache/workflow/SharedCacheWorkflow.cpp
index 71160e44..cde8310c 100644
--- a/view/sharedcache/workflow/SharedCacheWorkflow.cpp
+++ b/view/sharedcache/workflow/SharedCacheWorkflow.cpp
@@ -128,7 +128,7 @@ void AnalyzeStubFunction(Ref<Function> func, Ref<MediumLevelILFunction> mlil, Sh
// Adjust the new region semantics to read only, this helps analysis pickup constant loads in our stub functions.
// NOTE: We do NOT do this for stub island as that contains CODE!
if (region->type != SharedCacheRegionTypeStubIsland)
- region->flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentContainsData);
+ region->flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentContainsData | SegmentDenyWrite);
return controller.ApplyRegion(*view, *region);
};
@@ -252,7 +252,7 @@ void AnalyzeStandardFunction(Ref<Function> func, Ref<MediumLevelILFunction> mlil
// Adjust the new region semantics to read only, this helps analysis pickup constant loads in our stub functions.
// NOTE: We do NOT do this for stub island as that contains CODE!
if (region->type != SharedCacheRegionTypeStubIsland)
- region->flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentContainsData);
+ region->flags = static_cast<BNSegmentFlag>(SegmentReadable | SegmentContainsData | SegmentDenyWrite);
return controller.ApplyRegion(*view, *region);
};