Compare commits

...

7 Commits

Author SHA1 Message Date
WerWolv
fb2af5593f build: Bumped version to 1.21.1 2022-08-15 17:35:18 +02:00
WerWolv
e938b75acd patterns: Fixed out of bounds read 2022-08-15 17:34:09 +02:00
WerWolv
03daf0c95b fix: Unavailable address displaying on intel hex provider 2022-08-14 22:38:01 +02:00
WerWolv
189ea1c3c7 fix: File picker showing up when restoring safety backup 2022-08-14 19:13:13 +02:00
WerWolv
8448c3367b fix: In variables resetting on evaluation 2022-08-14 19:12:46 +02:00
WerWolv
cc29707bb1 fix: Recent entries with same name not being clickable 2022-08-14 19:12:24 +02:00
WerWolv
eff9ecf7cd fix: Crash when closing provider tab
Fixes #674
2022-08-14 19:11:49 +02:00
7 changed files with 16 additions and 13 deletions

View File

@@ -1 +1 @@
1.21.0
1.21.1

View File

@@ -292,7 +292,7 @@ namespace hex::prv {
}
if (!nextRegionAddress.has_value())
return { Region { address, this->getActualSize() - address }, true };
return { Region::Invalid(), false };
else
return { Region { address, *nextRegionAddress - address }, insideValidRegion };
}

View File

@@ -32,7 +32,7 @@ namespace hex::plugin::builtin {
for (const auto &id : providerIds) {
auto providerSettings = nlohmann::json::parse(tar.readString(basePath / hex::format("{}.json", id)));
auto provider = ImHexApi::Provider::createProvider(providerSettings["type"].get<std::string>());
auto provider = ImHexApi::Provider::createProvider(providerSettings["type"].get<std::string>(), true);
if (provider == nullptr) {
success = false;
continue;

View File

@@ -332,7 +332,7 @@ namespace hex::plugin::builtin {
bool open = true;
ImGui::PushID(tabProvider);
if (ImGui::BeginTabItem(tabProvider->getName().c_str(), &open, provider->isDirty() ? ImGuiTabItemFlags_UnsavedDocument : ImGuiTabItemFlags_None)) {
if (ImGui::BeginTabItem(tabProvider->getName().c_str(), &open, tabProvider->isDirty() ? ImGuiTabItemFlags_UnsavedDocument : ImGuiTabItemFlags_None)) {
ImHexApi::Provider::setCurrentProvider(i);
ImGui::EndTabItem();
}

View File

@@ -403,10 +403,14 @@ namespace hex::plugin::builtin {
if (this->m_hasUnevaluatedChanges && this->m_runningEvaluators == 0 && this->m_runningParsers == 0) {
this->m_hasUnevaluatedChanges = false;
if (this->m_runAutomatically)
this->evaluatePattern(this->m_textEditor.GetText());
else
std::thread([this, code = this->m_textEditor.GetText()] { this->parsePattern(code); }).detach();
std::thread([this, code = this->m_textEditor.GetText()]{
this->parsePattern(code);
if (this->m_runAutomatically)
this->evaluatePattern(code);
}).detach();
}
}
@@ -767,8 +771,6 @@ namespace hex::plugin::builtin {
}
void ViewPatternEditor::parsePattern(const std::string &code) {
auto task = ImHexApi::Tasks::createTask("hex.builtin.view.pattern_editor.evaluating", 1);
this->m_runningParsers++;
auto ast = this->m_parserRuntime->parseString(code);
@@ -821,8 +823,6 @@ namespace hex::plugin::builtin {
for (const auto &[id, name, value, type] : this->m_envVarEntries)
envVars.insert({ name, value });
this->parsePattern(code);
std::map<std::string, pl::core::Token::Literal> inVariables;
for (auto &[name, variable] : this->m_patternVariables) {
if (variable.inVariable)

View File

@@ -215,6 +215,9 @@ namespace hex::plugin::builtin {
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5_scaled);
{
for (const auto &recentProvider : s_recentProviders) {
ImGui::PushID(&recentProvider);
ON_SCOPE_EXIT { ImGui::PopID(); };
if (ImGui::BulletHyperlink(recentProvider.displayName.c_str())) {
loadRecentProvider(recentProvider);
break;