File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -472,12 +472,14 @@ void SharedCache::PerformInitialLoad(std::lock_guard<std::mutex>& lock)
472472 initialState.baseFilePath = path;
473473 initialState.cacheFormat = RegularCacheFormat;
474474
475+ // TODO: If this fails we should prompt the user to select there file, this probably means that
476+ // TODO: They are opening a database with no original file path.
475477 DataBuffer sig = baseFile->ReadBuffer (0 , 4 );
476478 if (sig.GetLength () != 4 )
477- abort ( );
479+ throw std::runtime_error ( " Not a valid dyld_shared_cache file " );
478480 const char * magic = (char *)sig.GetData ();
479481 if (strncmp (magic, " dyld" , 4 ) != 0 )
480- abort ( );
482+ throw std::runtime_error ( " Not a valid dyld_shared_cache file " );
481483
482484 dyld_cache_header primaryCacheHeader {};
483485 size_t header_size = baseFile->ReadUInt32 (16 );
@@ -1467,9 +1469,9 @@ SharedCache::SharedCache(BinaryNinja::Ref<BinaryNinja::BinaryView> dscView) :
14671469 try {
14681470 PerformInitialLoad (lock);
14691471 }
1470- catch (... )
1472+ catch (std::exception& e )
14711473 {
1472- m_logger->LogError (" Failed to perform initial load of Shared Cache" );
1474+ m_logger->LogError (" Failed to perform initial load of Shared Cache: %s " , e. what () );
14731475 }
14741476
14751477 auto settings = m_dscView->GetLoadSettings (VIEW_NAME);
You can’t perform that action at this time.
0 commit comments