mirror of https://github.com/WerWolv/ImHex.git
parent
7486468537
commit
a2284a5143
|
@ -83,6 +83,16 @@ namespace hex::plugin::hashes {
|
||||||
if (ImGui::BeginTable("##hashes_tooltip", 3, ImGuiTableFlags_NoHostExtendX | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit)) {
|
if (ImGui::BeginTable("##hashes_tooltip", 3, ImGuiTableFlags_NoHostExtendX | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit)) {
|
||||||
auto provider = ImHexApi::Provider::get();
|
auto provider = ImHexApi::Provider::get();
|
||||||
for (auto &function : hashFunctions) {
|
for (auto &function : hashFunctions) {
|
||||||
|
if (provider == nullptr)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
std::vector<u8> bytes;
|
||||||
|
try {
|
||||||
|
bytes = function.get(*selection, provider);
|
||||||
|
} catch (const std::exception &) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGuiExt::TextFormatted("{}", function.getName());
|
ImGuiExt::TextFormatted("{}", function.getName());
|
||||||
|
@ -91,8 +101,7 @@ namespace hex::plugin::hashes {
|
||||||
ImGuiExt::TextFormatted(" ");
|
ImGuiExt::TextFormatted(" ");
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
if (provider != nullptr)
|
ImGuiExt::TextFormatted("{}", crypt::encode16(bytes));
|
||||||
ImGuiExt::TextFormatted("{}", crypt::encode16(function.get(*selection, provider)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
|
@ -218,8 +227,13 @@ namespace hex::plugin::hashes {
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
std::string result;
|
std::string result;
|
||||||
if (provider != nullptr && selection.has_value())
|
if (provider != nullptr && selection.has_value()) {
|
||||||
result = crypt::encode16(function.get(*selection, provider));
|
try {
|
||||||
|
result = crypt::encode16(function.get(*selection, provider));
|
||||||
|
} catch (const std::exception &e) {
|
||||||
|
result = e.what();
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
result = "???";
|
result = "???";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue