feat: Added basic ability to interrupt long running tasks

This commit is contained in:
WerWolv
2022-08-17 16:15:36 +02:00
parent cf6ae52889
commit e779285be4
26 changed files with 422 additions and 310 deletions

View File

@@ -28,7 +28,7 @@ namespace hex::plugin::builtin {
void drawContent() override;
private:
bool m_disassembling = false;
TaskHolder m_disassemblerTask;
u64 m_baseAddress = 0;
ui::SelectedRegion m_range = ui::SelectedRegion::EntireData;

View File

@@ -74,7 +74,7 @@ namespace hex::plugin::builtin {
std::map<prv::Provider*, std::vector<Occurrence>> m_foundOccurrences, m_sortedOccurrences;
std::map<prv::Provider*, OccurrenceTree> m_occurrenceTree;
std::atomic<bool> m_searchRunning;
TaskHolder m_searchTask;
bool m_settingsValid = false;
std::string m_currFilter;

View File

@@ -1,6 +1,7 @@
#pragma once
#include <hex/ui/view.hpp>
#include <hex/api/task.hpp>
#include <array>
#include <atomic>
@@ -27,7 +28,7 @@ namespace hex::plugin::builtin {
double m_entropyHandlePosition;
std::array<ImU64, 256> m_valueCounts = { 0 };
bool m_analyzing = false;
TaskHolder m_analyzerTask;
Region m_analyzedRegion = { 0, 0 };

View File

@@ -5,6 +5,8 @@
#include <imgui.h>
#include <hex/ui/view.hpp>
#include <hex/api/task.hpp>
namespace hex::plugin::builtin {
class ViewYara : public View {
@@ -29,7 +31,7 @@ namespace hex::plugin::builtin {
std::vector<std::pair<std::fs::path, std::fs::path>> m_rules;
std::vector<YaraMatch> m_matches;
u32 m_selectedRule = 0;
bool m_matching = false;
TaskHolder m_matcherTask;
std::vector<std::string> m_consoleMessages;