1
0
mirror of synced 2024-11-30 18:34:29 +01:00

fix: Errors causing #pragma magic to not work as expected

This commit is contained in:
WerWolv 2024-08-03 20:09:10 +02:00
parent c3d15157ad
commit fafce72c01
2 changed files with 5 additions and 2 deletions

View File

@ -139,7 +139,7 @@ namespace hex::plugin::builtin {
} }
ImGui::NewLine(); ImGui::NewLine();
ImGuiExt::TextUnformattedCentered("hex.builtin.view.pattern_editor.accept_pattern.question"_lang); ImGui::TextUnformatted("hex.builtin.view.pattern_editor.accept_pattern.question"_lang);
ImGui::NewLine(); ImGui::NewLine();
ImGuiExt::ConfirmButtons("hex.ui.common.yes"_lang, "hex.ui.common.no"_lang, ImGuiExt::ConfirmButtons("hex.ui.common.yes"_lang, "hex.ui.common.no"_lang,

View File

@ -1373,7 +1373,7 @@ namespace hex::plugin::builtin {
if (end == std::string::npos) if (end == std::string::npos)
return std::nullopt; return std::nullopt;
value = value.substr(0, end - 1); value = value.substr(0, end);
value = wolv::util::trim(value); value = wolv::util::trim(value);
return BinaryPattern(value); return BinaryPattern(value);
@ -1406,6 +1406,9 @@ namespace hex::plugin::builtin {
return false; return false;
std::vector<u8> bytes(pattern->getSize()); std::vector<u8> bytes(pattern->getSize());
if (bytes.empty())
return false;
provider->read(*address, bytes.data(), bytes.size()); provider->read(*address, bytes.data(), bytes.size());
if (pattern->matches(bytes)) if (pattern->matches(bytes))