@@ -137,6 +137,22 @@ bool SharedCacheController::LoadImage(BinaryView &view, const CacheImage &image)
137137 return result;
138138}
139139
140+ bool SharedCacheController::IsRegionLoaded (const CacheRegion ®ion) const
141+ {
142+ auto apiRegion = RegionToApi (region);
143+ bool result = BNSharedCacheControllerIsRegionLoaded (m_object, &apiRegion);
144+ BNSharedCacheFreeRegion (apiRegion);
145+ return result;
146+ }
147+
148+ bool SharedCacheController::IsImageLoaded (const CacheImage &image) const
149+ {
150+ auto apiImage = ImageToApi (image);
151+ bool result = BNSharedCacheControllerIsImageLoaded (m_object, &apiImage);
152+ BNSharedCacheFreeImage (apiImage);
153+ return result;
154+ }
155+
140156std::optional<CacheRegion> SharedCacheController::GetRegionAt (uint64_t address) const
141157{
142158 BNSharedCacheRegion apiRegion;
@@ -219,6 +235,30 @@ std::vector<CacheEntry> SharedCacheController::GetEntries() const
219235 return result;
220236}
221237
238+ std::vector<CacheRegion> SharedCacheController::GetLoadedRegions () const
239+ {
240+ size_t count;
241+ BNSharedCacheRegion* regions = BNSharedCacheControllerGetLoadedRegions (m_object, &count);
242+ std::vector<CacheRegion> result;
243+ result.reserve (count);
244+ for (size_t i = 0 ; i < count; i++)
245+ result.emplace_back (RegionFromApi (regions[i]));
246+ BNSharedCacheFreeRegionList (regions, count);
247+ return result;
248+ }
249+
250+ std::vector<CacheRegion> SharedCacheController::GetRegions () const
251+ {
252+ size_t count;
253+ BNSharedCacheRegion* regions = BNSharedCacheControllerGetRegions (m_object, &count);
254+ std::vector<CacheRegion> result;
255+ result.reserve (count);
256+ for (size_t i = 0 ; i < count; i++)
257+ result.emplace_back (RegionFromApi (regions[i]));
258+ BNSharedCacheFreeRegionList (regions, count);
259+ return result;
260+ }
261+
222262std::vector<CacheImage> SharedCacheController::GetImages () const
223263{
224264 size_t count;
@@ -231,6 +271,18 @@ std::vector<CacheImage> SharedCacheController::GetImages() const
231271 return result;
232272}
233273
274+ std::vector<CacheImage> SharedCacheController::GetLoadedImages () const
275+ {
276+ size_t count;
277+ BNSharedCacheImage* images = BNSharedCacheControllerGetLoadedImages (m_object, &count);
278+ std::vector<CacheImage> result;
279+ result.reserve (count);
280+ for (size_t i = 0 ; i < count; i++)
281+ result.emplace_back (ImageFromApi (images[i]));
282+ BNSharedCacheFreeImageList (images, count);
283+ return result;
284+ }
285+
234286std::vector<CacheSymbol> SharedCacheController::GetSymbols () const
235287{
236288 size_t count;
@@ -241,4 +293,4 @@ std::vector<CacheSymbol> SharedCacheController::GetSymbols() const
241293 result.emplace_back (SymbolFromApi (symbols[i]));
242294 BNSharedCacheFreeSymbolList (symbols, count);
243295 return result;
244- }
296+ }
0 commit comments