From 86019f825db516d8d5349c271f702dfe69b5fead Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Thu, 10 Apr 2025 00:53:06 -0400 Subject: [SharedCache] Make the shared cache file lookup more straightforward We already had separated this part out into the `CacheProcessor` but its more like a builder than anything, so this refactors that out into a `SharedCacheBuilder`. - Separate out the `CacheProcessor` and simplify its implementation - Move more implementation specific stuff to the shared cache view - Prepare for more validation of the shared cache to detect irregular or incomplete shared cache information - Deduplicate a lot of file vs. project file lookup stuff - Stop copying all images when getting the number of images to log - Allow user to select another directory to scan for shared cache files, might make this a warning instead to prevent users from relying on this behavior We will likely follow this commit up soon with better open behavior, maybe open with options can specify a list of cache entry files? Shouldn't be too much effort aside from making the UI modal for that. --- view/sharedcache/core/SharedCacheView.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'view/sharedcache/core/SharedCacheView.h') diff --git a/view/sharedcache/core/SharedCacheView.h b/view/sharedcache/core/SharedCacheView.h index 1ead0b33..0ae43368 100644 --- a/view/sharedcache/core/SharedCacheView.h +++ b/view/sharedcache/core/SharedCacheView.h @@ -11,6 +11,7 @@ class SharedCacheView : public BinaryNinja::BinaryView { bool m_parseOnly; + BinaryNinja::Ref m_logger; public: SharedCacheView(const std::string& typeName, BinaryView* data, bool parseOnly = false); @@ -18,6 +19,9 @@ public: ~SharedCacheView() override = default; bool Init() override; + + // Initialized the shared cache controller for this view. This is what allows us to load images and regions. + bool InitController(); }; -- cgit v1.3.1