summaryrefslogtreecommitdiff
path: root/plugins/rtti/plugin.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-22 12:44:59 +0200
committerMason Reed <mason@vector35.com>2025-05-22 12:44:59 +0200
commit1b579ce8166b960533e098e37a4f076ca5a8fe02 (patch)
tree4f54ad41834b0d6c5c1e8460933e080995bb8f68 /plugins/rtti/plugin.cpp
parent7034625749757855498719688163172210395379 (diff)
[RTTI] Catch uncaught exceptions to let analysis finish in the event of an thrown exception
Probably should have done this sooner, just lets the user continue analysis, rtti exceptions are continuable from the view of analysis.
Diffstat (limited to 'plugins/rtti/plugin.cpp')
-rw-r--r--plugins/rtti/plugin.cpp53
1 files changed, 41 insertions, 12 deletions
diff --git a/plugins/rtti/plugin.cpp b/plugins/rtti/plugin.cpp
index b3a5b413..2cf4b973 100644
--- a/plugins/rtti/plugin.cpp
+++ b/plugins/rtti/plugin.cpp
@@ -21,14 +21,28 @@ void RTTIAnalysis(const Ref<AnalysisContext>& analysisContext)
if (platformName.find("window") != std::string::npos)
{
// We currently only want to check for MSVC rtti on windows platforms
- auto processor = RTTI::Microsoft::MicrosoftRTTIProcessor(view);
+ try
+ {
+ auto processor = RTTI::Microsoft::MicrosoftRTTIProcessor(view);
+ processor.ProcessRTTI();
+ view->StoreMetadata(VIEW_METADATA_RTTI, processor.SerializedMetadata(), true);
+ }
+ catch (std::exception& e)
+ {
+ LogErrorF("MSVC RTTI Analysis failed with uncaught exception: %s", e.what());
+ }
+ }
+
+ try
+ {
+ auto processor = RTTI::Itanium::ItaniumRTTIProcessor(view);
processor.ProcessRTTI();
view->StoreMetadata(VIEW_METADATA_RTTI, processor.SerializedMetadata(), true);
}
-
- auto processor = RTTI::Itanium::ItaniumRTTIProcessor(view);
- processor.ProcessRTTI();
- view->StoreMetadata(VIEW_METADATA_RTTI, processor.SerializedMetadata(), true);
+ catch (std::exception& e)
+ {
+ LogErrorF("Itanium RTTI Analysis failed with uncaught exception: %s", e.what());
+ }
}
@@ -37,13 +51,28 @@ void VFTAnalysis(const Ref<AnalysisContext>& analysisContext)
auto view = analysisContext->GetBinaryView();
if (!MetadataExists(view))
return;
- auto microsoftProcessor = RTTI::Microsoft::MicrosoftRTTIProcessor(view);
- microsoftProcessor.ProcessVFT();
- // TODO: We have to store the data for the second processor to pick up the info.
- view->StoreMetadata(VIEW_METADATA_RTTI, microsoftProcessor.SerializedMetadata(), true);
- auto itaniumProcessor = RTTI::Itanium::ItaniumRTTIProcessor(view);
- itaniumProcessor.ProcessVFT();
- view->StoreMetadata(VIEW_METADATA_RTTI, itaniumProcessor.SerializedMetadata(), true);
+ try
+ {
+ auto microsoftProcessor = RTTI::Microsoft::MicrosoftRTTIProcessor(view);
+ microsoftProcessor.ProcessVFT();
+ // TODO: We have to store the data for the second processor to pick up the info.
+ view->StoreMetadata(VIEW_METADATA_RTTI, microsoftProcessor.SerializedMetadata(), true);
+ }
+ catch (std::exception& e)
+ {
+ LogErrorF("MSVC VFT Analysis failed with uncaught exception: %s", e.what());
+ }
+
+ try
+ {
+ auto itaniumProcessor = RTTI::Itanium::ItaniumRTTIProcessor(view);
+ itaniumProcessor.ProcessVFT();
+ view->StoreMetadata(VIEW_METADATA_RTTI, itaniumProcessor.SerializedMetadata(), true);
+ }
+ catch (std::exception& e)
+ {
+ LogErrorF("Itanium VFT Analysis failed with uncaught exception: %s", e.what());
+ }
}