@@ -620,6 +620,7 @@ MicrosoftRTTIProcessor::MicrosoftRTTIProcessor(const Ref<BinaryView> &view, bool
620
620
621
621
void MicrosoftRTTIProcessor::ProcessRTTI ()
622
622
{
623
+ auto bgTask = new BackgroundTask (" Scanning for Microsoft RTTI..." , true );
623
624
auto start_time = std::chrono::high_resolution_clock::now ();
624
625
uint64_t startAddr = m_view->GetOriginalImageBase ();
625
626
uint64_t endAddr = m_view->GetEnd ();
@@ -630,6 +631,8 @@ void MicrosoftRTTIProcessor::ProcessRTTI()
630
631
for (uint64_t coLocatorAddr = segment->GetStart (); coLocatorAddr < segment->GetEnd () - 0x18 ;
631
632
coLocatorAddr += addrSize)
632
633
{
634
+ if (bgTask->IsCancelled ())
635
+ break ;
633
636
optReader.Seek (coLocatorAddr);
634
637
uint32_t sigVal = optReader.Read32 ();
635
638
if (sigVal == COL_SIG_REV1)
@@ -683,6 +686,7 @@ void MicrosoftRTTIProcessor::ProcessRTTI()
683
686
}
684
687
}
685
688
689
+ bgTask->Finish ();
686
690
auto end_time = std::chrono::high_resolution_clock::now ();
687
691
std::chrono::duration<double > elapsed_time = end_time - start_time;
688
692
m_logger->LogDebug (" ProcessRTTI took %f seconds" , elapsed_time.count ());
@@ -691,6 +695,7 @@ void MicrosoftRTTIProcessor::ProcessRTTI()
691
695
692
696
void MicrosoftRTTIProcessor::ProcessVFT ()
693
697
{
698
+ auto bgTask = new BackgroundTask (" Scanning for Microsoft RTTI..." , true );
694
699
std::map<uint64_t , uint64_t > vftMap = {};
695
700
std::map<uint64_t , std::optional<VirtualFunctionTableInfo>> vftFinishedMap = {};
696
701
auto start_time = std::chrono::high_resolution_clock::now ();
@@ -712,6 +717,8 @@ void MicrosoftRTTIProcessor::ProcessVFT()
712
717
uint64_t endAddr = segment->GetEnd ();
713
718
for (uint64_t vtableAddr = startAddr; vtableAddr < endAddr - 0x18 ; vtableAddr += addrSize)
714
719
{
720
+ if (bgTask->IsCancelled ())
721
+ break ;
715
722
optReader.Seek (vtableAddr);
716
723
uint64_t coLocatorAddr = optReader.ReadPointer ();
717
724
auto coLocator = m_classInfo.find (coLocatorAddr);
@@ -806,6 +813,7 @@ void MicrosoftRTTIProcessor::ProcessVFT()
806
813
for (const auto &[coLocatorAddr, _]: vftMap)
807
814
ProcessClassAndBases (coLocatorAddr);
808
815
816
+ bgTask->Finish ();
809
817
auto end_time = std::chrono::high_resolution_clock::now ();
810
818
std::chrono::duration<double > elapsed_time = end_time - start_time;
811
819
m_logger->LogDebug (" ProcessVFT took %f seconds" , elapsed_time.count ());
0 commit comments