refactor: Rework features that use external libraries into optional plugins (#1470)

This commit is contained in:
Nik
2023-12-23 21:09:41 +01:00
committed by GitHub
parent 84bfd10416
commit 61bfe10bc2
149 changed files with 2940 additions and 2390 deletions

View File

@@ -21,8 +21,6 @@ add_imhex_plugin(
source/content/data_inspector.cpp
source/content/pl_builtin_functions.cpp
source/content/pl_pragmas.cpp
source/content/pl_visualizers.cpp
source/content/pl_inline_visualizers.cpp
source/content/settings_entries.cpp
source/content/tools_entries.cpp
source/content/data_processor_nodes.cpp
@@ -46,6 +44,7 @@ add_imhex_plugin(
source/content/init_tasks.cpp
source/content/fonts.cpp
source/content/workspaces.cpp
source/content/pl_visualizers.cpp
source/content/data_processor_nodes/basic_nodes.cpp
source/content/data_processor_nodes/control_nodes.cpp
@@ -82,20 +81,12 @@ add_imhex_plugin(
source/content/tools/tcp_client_server.cpp
source/content/tools/wiki_explainer.cpp
source/content/pl_visualizers/hex_viewer.cpp
source/content/pl_visualizers/chunk_entropy.cpp
source/content/tutorials/tutorials.cpp
source/content/tutorials/introduction.cpp
source/content/pl_visualizers/line_plot.cpp
source/content/pl_visualizers/scatter_plot.cpp
source/content/pl_visualizers/image.cpp
source/content/pl_visualizers/disassembler.cpp
source/content/pl_visualizers/3d_model.cpp
source/content/pl_visualizers/sound.cpp
source/content/pl_visualizers/chunk_entropy.cpp
source/content/pl_visualizers/hex_viewer.cpp
source/content/pl_visualizers/coordinates.cpp
source/content/pl_visualizers/timestamp.cpp
source/content/views/view_hex_editor.cpp
source/content/views/view_pattern_editor.cpp
source/content/views/view_pattern_data.cpp
@@ -104,7 +95,6 @@ add_imhex_plugin(
source/content/views/view_about.cpp
source/content/views/view_tools.cpp
source/content/views/view_data_inspector.cpp
source/content/views/view_disassembler.cpp
source/content/views/view_bookmarks.cpp
source/content/views/view_patches.cpp
source/content/views/view_command_palette.cpp
@@ -120,26 +110,15 @@ add_imhex_plugin(
source/content/views/view_achievements.cpp
source/content/views/view_highlight_rules.cpp
source/content/views/view_tutorials.cpp
source/content/views/view_yara.cpp
source/content/helpers/notification.cpp
source/ui/hex_editor.cpp
source/ui/pattern_drawer.cpp
INCLUDES
include
${CAPSTONE_INCLUDE_DIRS}
${YARA_INCLUDE_DIRS}
${MINIAUDIO_INCLUDE_DIRS}
LIBRARIES
${CAPSTONE_LIBRARIES}
${YARA_LIBRARIES}
${MINIAUDIO_LIBRARIES}
ui
${JTHREAD_LIBRARIES}
${GLFW_LIBRARIES}
plcli libpl-gen
plcli
)
if (WIN32)

View File

@@ -11,8 +11,11 @@
#include <hex/providers/provider.hpp>
#include <hex/providers/buffered_reader.hpp>
#include <hex/helpers/utils.hpp>
#include <imgui_internal.h>
#include <atomic>
#include <random>
namespace hex {
@@ -299,7 +302,7 @@ namespace hex {
void draw(ImVec2 size, ImPlotFlags flags, bool updateHandle = false) {
if (!m_processing && ImPlot::BeginPlot("##ChunkBasedAnalysis", size, flags)) {
ImPlot::SetupAxes("hex.builtin.common.address"_lang, "hex.builtin.view.information.entropy"_lang,
ImPlot::SetupAxes("hex.ui.common.address"_lang, "hex.builtin.view.information.entropy"_lang,
ImPlotAxisFlags_Lock | ImPlotAxisFlags_NoHighlight | ImPlotAxisFlags_NoSideSwitch,
ImPlotAxisFlags_Lock | ImPlotAxisFlags_NoHighlight | ImPlotAxisFlags_NoSideSwitch);
ImPlot::SetupAxisFormat(ImAxis_X1, impl::IntegerAxisFormatter, (void*)("0x%04llX"));
@@ -595,7 +598,7 @@ namespace hex {
void draw(ImVec2 size, ImPlotFlags flags) {
if (!m_processing && ImPlot::BeginPlot("##distribution", size, flags)) {
ImPlot::SetupAxes("hex.builtin.common.value"_lang, "hex.builtin.common.count"_lang,
ImPlot::SetupAxes("hex.ui.common.value"_lang, "hex.ui.common.count"_lang,
ImPlotAxisFlags_Lock | ImPlotAxisFlags_NoHighlight | ImPlotAxisFlags_NoSideSwitch,
ImPlotAxisFlags_Lock | ImPlotAxisFlags_NoHighlight | ImPlotAxisFlags_NoSideSwitch);
ImPlot::SetupAxisScale(ImAxis_Y1, ImPlotScale_Log10);
@@ -690,7 +693,7 @@ namespace hex {
void draw(ImVec2 size, ImPlotFlags flags, bool updateHandle = false) {
// Draw the result of the analysis
if (!m_processing && ImPlot::BeginPlot("##byte_types", size, flags)) {
ImPlot::SetupAxes("hex.builtin.common.address"_lang, "hex.builtin.common.percentage"_lang,
ImPlot::SetupAxes("hex.ui.common.address"_lang, "hex.ui.common.percentage"_lang,
ImPlotAxisFlags_Lock | ImPlotAxisFlags_NoHighlight | ImPlotAxisFlags_NoSideSwitch,
ImPlotAxisFlags_Lock | ImPlotAxisFlags_NoHighlight | ImPlotAxisFlags_NoSideSwitch);
ImPlot::SetupAxesLimits(

View File

@@ -1,93 +0,0 @@
#pragma once
#include <hex.hpp>
#include <capstone/capstone.h>
namespace hex {
enum class Architecture : i32
{
ARM = CS_ARCH_ARM,
ARM64 = CS_ARCH_ARM64,
MIPS = CS_ARCH_MIPS,
X86 = CS_ARCH_X86,
PPC = CS_ARCH_PPC,
SPARC = CS_ARCH_SPARC,
SYSZ = CS_ARCH_SYSZ,
XCORE = CS_ARCH_XCORE,
M68K = CS_ARCH_M68K,
TMS320C64X = CS_ARCH_TMS320C64X,
M680X = CS_ARCH_M680X,
EVM = CS_ARCH_EVM,
#if CS_API_MAJOR >= 5
WASM = CS_ARCH_WASM,
RISCV = CS_ARCH_RISCV,
MOS65XX = CS_ARCH_MOS65XX,
BPF = CS_ARCH_BPF,
SH = CS_ARCH_SH,
TRICORE = CS_ARCH_TRICORE,
MAX = TRICORE,
# else
MAX = EVM,
#endif
MIN = ARM
};
class Disassembler {
public:
constexpr static cs_arch toCapstoneArchitecture(Architecture architecture) {
return static_cast<cs_arch>(architecture);
}
static bool isSupported(Architecture architecture) {
return cs_support(toCapstoneArchitecture(architecture));
}
constexpr static auto ArchitectureNames = []{
std::array<const char *, static_cast<u32>(Architecture::MAX) + 1> names = { };
names[CS_ARCH_ARM] = "ARM";
names[CS_ARCH_ARM64] = "AArch64";
names[CS_ARCH_MIPS] = "MIPS";
names[CS_ARCH_X86] = "Intel x86";
names[CS_ARCH_PPC] = "PowerPC";
names[CS_ARCH_SPARC] = "SPARC";
names[CS_ARCH_SYSZ] = "SystemZ";
names[CS_ARCH_XCORE] = "XCore";
names[CS_ARCH_M68K] = "Motorola 68K";
names[CS_ARCH_TMS320C64X] = "TMS320C64x";
names[CS_ARCH_M680X] = "M680X";
names[CS_ARCH_EVM] = "Ethereum Virtual Machine";
#if CS_API_MAJOR >= 5
names[CS_ARCH_WASM] = "WebAssembly";
names[CS_ARCH_RISCV] = "RISC-V";
names[CS_ARCH_MOS65XX] = "MOS Technology 65xx";
names[CS_ARCH_BPF] = "Berkeley Packet Filter";
names[CS_ARCH_SH] = "SuperH";
names[CS_ARCH_TRICORE] = "Tricore";
#endif
return names;
}();
static i32 getArchitectureSupportedCount() {
static i32 supportedCount = -1;
if (supportedCount != -1) {
return supportedCount;
}
for (supportedCount = static_cast<i32>(Architecture::MIN); supportedCount < static_cast<i32>(Architecture::MAX) + 1; supportedCount++) {
if (!cs_support(supportedCount)) {
break;
}
}
return supportedCount;
}
};
}

View File

@@ -1,20 +0,0 @@
#pragma once
#include <pl/pattern_language.hpp>
#include <pl/patterns/pattern.hpp>
namespace hex::plugin::builtin {
template<typename T>
std::vector<T> patternToArray(pl::ptrn::Pattern *pattern){
const auto bytes = pattern->getBytes();
std::vector<T> result;
result.resize(bytes.size() / sizeof(T));
for (size_t i = 0; i < result.size(); i++)
std::memcpy(&result[i], &bytes[i * sizeof(T)], sizeof(T));
return result;
}
}

View File

@@ -22,7 +22,7 @@ namespace hex::plugin::builtin {
ImGui::ProgressBar(m_task.getProgress() / 100.0F);
ImGui::NewLine();
if (ImGui::ButtonEx("hex.builtin.common.cancel"_lang, ImVec2(ImGui::GetContentRegionAvail().x, 0)) || ImGui::IsKeyDown(ImGuiKey_Escape))
if (ImGui::ButtonEx("hex.ui.common.cancel"_lang, ImVec2(ImGui::GetContentRegionAvail().x, 0)) || ImGui::IsKeyDown(ImGuiKey_Escape))
m_task.interrupt();
if (!m_task.isRunning()) {

View File

@@ -1,114 +0,0 @@
#pragma once
#include <hex/ui/popup.hpp>
#include <hex/api/localization_manager.hpp>
#include <wolv/utils/string.hpp>
#include <functional>
#include <string>
namespace hex::plugin::builtin {
class PopupFileChooser : public Popup<PopupFileChooser> {
public:
PopupFileChooser(const std::vector<std::fs::path> &basePaths, const std::vector<std::fs::path> &files, const std::vector<hex::fs::ItemFilter> &validExtensions, bool multiple, const std::function<void(std::fs::path)> &callback)
: hex::Popup<PopupFileChooser>("hex.builtin.common.choose_file"),
m_indices({ }),
m_openCallback(callback),
m_validExtensions(validExtensions), m_multiple(multiple) {
for (const auto &path : files) {
std::fs::path adjustedPath;
for (const auto &basePath : basePaths) {
if (isSubpath(basePath, path)) {
adjustedPath = std::fs::relative(path, basePath);
break;
}
}
if (adjustedPath.empty())
adjustedPath = path.filename();
m_files.push_back({ path, adjustedPath });
}
std::sort(m_files.begin(), m_files.end(), [](const auto &a, const auto &b) {
return a.first < b.first;
});
}
void drawContent() override {
bool doubleClicked = false;
if (ImGui::BeginListBox("##files", scaled(ImVec2(500, 400)))) {
u32 index = 0;
for (auto &[path, pathName] : m_files) {
ImGui::PushID(index);
bool selected = m_indices.contains(index);
if (ImGui::Selectable(wolv::util::toUTF8String(pathName).c_str(), selected, ImGuiSelectableFlags_DontClosePopups)) {
if (!m_multiple) {
m_indices.clear();
m_indices.insert(index);
} else {
if (selected) {
m_indices.erase(index);
} else {
m_indices.insert(index);
}
}
}
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0))
doubleClicked = true;
ImGuiExt::InfoTooltip(wolv::util::toUTF8String(path).c_str());
ImGui::PopID();
index++;
}
ImGui::EndListBox();
}
if (ImGui::Button("hex.builtin.common.open"_lang) || doubleClicked) {
for (const auto &index : m_indices)
m_openCallback(m_files[index].first);
Popup::close();
}
ImGui::SameLine();
if (ImGui::Button("hex.builtin.common.browse"_lang)) {
fs::openFileBrowser(fs::DialogMode::Open, m_validExtensions, [this](const auto &path) {
m_openCallback(path);
Popup::close();
}, {}, m_multiple);
}
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape)))
this->close();
}
[[nodiscard]] ImGuiWindowFlags getFlags() const override {
return ImGuiWindowFlags_AlwaysAutoResize;
}
private:
static bool isSubpath(const std::fs::path &basePath, const std::fs::path &path) {
auto relativePath = std::fs::relative(path, basePath);
return !relativePath.empty() && relativePath.native()[0] != '.';
}
private:
std::set<u32> m_indices;
std::vector<std::pair<std::fs::path, std::fs::path>> m_files;
std::function<void(std::fs::path)> m_openCallback;
std::vector<hex::fs::ItemFilter> m_validExtensions;
bool m_multiple = false;
};
}

View File

@@ -1,88 +0,0 @@
#pragma once
#include <hex/ui/popup.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/api/imhex_api.hpp>
#include <functional>
#include <string>
namespace hex::plugin::builtin {
namespace impl {
template<typename T>
class PopupNotification : public Popup<T> {
public:
PopupNotification(UnlocalizedString unlocalizedName, std::string message, std::function<void()> function)
: hex::Popup<T>(std::move(unlocalizedName), false),
m_message(std::move(message)), m_function(std::move(function)) { }
void drawContent() override {
ImGuiExt::TextFormattedWrapped("{}", m_message.c_str());
ImGui::NewLine();
ImGui::Separator();
if (ImGui::Button("hex.builtin.common.okay"_lang) || ImGui::IsKeyDown(ImGuiKey_Escape))
m_function();
ImGui::SetWindowPos((ImHexApi::System::getMainWindowSize() - ImGui::GetWindowSize()) / 2, ImGuiCond_Appearing);
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape)))
this->close();
}
[[nodiscard]] ImGuiWindowFlags getFlags() const override {
return ImGuiWindowFlags_AlwaysAutoResize;
}
[[nodiscard]] ImVec2 getMinSize() const override {
return scaled({ 400, 100 });
}
[[nodiscard]] ImVec2 getMaxSize() const override {
return scaled({ 600, 300 });
}
private:
std::string m_message;
std::function<void()> m_function;
};
}
class PopupInfo : public impl::PopupNotification<PopupInfo> {
public:
explicit PopupInfo(std::string message)
: PopupNotification("hex.builtin.common.info", std::move(message), [this] {
Popup::close();
}) { }
};
class PopupWarning : public impl::PopupNotification<PopupWarning> {
public:
explicit PopupWarning(std::string message)
: PopupNotification("hex.builtin.common.warning", std::move(message), [this] {
Popup::close();
}) { }
};
class PopupError : public impl::PopupNotification<PopupError> {
public:
explicit PopupError(std::string message)
: PopupNotification("hex.builtin.common.error", std::move(message), [this] {
Popup::close();
}) { }
};
class PopupFatal : public impl::PopupNotification<PopupFatal> {
public:
explicit PopupFatal(std::string message)
: PopupNotification("hex.builtin.common.fatal", std::move(message), [this] {
ImHexApi::System::closeImHex();
Popup::close();
}) { }
};
}

View File

@@ -1,57 +0,0 @@
#pragma once
#include <hex/ui/popup.hpp>
#include <hex/api/localization_manager.hpp>
#include <functional>
#include <string>
namespace hex::plugin::builtin {
class PopupQuestion : public Popup<PopupQuestion> {
public:
PopupQuestion(std::string message, std::function<void()> yesFunction, std::function<void()> noFunction)
: hex::Popup<PopupQuestion>("hex.builtin.common.question", false),
m_message(std::move(message)),
m_yesFunction(std::move(yesFunction)), m_noFunction(std::move(noFunction)) { }
void drawContent() override {
ImGuiExt::TextFormattedWrapped("{}", m_message.c_str());
ImGui::NewLine();
ImGui::Separator();
auto width = ImGui::GetWindowWidth();
ImGui::SetCursorPosX(width / 9);
if (ImGui::Button("hex.builtin.common.yes"_lang, ImVec2(width / 3, 0))) {
m_yesFunction();
this->close();
}
ImGui::SameLine();
ImGui::SetCursorPosX(width / 9 * 5);
if (ImGui::Button("hex.builtin.common.no"_lang, ImVec2(width / 3, 0))) {
m_noFunction();
this->close();
}
ImGui::SetWindowPos((ImHexApi::System::getMainWindowSize() - ImGui::GetWindowSize()) / 2, ImGuiCond_Appearing);
}
[[nodiscard]] ImGuiWindowFlags getFlags() const override {
return ImGuiWindowFlags_AlwaysAutoResize;
}
[[nodiscard]] ImVec2 getMinSize() const override {
return scaled({ 400, 100 });
}
[[nodiscard]] ImVec2 getMaxSize() const override {
return scaled({ 600, 300 });
}
private:
std::string m_message;
std::function<void()> m_yesFunction, m_noFunction;
};
}

View File

@@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
ImGuiExt::TextSpinner("");
ImGui::NewLine();
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - 150_scaled) / 2);
if (ImGui::ButtonEx("hex.builtin.common.cancel"_lang, ImVec2(150, 0)) || ImGui::IsKeyDown(ImGuiKey_Escape))
if (ImGui::ButtonEx("hex.ui.common.cancel"_lang, ImVec2(150, 0)) || ImGui::IsKeyDown(ImGuiKey_Escape))
ImGui::CloseCurrentPopup();
if (TaskManager::getRunningTaskCount() == 0 && TaskManager::getRunningBackgroundTaskCount() == 0) {

View File

@@ -13,7 +13,7 @@ namespace hex::plugin::builtin {
class PopupTelemetryRequest : public Popup<PopupTelemetryRequest> {
public:
PopupTelemetryRequest()
: hex::Popup<PopupTelemetryRequest>("hex.builtin.common.question", false) {
: hex::Popup<PopupTelemetryRequest>("hex.ui.common.question", false) {
// Check if there is a telemetry uuid
m_uuid = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.uuid", "").get<std::string>();
if(m_uuid.empty()) {
@@ -77,7 +77,7 @@ namespace hex::plugin::builtin {
const auto buttonPos = [&](u8 index) { return ImGui::GetStyle().FramePadding.x + (buttonSize.x + ImGui::GetStyle().FramePadding.x * 3) * index; };
ImGui::SetCursorPosX(buttonPos(0));
if (ImGui::Button("hex.builtin.common.allow"_lang, buttonSize)) {
if (ImGui::Button("hex.ui.common.allow"_lang, buttonSize)) {
ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.server_contact", 1);
ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.upload_crash_logs", 1);
this->close();
@@ -91,7 +91,7 @@ namespace hex::plugin::builtin {
}
ImGui::SameLine();
ImGui::SetCursorPosX(buttonPos(2));
if (ImGui::Button("hex.builtin.common.deny"_lang, buttonSize)) {
if (ImGui::Button("hex.ui.common.deny"_lang, buttonSize)) {
this->close();
}

View File

@@ -1,73 +0,0 @@
#pragma once
#include <hex/ui/popup.hpp>
#include <hex/api/imhex_api.hpp>
#include <hex/api/localization_manager.hpp>
#include <functional>
#include <string>
#include <fonts/codicons_font.h>
namespace hex::plugin::builtin {
class PopupTextInput : public Popup<PopupTextInput> {
public:
PopupTextInput(UnlocalizedString unlocalizedName, UnlocalizedString message, std::function<void(std::string)> function)
: hex::Popup<PopupTextInput>(std::move(unlocalizedName), false),
m_message(std::move(message)), m_function(std::move(function)) { }
void drawContent() override {
ImGuiExt::TextFormattedWrapped("{}", Lang(m_message));
ImGui::NewLine();
ImGui::PushItemWidth(-1);
if (m_justOpened) {
ImGui::SetKeyboardFocusHere();
m_justOpened = false;
}
ImGuiExt::InputTextIcon("##input", ICON_VS_SYMBOL_KEY, m_input);
ImGui::PopItemWidth();
ImGui::NewLine();
ImGui::Separator();
auto width = ImGui::GetWindowWidth();
ImGui::SetCursorPosX(width / 9);
if (ImGui::Button("hex.builtin.common.okay"_lang, ImVec2(width / 3, 0)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Enter))) {
m_function(m_input);
this->close();
}
ImGui::SameLine();
ImGui::SetCursorPosX(width / 9 * 5);
if (ImGui::Button("hex.builtin.common.cancel"_lang, ImVec2(width / 3, 0)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) {
this->close();
}
ImGui::SetWindowPos((ImHexApi::System::getMainWindowSize() - ImGui::GetWindowSize()) / 2, ImGuiCond_Appearing);
}
[[nodiscard]] ImGuiWindowFlags getFlags() const override {
return ImGuiWindowFlags_AlwaysAutoResize;
}
[[nodiscard]] ImVec2 getMinSize() const override {
return scaled({ 400, 100 });
}
[[nodiscard]] ImVec2 getMaxSize() const override {
return scaled({ 600, 300 });
}
private:
std::string m_input;
UnlocalizedString m_message;
std::function<void(std::string)> m_function;
bool m_justOpened = true;
};
}

View File

@@ -12,7 +12,7 @@ namespace hex::plugin::builtin {
class PopupUnsavedChanges : public Popup<PopupUnsavedChanges> {
public:
PopupUnsavedChanges(std::string message, std::function<void()> yesFunction, std::function<void()> noFunction)
: hex::Popup<PopupUnsavedChanges>("hex.builtin.common.question", false),
: hex::Popup<PopupUnsavedChanges>("hex.ui.common.question", false),
m_message(std::move(message)),
m_yesFunction(std::move(yesFunction)), m_noFunction(std::move(noFunction)) { }
@@ -34,13 +34,13 @@ namespace hex::plugin::builtin {
auto width = ImGui::GetWindowWidth();
ImGui::SetCursorPosX(width / 9);
if (ImGui::Button("hex.builtin.common.yes"_lang, ImVec2(width / 3, 0))) {
if (ImGui::Button("hex.ui.common.yes"_lang, ImVec2(width / 3, 0))) {
m_yesFunction();
this->close();
}
ImGui::SameLine();
ImGui::SetCursorPosX(width / 9 * 5);
if (ImGui::Button("hex.builtin.common.no"_lang, ImVec2(width / 3, 0)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) {
if (ImGui::Button("hex.ui.common.no"_lang, ImVec2(width / 3, 0)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) {
m_noFunction();
this->close();
}

View File

@@ -1,55 +0,0 @@
#pragma once
#include <hex/api/imhex_api.hpp>
#include <hex/ui/imgui_imhex_extensions.h>
#include <hex/ui/toast.hpp>
#include <fonts/codicons_font.h>
#include <hex/helpers/utils.hpp>
namespace hex::plugin::builtin::ui {
namespace impl {
template<typename T>
struct ToastNotification : Toast<T> {
ToastNotification(ImColor color, const char *icon, UnlocalizedString title, UnlocalizedString message)
: Toast<T>(color), m_icon(icon), m_title(std::move(title)), m_message(std::move(message)) {}
void drawContent() final {
ImGuiExt::TextFormattedColored(this->getColor(), "{}", m_icon);
ImGui::SameLine();
ImGui::PushFont(ImHexApi::Fonts::Bold());
{
ImGuiExt::TextFormatted("{}", hex::limitStringLength(Lang(m_title).get(), 30));
}
ImGui::PopFont();
ImGui::Separator();
ImGuiExt::TextFormattedWrapped("{}", hex::limitStringLength(Lang(m_message).get(), 60));
}
private:
const char *m_icon;
UnlocalizedString m_title, m_message;
};
}
struct ToastInfo : impl::ToastNotification<ToastInfo> {
ToastInfo(UnlocalizedString title, UnlocalizedString message)
: ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerInfo), ICON_VS_INFO, std::move(title), std::move(message)) {}
};
struct ToastWarn : impl::ToastNotification<ToastWarn> {
ToastWarn(UnlocalizedString title, UnlocalizedString message)
: ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerWarning), ICON_VS_WARNING, std::move(title), std::move(message)) {}
};
struct ToastError : impl::ToastNotification<ToastError> {
ToastError(UnlocalizedString title, UnlocalizedString message)
: ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerError), ICON_VS_ERROR, std::move(title), std::move(message)) {}
};
}

View File

@@ -1,46 +0,0 @@
#pragma once
#include <hex/api/task_manager.hpp>
#include <hex/ui/view.hpp>
#include <ui/widgets.hpp>
#include <content/helpers/disassembler.hpp>
#include <string>
#include <vector>
namespace hex::plugin::builtin {
struct Disassembly {
u64 address;
u64 offset;
size_t size;
std::string bytes;
std::string mnemonic;
std::string operators;
};
class ViewDisassembler : public View::Window {
public:
explicit ViewDisassembler();
~ViewDisassembler() override;
void drawContent() override;
private:
TaskHolder m_disassemblerTask;
u64 m_baseAddress = 0;
ui::RegionType m_range = ui::RegionType::EntireData;
Region m_codeRegion = { 0, 0 };
Architecture m_architecture = Architecture::ARM;
cs_mode m_mode = cs_mode(0);
std::vector<Disassembly> m_disassembly;
void disassemble();
};
}

View File

@@ -82,7 +82,7 @@ namespace hex::plugin::builtin {
ImGui::NewLine();
ImGui::TextUnformatted("hex.builtin.view.pattern_editor.accept_pattern.question"_lang);
ImGuiExt::ConfirmButtons("hex.builtin.common.yes"_lang, "hex.builtin.common.no"_lang,
ImGuiExt::ConfirmButtons("hex.ui.common.yes"_lang, "hex.ui.common.no"_lang,
[this, provider] {
m_view->loadPatternFile(m_view->m_possiblePatternFiles.get(provider)[m_selectedPatternFile], provider);
this->close();

View File

@@ -1,44 +0,0 @@
#pragma once
#include <hex.hpp>
#include <hex/ui/view.hpp>
#include <hex/api/task_manager.hpp>
namespace hex::plugin::builtin {
class ViewYara : public View::Window {
public:
ViewYara();
~ViewYara() override;
void drawContent() override;
private:
struct YaraMatch {
std::string identifier;
std::string variable;
u64 address;
size_t size;
bool wholeDataMatch;
mutable u32 highlightId;
mutable u32 tooltipId;
};
private:
PerProvider<std::vector<std::pair<std::fs::path, std::fs::path>>> m_rules;
PerProvider<std::vector<YaraMatch>> m_matches;
PerProvider<std::vector<YaraMatch*>> m_sortedMatches;
u32 m_selectedRule = 0;
TaskHolder m_matcherTask;
std::vector<std::string> m_consoleMessages;
void applyRules();
void clearResult();
};
}

View File

@@ -1,278 +0,0 @@
#pragma once
#include <hex.hpp>
#include <hex/api/imhex_api.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/providers/provider.hpp>
#include <hex/helpers/encoding_file.hpp>
#include <imgui.h>
#include <hex/ui/view.hpp>
namespace hex::plugin::builtin::ui {
class HexEditor {
public:
explicit HexEditor(prv::Provider *provider = nullptr);
~HexEditor();
void draw(float height = ImGui::GetContentRegionAvail().y);
void setProvider(prv::Provider *provider) {
m_provider = provider;
m_currValidRegion = { Region::Invalid(), false };
}
void setUnknownDataCharacter(char character) { m_unknownDataCharacter = character; }
private:
enum class CellType { None, Hex, ASCII };
void drawCell(u64 address, const u8 *data, size_t size, bool hovered, CellType cellType);
void drawSelectionFrame(u32 x, u32 y, Region selection, u64 byteAddress, u16 bytesPerCell, const ImVec2 &cellPos, const ImVec2 &cellSize, const ImColor &backgroundColor) const;
void drawEditor(const ImVec2 &size);
void drawFooter(const ImVec2 &size);
void drawTooltip(u64 address, const u8 *data, size_t size) const;
void handleSelection(u64 address, u32 bytesPerCell, const u8 *data, bool cellHovered);
std::optional<color_t> applySelectionColor(u64 byteAddress, std::optional<color_t> color);
public:
void setSelectionUnchecked(std::optional<u64> start, std::optional<u64> end) {
m_selectionStart = start;
m_selectionEnd = end;
m_cursorPosition = end;
}
void setSelection(const Region &region) { this->setSelection(region.getStartAddress(), region.getEndAddress()); }
void setSelection(u128 start, u128 end) {
if (!ImHexApi::Provider::isValid())
return;
if (start > m_provider->getBaseAddress() + m_provider->getActualSize())
return;
if (start < m_provider->getBaseAddress())
return;
if (m_provider->getActualSize() == 0)
return;
const size_t maxAddress = m_provider->getActualSize() + m_provider->getBaseAddress() - 1;
constexpr static auto alignDown = [](u128 value, u128 alignment) {
return value & ~(alignment - 1);
};
m_selectionChanged = m_selectionStart != start || m_selectionEnd != end;
if (!m_selectionStart.has_value()) m_selectionStart = start;
if (!m_selectionEnd.has_value()) m_selectionEnd = end;
if (auto bytesPerCell = m_currDataVisualizer->getBytesPerCell(); bytesPerCell > 1) {
if (end > start) {
start = alignDown(start, bytesPerCell);
end = alignDown(end, bytesPerCell) + (bytesPerCell - 1);
} else {
start = alignDown(start, bytesPerCell) + (bytesPerCell - 1);
end = alignDown(end, bytesPerCell);
}
}
m_selectionStart = std::clamp<u128>(start, 0, maxAddress);
m_selectionEnd = std::clamp<u128>(end, 0, maxAddress);
m_cursorPosition = m_selectionEnd;
if (m_selectionChanged) {
auto selection = this->getSelection();
EventRegionSelected::post(ImHexApi::HexEditor::ProviderRegion{ { selection.address, selection.size }, m_provider });
m_shouldModifyValue = true;
}
}
[[nodiscard]] Region getSelection() const {
if (!isSelectionValid())
return Region::Invalid();
const auto start = std::min(m_selectionStart.value(), m_selectionEnd.value());
const auto end = std::max(m_selectionStart.value(), m_selectionEnd.value());
const size_t size = end - start + 1;
return { start, size };
}
[[nodiscard]] std::optional<u64> getCursorPosition() const {
return m_cursorPosition;
}
void setCursorPosition(u64 cursorPosition) {
m_cursorPosition = cursorPosition;
}
[[nodiscard]] bool isSelectionValid() const {
return m_selectionStart.has_value() && m_selectionEnd.has_value();
}
void jumpToSelection(bool center = true) {
m_shouldJumpToSelection = true;
if (center)
m_centerOnJump = true;
}
void scrollToSelection() {
m_shouldScrollToSelection = true;
}
void jumpIfOffScreen() {
m_shouldJumpWhenOffScreen = true;
}
[[nodiscard]] u16 getBytesPerRow() const {
return m_bytesPerRow;
}
[[nodiscard]] u16 getBytesPerCell() const {
return m_currDataVisualizer->getBytesPerCell();
}
void setBytesPerRow(u16 bytesPerRow) {
m_bytesPerRow = bytesPerRow;
}
[[nodiscard]] u16 getVisibleRowCount() const {
return m_visibleRowCount;
}
void setSelectionColor(color_t color) {
m_selectionColor = color;
}
void enableUpperCaseHex(bool upperCaseHex) {
m_upperCaseHex = upperCaseHex;
}
void enableGrayOutZeros(bool grayOutZeros) {
m_grayOutZero = grayOutZeros;
}
void enableShowAscii(bool showAscii) {
m_showAscii = showAscii;
}
void enableShowHumanReadableUnits(bool showHumanReadableUnits) {
m_showHumanReadableUnits = showHumanReadableUnits;
}
void enableSyncScrolling(bool syncScrolling) {
m_syncScrolling = syncScrolling;
}
void setByteCellPadding(u32 byteCellPadding) {
m_byteCellPadding = byteCellPadding;
}
void setCharacterCellPadding(u32 characterCellPadding) {
m_characterCellPadding = characterCellPadding;
}
[[nodiscard]] const std::optional<EncodingFile>& getCustomEncoding() const {
return m_currCustomEncoding;
}
void setCustomEncoding(const EncodingFile &encoding) {
m_currCustomEncoding = encoding;
m_encodingLineStartAddresses.clear();
}
void setCustomEncoding(EncodingFile &&encoding) {
m_currCustomEncoding = std::move(encoding);
m_encodingLineStartAddresses.clear();
}
void forceUpdateScrollPosition() {
m_shouldUpdateScrollPosition = true;
}
void setForegroundHighlightCallback(const std::function<std::optional<color_t>(u64, const u8 *, size_t)> &callback) {
m_foregroundColorCallback = callback;
}
void setBackgroundHighlightCallback(const std::function<std::optional<color_t>(u64, const u8 *, size_t)> &callback) {
m_backgroundColorCallback = callback;
}
void setTooltipCallback(const std::function<void(u64, const u8 *, size_t)> &callback) {
m_tooltipCallback = callback;
}
[[nodiscard]] float getScrollPosition() const {
return m_scrollPosition;
}
void setScrollPosition(float scrollPosition) {
m_scrollPosition = scrollPosition;
}
void setEditingAddress(u64 address) {
m_editingAddress = address;
m_shouldModifyValue = false;
m_enteredEditingMode = true;
m_editingBytes.resize(m_currDataVisualizer->getBytesPerCell());
m_provider->read(address + m_provider->getBaseAddress(), m_editingBytes.data(), m_editingBytes.size());
m_editingCellType = CellType::Hex;
}
void clearEditingAddress() {
m_editingAddress = std::nullopt;
}
private:
prv::Provider *m_provider;
std::optional<u64> m_selectionStart;
std::optional<u64> m_selectionEnd;
std::optional<u64> m_cursorPosition;
ImS64 m_scrollPosition = 0;
u16 m_bytesPerRow = 16;
std::endian m_dataVisualizerEndianness = std::endian::little;
std::shared_ptr<ContentRegistry::HexEditor::DataVisualizer> m_currDataVisualizer;
char m_unknownDataCharacter = '?';
bool m_shouldJumpToSelection = false;
bool m_centerOnJump = false;
bool m_shouldScrollToSelection = false;
bool m_shouldJumpWhenOffScreen = false;
bool m_shouldUpdateScrollPosition = false;
bool m_selectionChanged = false;
u16 m_visibleRowCount = 0;
CellType m_editingCellType = CellType::None;
std::optional<u64> m_editingAddress;
bool m_shouldModifyValue = false;
bool m_enteredEditingMode = false;
bool m_shouldUpdateEditingValue = false;
std::vector<u8> m_editingBytes;
color_t m_selectionColor = 0x00;
bool m_upperCaseHex = true;
bool m_grayOutZero = true;
bool m_showAscii = true;
bool m_showCustomEncoding = true;
bool m_showHumanReadableUnits = true;
bool m_syncScrolling = false;
u32 m_byteCellPadding = 0, m_characterCellPadding = 0;
bool m_footerCollapsed = true;
std::optional<EncodingFile> m_currCustomEncoding;
std::vector<u64> m_encodingLineStartAddresses;
std::pair<Region, bool> m_currValidRegion = { Region::Invalid(), false };
static std::optional<color_t> defaultColorCallback(u64, const u8 *, size_t) { return std::nullopt; }
static void defaultTooltipCallback(u64, const u8 *, size_t) { }
std::function<std::optional<color_t>(u64, const u8 *, size_t)> m_foregroundColorCallback = defaultColorCallback, m_backgroundColorCallback = defaultColorCallback;
std::function<void(u64, const u8 *, size_t)> m_tooltipCallback = defaultTooltipCallback;
};
}

View File

@@ -1,122 +0,0 @@
#pragma once
#include <hex/api/task_manager.hpp>
#include <hex/api/content_registry.hpp>
#include <pl/patterns/pattern.hpp>
#include <pl/pattern_visitor.hpp>
#include <pl/formatters.hpp>
#include <set>
struct ImGuiTableSortSpecs;
namespace hex::plugin::builtin::ui {
class PatternDrawer : public pl::PatternVisitor {
public:
PatternDrawer() {
m_formatters = pl::gen::fmt::createFormatters();
}
virtual ~PatternDrawer() = default;
void draw(const std::vector<std::shared_ptr<pl::ptrn::Pattern>> &patterns, pl::PatternLanguage *runtime = nullptr, float height = 0.0F);
enum class TreeStyle {
Default = 0,
AutoExpanded = 1,
Flattened = 2
};
void setTreeStyle(TreeStyle style) { m_treeStyle = style; }
void setSelectionCallback(std::function<void(Region)> callback) { m_selectionCallback = std::move(callback); }
void enableRowColoring(bool enabled) { m_rowColoring = enabled; }
void reset();
private:
void draw(pl::ptrn::Pattern& pattern);
public:
void visit(pl::ptrn::PatternArrayDynamic& pattern) override;
void visit(pl::ptrn::PatternArrayStatic& pattern) override;
void visit(pl::ptrn::PatternBitfieldField& pattern) override;
void visit(pl::ptrn::PatternBitfieldArray& pattern) override;
void visit(pl::ptrn::PatternBitfield& pattern) override;
void visit(pl::ptrn::PatternBoolean& pattern) override;
void visit(pl::ptrn::PatternCharacter& pattern) override;
void visit(pl::ptrn::PatternEnum& pattern) override;
void visit(pl::ptrn::PatternFloat& pattern) override;
void visit(pl::ptrn::PatternPadding& pattern) override;
void visit(pl::ptrn::PatternPointer& pattern) override;
void visit(pl::ptrn::PatternSigned& pattern) override;
void visit(pl::ptrn::PatternString& pattern) override;
void visit(pl::ptrn::PatternStruct& pattern) override;
void visit(pl::ptrn::PatternUnion& pattern) override;
void visit(pl::ptrn::PatternUnsigned& pattern) override;
void visit(pl::ptrn::PatternWideCharacter& pattern) override;
void visit(pl::ptrn::PatternWideString& pattern) override;
private:
constexpr static auto ChunkSize = 512;
constexpr static auto DisplayEndStep = 64;
void drawArray(pl::ptrn::Pattern& pattern, pl::ptrn::IIterable &iterable, bool isInlined);
u64& getDisplayEnd(const pl::ptrn::Pattern& pattern);
void makeSelectable(const pl::ptrn::Pattern &pattern);
void drawValueColumn(pl::ptrn::Pattern& pattern);
void drawVisualizer(const std::map<std::string, ContentRegistry::PatternLanguage::impl::Visualizer> &visualizers, const std::vector<pl::core::Token::Literal> &arguments, pl::ptrn::Pattern &pattern, pl::ptrn::IIterable &iterable, bool reset);
void drawFavoriteColumn(const pl::ptrn::Pattern& pattern);
void drawColorColumn(const pl::ptrn::Pattern& pattern);
bool beginPatternTable(const std::vector<std::shared_ptr<pl::ptrn::Pattern>> &patterns, std::vector<pl::ptrn::Pattern*> &sortedPatterns, float height) const;
bool createTreeNode(const pl::ptrn::Pattern& pattern, bool leaf = false);
void createDefaultEntry(const pl::ptrn::Pattern &pattern);
void closeTreeNode(bool inlined) const;
bool sortPatterns(const ImGuiTableSortSpecs* sortSpecs, const pl::ptrn::Pattern * left, const pl::ptrn::Pattern * right) const;
bool isEditingPattern(const pl::ptrn::Pattern& pattern) const;
void resetEditing();
bool matchesFilter(const std::vector<std::string> &filterPath, const std::vector<std::string> &patternPath, bool fullMatch) const;
void traversePatternTree(pl::ptrn::Pattern &pattern, std::vector<std::string> &patternPath, const std::function<void(pl::ptrn::Pattern&)> &callback);
std::string getDisplayName(const pl::ptrn::Pattern& pattern) const;
struct Filter {
std::vector<std::string> path;
std::optional<pl::core::Token::Literal> value;
};
std::optional<Filter> parseRValueFilter(const std::string &filter) const;
private:
std::map<const pl::ptrn::Pattern*, u64> m_displayEnd;
std::vector<pl::ptrn::Pattern*> m_sortedPatterns;
const pl::ptrn::Pattern *m_editingPattern = nullptr;
u64 m_editingPatternOffset = 0;
TreeStyle m_treeStyle = TreeStyle::Default;
bool m_rowColoring = false;
pl::ptrn::Pattern *m_currVisualizedPattern = nullptr;
std::set<pl::ptrn::Pattern*> m_visualizedPatterns;
std::string m_lastVisualizerError;
std::string m_filterText;
Filter m_filter;
std::vector<std::string> m_currPatternPath;
std::map<std::vector<std::string>, std::unique_ptr<pl::ptrn::Pattern>> m_favorites;
std::map<std::string, std::vector<std::unique_ptr<pl::ptrn::Pattern>>> m_groups;
bool m_showFavoriteStars = false;
bool m_favoritesUpdated = false;
bool m_showSpecName = false;
TaskHolder m_favoritesUpdateTask;
std::function<void(Region)> m_selectionCallback = [](Region) { };
pl::gen::fmt::FormatterArray m_formatters;
};
}

View File

@@ -1,61 +0,0 @@
#pragma once
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
namespace pl::ptrn { class Pattern; }
namespace hex::prv { class Provider; }
namespace hex::plugin::builtin::ui {
enum class RegionType : int {
EntireData,
Selection,
Region
};
inline void regionSelectionPicker(Region *region, prv::Provider *provider, RegionType *type, bool showHeader = true, bool firstEntry = false) {
if (showHeader)
ImGuiExt::Header("hex.builtin.common.range"_lang, firstEntry);
if (ImGui::RadioButton("hex.builtin.common.range.entire_data"_lang, *type == RegionType::EntireData))
*type = RegionType::EntireData;
if (ImGui::RadioButton("hex.builtin.common.range.selection"_lang, *type == RegionType::Selection))
*type = RegionType::Selection;
if (ImGui::RadioButton("hex.builtin.common.region"_lang, *type == RegionType::Region))
*type = RegionType::Region;
switch (*type) {
case RegionType::EntireData:
*region = { provider->getBaseAddress(), provider->getActualSize() };
break;
case RegionType::Selection:
*region = ImHexApi::HexEditor::getSelection().value_or(
ImHexApi::HexEditor::ProviderRegion {
{ 0, 1 },
provider }
).getRegion();
break;
case RegionType::Region:
ImGui::SameLine();
const auto width = ImGui::GetContentRegionAvail().x / 2 - ImGui::CalcTextSize(" - ").x / 2;
u64 start = region->getStartAddress(), end = region->getEndAddress();
ImGui::PushItemWidth(width);
ImGuiExt::InputHexadecimal("##start", &start);
ImGui::PopItemWidth();
ImGui::SameLine(0, 0);
ImGui::TextUnformatted(" - ");
ImGui::SameLine(0, 0);
ImGui::PushItemWidth(width);
ImGuiExt::InputHexadecimal("##end", &end);
ImGui::PopItemWidth();
*region = { start, (end - start) + 1 };
break;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -63,76 +63,6 @@
"hex.builtin.command.cmd.result": "Befehl '{0}' ausführen",
"hex.builtin.command.web.desc": "Webseite nachschlagen",
"hex.builtin.command.web.result": "'{0}' nachschlagen",
"hex.builtin.common.address": "Adresse",
"hex.builtin.common.allow": "Erlauben",
"hex.builtin.common.begin": "Anfangen",
"hex.builtin.common.big": "Big",
"hex.builtin.common.big_endian": "Big Endian",
"hex.builtin.common.browse": "Durchsuchen...",
"hex.builtin.common.bytes": "Bytes",
"hex.builtin.common.cancel": "Abbrechen",
"hex.builtin.common.choose_file": "Datei auswählen",
"hex.builtin.common.close": "Schliessen",
"hex.builtin.common.comment": "Kommentar",
"hex.builtin.common.count": "Anzahl",
"hex.builtin.common.decimal": "Dezimal",
"hex.builtin.common.deny": "Verweigern",
"hex.builtin.common.dont_show_again": "Nicht mehr anzeigen",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "Beenden",
"hex.builtin.common.endian": "Endian",
"hex.builtin.common.warning": "Warnung",
"hex.builtin.common.error": "Fehler",
"hex.builtin.common.fatal": "Fataler Fehler",
"hex.builtin.common.file": "Datei",
"hex.builtin.common.filter": "Filter",
"hex.builtin.common.hexadecimal": "Hexadezimal",
"hex.builtin.common.info": "Information",
"hex.builtin.common.instruction": "Instruktion",
"hex.builtin.common.link": "Link",
"hex.builtin.common.little": "Little",
"hex.builtin.common.little_endian": "Little Endian",
"hex.builtin.common.load": "Laden",
"hex.builtin.common.match_selection": "Arbeitsbereich synchronisieren",
"hex.builtin.common.name": "Name",
"hex.builtin.common.no": "Nein",
"hex.builtin.common.number_format": "Format",
"hex.builtin.common.octal": "Oktal",
"hex.builtin.common.offset": "Offset",
"hex.builtin.common.okay": "Okay",
"hex.builtin.common.open": "Öffnen",
"hex.builtin.common.percentage": "Prozent",
"hex.builtin.common.processing": "Verarbeiten",
"hex.builtin.common.project": "Projekt",
"hex.builtin.common.question": "Frage",
"hex.builtin.common.range": "Bereich",
"hex.builtin.common.range.entire_data": "Gesamte Daten",
"hex.builtin.common.range.selection": "Auswahl",
"hex.builtin.common.region": "Region",
"hex.builtin.common.reset": "Zurücksetzen",
"hex.builtin.common.set": "Setzen",
"hex.builtin.common.settings": "Einstellungen",
"hex.builtin.common.size": "Länge",
"hex.builtin.common.type": "Typ",
"hex.builtin.common.type.f32": "float",
"hex.builtin.common.type.f64": "double",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "Wert",
"hex.builtin.common.yes": "Ja",
"hex.builtin.hash.crc.iv": "Initialwert",
"hex.builtin.hash.crc.poly": "Polynom",
"hex.builtin.hash.crc.refl_in": "Reflect In",
@@ -150,18 +80,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "ASCII Spalte anzeigen",
"hex.builtin.hex_editor.custom_encoding_view": "Erweiterte Dekodierungsspalte anzeigen",
"hex.builtin.hex_editor.human_readable_units_footer": "",
"hex.builtin.hex_editor.data_size": "Datengrösse",
"hex.builtin.hex_editor.gray_out_zero": "Nullen ausgrauen",
"hex.builtin.hex_editor.no_bytes": "Keine Bytes verfügbar",
"hex.builtin.hex_editor.page": "Seite",
"hex.builtin.hex_editor.region": "Region",
"hex.builtin.hex_editor.selection": "Auswahl",
"hex.builtin.hex_editor.selection.none": "Keine",
"hex.builtin.hex_editor.uppercase_hex": "Hex Zeichen als Grossbuchstaben",
"hex.builtin.hex_editor.visualizer": "Daten Anzeige",
"hex.builtin.inspector.ascii": "ASCII Zeichen",
"hex.builtin.inspector.binary": "Binär (8 bit)",
"hex.builtin.inspector.bool": "bool",
@@ -423,31 +341,6 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "RGBA8 Bild",
"hex.builtin.nodes.visualizer.layered_dist": "Schichtverteilung",
"hex.builtin.nodes.visualizer.layered_dist.header": "Schichtverteilung",
"hex.builtin.pattern_drawer.color": "Farbe",
"hex.builtin.pattern_drawer.double_click": "Doppelklicken um mehr Einträge zu sehen",
"hex.builtin.pattern_drawer.end": "Ende",
"hex.builtin.pattern_drawer.export": "Pattern exportieren als...",
"hex.builtin.pattern_drawer.favorites": "Favoriten",
"hex.builtin.pattern_drawer.local": "Local",
"hex.builtin.pattern_drawer.size": "Grösse",
"hex.builtin.pattern_drawer.spec_name": "",
"hex.builtin.pattern_drawer.start": "Start",
"hex.builtin.pattern_drawer.tree_style.tree": "Baum",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "Automatisch geöffneter Baum",
"hex.builtin.pattern_drawer.tree_style.flattened": "Flach",
"hex.builtin.pattern_drawer.type": "Typ",
"hex.builtin.pattern_drawer.updating": "",
"hex.builtin.pattern_drawer.value": "Wert",
"hex.builtin.pattern_drawer.var_name": "Name",
"hex.builtin.pattern_drawer.visualizer.unknown": "Unbekannter Visualizer",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "Falsche anzahl Parameter",
"hex.builtin.pl_visualizer.3d.rotation": "Rotation",
"hex.builtin.pl_visualizer.3d.scale": "Skala",
"hex.builtin.pl_visualizer.coordinates.latitude": "Breitengrade",
"hex.builtin.pl_visualizer.coordinates.longitude": "Längengrad",
"hex.builtin.pl_visualizer.coordinates.query": "Adresse finden",
"hex.builtin.pl_visualizer.coordinates.querying": "Adresse abfragen...",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "Keine Adresse gefunden",
"hex.builtin.popup.close_provider.desc": "Es wurden ungespeicherte Änderungen an einem oder mehreren Provider vorgenommen.\nBist du sicher, dass du diese schliessen willst?",
"hex.builtin.popup.close_provider.title": "Provider schliessen?",
"hex.builtin.popup.docs_question.title": "Dokumentationsabfrage",
@@ -701,76 +594,6 @@
"hex.builtin.view.diff.provider_a": "",
"hex.builtin.view.diff.provider_b": "",
"hex.builtin.view.diff.removed": "",
"hex.builtin.view.disassembler.16bit": "16-bit",
"hex.builtin.view.disassembler.32bit": "32-bit",
"hex.builtin.view.disassembler.64bit": "64-bit",
"hex.builtin.view.disassembler.arch": "Architektur",
"hex.builtin.view.disassembler.arm.arm": "ARM",
"hex.builtin.view.disassembler.arm.armv8": "ARMv8",
"hex.builtin.view.disassembler.arm.cortex_m": "Cortex-M",
"hex.builtin.view.disassembler.arm.default": "Standard",
"hex.builtin.view.disassembler.arm.thumb": "Thumb",
"hex.builtin.view.disassembler.base": "Basisadresse",
"hex.builtin.view.disassembler.bpf.classic": "Classic",
"hex.builtin.view.disassembler.bpf.extended": "Extended",
"hex.builtin.view.disassembler.disassemble": "Disassemble",
"hex.builtin.view.disassembler.disassembling": "Disassemblen...",
"hex.builtin.view.disassembler.disassembly.address": "Adresse",
"hex.builtin.view.disassembler.disassembly.bytes": "Byte",
"hex.builtin.view.disassembler.disassembly.offset": "Offset",
"hex.builtin.view.disassembler.disassembly.title": "Disassembly",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "",
"hex.builtin.view.disassembler.sh.sh2a": "",
"hex.builtin.view.disassembler.sh.sh3": "",
"hex.builtin.view.disassembler.sh.sh4": "",
"hex.builtin.view.disassembler.sh.sh4a": "",
"hex.builtin.view.disassembler.sh.fpu": "",
"hex.builtin.view.disassembler.sh.dsp": "",
"hex.builtin.view.disassembler.tricore.110": "",
"hex.builtin.view.disassembler.tricore.120": "",
"hex.builtin.view.disassembler.tricore.130": "",
"hex.builtin.view.disassembler.tricore.131": "",
"hex.builtin.view.disassembler.tricore.160": "",
"hex.builtin.view.disassembler.tricore.161": "",
"hex.builtin.view.disassembler.tricore.162": "",
"hex.builtin.view.disassembler.name": "Disassembler",
"hex.builtin.view.disassembler.position": "Position",
"hex.builtin.view.disassembler.ppc.booke": "Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "Quad Processing Extensions",
"hex.builtin.view.disassembler.ppc.spe": "Signal Processing Engine",
"hex.builtin.view.disassembler.region": "Code Region",
"hex.builtin.view.disassembler.riscv.compressed": "Komprimiert",
"hex.builtin.view.disassembler.settings.mode": "Modus",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "Binärpattern",
"hex.builtin.view.find.binary_pattern.alignment": "",
"hex.builtin.view.find.context.copy": "Wert kopieren",
@@ -981,19 +804,6 @@
"hex.builtin.view.theme_manager.save_theme": "",
"hex.builtin.view.theme_manager.styles": "",
"hex.builtin.view.tools.name": "Werkzeuge",
"hex.builtin.view.yara.error": "Yara Kompilerfehler: {0}",
"hex.builtin.view.yara.header.matches": "Treffer",
"hex.builtin.view.yara.header.rules": "Regeln",
"hex.builtin.view.yara.match": "Regeln anwenden",
"hex.builtin.view.yara.matches.identifier": "Kennung",
"hex.builtin.view.yara.matches.variable": "Variable",
"hex.builtin.view.yara.matching": "Anwenden...",
"hex.builtin.view.yara.name": "Yara Regeln",
"hex.builtin.view.yara.no_rules": "Keine Yara Regeln gefunden. Platziere sie in ImHex's 'yara' Ordner",
"hex.builtin.view.yara.reload": "Neu laden",
"hex.builtin.view.yara.reset": "Zurücksetzen",
"hex.builtin.view.yara.rule_added": "Yara Regel hinzugefügt!",
"hex.builtin.view.yara.whole_data": "Gesamte Daten Übereinstimmung!",
"hex.builtin.visualizer.binary": "",
"hex.builtin.visualizer.decimal.signed.16bit": "Dezimal Signed (16 bits)",
"hex.builtin.visualizer.decimal.signed.32bit": "Dezimal Signed (32 bits)",

View File

@@ -75,82 +75,6 @@
"hex.builtin.command.cmd.result": "Run command '{0}'",
"hex.builtin.command.web.desc": "Website lookup",
"hex.builtin.command.web.result": "Navigate to '{0}'",
"hex.builtin.common.address": "Address",
"hex.builtin.common.allow": "Allow",
"hex.builtin.common.begin": "Begin",
"hex.builtin.common.big": "Big",
"hex.builtin.common.big_endian": "Big Endian",
"hex.builtin.common.browse": "Browse...",
"hex.builtin.common.bytes": "Bytes",
"hex.builtin.common.cancel": "Cancel",
"hex.builtin.common.choose_file": "Choose file",
"hex.builtin.common.close": "Close",
"hex.builtin.common.comment": "Comment",
"hex.builtin.common.count": "Count",
"hex.builtin.common.decimal": "Decimal",
"hex.builtin.common.deny": "Deny",
"hex.builtin.common.dont_show_again": "Don't show again",
"hex.builtin.common.edit": "Edit",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "End",
"hex.builtin.common.endian": "Endian",
"hex.builtin.common.warning": "Warning",
"hex.builtin.common.error": "Error",
"hex.builtin.common.fatal": "Fatal Error",
"hex.builtin.common.file": "File",
"hex.builtin.common.filter": "Filter",
"hex.builtin.common.hexadecimal": "Hexadecimal",
"hex.builtin.common.info": "Information",
"hex.builtin.common.instruction": "Instruction",
"hex.builtin.common.link": "Link",
"hex.builtin.common.little": "Little",
"hex.builtin.common.little_endian": "Little Endian",
"hex.builtin.common.load": "Load",
"hex.builtin.common.loading": "Loading...",
"hex.builtin.common.match_selection": "Match Selection",
"hex.builtin.common.name": "Name",
"hex.builtin.common.no": "No",
"hex.builtin.common.number_format": "Format",
"hex.builtin.common.octal": "Octal",
"hex.builtin.common.offset": "Offset",
"hex.builtin.common.okay": "Okay",
"hex.builtin.common.open": "Open",
"hex.builtin.common.on": "On",
"hex.builtin.common.off": "Off",
"hex.builtin.common.path": "Path",
"hex.builtin.common.percentage": "Percentage",
"hex.builtin.common.processing": "Processing",
"hex.builtin.common.project": "Project",
"hex.builtin.common.question": "Question",
"hex.builtin.common.range": "Range",
"hex.builtin.common.range.entire_data": "Entire Data",
"hex.builtin.common.range.selection": "Selection",
"hex.builtin.common.region": "Region",
"hex.builtin.common.remove": "Remove",
"hex.builtin.common.reset": "Reset",
"hex.builtin.common.set": "Set",
"hex.builtin.common.settings": "Settings",
"hex.builtin.common.size": "Size",
"hex.builtin.common.type": "Type",
"hex.builtin.common.type.f32": "float",
"hex.builtin.common.type.f64": "double",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "Value",
"hex.builtin.common.yes": "Yes",
"hex.builtin.hash.crc.iv": "Initial Value",
"hex.builtin.hash.crc.poly": "Polynomial",
"hex.builtin.hash.crc.refl_in": "Reflect In",
@@ -168,18 +92,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "Display ASCII column",
"hex.builtin.hex_editor.custom_encoding_view": "Display advanced decoding column",
"hex.builtin.hex_editor.human_readable_units_footer": "Convert sizes to human-readable units",
"hex.builtin.hex_editor.data_size": "Data Size",
"hex.builtin.hex_editor.gray_out_zero": "Grey out zeros",
"hex.builtin.hex_editor.no_bytes": "No bytes available",
"hex.builtin.hex_editor.page": "Page",
"hex.builtin.hex_editor.region": "Region",
"hex.builtin.hex_editor.selection": "Selection",
"hex.builtin.hex_editor.selection.none": "None",
"hex.builtin.hex_editor.uppercase_hex": "Upper case Hex characters",
"hex.builtin.hex_editor.visualizer": "Data visualizer",
"hex.builtin.inspector.ascii": "ASCII Character",
"hex.builtin.inspector.binary": "Binary (8 bit)",
"hex.builtin.inspector.bool": "bool",
@@ -453,37 +365,6 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "RGBA8 Image Visualizer",
"hex.builtin.nodes.visualizer.layered_dist": "Layered Distribution",
"hex.builtin.nodes.visualizer.layered_dist.header": "Layered Distribution",
"hex.builtin.pattern_drawer.color": "Color",
"hex.builtin.pattern_drawer.double_click": "Double-click to see more items",
"hex.builtin.pattern_drawer.end": "End",
"hex.builtin.pattern_drawer.export": "Export Patterns as...",
"hex.builtin.pattern_drawer.favorites": "Favorites",
"hex.builtin.pattern_drawer.local": "Local",
"hex.builtin.pattern_drawer.size": "Size",
"hex.builtin.pattern_drawer.spec_name": "Display specification names",
"hex.builtin.pattern_drawer.start": "Start",
"hex.builtin.pattern_drawer.tree_style.tree": "Tree",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "Auto Expanded Tree",
"hex.builtin.pattern_drawer.tree_style.flattened": "Flattened",
"hex.builtin.pattern_drawer.type": "Type",
"hex.builtin.pattern_drawer.updating": "Updating patterns...",
"hex.builtin.pattern_drawer.value": "Value",
"hex.builtin.pattern_drawer.var_name": "Name",
"hex.builtin.pattern_drawer.visualizer.unknown": "Unknown visualizer",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "Invalid parameter count",
"hex.builtin.pl_visualizer.3d.light_position": "Light Position",
"hex.builtin.pl_visualizer.3d.ambient_brightness": "Ambient Brightness",
"hex.builtin.pl_visualizer.3d.diffuse_brightness": "Diffuse Brightness",
"hex.builtin.pl_visualizer.3d.specular_brightness": "Specular Brightness",
"hex.builtin.pl_visualizer.3d.object_reflectiveness": "Object Reflectiveness",
"hex.builtin.pl_visualizer.3d.light_color": "Light Color",
"hex.builtin.pl_visualizer.3d.more_settings": "More Settings",
"hex.builtin.pl_visualizer.3d.texture_file": "Texture File Path",
"hex.builtin.pl_visualizer.coordinates.latitude": "Latitude",
"hex.builtin.pl_visualizer.coordinates.longitude": "Longitude",
"hex.builtin.pl_visualizer.coordinates.query": "Find address",
"hex.builtin.pl_visualizer.coordinates.querying": "Querying address...",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "No address found",
"hex.builtin.popup.close_provider.desc": "There are unsaved changes made to one or more Providers\nthat haven't been saved to a Project yet.\n\nAre you sure you want to close them?",
"hex.builtin.popup.close_provider.title": "Close Provider?",
"hex.builtin.popup.docs_question.title": "Documentation query",
@@ -808,76 +689,6 @@
"hex.builtin.view.diff.provider_a": "Provider A",
"hex.builtin.view.diff.provider_b": "Provider B",
"hex.builtin.view.diff.removed": "Removed",
"hex.builtin.view.disassembler.16bit": "16-bit",
"hex.builtin.view.disassembler.32bit": "32-bit",
"hex.builtin.view.disassembler.64bit": "64-bit",
"hex.builtin.view.disassembler.arch": "Architecture",
"hex.builtin.view.disassembler.arm.arm": "ARM",
"hex.builtin.view.disassembler.arm.armv8": "ARMv8",
"hex.builtin.view.disassembler.arm.cortex_m": "Cortex-M",
"hex.builtin.view.disassembler.arm.default": "Default",
"hex.builtin.view.disassembler.arm.thumb": "Thumb",
"hex.builtin.view.disassembler.base": "Base address",
"hex.builtin.view.disassembler.bpf.classic": "Classic",
"hex.builtin.view.disassembler.bpf.extended": "Extended",
"hex.builtin.view.disassembler.disassemble": "Disassemble",
"hex.builtin.view.disassembler.disassembling": "Disassembling...",
"hex.builtin.view.disassembler.disassembly.address": "Address",
"hex.builtin.view.disassembler.disassembly.bytes": "Byte",
"hex.builtin.view.disassembler.disassembly.offset": "Offset",
"hex.builtin.view.disassembler.disassembly.title": "Disassembly",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "SH2",
"hex.builtin.view.disassembler.sh.sh2a": "SH2A",
"hex.builtin.view.disassembler.sh.sh3": "SH3",
"hex.builtin.view.disassembler.sh.sh4": "SH4",
"hex.builtin.view.disassembler.sh.sh4a": "SH4A",
"hex.builtin.view.disassembler.sh.fpu": "FPU",
"hex.builtin.view.disassembler.sh.dsp": "DSP",
"hex.builtin.view.disassembler.tricore.110": "110",
"hex.builtin.view.disassembler.tricore.120": "120",
"hex.builtin.view.disassembler.tricore.130": "130",
"hex.builtin.view.disassembler.tricore.131": "131",
"hex.builtin.view.disassembler.tricore.160": "160",
"hex.builtin.view.disassembler.tricore.161": "161",
"hex.builtin.view.disassembler.tricore.162": "162",
"hex.builtin.view.disassembler.name": "Disassembler",
"hex.builtin.view.disassembler.position": "Position",
"hex.builtin.view.disassembler.ppc.booke": "Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "Quad Processing Extensions",
"hex.builtin.view.disassembler.ppc.spe": "Signal Processing Engine",
"hex.builtin.view.disassembler.region": "Code region",
"hex.builtin.view.disassembler.riscv.compressed": "Compressed",
"hex.builtin.view.disassembler.settings.mode": "Mode",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "Binary Pattern",
"hex.builtin.view.find.binary_pattern.alignment": "Alignment",
"hex.builtin.view.find.context.copy": "Copy Value",
@@ -1123,19 +934,6 @@
"hex.builtin.view.tutorials.name": "Interactive Tutorials",
"hex.builtin.view.tutorials.description": "Description",
"hex.builtin.view.tutorials.start": "Start Tutorial",
"hex.builtin.view.yara.error": "Yara Compiler error: {0}",
"hex.builtin.view.yara.header.matches": "Matches",
"hex.builtin.view.yara.header.rules": "Rules",
"hex.builtin.view.yara.match": "Match Rules",
"hex.builtin.view.yara.matches.identifier": "Identifier",
"hex.builtin.view.yara.matches.variable": "Variable",
"hex.builtin.view.yara.matching": "Matching...",
"hex.builtin.view.yara.name": "Yara Rules",
"hex.builtin.view.yara.no_rules": "No YARA rules found. Put them in ImHex's 'yara' folder",
"hex.builtin.view.yara.reload": "Reload",
"hex.builtin.view.yara.reset": "Reset",
"hex.builtin.view.yara.rule_added": "Yara rule added!",
"hex.builtin.view.yara.whole_data": "Whole file matches!",
"hex.builtin.visualizer.binary": "Binary",
"hex.builtin.visualizer.decimal.signed.16bit": "Decimal Signed (16 bits)",
"hex.builtin.visualizer.decimal.signed.32bit": "Decimal Signed (32 bits)",

View File

@@ -63,76 +63,6 @@
"hex.builtin.command.cmd.result": "Ejecutar comando '{0}'",
"hex.builtin.command.web.desc": "Búsqueda (de) web",
"hex.builtin.command.web.result": "Navegar a '{0}'",
"hex.builtin.common.address": "Dirección",
"hex.builtin.common.allow": "",
"hex.builtin.common.begin": "Inicio",
"hex.builtin.common.big": "Big",
"hex.builtin.common.big_endian": "Big Endian",
"hex.builtin.common.browse": "Navegar...",
"hex.builtin.common.bytes": "Bytes",
"hex.builtin.common.cancel": "Cancelar",
"hex.builtin.common.choose_file": "Escoger archivo",
"hex.builtin.common.close": "Cerrar",
"hex.builtin.common.comment": "Comentario",
"hex.builtin.common.count": "Cantidad",
"hex.builtin.common.decimal": "Decimal",
"hex.builtin.common.deny": "",
"hex.builtin.common.dont_show_again": "No mostrar de nuevo",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "Fin",
"hex.builtin.common.endian": "Endian",
"hex.builtin.common.warning": "",
"hex.builtin.common.error": "Error",
"hex.builtin.common.fatal": "Error Crítico",
"hex.builtin.common.file": "Archivo",
"hex.builtin.common.filter": "Filtro",
"hex.builtin.common.hexadecimal": "Hexadecimal",
"hex.builtin.common.info": "Información",
"hex.builtin.common.instruction": "Instrucción",
"hex.builtin.common.link": "Enlace",
"hex.builtin.common.little": "Little",
"hex.builtin.common.little_endian": "Little Endian",
"hex.builtin.common.load": "Cargar",
"hex.builtin.common.match_selection": "Match Selection",
"hex.builtin.common.name": "Nombre",
"hex.builtin.common.no": "No",
"hex.builtin.common.number_format": "Formato",
"hex.builtin.common.octal": "Octal",
"hex.builtin.common.offset": "Offset",
"hex.builtin.common.okay": "Okey",
"hex.builtin.common.open": "Abrir",
"hex.builtin.common.percentage": "Porcentaje",
"hex.builtin.common.processing": "Procesado",
"hex.builtin.common.project": "",
"hex.builtin.common.question": "Pregunta",
"hex.builtin.common.range": "Rango",
"hex.builtin.common.range.entire_data": "Todos los Datos",
"hex.builtin.common.range.selection": "Selección",
"hex.builtin.common.region": "Región",
"hex.builtin.common.reset": "",
"hex.builtin.common.set": "Establecer",
"hex.builtin.common.settings": "Ajustes",
"hex.builtin.common.size": "Tamaño",
"hex.builtin.common.type": "Tipo",
"hex.builtin.common.type.f32": "float",
"hex.builtin.common.type.f64": "double",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "Valor",
"hex.builtin.common.yes": "Sí",
"hex.builtin.hash.crc.iv": "Valor Inicial",
"hex.builtin.hash.crc.poly": "Polinomio",
"hex.builtin.hash.crc.refl_in": "Reflect In",
@@ -150,18 +80,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "Mostrar columna ASCII",
"hex.builtin.hex_editor.custom_encoding_view": "Mostrar columna de decodificación avanzada",
"hex.builtin.hex_editor.human_readable_units_footer": "",
"hex.builtin.hex_editor.data_size": "Tamaño de Datos",
"hex.builtin.hex_editor.gray_out_zero": "Mostrar ceros en gris",
"hex.builtin.hex_editor.no_bytes": "No hay bytes disponibles",
"hex.builtin.hex_editor.page": "Página",
"hex.builtin.hex_editor.region": "Región",
"hex.builtin.hex_editor.selection": "Selección",
"hex.builtin.hex_editor.selection.none": "Ninguno",
"hex.builtin.hex_editor.uppercase_hex": "Caracteres hexadecimales mayúscula",
"hex.builtin.hex_editor.visualizer": "Visualizador de datos",
"hex.builtin.inspector.ascii": "Carácter ASCII",
"hex.builtin.inspector.binary": "Binario (8 bit)",
"hex.builtin.inspector.bool": "bool",
@@ -422,31 +340,6 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "Visualizador de Imágenes RGBA8",
"hex.builtin.nodes.visualizer.layered_dist": "Distribución en Capas",
"hex.builtin.nodes.visualizer.layered_dist.header": "Distribución en Capas",
"hex.builtin.pattern_drawer.color": "Color",
"hex.builtin.pattern_drawer.double_click": "Haga doble clic para ver más elementos",
"hex.builtin.pattern_drawer.end": "",
"hex.builtin.pattern_drawer.export": "",
"hex.builtin.pattern_drawer.favorites": "",
"hex.builtin.pattern_drawer.local": "",
"hex.builtin.pattern_drawer.size": "Tamaño",
"hex.builtin.pattern_drawer.spec_name": "",
"hex.builtin.pattern_drawer.start": "",
"hex.builtin.pattern_drawer.tree_style.tree": "Árbol",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "Árbol Automáticamente Expandido",
"hex.builtin.pattern_drawer.tree_style.flattened": "Allanado",
"hex.builtin.pattern_drawer.type": "Tipo",
"hex.builtin.pattern_drawer.updating": "",
"hex.builtin.pattern_drawer.value": "Valor",
"hex.builtin.pattern_drawer.var_name": "Nombre",
"hex.builtin.pattern_drawer.visualizer.unknown": "Visualizador Desconocido",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "Cantidad de parámetros inválida",
"hex.builtin.pl_visualizer.3d.rotation": "Rotación",
"hex.builtin.pl_visualizer.3d.scale": "Escala",
"hex.builtin.pl_visualizer.coordinates.latitude": "",
"hex.builtin.pl_visualizer.coordinates.longitude": "",
"hex.builtin.pl_visualizer.coordinates.query": "",
"hex.builtin.pl_visualizer.coordinates.querying": "",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "",
"hex.builtin.popup.close_provider.desc": "",
"hex.builtin.popup.close_provider.title": "¿Cerrar Proveedor?",
"hex.builtin.popup.docs_question.title": "Búsqueda de Documentación",
@@ -700,76 +593,6 @@
"hex.builtin.view.diff.provider_a": "Proveedor A",
"hex.builtin.view.diff.provider_b": "Proveedor B",
"hex.builtin.view.diff.removed": "Eliminados",
"hex.builtin.view.disassembler.16bit": "16-bit",
"hex.builtin.view.disassembler.32bit": "32-bit",
"hex.builtin.view.disassembler.64bit": "64-bit",
"hex.builtin.view.disassembler.arch": "Arquitectura",
"hex.builtin.view.disassembler.arm.arm": "",
"hex.builtin.view.disassembler.arm.armv8": "",
"hex.builtin.view.disassembler.arm.cortex_m": "",
"hex.builtin.view.disassembler.arm.default": "Estándar",
"hex.builtin.view.disassembler.arm.thumb": "",
"hex.builtin.view.disassembler.base": "Dirección base",
"hex.builtin.view.disassembler.bpf.classic": "Clásica",
"hex.builtin.view.disassembler.bpf.extended": "Extendida",
"hex.builtin.view.disassembler.disassemble": "Desensamblar",
"hex.builtin.view.disassembler.disassembling": "Desensamblando...",
"hex.builtin.view.disassembler.disassembly.address": "Dirección",
"hex.builtin.view.disassembler.disassembly.bytes": "Byte",
"hex.builtin.view.disassembler.disassembly.offset": "Offset",
"hex.builtin.view.disassembler.disassembly.title": "Desensamblado",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "",
"hex.builtin.view.disassembler.sh.sh2a": "",
"hex.builtin.view.disassembler.sh.sh3": "",
"hex.builtin.view.disassembler.sh.sh4": "",
"hex.builtin.view.disassembler.sh.sh4a": "",
"hex.builtin.view.disassembler.sh.fpu": "",
"hex.builtin.view.disassembler.sh.dsp": "",
"hex.builtin.view.disassembler.tricore.110": "",
"hex.builtin.view.disassembler.tricore.120": "",
"hex.builtin.view.disassembler.tricore.130": "",
"hex.builtin.view.disassembler.tricore.131": "",
"hex.builtin.view.disassembler.tricore.160": "",
"hex.builtin.view.disassembler.tricore.161": "",
"hex.builtin.view.disassembler.tricore.162": "",
"hex.builtin.view.disassembler.name": "Desensamblador",
"hex.builtin.view.disassembler.position": "Posición",
"hex.builtin.view.disassembler.ppc.booke": "Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "Quad Processing Extensions",
"hex.builtin.view.disassembler.ppc.spe": "Signal Processing Engine",
"hex.builtin.view.disassembler.region": "Región de código",
"hex.builtin.view.disassembler.riscv.compressed": "Comprimido",
"hex.builtin.view.disassembler.settings.mode": "Modo",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "Patrón Binario",
"hex.builtin.view.find.binary_pattern.alignment": "Alineado",
"hex.builtin.view.find.context.copy": "Copiar Valor",
@@ -979,19 +802,6 @@
"hex.builtin.view.theme_manager.save_theme": "Guardar Tema",
"hex.builtin.view.theme_manager.styles": "Estilos",
"hex.builtin.view.tools.name": "Herramientas",
"hex.builtin.view.yara.error": "Error del compilador de Yara: ",
"hex.builtin.view.yara.header.matches": "Coincidenciasç",
"hex.builtin.view.yara.header.rules": "Rules",
"hex.builtin.view.yara.match": "Reglas de Coincidencia",
"hex.builtin.view.yara.matches.identifier": "Identificador",
"hex.builtin.view.yara.matches.variable": "",
"hex.builtin.view.yara.matching": "Analizando coincidencias...",
"hex.builtin.view.yara.name": "Yara Rules",
"hex.builtin.view.yara.no_rules": "No se encontraron Yara Rules. Estas han de encontrarse en la carpeta 'yara' de ImHex.",
"hex.builtin.view.yara.reload": "Recargar",
"hex.builtin.view.yara.reset": "Restablecer",
"hex.builtin.view.yara.rule_added": "¡La Yara Rule fue añadida con éxito!",
"hex.builtin.view.yara.whole_data": "¡El archivo completo coincide!",
"hex.builtin.visualizer.binary": "Binario",
"hex.builtin.visualizer.decimal.signed.16bit": "Decimal con Signo (16 bits)",
"hex.builtin.visualizer.decimal.signed.32bit": "Decimal con Signo (32 bits)",

View File

@@ -63,76 +63,6 @@
"hex.builtin.command.cmd.result": "Esegui comando '{0}'",
"hex.builtin.command.web.desc": "Consulta il Web",
"hex.builtin.command.web.result": "Naviga a '{0}'",
"hex.builtin.common.address": "Indirizzo",
"hex.builtin.common.allow": "",
"hex.builtin.common.begin": "",
"hex.builtin.common.big": "Big",
"hex.builtin.common.big_endian": "Big Endian",
"hex.builtin.common.browse": "Esplora...",
"hex.builtin.common.bytes": "",
"hex.builtin.common.cancel": "Cancella",
"hex.builtin.common.choose_file": "Scegli file",
"hex.builtin.common.close": "Chiudi",
"hex.builtin.common.comment": "",
"hex.builtin.common.count": "",
"hex.builtin.common.decimal": "Decimale",
"hex.builtin.common.deny": "",
"hex.builtin.common.dont_show_again": "Non mostrare di nuovo",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "",
"hex.builtin.common.endian": "Endian",
"hex.builtin.common.warning": "",
"hex.builtin.common.error": "Errore",
"hex.builtin.common.fatal": "Errore Fatale",
"hex.builtin.common.file": "File",
"hex.builtin.common.filter": "",
"hex.builtin.common.hexadecimal": "Esadecimale",
"hex.builtin.common.info": "Informazioni",
"hex.builtin.common.instruction": "",
"hex.builtin.common.link": "Link",
"hex.builtin.common.little": "Little",
"hex.builtin.common.little_endian": "Little Endian",
"hex.builtin.common.load": "Carica",
"hex.builtin.common.match_selection": "Seleziona abbinamento",
"hex.builtin.common.name": "",
"hex.builtin.common.no": "No",
"hex.builtin.common.number_format": "",
"hex.builtin.common.octal": "Ottale",
"hex.builtin.common.offset": "Offset",
"hex.builtin.common.okay": "Okay",
"hex.builtin.common.open": "Apri",
"hex.builtin.common.percentage": "",
"hex.builtin.common.processing": "",
"hex.builtin.common.project": "",
"hex.builtin.common.question": "",
"hex.builtin.common.range": "",
"hex.builtin.common.range.entire_data": "",
"hex.builtin.common.range.selection": "",
"hex.builtin.common.region": "Regione",
"hex.builtin.common.reset": "",
"hex.builtin.common.set": "Imposta",
"hex.builtin.common.settings": "Impostazioni",
"hex.builtin.common.size": "Dimensione",
"hex.builtin.common.type": "",
"hex.builtin.common.type.f32": "float",
"hex.builtin.common.type.f64": "double",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "",
"hex.builtin.common.yes": "Sì",
"hex.builtin.hash.crc.iv": "Valore Iniziale",
"hex.builtin.hash.crc.poly": "Polinomio",
"hex.builtin.hash.crc.refl_in": "",
@@ -150,18 +80,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "Mostra la colonna ASCII",
"hex.builtin.hex_editor.custom_encoding_view": "Mostra la colonna di decodifica avanzata",
"hex.builtin.hex_editor.human_readable_units_footer": "",
"hex.builtin.hex_editor.data_size": "",
"hex.builtin.hex_editor.gray_out_zero": "Taglia fuori gli zeri",
"hex.builtin.hex_editor.no_bytes": "",
"hex.builtin.hex_editor.page": "",
"hex.builtin.hex_editor.region": "",
"hex.builtin.hex_editor.selection": "",
"hex.builtin.hex_editor.selection.none": "",
"hex.builtin.hex_editor.uppercase_hex": "Caratteri esadecimali maiuscoli",
"hex.builtin.hex_editor.visualizer": "",
"hex.builtin.inspector.ascii": "ASCII Character",
"hex.builtin.inspector.binary": "Binary (8 bit)",
"hex.builtin.inspector.bool": "bool",
@@ -422,31 +340,6 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "",
"hex.builtin.nodes.visualizer.layered_dist": "",
"hex.builtin.nodes.visualizer.layered_dist.header": "",
"hex.builtin.pattern_drawer.color": "",
"hex.builtin.pattern_drawer.double_click": "",
"hex.builtin.pattern_drawer.end": "",
"hex.builtin.pattern_drawer.export": "",
"hex.builtin.pattern_drawer.favorites": "",
"hex.builtin.pattern_drawer.local": "",
"hex.builtin.pattern_drawer.size": "",
"hex.builtin.pattern_drawer.spec_name": "",
"hex.builtin.pattern_drawer.start": "",
"hex.builtin.pattern_drawer.tree_style.tree": "",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "",
"hex.builtin.pattern_drawer.tree_style.flattened": "",
"hex.builtin.pattern_drawer.type": "",
"hex.builtin.pattern_drawer.updating": "",
"hex.builtin.pattern_drawer.value": "",
"hex.builtin.pattern_drawer.var_name": "",
"hex.builtin.pattern_drawer.visualizer.unknown": "",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "",
"hex.builtin.pl_visualizer.3d.rotation": "",
"hex.builtin.pl_visualizer.3d.scale": "",
"hex.builtin.pl_visualizer.coordinates.latitude": "",
"hex.builtin.pl_visualizer.coordinates.longitude": "",
"hex.builtin.pl_visualizer.coordinates.query": "",
"hex.builtin.pl_visualizer.coordinates.querying": "",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "",
"hex.builtin.popup.close_provider.desc": "",
"hex.builtin.popup.close_provider.title": "",
"hex.builtin.popup.docs_question.title": "",
@@ -700,76 +593,6 @@
"hex.builtin.view.diff.provider_a": "",
"hex.builtin.view.diff.provider_b": "",
"hex.builtin.view.diff.removed": "",
"hex.builtin.view.disassembler.16bit": "16-bit",
"hex.builtin.view.disassembler.32bit": "32-bit",
"hex.builtin.view.disassembler.64bit": "64-bit",
"hex.builtin.view.disassembler.arch": "Architettura",
"hex.builtin.view.disassembler.arm.arm": "ARM",
"hex.builtin.view.disassembler.arm.armv8": "ARMv8",
"hex.builtin.view.disassembler.arm.cortex_m": "Cortex-M",
"hex.builtin.view.disassembler.arm.default": "Default",
"hex.builtin.view.disassembler.arm.thumb": "Thumb",
"hex.builtin.view.disassembler.base": "Indirizzo di base",
"hex.builtin.view.disassembler.bpf.classic": "Classico",
"hex.builtin.view.disassembler.bpf.extended": "Esteso",
"hex.builtin.view.disassembler.disassemble": "Disassembla",
"hex.builtin.view.disassembler.disassembling": "Disassemblaggio...",
"hex.builtin.view.disassembler.disassembly.address": "Indirizzo",
"hex.builtin.view.disassembler.disassembly.bytes": "Byte",
"hex.builtin.view.disassembler.disassembly.offset": "Offset",
"hex.builtin.view.disassembler.disassembly.title": "Disassembla",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "",
"hex.builtin.view.disassembler.sh.sh2a": "",
"hex.builtin.view.disassembler.sh.sh3": "",
"hex.builtin.view.disassembler.sh.sh4": "",
"hex.builtin.view.disassembler.sh.sh4a": "",
"hex.builtin.view.disassembler.sh.fpu": "",
"hex.builtin.view.disassembler.sh.dsp": "",
"hex.builtin.view.disassembler.tricore.110": "",
"hex.builtin.view.disassembler.tricore.120": "",
"hex.builtin.view.disassembler.tricore.130": "",
"hex.builtin.view.disassembler.tricore.131": "",
"hex.builtin.view.disassembler.tricore.160": "",
"hex.builtin.view.disassembler.tricore.161": "",
"hex.builtin.view.disassembler.tricore.162": "",
"hex.builtin.view.disassembler.name": "Disassembla",
"hex.builtin.view.disassembler.position": "Posiziona",
"hex.builtin.view.disassembler.ppc.booke": "Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "Quad Processing Extensions",
"hex.builtin.view.disassembler.ppc.spe": "Signal Processing Engine",
"hex.builtin.view.disassembler.region": "Regione del Codice",
"hex.builtin.view.disassembler.riscv.compressed": "Compresso",
"hex.builtin.view.disassembler.settings.mode": "",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "",
"hex.builtin.view.find.binary_pattern.alignment": "",
"hex.builtin.view.find.context.copy": "",
@@ -979,19 +802,6 @@
"hex.builtin.view.theme_manager.save_theme": "",
"hex.builtin.view.theme_manager.styles": "",
"hex.builtin.view.tools.name": "Strumenti",
"hex.builtin.view.yara.error": "Errore compilazione Yara: {0}",
"hex.builtin.view.yara.header.matches": "Abbinamenti",
"hex.builtin.view.yara.header.rules": "Regola",
"hex.builtin.view.yara.match": "Abbina Regole",
"hex.builtin.view.yara.matches.identifier": "Identificatore",
"hex.builtin.view.yara.matches.variable": "Variabile",
"hex.builtin.view.yara.matching": "Abbinamento...",
"hex.builtin.view.yara.name": "Regole di Yara",
"hex.builtin.view.yara.no_rules": "Nessuna regola di YARA. Aggiungile in nella cartella 'yara' di 'ImHex'",
"hex.builtin.view.yara.reload": "Ricarica",
"hex.builtin.view.yara.reset": "",
"hex.builtin.view.yara.rule_added": "Regola di Yara aggiunta!",
"hex.builtin.view.yara.whole_data": "Tutti i file combaciano!",
"hex.builtin.visualizer.binary": "",
"hex.builtin.visualizer.decimal.signed.16bit": "",
"hex.builtin.visualizer.decimal.signed.32bit": "",

View File

@@ -63,76 +63,6 @@
"hex.builtin.command.cmd.result": "コマンド '{0}' を実行",
"hex.builtin.command.web.desc": "ウェブサイト参照",
"hex.builtin.command.web.result": "'{0}' を開く",
"hex.builtin.common.address": "アドレス",
"hex.builtin.common.allow": "",
"hex.builtin.common.begin": "",
"hex.builtin.common.big": "ビッグ",
"hex.builtin.common.big_endian": "ビッグエンディアン",
"hex.builtin.common.browse": "ファイルを参照…",
"hex.builtin.common.bytes": "",
"hex.builtin.common.cancel": "キャンセル",
"hex.builtin.common.choose_file": "ファイルを選択",
"hex.builtin.common.close": "閉じる",
"hex.builtin.common.comment": "コメント",
"hex.builtin.common.count": "",
"hex.builtin.common.decimal": "10進数",
"hex.builtin.common.deny": "",
"hex.builtin.common.dont_show_again": "再度表示しない",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "",
"hex.builtin.common.endian": "エンディアン",
"hex.builtin.common.warning": "",
"hex.builtin.common.error": "エラー",
"hex.builtin.common.fatal": "深刻なエラー",
"hex.builtin.common.file": "ファイル",
"hex.builtin.common.filter": "フィルタ",
"hex.builtin.common.hexadecimal": "16進数",
"hex.builtin.common.info": "情報",
"hex.builtin.common.instruction": "",
"hex.builtin.common.link": "リンク",
"hex.builtin.common.little": "リトル",
"hex.builtin.common.little_endian": "リトルエンディアン",
"hex.builtin.common.load": "読み込む",
"hex.builtin.common.match_selection": "選択範囲と一致",
"hex.builtin.common.name": "",
"hex.builtin.common.no": "いいえ",
"hex.builtin.common.number_format": "",
"hex.builtin.common.octal": "8進数",
"hex.builtin.common.offset": "オフセット",
"hex.builtin.common.okay": "OK",
"hex.builtin.common.open": "開く",
"hex.builtin.common.percentage": "",
"hex.builtin.common.processing": "",
"hex.builtin.common.project": "",
"hex.builtin.common.question": "",
"hex.builtin.common.range": "範囲",
"hex.builtin.common.range.entire_data": "データ全体",
"hex.builtin.common.range.selection": "選択範囲",
"hex.builtin.common.region": "領域",
"hex.builtin.common.reset": "",
"hex.builtin.common.set": "セット",
"hex.builtin.common.settings": "設定",
"hex.builtin.common.size": "サイズ",
"hex.builtin.common.type": "",
"hex.builtin.common.type.f32": "float",
"hex.builtin.common.type.f64": "double",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "値",
"hex.builtin.common.yes": "はい",
"hex.builtin.hash.crc.iv": "初期値",
"hex.builtin.hash.crc.poly": "多項式",
"hex.builtin.hash.crc.refl_in": "入力を反映",
@@ -150,18 +80,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "ASCIIを表示",
"hex.builtin.hex_editor.custom_encoding_view": "他のデコード列を表示",
"hex.builtin.hex_editor.human_readable_units_footer": "",
"hex.builtin.hex_editor.data_size": "ファイルサイズ",
"hex.builtin.hex_editor.gray_out_zero": "ゼロをグレーアウト",
"hex.builtin.hex_editor.no_bytes": "",
"hex.builtin.hex_editor.page": "ページ",
"hex.builtin.hex_editor.region": "ページの領域",
"hex.builtin.hex_editor.selection": "選択中",
"hex.builtin.hex_editor.selection.none": "なし",
"hex.builtin.hex_editor.uppercase_hex": "16進数を大文字表記",
"hex.builtin.hex_editor.visualizer": "データ表示方式",
"hex.builtin.inspector.ascii": "ASCII",
"hex.builtin.inspector.binary": "バイナリ (8 bit)",
"hex.builtin.inspector.bool": "bool",
@@ -422,31 +340,6 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "",
"hex.builtin.nodes.visualizer.layered_dist": "層状分布",
"hex.builtin.nodes.visualizer.layered_dist.header": "層状分布",
"hex.builtin.pattern_drawer.color": "色",
"hex.builtin.pattern_drawer.double_click": "",
"hex.builtin.pattern_drawer.end": "",
"hex.builtin.pattern_drawer.export": "",
"hex.builtin.pattern_drawer.favorites": "",
"hex.builtin.pattern_drawer.local": "",
"hex.builtin.pattern_drawer.size": "サイズ",
"hex.builtin.pattern_drawer.spec_name": "",
"hex.builtin.pattern_drawer.start": "",
"hex.builtin.pattern_drawer.tree_style.tree": "",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "",
"hex.builtin.pattern_drawer.tree_style.flattened": "",
"hex.builtin.pattern_drawer.type": "型",
"hex.builtin.pattern_drawer.updating": "",
"hex.builtin.pattern_drawer.value": "値",
"hex.builtin.pattern_drawer.var_name": "名前",
"hex.builtin.pattern_drawer.visualizer.unknown": "",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "",
"hex.builtin.pl_visualizer.3d.rotation": "",
"hex.builtin.pl_visualizer.3d.scale": "",
"hex.builtin.pl_visualizer.coordinates.latitude": "",
"hex.builtin.pl_visualizer.coordinates.longitude": "",
"hex.builtin.pl_visualizer.coordinates.query": "",
"hex.builtin.pl_visualizer.coordinates.querying": "",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "",
"hex.builtin.popup.close_provider.desc": "",
"hex.builtin.popup.close_provider.title": "タブを閉じますか?",
"hex.builtin.popup.docs_question.title": "",
@@ -700,76 +593,6 @@
"hex.builtin.view.diff.provider_a": "",
"hex.builtin.view.diff.provider_b": "",
"hex.builtin.view.diff.removed": "",
"hex.builtin.view.disassembler.16bit": "16-bit",
"hex.builtin.view.disassembler.32bit": "32-bit",
"hex.builtin.view.disassembler.64bit": "64-bit",
"hex.builtin.view.disassembler.arch": "アーキテクチャ",
"hex.builtin.view.disassembler.arm.arm": "ARM",
"hex.builtin.view.disassembler.arm.armv8": "ARMv8",
"hex.builtin.view.disassembler.arm.cortex_m": "Cortex-M",
"hex.builtin.view.disassembler.arm.default": "デフォルト",
"hex.builtin.view.disassembler.arm.thumb": "Thumb",
"hex.builtin.view.disassembler.base": "ベースアドレス",
"hex.builtin.view.disassembler.bpf.classic": "クラシック",
"hex.builtin.view.disassembler.bpf.extended": "拡張",
"hex.builtin.view.disassembler.disassemble": "逆アセンブル",
"hex.builtin.view.disassembler.disassembling": "逆アセンブル中…",
"hex.builtin.view.disassembler.disassembly.address": "アドレス",
"hex.builtin.view.disassembler.disassembly.bytes": "バイト",
"hex.builtin.view.disassembler.disassembly.offset": "オフセット",
"hex.builtin.view.disassembler.disassembly.title": "逆アセンブル",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "",
"hex.builtin.view.disassembler.sh.sh2a": "",
"hex.builtin.view.disassembler.sh.sh3": "",
"hex.builtin.view.disassembler.sh.sh4": "",
"hex.builtin.view.disassembler.sh.sh4a": "",
"hex.builtin.view.disassembler.sh.fpu": "",
"hex.builtin.view.disassembler.sh.dsp": "",
"hex.builtin.view.disassembler.tricore.110": "",
"hex.builtin.view.disassembler.tricore.120": "",
"hex.builtin.view.disassembler.tricore.130": "",
"hex.builtin.view.disassembler.tricore.131": "",
"hex.builtin.view.disassembler.tricore.160": "",
"hex.builtin.view.disassembler.tricore.161": "",
"hex.builtin.view.disassembler.tricore.162": "",
"hex.builtin.view.disassembler.name": "逆アセンブラ",
"hex.builtin.view.disassembler.position": "位置",
"hex.builtin.view.disassembler.ppc.booke": "Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "",
"hex.builtin.view.disassembler.ppc.spe": "信号処理エンジン",
"hex.builtin.view.disassembler.region": "コード領域",
"hex.builtin.view.disassembler.riscv.compressed": "圧縮済み",
"hex.builtin.view.disassembler.settings.mode": "モード",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "16進数",
"hex.builtin.view.find.binary_pattern.alignment": "",
"hex.builtin.view.find.context.copy": "値をコピー",
@@ -979,19 +802,6 @@
"hex.builtin.view.theme_manager.save_theme": "",
"hex.builtin.view.theme_manager.styles": "",
"hex.builtin.view.tools.name": "ツール",
"hex.builtin.view.yara.error": "Yaraコンパイルエラー: {0}",
"hex.builtin.view.yara.header.matches": "マッチ結果",
"hex.builtin.view.yara.header.rules": "ルール",
"hex.builtin.view.yara.match": "検出",
"hex.builtin.view.yara.matches.identifier": "識別子",
"hex.builtin.view.yara.matches.variable": "変数",
"hex.builtin.view.yara.matching": "マッチ中…",
"hex.builtin.view.yara.name": "Yaraルール",
"hex.builtin.view.yara.no_rules": "YARAルールが見つかりませんでした。ImHexの'yara'フォルダ内に入れてください",
"hex.builtin.view.yara.reload": "リロード",
"hex.builtin.view.yara.reset": "",
"hex.builtin.view.yara.rule_added": "Yaraルールが追加されました。",
"hex.builtin.view.yara.whole_data": "ファイル全体が一致します。",
"hex.builtin.visualizer.binary": "",
"hex.builtin.visualizer.decimal.signed.16bit": "符号付き整数型 (16 bits)",
"hex.builtin.visualizer.decimal.signed.32bit": "符号付き整数型 (32 bits)",

View File

@@ -63,76 +63,6 @@
"hex.builtin.command.cmd.result": "'{0}' 명령 실행",
"hex.builtin.command.web.desc": "웹사이트 탐색",
"hex.builtin.command.web.result": "'{0}'(으)로 이동",
"hex.builtin.common.address": "주소",
"hex.builtin.common.allow": "허용",
"hex.builtin.common.begin": "시작",
"hex.builtin.common.big": "빅",
"hex.builtin.common.big_endian": "빅 엔디언",
"hex.builtin.common.browse": "찾아보기...",
"hex.builtin.common.bytes": "바이트",
"hex.builtin.common.cancel": "취소",
"hex.builtin.common.choose_file": "파일 선택",
"hex.builtin.common.close": "닫기",
"hex.builtin.common.comment": "주석",
"hex.builtin.common.count": "개수",
"hex.builtin.common.decimal": "10진수",
"hex.builtin.common.deny": "거부",
"hex.builtin.common.dont_show_again": "다시 보지 않기",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "끝",
"hex.builtin.common.endian": "엔디언",
"hex.builtin.common.warning": "경고",
"hex.builtin.common.error": "오류",
"hex.builtin.common.fatal": "치명적 오류",
"hex.builtin.common.file": "파일",
"hex.builtin.common.filter": "필터",
"hex.builtin.common.hexadecimal": "16진수",
"hex.builtin.common.info": "정보",
"hex.builtin.common.instruction": "지침",
"hex.builtin.common.link": "링크",
"hex.builtin.common.little": "리틀",
"hex.builtin.common.little_endian": "리틀 엔디언",
"hex.builtin.common.load": "불러오기",
"hex.builtin.common.match_selection": "선택 영역 일치",
"hex.builtin.common.name": "이름",
"hex.builtin.common.no": "아니요",
"hex.builtin.common.number_format": "포맷",
"hex.builtin.common.octal": "8진수",
"hex.builtin.common.offset": "오프셋",
"hex.builtin.common.okay": "확인",
"hex.builtin.common.open": "열기",
"hex.builtin.common.percentage": "비율",
"hex.builtin.common.processing": "작업 중",
"hex.builtin.common.project": "프로젝트",
"hex.builtin.common.question": "질문",
"hex.builtin.common.range": "범위",
"hex.builtin.common.range.entire_data": "전체 데이터",
"hex.builtin.common.range.selection": "선택 영역",
"hex.builtin.common.region": "영역",
"hex.builtin.common.reset": "재설정",
"hex.builtin.common.set": "설정",
"hex.builtin.common.settings": "설정",
"hex.builtin.common.size": "크기",
"hex.builtin.common.type": "유형",
"hex.builtin.common.type.f32": "플로트",
"hex.builtin.common.type.f64": "더블",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "값",
"hex.builtin.common.yes": "예",
"hex.builtin.hash.crc.iv": "초기 값",
"hex.builtin.hash.crc.poly": "다항식",
"hex.builtin.hash.crc.refl_in": "입력에 반영",
@@ -150,18 +80,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "ASCII 열 표시",
"hex.builtin.hex_editor.custom_encoding_view": "추가 디코딩 열 표시",
"hex.builtin.hex_editor.human_readable_units_footer": "크기를 사람이 읽을 수 있는 단위로 변환",
"hex.builtin.hex_editor.data_size": "데이터 크기",
"hex.builtin.hex_editor.gray_out_zero": "00을 회색으로 표시",
"hex.builtin.hex_editor.no_bytes": "바이트가 없습니다",
"hex.builtin.hex_editor.page": "페이지",
"hex.builtin.hex_editor.region": "영역",
"hex.builtin.hex_editor.selection": "선택 영역",
"hex.builtin.hex_editor.selection.none": "없음",
"hex.builtin.hex_editor.uppercase_hex": "16진수 값을 대문자로 표시",
"hex.builtin.hex_editor.visualizer": "데이터 시각화",
"hex.builtin.inspector.ascii": "ASCII 문자",
"hex.builtin.inspector.binary": "2진수 (8비트)",
"hex.builtin.inspector.bool": "부울",
@@ -422,31 +340,13 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "RGBA8 이미지 시각화",
"hex.builtin.nodes.visualizer.layered_dist": "계층적 분포",
"hex.builtin.nodes.visualizer.layered_dist.header": "계층적 분포",
"hex.builtin.pattern_drawer.color": "색상",
"hex.builtin.pattern_drawer.double_click": "더 많은 항목을 보려면 두 번 클릭",
"hex.builtin.pattern_drawer.end": "",
"hex.builtin.pattern_drawer.export": "다른 이름으로 패턴 내보내기...",
"hex.builtin.pattern_drawer.favorites": "즐겨찾기",
"hex.builtin.pattern_drawer.local": "로컬",
"hex.builtin.pattern_drawer.size": "크기",
"hex.builtin.pattern_drawer.spec_name": "명세 이름 표시",
"hex.builtin.pattern_drawer.start": "시작",
"hex.builtin.pattern_drawer.tree_style.tree": "트리",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "자동 확장 트리",
"hex.builtin.pattern_drawer.tree_style.flattened": "접기",
"hex.builtin.pattern_drawer.type": "유형",
"hex.builtin.pattern_drawer.updating": "패턴 업데이트 중...",
"hex.builtin.pattern_drawer.value": "값",
"hex.builtin.pattern_drawer.var_name": "이름",
"hex.builtin.pattern_drawer.visualizer.unknown": "알 수 없는 시각화",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "잘못된 매개변수 수",
"hex.builtin.pl_visualizer.3d.rotation": "회전",
"hex.builtin.pl_visualizer.3d.scale": "배율",
"hex.builtin.pl_visualizer.coordinates.latitude": "위도",
"hex.builtin.pl_visualizer.coordinates.longitude": "경도",
"hex.builtin.pl_visualizer.coordinates.query": "주소 찾기",
"hex.builtin.pl_visualizer.coordinates.querying": "주소 쿼리 중...",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "찾은 주소가 없습니다",
"hex.visualizers.pl_visualizer.3d.rotation": "회전",
"hex.visualizers.pl_visualizer.3d.scale": "배율",
"hex.visualizers.pl_visualizer.coordinates.latitude": "위도",
"hex.visualizers.pl_visualizer.coordinates.longitude": "경도",
"hex.visualizers.pl_visualizer.coordinates.query": "주소 찾기",
"hex.visualizers.pl_visualizer.coordinates.querying": "주소 쿼리 중...",
"hex.visualizers.pl_visualizer.coordinates.querying_no_address": "찾은 주소가 없습니다",
"hex.builtin.popup.close_provider.desc": "이 공급자에 대해 아직 프로젝트에\n저장되지 않은 변경 사항이 있습니다.\n\n정말 종료하시겠습니까?",
"hex.builtin.popup.close_provider.title": "공급자를 종료하시겠습니까?",
"hex.builtin.popup.docs_question.title": "설명서 쿼리",
@@ -714,76 +614,6 @@
"hex.builtin.view.diff.provider_a": "공급자 A",
"hex.builtin.view.diff.provider_b": "공급자 B",
"hex.builtin.view.diff.removed": "제거됨",
"hex.builtin.view.disassembler.16bit": "16비트",
"hex.builtin.view.disassembler.32bit": "32비트",
"hex.builtin.view.disassembler.64bit": "64비트",
"hex.builtin.view.disassembler.arch": "아키텍처",
"hex.builtin.view.disassembler.arm.arm": "ARM",
"hex.builtin.view.disassembler.arm.armv8": "ARMv8",
"hex.builtin.view.disassembler.arm.cortex_m": "Cortex-M",
"hex.builtin.view.disassembler.arm.default": "기본",
"hex.builtin.view.disassembler.arm.thumb": "Thumb",
"hex.builtin.view.disassembler.base": "베이스 주소",
"hex.builtin.view.disassembler.bpf.classic": "클래식",
"hex.builtin.view.disassembler.bpf.extended": "확장",
"hex.builtin.view.disassembler.disassemble": "디스어셈블",
"hex.builtin.view.disassembler.disassembling": "디스어셈블하는 중...",
"hex.builtin.view.disassembler.disassembly.address": "주소",
"hex.builtin.view.disassembler.disassembly.bytes": "바이트",
"hex.builtin.view.disassembler.disassembly.offset": "오프셋",
"hex.builtin.view.disassembler.disassembly.title": "디스어셈블리",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "SH2",
"hex.builtin.view.disassembler.sh.sh2a": "SH2A",
"hex.builtin.view.disassembler.sh.sh3": "SH3",
"hex.builtin.view.disassembler.sh.sh4": "SH4",
"hex.builtin.view.disassembler.sh.sh4a": "SH4A",
"hex.builtin.view.disassembler.sh.fpu": "FPU",
"hex.builtin.view.disassembler.sh.dsp": "DSP",
"hex.builtin.view.disassembler.tricore.110": "110",
"hex.builtin.view.disassembler.tricore.120": "120",
"hex.builtin.view.disassembler.tricore.130": "130",
"hex.builtin.view.disassembler.tricore.131": "131",
"hex.builtin.view.disassembler.tricore.160": "160",
"hex.builtin.view.disassembler.tricore.161": "161",
"hex.builtin.view.disassembler.tricore.162": "162",
"hex.builtin.view.disassembler.name": "디스어셈블러",
"hex.builtin.view.disassembler.position": "위치",
"hex.builtin.view.disassembler.ppc.booke": "Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "쿼드 프로세싱 확장",
"hex.builtin.view.disassembler.ppc.spe": "시그널 프로세싱 엔진",
"hex.builtin.view.disassembler.region": "코드 영역",
"hex.builtin.view.disassembler.riscv.compressed": "압축됨",
"hex.builtin.view.disassembler.settings.mode": "모드",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "바이너리 패턴",
"hex.builtin.view.find.binary_pattern.alignment": "정렬",
"hex.builtin.view.find.context.copy": "값 복사",
@@ -993,19 +823,6 @@
"hex.builtin.view.theme_manager.save_theme": "테마 저장",
"hex.builtin.view.theme_manager.styles": "스타일",
"hex.builtin.view.tools.name": "도구",
"hex.builtin.view.yara.error": "Yara 컴파일러 오류: {0}",
"hex.builtin.view.yara.header.matches": "일치",
"hex.builtin.view.yara.header.rules": "규칙",
"hex.builtin.view.yara.match": "규칙 일치 찾기",
"hex.builtin.view.yara.matches.identifier": "식별자",
"hex.builtin.view.yara.matches.variable": "변수",
"hex.builtin.view.yara.matching": "검색 중...",
"hex.builtin.view.yara.name": "Yara 규칙",
"hex.builtin.view.yara.no_rules": "Yara 규칙이 없습니다. ImHex의 'yara' 폴더에 Yara 규칙을 넣으세요",
"hex.builtin.view.yara.reload": "새로 고침",
"hex.builtin.view.yara.reset": "재설정",
"hex.builtin.view.yara.rule_added": "Yara 규칙 추가됨!",
"hex.builtin.view.yara.whole_data": "모든 파일을 검색했습니다!",
"hex.builtin.visualizer.binary": "2진수",
"hex.builtin.visualizer.decimal.signed.16bit": "부호 있는 10진수 (16비트)",
"hex.builtin.visualizer.decimal.signed.32bit": "부호 있는 10진수 (32비트)",
@@ -1104,7 +921,6 @@
"hex.builtin.view.help.about.release_notes": "릴리스 노트",
"hex.builtin.menu.file.export.as_language": "텍스트 형식 바이트",
"hex.builtin.view.help.about.commits": "커밋 기록",
"hex.builtin.common.loading": "불러오는 중...",
"hex.builtin.undo_operation.remove": "{0} 제거",
"hex.builtin.view.find.shortcut.select_all": "모든 발생 선택",
"hex.builtin.view.hex_editor.menu.edit.cut": "자르기",
@@ -1153,18 +969,8 @@
"hex.builtin.view.pattern_editor.shortcut.step_debugger": "스텝 디버거",
"hex.builtin.welcome.learn.achievements.title": "도전 과제 진행 상황",
"hex.builtin.welcome.learn.achievements.desc": "모든 도전 과제를 완료하여 ImHex의 사용 방법을 알아보세요",
"hex.builtin.common.remove": "제거",
"hex.builtin.common.edit": "편집",
"hex.builtin.popup.blocking_task.desc": "현재 작업을 실행 중입니다.",
"hex.builtin.popup.blocking_task.title": "작업 실행 중",
"hex.builtin.pl_visualizer.3d.light_position": "조명 위치",
"hex.builtin.pl_visualizer.3d.ambient_brightness": "주변 밝기",
"hex.builtin.pl_visualizer.3d.diffuse_brightness": "확산 밝기",
"hex.builtin.pl_visualizer.3d.specular_brightness": "반사 밝기",
"hex.builtin.pl_visualizer.3d.object_reflectiveness": "개체 반사도",
"hex.builtin.pl_visualizer.3d.light_color": "조명 색상",
"hex.builtin.pl_visualizer.3d.more_settings": "설정 더 보기",
"hex.builtin.pl_visualizer.3d.texture_file": "텍스처 파일 경로",
"hex.builtin.menu.workspace.layout.lock": "레이아웃 잠금",
"hex.builtin.welcome.drop_file": "시작하려면 여기에 파일을 놓으세요...",
"hex.builtin.command.convert.desc": "단위 변환",

View File

@@ -63,76 +63,6 @@
"hex.builtin.command.cmd.result": "Iniciar Comando '{0}'",
"hex.builtin.command.web.desc": "Website lookup",
"hex.builtin.command.web.result": "Navegar para '{0}'",
"hex.builtin.common.address": "Address",
"hex.builtin.common.allow": "",
"hex.builtin.common.begin": "",
"hex.builtin.common.big": "Big",
"hex.builtin.common.big_endian": "Big Endian",
"hex.builtin.common.browse": "Navegar...",
"hex.builtin.common.bytes": "",
"hex.builtin.common.cancel": "Cancelar",
"hex.builtin.common.choose_file": "Escolher arquivo",
"hex.builtin.common.close": "Fechar",
"hex.builtin.common.comment": "",
"hex.builtin.common.count": "",
"hex.builtin.common.decimal": "Decimal",
"hex.builtin.common.deny": "",
"hex.builtin.common.dont_show_again": "Não Mostrar Novamente",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "",
"hex.builtin.common.endian": "Endian",
"hex.builtin.common.warning": "",
"hex.builtin.common.error": "Erro",
"hex.builtin.common.fatal": "Erro Fatal",
"hex.builtin.common.file": "Arquivo",
"hex.builtin.common.filter": "",
"hex.builtin.common.hexadecimal": "Hexadecimal",
"hex.builtin.common.info": "Informação",
"hex.builtin.common.instruction": "",
"hex.builtin.common.link": "Link",
"hex.builtin.common.little": "Little",
"hex.builtin.common.little_endian": "Little Endian",
"hex.builtin.common.load": "Carregar",
"hex.builtin.common.match_selection": "Seleção de correspondência",
"hex.builtin.common.name": "",
"hex.builtin.common.no": "Não",
"hex.builtin.common.number_format": "Format",
"hex.builtin.common.octal": "Octal",
"hex.builtin.common.offset": "Offset",
"hex.builtin.common.okay": "OK",
"hex.builtin.common.open": "Abrir",
"hex.builtin.common.percentage": "",
"hex.builtin.common.processing": "Processando",
"hex.builtin.common.project": "",
"hex.builtin.common.question": "Question",
"hex.builtin.common.range": "",
"hex.builtin.common.range.entire_data": "",
"hex.builtin.common.range.selection": "",
"hex.builtin.common.region": "Region",
"hex.builtin.common.reset": "",
"hex.builtin.common.set": "Colocar",
"hex.builtin.common.settings": "Configurações",
"hex.builtin.common.size": "Tamanho",
"hex.builtin.common.type": "",
"hex.builtin.common.type.f32": "float",
"hex.builtin.common.type.f64": "double",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "",
"hex.builtin.common.yes": "Sim",
"hex.builtin.hash.crc.iv": "Initial Value",
"hex.builtin.hash.crc.poly": "Polynomial",
"hex.builtin.hash.crc.refl_in": "Reflect In",
@@ -150,18 +80,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "Exibir coluna ASCII",
"hex.builtin.hex_editor.custom_encoding_view": "",
"hex.builtin.hex_editor.human_readable_units_footer": "",
"hex.builtin.hex_editor.data_size": "Tamanho dos Dados",
"hex.builtin.hex_editor.gray_out_zero": "",
"hex.builtin.hex_editor.no_bytes": "Nenhum Byte Disponivel",
"hex.builtin.hex_editor.page": "Pagina",
"hex.builtin.hex_editor.region": "Região",
"hex.builtin.hex_editor.selection": "Seleção",
"hex.builtin.hex_editor.selection.none": "Nenhum",
"hex.builtin.hex_editor.uppercase_hex": "",
"hex.builtin.hex_editor.visualizer": "Visualizador de Dados",
"hex.builtin.inspector.ascii": "ASCII Character",
"hex.builtin.inspector.binary": "Binary (8 bit)",
"hex.builtin.inspector.bool": "bool",
@@ -422,31 +340,6 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "",
"hex.builtin.nodes.visualizer.layered_dist": "Layered Distribution",
"hex.builtin.nodes.visualizer.layered_dist.header": "Layered Distribution",
"hex.builtin.pattern_drawer.color": "Cor",
"hex.builtin.pattern_drawer.double_click": "",
"hex.builtin.pattern_drawer.end": "",
"hex.builtin.pattern_drawer.export": "",
"hex.builtin.pattern_drawer.favorites": "",
"hex.builtin.pattern_drawer.local": "",
"hex.builtin.pattern_drawer.size": "Tamanho",
"hex.builtin.pattern_drawer.spec_name": "",
"hex.builtin.pattern_drawer.start": "",
"hex.builtin.pattern_drawer.tree_style.tree": "",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "",
"hex.builtin.pattern_drawer.tree_style.flattened": "",
"hex.builtin.pattern_drawer.type": "Tipo",
"hex.builtin.pattern_drawer.updating": "",
"hex.builtin.pattern_drawer.value": "Valor",
"hex.builtin.pattern_drawer.var_name": "Nome",
"hex.builtin.pattern_drawer.visualizer.unknown": "",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "",
"hex.builtin.pl_visualizer.3d.rotation": "",
"hex.builtin.pl_visualizer.3d.scale": "",
"hex.builtin.pl_visualizer.coordinates.latitude": "",
"hex.builtin.pl_visualizer.coordinates.longitude": "",
"hex.builtin.pl_visualizer.coordinates.query": "",
"hex.builtin.pl_visualizer.coordinates.querying": "",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "",
"hex.builtin.popup.close_provider.desc": "",
"hex.builtin.popup.close_provider.title": "",
"hex.builtin.popup.docs_question.title": "",
@@ -700,76 +593,6 @@
"hex.builtin.view.diff.provider_a": "",
"hex.builtin.view.diff.provider_b": "",
"hex.builtin.view.diff.removed": "",
"hex.builtin.view.disassembler.16bit": "16-bit",
"hex.builtin.view.disassembler.32bit": "32-bit",
"hex.builtin.view.disassembler.64bit": "64-bit",
"hex.builtin.view.disassembler.arch": "Arquitetura",
"hex.builtin.view.disassembler.arm.arm": "ARM",
"hex.builtin.view.disassembler.arm.armv8": "ARMv8",
"hex.builtin.view.disassembler.arm.cortex_m": "Cortex-M",
"hex.builtin.view.disassembler.arm.default": "Default",
"hex.builtin.view.disassembler.arm.thumb": "Thumb",
"hex.builtin.view.disassembler.base": "Endereço base",
"hex.builtin.view.disassembler.bpf.classic": "Classico",
"hex.builtin.view.disassembler.bpf.extended": "Extendido",
"hex.builtin.view.disassembler.disassemble": "Desmontar",
"hex.builtin.view.disassembler.disassembling": "Desmontando...",
"hex.builtin.view.disassembler.disassembly.address": "Address",
"hex.builtin.view.disassembler.disassembly.bytes": "Byte",
"hex.builtin.view.disassembler.disassembly.offset": "Offset",
"hex.builtin.view.disassembler.disassembly.title": "Disassembly",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "",
"hex.builtin.view.disassembler.sh.sh2a": "",
"hex.builtin.view.disassembler.sh.sh3": "",
"hex.builtin.view.disassembler.sh.sh4": "",
"hex.builtin.view.disassembler.sh.sh4a": "",
"hex.builtin.view.disassembler.sh.fpu": "",
"hex.builtin.view.disassembler.sh.dsp": "",
"hex.builtin.view.disassembler.tricore.110": "",
"hex.builtin.view.disassembler.tricore.120": "",
"hex.builtin.view.disassembler.tricore.130": "",
"hex.builtin.view.disassembler.tricore.131": "",
"hex.builtin.view.disassembler.tricore.160": "",
"hex.builtin.view.disassembler.tricore.161": "",
"hex.builtin.view.disassembler.tricore.162": "",
"hex.builtin.view.disassembler.name": "Desmontador",
"hex.builtin.view.disassembler.position": "Posição",
"hex.builtin.view.disassembler.ppc.booke": "Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "Quad Processing Extensions",
"hex.builtin.view.disassembler.ppc.spe": "Signal Processing Engine",
"hex.builtin.view.disassembler.region": "Região do código",
"hex.builtin.view.disassembler.riscv.compressed": "Compressed",
"hex.builtin.view.disassembler.settings.mode": "Modo",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "",
"hex.builtin.view.find.binary_pattern.alignment": "",
"hex.builtin.view.find.context.copy": "",
@@ -979,19 +802,6 @@
"hex.builtin.view.theme_manager.save_theme": "",
"hex.builtin.view.theme_manager.styles": "",
"hex.builtin.view.tools.name": "Ferramentas",
"hex.builtin.view.yara.error": "Erro do compilador Yara: {0}",
"hex.builtin.view.yara.header.matches": "Combinações",
"hex.builtin.view.yara.header.rules": "Regras",
"hex.builtin.view.yara.match": "Combinar Regras",
"hex.builtin.view.yara.matches.identifier": "Identificador",
"hex.builtin.view.yara.matches.variable": "Variável",
"hex.builtin.view.yara.matching": "Combinando...",
"hex.builtin.view.yara.name": "Regras Yara",
"hex.builtin.view.yara.no_rules": "Nenhuma regra YARA encontrada. Coloque-os na pasta 'yara' do ImHex",
"hex.builtin.view.yara.reload": "Recarregar",
"hex.builtin.view.yara.reset": "",
"hex.builtin.view.yara.rule_added": "Regra Yara Adicionada!",
"hex.builtin.view.yara.whole_data": "O arquivo inteiro corresponde!",
"hex.builtin.visualizer.binary": "",
"hex.builtin.visualizer.decimal.signed.16bit": "Decimal Signed (16 bits)",
"hex.builtin.visualizer.decimal.signed.32bit": "Decimal Signed (32 bits)",

View File

@@ -63,76 +63,6 @@
"hex.builtin.command.cmd.result": "运行指令 '{0}'",
"hex.builtin.command.web.desc": "网站解析",
"hex.builtin.command.web.result": "导航到 '{0}'",
"hex.builtin.common.address": "地址",
"hex.builtin.common.allow": "允许",
"hex.builtin.common.begin": "起始",
"hex.builtin.common.big": "大",
"hex.builtin.common.big_endian": "大端序",
"hex.builtin.common.browse": "浏览...",
"hex.builtin.common.bytes": "字节",
"hex.builtin.common.cancel": "取消",
"hex.builtin.common.choose_file": "选择文件",
"hex.builtin.common.close": "关闭",
"hex.builtin.common.comment": "注释",
"hex.builtin.common.count": "数量",
"hex.builtin.common.decimal": "十进制",
"hex.builtin.common.deny": "拒绝",
"hex.builtin.common.dont_show_again": "不要再次显示",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "末尾",
"hex.builtin.common.endian": "端序",
"hex.builtin.common.warning": "警告",
"hex.builtin.common.error": "错误",
"hex.builtin.common.fatal": "致命错误",
"hex.builtin.common.file": "文件",
"hex.builtin.common.filter": "过滤器",
"hex.builtin.common.hexadecimal": "十六进制",
"hex.builtin.common.info": "信息",
"hex.builtin.common.instruction": "指示",
"hex.builtin.common.link": "链接",
"hex.builtin.common.little": "小",
"hex.builtin.common.little_endian": "小端序",
"hex.builtin.common.load": "加载",
"hex.builtin.common.match_selection": "匹配选择",
"hex.builtin.common.name": "名称",
"hex.builtin.common.no": "否",
"hex.builtin.common.number_format": "数字进制",
"hex.builtin.common.octal": "八进制",
"hex.builtin.common.offset": "偏移",
"hex.builtin.common.okay": "好的",
"hex.builtin.common.open": "打开",
"hex.builtin.common.percentage": "百分比",
"hex.builtin.common.processing": "处理",
"hex.builtin.common.project": "项目",
"hex.builtin.common.question": "问题",
"hex.builtin.common.range": "范围",
"hex.builtin.common.range.entire_data": "所有数据",
"hex.builtin.common.range.selection": "选区",
"hex.builtin.common.region": "区域",
"hex.builtin.common.reset": "重置",
"hex.builtin.common.set": "设置",
"hex.builtin.common.settings": "设置",
"hex.builtin.common.size": "大小",
"hex.builtin.common.type": "类型",
"hex.builtin.common.type.f32": "float",
"hex.builtin.common.type.f64": "double",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "值",
"hex.builtin.common.yes": "是",
"hex.builtin.hash.crc.iv": "初始值",
"hex.builtin.hash.crc.poly": "多项式",
"hex.builtin.hash.crc.refl_in": "输入值取反",
@@ -150,18 +80,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "显示 ASCII 栏",
"hex.builtin.hex_editor.custom_encoding_view": "显示高级解码栏",
"hex.builtin.hex_editor.human_readable_units_footer": "将数据转换为人类可读的单位",
"hex.builtin.hex_editor.data_size": "总大小",
"hex.builtin.hex_editor.gray_out_zero": "显示零字节为灰色",
"hex.builtin.hex_editor.no_bytes": "没有可显示的字节",
"hex.builtin.hex_editor.page": "分页",
"hex.builtin.hex_editor.region": "范围",
"hex.builtin.hex_editor.selection": "选区",
"hex.builtin.hex_editor.selection.none": "未选中",
"hex.builtin.hex_editor.uppercase_hex": "大写十六进制",
"hex.builtin.hex_editor.visualizer": "数据处理器的数据可视化格式",
"hex.builtin.inspector.ascii": "ASCII 字符",
"hex.builtin.inspector.binary": "二进制8 位)",
"hex.builtin.inspector.bool": "bool",
@@ -422,31 +340,6 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "RGBA8 图像可视化",
"hex.builtin.nodes.visualizer.layered_dist": "分层布局",
"hex.builtin.nodes.visualizer.layered_dist.header": "分层布局",
"hex.builtin.pattern_drawer.color": "颜色",
"hex.builtin.pattern_drawer.double_click": "双击查看更多",
"hex.builtin.pattern_drawer.end": "结束",
"hex.builtin.pattern_drawer.export": "导出为...",
"hex.builtin.pattern_drawer.favorites": "收藏",
"hex.builtin.pattern_drawer.local": "本地",
"hex.builtin.pattern_drawer.size": "大小",
"hex.builtin.pattern_drawer.spec_name": "显示标准名称",
"hex.builtin.pattern_drawer.start": "开始",
"hex.builtin.pattern_drawer.tree_style.tree": "树",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "自动展开树",
"hex.builtin.pattern_drawer.tree_style.flattened": "扁平化",
"hex.builtin.pattern_drawer.type": "类型",
"hex.builtin.pattern_drawer.updating": "更新模式中...",
"hex.builtin.pattern_drawer.value": "值",
"hex.builtin.pattern_drawer.var_name": "名称",
"hex.builtin.pattern_drawer.visualizer.unknown": "未知可视化器",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "无效参数数",
"hex.builtin.pl_visualizer.3d.rotation": "旋转",
"hex.builtin.pl_visualizer.3d.scale": "缩放",
"hex.builtin.pl_visualizer.coordinates.latitude": "维度",
"hex.builtin.pl_visualizer.coordinates.longitude": "精度",
"hex.builtin.pl_visualizer.coordinates.query": "查找地址",
"hex.builtin.pl_visualizer.coordinates.querying": "正在查找地址...",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "找不到地址",
"hex.builtin.popup.close_provider.desc": "",
"hex.builtin.popup.close_provider.title": "关闭提供器?",
"hex.builtin.popup.docs_question.title": "查找文档",
@@ -714,76 +607,6 @@
"hex.builtin.view.diff.provider_a": "提供者A",
"hex.builtin.view.diff.provider_b": "提供者B",
"hex.builtin.view.diff.removed": "移除",
"hex.builtin.view.disassembler.16bit": "16 位",
"hex.builtin.view.disassembler.32bit": "32 位",
"hex.builtin.view.disassembler.64bit": "64 位",
"hex.builtin.view.disassembler.arch": "架构",
"hex.builtin.view.disassembler.arm.arm": "ARM",
"hex.builtin.view.disassembler.arm.armv8": "ARMv8",
"hex.builtin.view.disassembler.arm.cortex_m": "Cortex-M",
"hex.builtin.view.disassembler.arm.default": "默认",
"hex.builtin.view.disassembler.arm.thumb": "Thumb",
"hex.builtin.view.disassembler.base": "基地址",
"hex.builtin.view.disassembler.bpf.classic": "传统 BPFcBPF",
"hex.builtin.view.disassembler.bpf.extended": "扩展 BPFeBPF",
"hex.builtin.view.disassembler.disassemble": "反汇编",
"hex.builtin.view.disassembler.disassembling": "反汇编中...",
"hex.builtin.view.disassembler.disassembly.address": "地址",
"hex.builtin.view.disassembler.disassembly.bytes": "字节",
"hex.builtin.view.disassembler.disassembly.offset": "偏移",
"hex.builtin.view.disassembler.disassembly.title": "反汇编",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro MIPS",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "SH2",
"hex.builtin.view.disassembler.sh.sh2a": "SH2A",
"hex.builtin.view.disassembler.sh.sh3": "SH3",
"hex.builtin.view.disassembler.sh.sh4": "SH4",
"hex.builtin.view.disassembler.sh.sh4a": "SH4A",
"hex.builtin.view.disassembler.sh.fpu": "FPU",
"hex.builtin.view.disassembler.sh.dsp": "DSP",
"hex.builtin.view.disassembler.tricore.110": "110",
"hex.builtin.view.disassembler.tricore.120": "120",
"hex.builtin.view.disassembler.tricore.130": "130",
"hex.builtin.view.disassembler.tricore.131": "131",
"hex.builtin.view.disassembler.tricore.160": "160",
"hex.builtin.view.disassembler.tricore.161": "161",
"hex.builtin.view.disassembler.tricore.162": "162",
"hex.builtin.view.disassembler.name": "反汇编",
"hex.builtin.view.disassembler.position": "位置",
"hex.builtin.view.disassembler.ppc.booke": "PowerPC Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "PowerPC 四核处理扩展QPX",
"hex.builtin.view.disassembler.ppc.spe": "PowerPC 单核引擎SPE",
"hex.builtin.view.disassembler.region": "代码范围",
"hex.builtin.view.disassembler.riscv.compressed": "压缩的 RISC-V",
"hex.builtin.view.disassembler.settings.mode": "模式",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "二进制模式",
"hex.builtin.view.find.binary_pattern.alignment": "对齐",
"hex.builtin.view.find.context.copy": "复制值",
@@ -993,19 +816,6 @@
"hex.builtin.view.theme_manager.save_theme": "保存主题",
"hex.builtin.view.theme_manager.styles": "样式",
"hex.builtin.view.tools.name": "工具",
"hex.builtin.view.yara.error": "Yara 编译器错误: {0}",
"hex.builtin.view.yara.header.matches": "匹配",
"hex.builtin.view.yara.header.rules": "规则",
"hex.builtin.view.yara.match": "匹配规则",
"hex.builtin.view.yara.matches.identifier": "标识符",
"hex.builtin.view.yara.matches.variable": "变量",
"hex.builtin.view.yara.matching": "匹配中...",
"hex.builtin.view.yara.name": "Yara 规则",
"hex.builtin.view.yara.no_rules": "没有找到 Yara 规则。请将规则放到 ImHex 的 'yara' 目录下。",
"hex.builtin.view.yara.reload": "重新加载",
"hex.builtin.view.yara.reset": "重置",
"hex.builtin.view.yara.rule_added": "Yara 规则已添加!",
"hex.builtin.view.yara.whole_data": "全文件匹配!",
"hex.builtin.visualizer.binary": "二进制",
"hex.builtin.visualizer.decimal.signed.16bit": "有符号十进制16 位)",
"hex.builtin.visualizer.decimal.signed.32bit": "有符号十进制32 位)",

View File

@@ -63,76 +63,6 @@
"hex.builtin.command.cmd.result": "執行命令 '{0}'",
"hex.builtin.command.web.desc": "網站查詢",
"hex.builtin.command.web.result": "前往 '{0}'",
"hex.builtin.common.address": "位址",
"hex.builtin.common.allow": "允許",
"hex.builtin.common.begin": "起始",
"hex.builtin.common.big": "大",
"hex.builtin.common.big_endian": "大端序",
"hex.builtin.common.browse": "瀏覽...",
"hex.builtin.common.bytes": "位元組",
"hex.builtin.common.cancel": "取消",
"hex.builtin.common.choose_file": "選擇檔案",
"hex.builtin.common.close": "關閉",
"hex.builtin.common.comment": "註解",
"hex.builtin.common.count": "計數",
"hex.builtin.common.decimal": "十進位",
"hex.builtin.common.deny": "拒絕",
"hex.builtin.common.dont_show_again": "不再顯示",
"hex.builtin.common.encoding.ascii": "ASCII",
"hex.builtin.common.encoding.utf16be": "UTF-16BE",
"hex.builtin.common.encoding.utf16le": "UTF-16LE",
"hex.builtin.common.encoding.utf8": "UTF-8",
"hex.builtin.common.end": "結尾",
"hex.builtin.common.endian": "端序",
"hex.builtin.common.warning": "警告",
"hex.builtin.common.error": "錯誤",
"hex.builtin.common.fatal": "嚴重錯誤",
"hex.builtin.common.file": "檔案",
"hex.builtin.common.filter": "篩選",
"hex.builtin.common.hexadecimal": "十六進位",
"hex.builtin.common.info": "資訊",
"hex.builtin.common.instruction": "指令",
"hex.builtin.common.link": "連結",
"hex.builtin.common.little": "小",
"hex.builtin.common.little_endian": "小端序",
"hex.builtin.common.load": "載入",
"hex.builtin.common.match_selection": "符合選取",
"hex.builtin.common.name": "名稱",
"hex.builtin.common.no": "否",
"hex.builtin.common.number_format": "格式",
"hex.builtin.common.octal": "八進位",
"hex.builtin.common.offset": "位移",
"hex.builtin.common.okay": "好",
"hex.builtin.common.open": "開啟",
"hex.builtin.common.percentage": "百分比",
"hex.builtin.common.processing": "正在處理",
"hex.builtin.common.project": "專案",
"hex.builtin.common.question": "問題",
"hex.builtin.common.range": "範圍",
"hex.builtin.common.range.entire_data": "整筆資料",
"hex.builtin.common.range.selection": "所選",
"hex.builtin.common.region": "區域",
"hex.builtin.common.reset": "重設",
"hex.builtin.common.set": "設定",
"hex.builtin.common.settings": "設定",
"hex.builtin.common.size": "大小",
"hex.builtin.common.type": "類型",
"hex.builtin.common.type.f32": "float",
"hex.builtin.common.type.f64": "double",
"hex.builtin.common.type.i16": "int16_t",
"hex.builtin.common.type.i24": "int24_t",
"hex.builtin.common.type.i32": "int32_t",
"hex.builtin.common.type.i48": "int48_t",
"hex.builtin.common.type.i64": "int64_t",
"hex.builtin.common.type.i8": "int8_t",
"hex.builtin.common.type.u16": "uint16_t",
"hex.builtin.common.type.u24": "uint24_t",
"hex.builtin.common.type.u32": "uint32_t",
"hex.builtin.common.type.u48": "uint48_t",
"hex.builtin.common.type.u64": "uint64_t",
"hex.builtin.common.type.u8": "uint8_t",
"hex.builtin.common.value": "數值",
"hex.builtin.common.yes": "是",
"hex.builtin.hash.crc.iv": "初始數值",
"hex.builtin.hash.crc.poly": "多項式",
"hex.builtin.hash.crc.refl_in": "Reflect In",
@@ -150,18 +80,6 @@
"hex.builtin.hash.sha256": "SHA256",
"hex.builtin.hash.sha384": "SHA384",
"hex.builtin.hash.sha512": "SHA512",
"hex.builtin.hex_editor.ascii_view": "顯示 ASCII 欄",
"hex.builtin.hex_editor.custom_encoding_view": "顯示進階解碼欄",
"hex.builtin.hex_editor.human_readable_units_footer": "將大小轉換成較為易讀的單位",
"hex.builtin.hex_editor.data_size": "資料大小",
"hex.builtin.hex_editor.gray_out_zero": "Grey out zeros",
"hex.builtin.hex_editor.no_bytes": "無可用位元組",
"hex.builtin.hex_editor.page": "頁面",
"hex.builtin.hex_editor.region": "區域",
"hex.builtin.hex_editor.selection": "選取",
"hex.builtin.hex_editor.selection.none": "無",
"hex.builtin.hex_editor.uppercase_hex": "十六進位使用大寫字母",
"hex.builtin.hex_editor.visualizer": "資料可視化工具",
"hex.builtin.inspector.ascii": "ASCII 字元",
"hex.builtin.inspector.binary": "二進位 (8 位元)",
"hex.builtin.inspector.bool": "bool",
@@ -422,31 +340,6 @@
"hex.builtin.nodes.visualizer.image_rgba.header": "RGBA8 圖片視覺化工具",
"hex.builtin.nodes.visualizer.layered_dist": "Layered Distribution",
"hex.builtin.nodes.visualizer.layered_dist.header": "Layered Distribution",
"hex.builtin.pattern_drawer.color": "顏色",
"hex.builtin.pattern_drawer.double_click": "點擊兩下以檢視更多項目",
"hex.builtin.pattern_drawer.end": "結尾",
"hex.builtin.pattern_drawer.export": "匯出模式為...",
"hex.builtin.pattern_drawer.favorites": "",
"hex.builtin.pattern_drawer.local": "",
"hex.builtin.pattern_drawer.size": "大小",
"hex.builtin.pattern_drawer.spec_name": "Display specification names",
"hex.builtin.pattern_drawer.start": "起始",
"hex.builtin.pattern_drawer.tree_style.tree": "樹",
"hex.builtin.pattern_drawer.tree_style.auto_expanded": "",
"hex.builtin.pattern_drawer.tree_style.flattened": "",
"hex.builtin.pattern_drawer.type": "類型",
"hex.builtin.pattern_drawer.updating": "正在更新模式...",
"hex.builtin.pattern_drawer.value": "數值",
"hex.builtin.pattern_drawer.var_name": "名稱",
"hex.builtin.pattern_drawer.visualizer.unknown": "",
"hex.builtin.pattern_drawer.visualizer.invalid_parameter_count": "",
"hex.builtin.pl_visualizer.3d.rotation": "",
"hex.builtin.pl_visualizer.3d.scale": "",
"hex.builtin.pl_visualizer.coordinates.latitude": "緯度",
"hex.builtin.pl_visualizer.coordinates.longitude": "經度",
"hex.builtin.pl_visualizer.coordinates.query": "查詢地址",
"hex.builtin.pl_visualizer.coordinates.querying": "正在查詢地址...",
"hex.builtin.pl_visualizer.coordinates.querying_no_address": "找不到地址",
"hex.builtin.popup.close_provider.desc": "",
"hex.builtin.popup.close_provider.title": "關閉提供者?",
"hex.builtin.popup.docs_question.title": "說明文件查詢",
@@ -714,76 +607,6 @@
"hex.builtin.view.diff.provider_a": "提供者 A",
"hex.builtin.view.diff.provider_b": "提供者 B",
"hex.builtin.view.diff.removed": "已移除",
"hex.builtin.view.disassembler.16bit": "16 位元",
"hex.builtin.view.disassembler.32bit": "32 位元",
"hex.builtin.view.disassembler.64bit": "64 位元",
"hex.builtin.view.disassembler.arch": "架構",
"hex.builtin.view.disassembler.arm.arm": "ARM",
"hex.builtin.view.disassembler.arm.armv8": "ARMv8",
"hex.builtin.view.disassembler.arm.cortex_m": "Cortex-M",
"hex.builtin.view.disassembler.arm.default": "預設",
"hex.builtin.view.disassembler.arm.thumb": "Thumb",
"hex.builtin.view.disassembler.base": "基址",
"hex.builtin.view.disassembler.bpf.classic": "經典",
"hex.builtin.view.disassembler.bpf.extended": "擴充",
"hex.builtin.view.disassembler.disassemble": "解譯",
"hex.builtin.view.disassembler.disassembling": "正在反組譯...",
"hex.builtin.view.disassembler.disassembly.address": "位址",
"hex.builtin.view.disassembler.disassembly.bytes": "位元",
"hex.builtin.view.disassembler.disassembly.offset": "位移",
"hex.builtin.view.disassembler.disassembly.title": "反組譯",
"hex.builtin.view.disassembler.m680x.6301": "6301",
"hex.builtin.view.disassembler.m680x.6309": "6309",
"hex.builtin.view.disassembler.m680x.6800": "6800",
"hex.builtin.view.disassembler.m680x.6801": "6801",
"hex.builtin.view.disassembler.m680x.6805": "6805",
"hex.builtin.view.disassembler.m680x.6808": "6808",
"hex.builtin.view.disassembler.m680x.6809": "6809",
"hex.builtin.view.disassembler.m680x.6811": "6811",
"hex.builtin.view.disassembler.m680x.cpu12": "CPU12",
"hex.builtin.view.disassembler.m680x.hcs08": "HCS08",
"hex.builtin.view.disassembler.m68k.000": "000",
"hex.builtin.view.disassembler.m68k.010": "010",
"hex.builtin.view.disassembler.m68k.020": "020",
"hex.builtin.view.disassembler.m68k.030": "030",
"hex.builtin.view.disassembler.m68k.040": "040",
"hex.builtin.view.disassembler.m68k.060": "060",
"hex.builtin.view.disassembler.mips.micro": "Micro",
"hex.builtin.view.disassembler.mips.mips2": "MIPS II",
"hex.builtin.view.disassembler.mips.mips3": "MIPS III",
"hex.builtin.view.disassembler.mips.mips32": "MIPS32",
"hex.builtin.view.disassembler.mips.mips32R6": "MIPS32R6",
"hex.builtin.view.disassembler.mips.mips64": "MIPS64",
"hex.builtin.view.disassembler.mos65xx.6502": "6502",
"hex.builtin.view.disassembler.mos65xx.65816": "65816",
"hex.builtin.view.disassembler.mos65xx.65816_long_m": "65816 Long M",
"hex.builtin.view.disassembler.mos65xx.65816_long_mx": "65816 Long MX",
"hex.builtin.view.disassembler.mos65xx.65816_long_x": "65816 Long X",
"hex.builtin.view.disassembler.mos65xx.65c02": "65C02",
"hex.builtin.view.disassembler.mos65xx.w65c02": "W65C02",
"hex.builtin.view.disassembler.sh.sh2": "SH2",
"hex.builtin.view.disassembler.sh.sh2a": "SH2A",
"hex.builtin.view.disassembler.sh.sh3": "SH3",
"hex.builtin.view.disassembler.sh.sh4": "SH4",
"hex.builtin.view.disassembler.sh.sh4a": "SH4A",
"hex.builtin.view.disassembler.sh.fpu": "FPU",
"hex.builtin.view.disassembler.sh.dsp": "DSP",
"hex.builtin.view.disassembler.tricore.110": "110",
"hex.builtin.view.disassembler.tricore.120": "120",
"hex.builtin.view.disassembler.tricore.130": "130",
"hex.builtin.view.disassembler.tricore.131": "131",
"hex.builtin.view.disassembler.tricore.160": "160",
"hex.builtin.view.disassembler.tricore.161": "161",
"hex.builtin.view.disassembler.tricore.162": "162",
"hex.builtin.view.disassembler.name": "反組譯器",
"hex.builtin.view.disassembler.position": "位置",
"hex.builtin.view.disassembler.ppc.booke": "Book-E",
"hex.builtin.view.disassembler.ppc.qpx": "Quad Processing Extensions",
"hex.builtin.view.disassembler.ppc.spe": "訊號處理引擎",
"hex.builtin.view.disassembler.region": "程式碼區域",
"hex.builtin.view.disassembler.riscv.compressed": "Compressed",
"hex.builtin.view.disassembler.settings.mode": "模式",
"hex.builtin.view.disassembler.sparc.v9": "Sparc V9",
"hex.builtin.view.find.binary_pattern": "二進位模式",
"hex.builtin.view.find.binary_pattern.alignment": "",
"hex.builtin.view.find.context.copy": "複製數值",
@@ -993,19 +816,6 @@
"hex.builtin.view.theme_manager.save_theme": "儲存主題",
"hex.builtin.view.theme_manager.styles": "樣式",
"hex.builtin.view.tools.name": "工具",
"hex.builtin.view.yara.error": "Yara 編譯器錯誤:",
"hex.builtin.view.yara.header.matches": "Matches",
"hex.builtin.view.yara.header.rules": "規則",
"hex.builtin.view.yara.match": "Match Rules",
"hex.builtin.view.yara.matches.identifier": "識別碼",
"hex.builtin.view.yara.matches.variable": "變數",
"hex.builtin.view.yara.matching": "Matching...",
"hex.builtin.view.yara.name": "Yara 規則",
"hex.builtin.view.yara.no_rules": "找不到 YARA 規則。請放進 ImHex 的 'yara' 資料夾中",
"hex.builtin.view.yara.reload": "重新載入",
"hex.builtin.view.yara.reset": "重設",
"hex.builtin.view.yara.rule_added": " Yara 規則已新增!",
"hex.builtin.view.yara.whole_data": "Whole file matches!",
"hex.builtin.visualizer.binary": "",
"hex.builtin.visualizer.decimal.signed.16bit": "十進位有號數 (16 位元)",
"hex.builtin.visualizer.decimal.signed.32bit": "十進位有號數 (32 位元)",

View File

@@ -55,7 +55,7 @@ Pos=-1889,-120
Size=510,420
Collapsed=0
[Window][###hex.builtin.view.yara.name]
[Window][###hex.yara_rules.view.yara.name]
Pos=720,38
Size=560,660
Collapsed=0
@@ -127,7 +127,7 @@ Pos=419,-124
Size=652,660
Collapsed=0
[Window][###hex.builtin.view.disassembler.name]
[Window][###hex.disassembler.view.disassembler.name]
Pos=1004,-204
Size=1336,1320
Collapsed=0
@@ -150,7 +150,7 @@ hex.builtin.view.constants.name=0
hex.builtin.view.data_inspector.name=1
hex.builtin.view.data_processor.name=0
hex.builtin.view.diff.name=0
hex.builtin.view.disassembler.name=0
hex.disassembler.view.disassembler.name=0
hex.builtin.view.find.name=0
hex.builtin.view.hashes.name=0
hex.builtin.view.help.about.name=0
@@ -164,5 +164,5 @@ hex.builtin.view.settings.name=0
hex.builtin.view.store.name=0
hex.builtin.view.theme_manager.name=0
hex.builtin.view.tools.name=0
hex.builtin.view.yara.name=0
hex.yara_rules.view.yara.name=0
hex.windows.view.tty_console.name=0

View File

@@ -55,7 +55,7 @@ Pos=-1889,-120
Size=510,420
Collapsed=0
[Window][###hex.builtin.view.yara.name]
[Window][###hex.yara_rules.view.yara.name]
Pos=720,38
Size=560,660
Collapsed=0
@@ -127,7 +127,7 @@ Pos=419,-124
Size=652,660
Collapsed=0
[Window][###hex.builtin.view.disassembler.name]
[Window][###hex.disassembler.view.disassembler.name]
Pos=1004,-204
Size=1336,1320
Collapsed=0
@@ -151,7 +151,7 @@ hex.builtin.view.constants.name=0
hex.builtin.view.data_inspector.name=0
hex.builtin.view.data_processor.name=0
hex.builtin.view.diff.name=0
hex.builtin.view.disassembler.name=0
hex.disassembler.view.disassembler.name=0
hex.builtin.view.find.name=0
hex.builtin.view.hashes.name=0
hex.builtin.view.help.about.name=0
@@ -167,7 +167,7 @@ hex.builtin.view.settings.name=0
hex.builtin.view.store.name=0
hex.builtin.view.theme_manager.name=0
hex.builtin.view.tools.name=0
hex.builtin.view.yara.name=0
hex.yara_rules.view.yara.name=0
hex.windows.view.tty_console.name=0
hex.builtin.tools.demangler=0
hex.builtin.tools.ascii_table=0

View File

@@ -1,81 +0,0 @@
Creative Commons Attribution 2.0
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
a. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
b. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
c. "Licensor" means the individual or entity that offers the Work under the terms of this License.
d. "Original Author" means the individual or entity who created the Work.
e. "Work" means the copyrightable work of authorship offered under the terms of this License.
f. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
a. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
b. to create and reproduce Derivative Works;
c. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
d. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
e. For the avoidance of doubt, where the work is a musical composition:
i. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
ii. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
f. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
a. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
b. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
b. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
a. Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
b. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
c. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
d. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
e. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
Creative Commons may be contacted at http://creativecommons.org/.

View File

@@ -1,40 +0,0 @@
#version 330 core
in VertexData {
vec3 normal;
vec4 fragColor;
vec2 texCoord;
vec3 lightPosition;
vec3 fragPosition;
vec4 lightBrightness;
vec3 lightColor;
} vertexData;
out vec4 outColor;
uniform sampler2D modelTexture;
void main() {
vec3 ambientLightColor = vec3(1.0, 1.0, 1.0);
// Ambient lighting
vec3 ambient = vertexData.lightBrightness.x * ambientLightColor;
// Diffuse lighting
vec3 normalVector = normalize(vertexData.normal);
vec3 lightDirection = normalize(vertexData.lightPosition - vertexData.fragPosition);
float diffuse = vertexData.lightBrightness.y * max(dot(normalVector, lightDirection), 0.0);
// Specular lighting
vec3 viewDirection = normalize(-vertexData.fragPosition);
vec3 reflectDirection = normalize(-reflect(lightDirection, normalVector));
float reflectionIntensity = pow(max(dot(viewDirection, reflectDirection), 0.0), vertexData.lightBrightness.w);
float specular = vertexData.lightBrightness.z * reflectionIntensity;
float dst = distance(vertexData.lightPosition, vertexData.fragPosition);
float attn = 1./(1.0f + 0.1f*dst + 0.01f*dst*dst) ;
vec3 color = ((diffuse + specular)*attn + ambient) * vertexData.lightColor;
outColor = (texture(modelTexture, vertexData.texCoord) + vertexData.fragColor) * vec4(color, 1.0);
}

View File

@@ -1,22 +0,0 @@
#version 330
in VertexData {
vec3 normal;
vec4 color;
vec3 fragPosition;
} vertexData;
out vec4 outColor;
void main() {
vec3 nLight = normalize(-vertexData.fragPosition);
vec3 nNormal = normalize(vertexData.normal);
float dotLN = dot(nLight, nNormal);
float diffuse = dotLN * 0.5;
vec3 color = (diffuse+0.7)*vertexData.color.xyz;
outColor = vec4(color, 1.0f);
}

View File

@@ -1,27 +0,0 @@
#version 330
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
layout (location = 0) in vec3 in_Position;
layout (location = 1) in vec3 in_Normal;
layout (location = 2) in vec4 in_Color;
out VertexData {
vec3 normal;
vec4 color;
vec3 fragPosition;
} vertexData;
void main() {
vertexData.normal = (modelMatrix * vec4(in_Normal,0)).xyz;
//vertexData.normal = mat3(transpose(inverse(modelMatrix))) * in_Normal;
//vertexData.fragPosition = (viewMatrix * modelMatrix * vec4(in_Position, 1.0)).xyz;
vertexData.fragPosition = (modelMatrix * vec4(in_Position, 1.0)).xyz;
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(in_Position, 1.0);
vertexData.color = in_Color;
}

View File

@@ -1,8 +0,0 @@
#version 330 core
in vec4 fragColor;
out vec4 outColor;
void main() {
outColor = fragColor;
}

View File

@@ -1,15 +0,0 @@
#version 330 core
layout (location = 0) in vec3 in_Position;
layout (location = 1) in vec4 in_Color;
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
out vec4 fragColor;
void main() {
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(in_Position, 1.0);
fragColor = in_Color;
}

View File

@@ -1,39 +0,0 @@
#version 330 core
layout (location = 0) in vec3 in_Position;
layout (location = 1) in vec4 in_Color;
layout (location = 2) in vec3 in_Normal;
layout (location = 3) in vec2 in_TexCoord;
uniform mat4 modelScale;
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
uniform vec3 lightPosition;
uniform vec4 lightBrightness;
uniform vec3 lightColor;
out VertexData {
vec3 normal;
vec4 fragColor;
vec2 texCoord;
vec3 lightPosition;
vec3 fragPosition;
vec4 lightBrightness;
vec3 lightColor;
} vertexData;
void main() {
gl_Position = projectionMatrix * viewMatrix * modelScale * vec4(in_Position, 1.0);
vertexData.normal = mat3(transpose(inverse(modelScale))) * in_Normal;
vertexData.fragPosition = vec3(viewMatrix * modelScale * vec4(in_Position, 1.0));
vertexData.fragColor = in_Color;
vertexData.texCoord = in_TexCoord;
vertexData.lightBrightness = lightBrightness;
vertexData.lightColor = lightColor;
// Transform world-space light position to view-space light position
vertexData.lightPosition = vec3(viewMatrix * modelMatrix * vec4(lightPosition, 1.0));
}

View File

@@ -4,8 +4,8 @@
#include <hex/helpers/crypto.hpp>
#include <content/popups/popup_notification.hpp>
#include <content/popups/popup_text_input.hpp>
#include <popups/popup_notification.hpp>
#include <popups/popup_text_input.hpp>
#include <nlohmann/json.hpp>
#include <romfs/romfs.hpp>
@@ -276,11 +276,11 @@ namespace hex::plugin::builtin {
if (password.empty())
achievement.setUnlocked(true);
else
PopupTextInput::open("Enter Password", "Enter the password to unlock this achievement", [password, &achievement](const std::string &input) {
ui::PopupTextInput::open("Enter Password", "Enter the password to unlock this achievement", [password, &achievement](const std::string &input) {
if (input == password)
achievement.setUnlocked(true);
else
PopupInfo::open("The password you entered was incorrect.");
ui::PopupInfo::open("The password you entered was incorrect.");
});
});
@@ -301,7 +301,7 @@ namespace hex::plugin::builtin {
return false;
}
PopupInfo::open(challengeDescription);
ui::PopupInfo::open(challengeDescription);
return true;

View File

@@ -197,7 +197,7 @@ namespace hex::plugin::builtin {
class NodeBufferPatch : public dp::Node {
public:
NodeBufferPatch() : Node("hex.builtin.nodes.buffer.patch.header", { dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.input"), dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Buffer, "hex.builtin.nodes.buffer.patch.input.patch"), dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Integer, "hex.builtin.common.address"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.output") }) { }
NodeBufferPatch() : Node("hex.builtin.nodes.buffer.patch.header", { dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.input"), dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Buffer, "hex.builtin.nodes.buffer.patch.input.patch"), dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Integer, "hex.ui.common.address"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.output") }) { }
void process() override {
auto buffer = this->getBufferOnInput(0);

View File

@@ -14,8 +14,8 @@
#include <wolv/io/fs.hpp>
#include <wolv/utils/string.hpp>
#include <content/popups/popup_notification.hpp>
#include <content/popups/popup_question.hpp>
#include <popups/popup_notification.hpp>
#include <popups/popup_question.hpp>
#include <content/popups/popup_tasks_waiting.hpp>
#include <content/popups/popup_unsaved_changes.hpp>
@@ -26,7 +26,7 @@ namespace hex::plugin::builtin {
if (auto *fileProvider = dynamic_cast<FileProvider*>(provider); fileProvider != nullptr) {
fileProvider->setPath(path);
if (!provider->open() || !provider->isAvailable()) {
PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage()));
ui::PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage()));
TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); });
} else {
EventProviderOpened::post(fileProvider);
@@ -41,7 +41,7 @@ namespace hex::plugin::builtin {
imhexClosing = false;
if (ImHexApi::Provider::isDirty() && !imhexClosing) {
glfwSetWindowShouldClose(window, GLFW_FALSE);
PopupQuestion::open("hex.builtin.popup.exit_application.desc"_lang,
ui::PopupQuestion::open("hex.builtin.popup.exit_application.desc"_lang,
[] {
imhexClosing = true;
for (const auto &provider : auto(ImHexApi::Provider::getProviders()))
@@ -104,7 +104,7 @@ namespace hex::plugin::builtin {
fs::openFileBrowser(fs::DialogMode::Open, { }, [](const auto &path) {
if (path.extension() == ".hexproj") {
if (!ProjectFile::load(path)) {
PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
ui::PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
}
} else {
FileProvider* newProvider = static_cast<FileProvider*>(
@@ -128,7 +128,7 @@ namespace hex::plugin::builtin {
fs::openFileBrowser(fs::DialogMode::Open, { {"Project File", "hexproj"} },
[](const auto &path) {
if (!ProjectFile::load(path)) {
PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
ui::PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
}
});
}
@@ -149,7 +149,7 @@ namespace hex::plugin::builtin {
return;
}
if (!provider->open()) {
PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage()));
ui::PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage()));
TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); });
return;
}
@@ -158,7 +158,7 @@ namespace hex::plugin::builtin {
}
else if (!provider->hasLoadInterface()) {
if (!provider->open() || !provider->isAvailable()) {
PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage()));
ui::PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage()));
TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); });
return;
}
@@ -172,22 +172,22 @@ namespace hex::plugin::builtin {
});
RequestOpenInfoPopup::subscribe([](const std::string &message) {
PopupInfo::open(message);
ui::PopupInfo::open(message);
});
RequestOpenErrorPopup::subscribe([](const std::string &message) {
PopupError::open(message);
ui::PopupError::open(message);
});
RequestOpenFatalPopup::subscribe([](const std::string &message) {
PopupFatal::open(message);
ui::PopupFatal::open(message);
});
fs::setFileBrowserErrorCallback([](const std::string& errMsg){
#if defined(NFD_PORTAL)
PopupError::open(hex::format("hex.builtin.popup.error.file_dialog.portal"_lang, errMsg));
ui::PopupError::open(hex::format("hex.builtin.popup.error.file_dialog.portal"_lang, errMsg));
#else
PopupError::open(hex::format("hex.builtin.popup.error.file_dialog.common"_lang, errMsg));
ui::PopupError::open(hex::format("hex.builtin.popup.error.file_dialog.common"_lang, errMsg));
#endif
});

View File

@@ -3,7 +3,7 @@
#include <hex/api/project_file_manager.hpp>
#include <hex/helpers/logger.hpp>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
#include <wolv/utils/string.hpp>
@@ -13,7 +13,7 @@ namespace hex::plugin::builtin {
fs::openFileBrowser(fs::DialogMode::Open, { {"Project File", "hexproj"} },
[](const auto &path) {
if (!ProjectFile::load(path)) {
PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
ui::PopupError::open(hex::format("hex.builtin.popup.error.project.load"_lang, wolv::util::toUTF8String(path)));
}
});
}
@@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
void saveProject() {
if (ImHexApi::Provider::isValid() && ProjectFile::hasPath()) {
if (!ProjectFile::store()) {
PopupError::open("hex.builtin.popup.error.project.save"_lang);
ui::PopupError::open("hex.builtin.popup.error.project.save"_lang);
} else {
log::debug("Project saved");
}
@@ -36,7 +36,7 @@ namespace hex::plugin::builtin {
}
if (!ProjectFile::store(path)) {
PopupError::open("hex.builtin.popup.error.project.save"_lang);
ui::PopupError::open("hex.builtin.popup.error.project.save"_lang);
}
});
}

View File

@@ -1,16 +1,16 @@
#include <hex/helpers/logger.hpp>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
namespace hex::plugin::builtin {
void showError(const std::string& message){
PopupError::open(message);
ui::PopupError::open(message);
log::error(message);
}
void showWarning(const std::string& message){
PopupWarning::open(message);
ui::PopupWarning::open(message);
log::warn(message);
}
}

View File

@@ -14,8 +14,8 @@
#include <hex/helpers/debugging.hpp>
#include <content/global_actions.hpp>
#include <content/popups/popup_notification.hpp>
#include <content/popups/popup_text_input.hpp>
#include <popups/popup_notification.hpp>
#include <popups/popup_text_input.hpp>
#include <hex/api/workspace_manager.hpp>
#include <wolv/io/file.hpp>
@@ -50,19 +50,19 @@ namespace hex::plugin::builtin {
TaskManager::doLater([error]{
switch (error) {
case IPSError::InvalidPatchHeader:
PopupError::open("hex.builtin.menu.file.export.ips.popup.invalid_patch_header_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.ips.popup.invalid_patch_header_error"_lang);
break;
case IPSError::AddressOutOfRange:
PopupError::open("hex.builtin.menu.file.export.ips.popup.address_out_of_range_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.ips.popup.address_out_of_range_error"_lang);
break;
case IPSError::PatchTooLarge:
PopupError::open("hex.builtin.menu.file.export.ips.popup.patch_too_large_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.ips.popup.patch_too_large_error"_lang);
break;
case IPSError::InvalidPatchFormat:
PopupError::open("hex.builtin.menu.file.export.ips.popup.invalid_patch_format_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.ips.popup.invalid_patch_format_error"_lang);
break;
case IPSError::MissingEOF:
PopupError::open("hex.builtin.menu.file.export.ips.popup.missing_eof_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.ips.popup.missing_eof_error"_lang);
break;
}
});
@@ -77,7 +77,7 @@ namespace hex::plugin::builtin {
fs::openFileBrowser(fs::DialogMode::Open, {}, [](const auto &path) {
wolv::io::File inputFile(path, wolv::io::File::Mode::Read);
if (!inputFile.isValid()) {
PopupError::open("hex.builtin.menu.file.import.base64.popup.open_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.import.base64.popup.open_error"_lang);
return;
}
@@ -87,26 +87,26 @@ namespace hex::plugin::builtin {
auto data = crypt::decode64(base64);
if (data.empty())
PopupError::open("hex.builtin.menu.file.import.base64.popup.import_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.import.base64.popup.import_error"_lang);
else {
fs::openFileBrowser(fs::DialogMode::Save, {}, [&data](const std::fs::path &path) {
wolv::io::File outputFile(path, wolv::io::File::Mode::Create);
if (!outputFile.isValid())
PopupError::open("hex.builtin.menu.file.import.base64.popup.import_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.import.base64.popup.import_error"_lang);
outputFile.writeVector(data);
});
}
} else {
PopupError::open("hex.builtin.popup.file_open_error"_lang);
ui::PopupError::open("hex.builtin.popup.file_open_error"_lang);
}
});
}
void importIPSPatch() {
fs::openFileBrowser(fs::DialogMode::Open, {}, [](const auto &path) {
TaskManager::createTask("hex.builtin.common.processing", TaskManager::NoProgress, [path](auto &task) {
TaskManager::createTask("hex.ui.common.processing", TaskManager::NoProgress, [path](auto &task) {
auto patchData = wolv::io::File(path, wolv::io::File::Mode::Read).readVector();
auto patch = Patches::fromIPSPatch(patchData);
if (!patch.has_value()) {
@@ -132,7 +132,7 @@ namespace hex::plugin::builtin {
void importIPS32Patch() {
fs::openFileBrowser(fs::DialogMode::Open, {}, [](const auto &path) {
TaskManager::createTask("hex.builtin.common.processing", TaskManager::NoProgress, [path](auto &task) {
TaskManager::createTask("hex.ui.common.processing", TaskManager::NoProgress, [path](auto &task) {
auto patchData = wolv::io::File(path, wolv::io::File::Mode::Read).readVector();
auto patch = Patches::fromIPS32Patch(patchData);
if (!patch.has_value()) {
@@ -158,12 +158,12 @@ namespace hex::plugin::builtin {
void importModifiedFile() {
fs::openFileBrowser(fs::DialogMode::Open, {}, [](const auto &path) {
TaskManager::createTask("hex.builtin.common.processing", TaskManager::NoProgress, [path](auto &task) {
TaskManager::createTask("hex.ui.common.processing", TaskManager::NoProgress, [path](auto &task) {
auto provider = ImHexApi::Provider::get();
auto patchData = wolv::io::File(path, wolv::io::File::Mode::Read).readVector();
if (patchData.size() != provider->getActualSize()) {
PopupError::open("hex.builtin.menu.file.import.modified_file.popup.invalid_size"_lang);
ui::PopupError::open("hex.builtin.menu.file.import.modified_file.popup.invalid_size"_lang);
return;
}
@@ -199,11 +199,11 @@ namespace hex::plugin::builtin {
void exportBase64() {
fs::openFileBrowser(fs::DialogMode::Save, {}, [](const auto &path) {
TaskManager::createTask("hex.builtin.common.processing", TaskManager::NoProgress, [path](auto &) {
TaskManager::createTask("hex.ui.common.processing", TaskManager::NoProgress, [path](auto &) {
wolv::io::File outputFile(path, wolv::io::File::Mode::Create);
if (!outputFile.isValid()) {
TaskManager::doLater([] {
PopupError::open("hex.builtin.menu.file.export.base64.popup.export_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.base64.popup.export_error"_lang);
});
return;
}
@@ -238,7 +238,7 @@ namespace hex::plugin::builtin {
wolv::io::File file(path, wolv::io::File::Mode::Create);
if (!file.isValid()) {
TaskManager::doLater([] {
PopupError::open("hex.builtin.menu.file.export.as_language.popup.export_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.as_language.popup.export_error"_lang);
});
return;
}
@@ -251,7 +251,7 @@ namespace hex::plugin::builtin {
}
void exportReport() {
TaskManager::createTask("hex.builtin.common.processing", TaskManager::NoProgress, [](auto &) {
TaskManager::createTask("hex.ui.common.processing", TaskManager::NoProgress, [](auto &) {
std::string data;
for (const auto &provider : ImHexApi::Provider::getProviders()) {
@@ -269,7 +269,7 @@ namespace hex::plugin::builtin {
fs::openFileBrowser(fs::DialogMode::Save, { { "Markdown File", "md" }}, [&data](const auto &path) {
auto file = wolv::io::File(path, wolv::io::File::Mode::Create);
if (!file.isValid()) {
PopupError::open("hex.builtin.menu.file.export.report.popup.export_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.report.popup.export_error"_lang);
return;
}
@@ -295,14 +295,14 @@ namespace hex::plugin::builtin {
patches->get().at(0x00454F45) = value;
}
TaskManager::createTask("hex.builtin.common.processing", TaskManager::NoProgress, [patches](auto &) {
TaskManager::createTask("hex.ui.common.processing", TaskManager::NoProgress, [patches](auto &) {
auto data = patches->toIPSPatch();
TaskManager::doLater([data] {
fs::openFileBrowser(fs::DialogMode::Save, {}, [&data](const auto &path) {
auto file = wolv::io::File(path, wolv::io::File::Mode::Create);
if (!file.isValid()) {
PopupError::open("hex.builtin.menu.file.export.ips.popup.export_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.ips.popup.export_error"_lang);
return;
}
@@ -334,14 +334,14 @@ namespace hex::plugin::builtin {
patches->get().at(0x45454F45) = value;
}
TaskManager::createTask("hex.builtin.common.processing", TaskManager::NoProgress, [patches](auto &) {
TaskManager::createTask("hex.ui.common.processing", TaskManager::NoProgress, [patches](auto &) {
auto data = patches->toIPS32Patch();
TaskManager::doLater([data] {
fs::openFileBrowser(fs::DialogMode::Save, {}, [&data](const auto &path) {
auto file = wolv::io::File(path, wolv::io::File::Mode::Create);
if (!file.isValid()) {
PopupError::open("hex.builtin.menu.file.export.ips.popup.export_error"_lang);
ui::PopupError::open("hex.builtin.menu.file.export.ips.popup.export_error"_lang);
return;
}
@@ -542,14 +542,14 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::registerMainMenuItem("hex.builtin.menu.workspace", 4000);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.layout", "hex.builtin.menu.workspace.layout.save" }, 1100, Shortcut::None, [] {
PopupTextInput::open("hex.builtin.popup.save_layout.title", "hex.builtin.popup.save_layout.desc", [](const std::string &name) {
ui::PopupTextInput::open("hex.builtin.popup.save_layout.title", "hex.builtin.popup.save_layout.desc", [](const std::string &name) {
LayoutManager::save(name);
});
}, ImHexApi::Provider::isValid);
ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.layout" }, 1150, [] {
bool locked = LayoutManager::isLayoutLocked();
if (ImGui::MenuItem("hex.builtin.menu.workspace.layout.lock", nullptr, &locked, ImHexApi::Provider::isValid())) {
if (ImGui::MenuItem("hex.builtin.menu.workspace.layout.lock"_lang, nullptr, &locked, ImHexApi::Provider::isValid())) {
LayoutManager::lockLayout(locked);
ContentRegistry::Settings::write("hex.builtin.setting.interface", "hex.builtin.setting.interface.layout_locked", locked);
}
@@ -584,7 +584,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.workspace" }, 3000);
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.workspace", "hex.builtin.menu.workspace.create" }, 3100, Shortcut::None, [] {
PopupTextInput::open("hex.builtin.popup.create_workspace.title", "hex.builtin.popup.create_workspace.desc", [](const std::string &name) {
ui::PopupTextInput::open("hex.builtin.popup.create_workspace.title", "hex.builtin.popup.create_workspace.desc", [](const std::string &name) {
WorkspaceManager::createWorkspace(name);
});
}, ImHexApi::Provider::isValid);

View File

@@ -1,66 +0,0 @@
#include <hex/api/content_registry.hpp>
#include <imgui.h>
#include <pl/patterns/pattern.hpp>
#include <hex/helpers/fmt.hpp>
#include <fonts/codicons_font.h>
namespace hex::plugin::builtin {
namespace {
void drawColorInlineVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments) {
auto r = arguments[0].toFloatingPoint();
auto g = arguments[1].toFloatingPoint();
auto b = arguments[2].toFloatingPoint();
auto a = arguments[3].toFloatingPoint();
ImGui::ColorButton("color", ImVec4(r / 255.0F, g / 255.0F, b / 255.0F, a / 255.0F), ImGuiColorEditFlags_NoTooltip, ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight()));
}
void drawGaugeInlineVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments) {
auto value = arguments[0].toFloatingPoint();
const auto color = ImGui::GetStyleColorVec4(ImGuiCol_Text);
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, ImVec4(color.x, color.y, color.z, 0.2F));
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.0F, 0.0F, 0.0F, 0.0F));
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(color.x, color.y, color.z, 0.5F));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0F);
ImGui::ProgressBar(value / 100.0F, ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight()), "");
ImGui::PopStyleVar(1);
ImGui::PopStyleColor(3);
}
void drawButtonInlineVisualizer(pl::ptrn::Pattern &pattern, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments) {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0.5F));
if (ImGui::Button(hex::format(" {} {}", ICON_VS_PLAY, pattern.getFormattedValue()).c_str(), ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight()))) {
auto *evaluator = pattern.getEvaluator();
const auto functionName = arguments[0].toString(false);
const auto &function = evaluator->findFunction(functionName);
if (function.has_value())
function->func(evaluator, { pattern.clone() });
}
ImGui::PopStyleVar(2);
}
}
void registerPatternLanguageInlineVisualizers() {
using ParamCount = pl::api::FunctionParameterCount;
ContentRegistry::PatternLanguage::addInlineVisualizer("color", drawColorInlineVisualizer, ParamCount::exactly(4));
ContentRegistry::PatternLanguage::addInlineVisualizer("gauge", drawGaugeInlineVisualizer, ParamCount::exactly(1));
ContentRegistry::PatternLanguage::addInlineVisualizer("button", drawButtonInlineVisualizer, ParamCount::exactly(1));
}
}

View File

@@ -1,36 +1,18 @@
#include <hex/api/imhex_api.hpp>
#include <hex/api/content_registry.hpp>
#include <pl/patterns/pattern.hpp>
#include <pl/core/evaluator.hpp>
namespace hex::plugin::builtin {
void drawLinePlotVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawScatterPlotVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawImageVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawBitmapVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawDisassemblyVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void draw3DVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawSoundVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawChunkBasedEntropyVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawHexVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawCoordinateVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawTimestampVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void drawChunkBasedEntropyVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments);
void registerPatternLanguageVisualizers() {
using ParamCount = pl::api::FunctionParameterCount;
ContentRegistry::PatternLanguage::addVisualizer("line_plot", drawLinePlotVisualizer, ParamCount::exactly(1));
ContentRegistry::PatternLanguage::addVisualizer("scatter_plot", drawScatterPlotVisualizer, ParamCount::exactly(2));
ContentRegistry::PatternLanguage::addVisualizer("image", drawImageVisualizer, ParamCount::exactly(1));
ContentRegistry::PatternLanguage::addVisualizer("bitmap", drawBitmapVisualizer, ParamCount::exactly(3));
ContentRegistry::PatternLanguage::addVisualizer("disassembler", drawDisassemblyVisualizer, ParamCount::exactly(4));
ContentRegistry::PatternLanguage::addVisualizer("3d", draw3DVisualizer, ParamCount::between(2, 6));
ContentRegistry::PatternLanguage::addVisualizer("sound", drawSoundVisualizer, ParamCount::exactly(3));
ContentRegistry::PatternLanguage::addVisualizer("hex_viewer", drawHexVisualizer, ParamCount::exactly(1));
ContentRegistry::PatternLanguage::addVisualizer("chunk_entropy", drawChunkBasedEntropyVisualizer, ParamCount::exactly(2));
ContentRegistry::PatternLanguage::addVisualizer("hex_viewer", drawHexVisualizer, ParamCount::exactly(1));
ContentRegistry::PatternLanguage::addVisualizer("coordinates", drawCoordinateVisualizer, ParamCount::exactly(2));
ContentRegistry::PatternLanguage::addVisualizer("timestamp", drawTimestampVisualizer, ParamCount::exactly(1));
}
}
}

View File

@@ -1,908 +0,0 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <fonts/codicons_font.h>
#include <fonts/blendericons_font.h>
#include <imgui.h>
#include <imgui_internal.h>
#include <hex/helpers/opengl.hpp>
#include <opengl_support.h>
#include <GLFW/glfw3.h>
#include <numbers>
#include <hex/ui/imgui_imhex_extensions.h>
#include <hex/api/imhex_api.hpp>
#include <hex/api/localization_manager.hpp>
#include <romfs/romfs.hpp>
namespace hex::plugin::builtin {
namespace {
enum class IndexType {
U8,
U16,
U32,
Invalid,
};
struct Vectors {
std::vector<float> vertices;
std::vector<float> normals;
std::vector<float> colors;
std::vector<float> uv1;
std::vector<u8> indices8;
std::vector<u16> indices16;
std::vector<u32> indices32;
};
struct LineVectors {
std::vector<float> vertices;
std::vector<float> colors;
std::vector<u8> indices8;
std::vector<u16> indices16;
std::vector<u32> indices32;
};
struct Buffers {
gl::Buffer<float> vertices;
gl::Buffer<float> normals;
gl::Buffer<float> colors;
gl::Buffer<float> uv1;
gl::Buffer<u8> indices8;
gl::Buffer<u16> indices16;
gl::Buffer<u32> indices32;
};
struct LineBuffers {
gl::Buffer<float> vertices;
gl::Buffer<float> colors;
gl::Buffer<u8> indices8;
gl::Buffer<u16> indices16;
gl::Buffer<u32> indices32;
};
ImVec2 s_renderingWindowSize;
int s_drawMode = GL_TRIANGLES;
float s_nearLimit = 0.9F;
float s_farLimit = 100.0F;
float s_scaling = 1.0F;
float s_max;
bool s_isPerspective = true;
bool s_drawAxes = true;
bool s_drawGrid = true;
bool s_drawLightSource = true;
bool s_drawTexture = false;
bool s_shouldReset = false;
bool s_shouldUpdateLightSource = true;
bool s_shouldUpdateTexture = false;
IndexType s_indexType;
ImGuiExt::Texture s_modelTexture;
gl::Vector<float, 3> s_translation = { { 0.0F, 0.0F, -3.0F } };
gl::Vector<float, 3> s_rotation = { { 0.0F, 0.0F, 0.0F } };
gl::Vector<float, 3> s_lightPosition = { { -0.7F, 0.0F, 0.0F } };
gl::Vector<float, 4> s_lightBrightness = { { 0.5F, 0.5F, 0.5F, 32.0F } };
gl::Vector<float, 3> s_lightColor = { { 1.0F, 1.0F, 1.0f } };
gl::Matrix<float, 4, 4> s_rotate = gl::Matrix<float, 4, 4>::identity();
ImGuiExt::Texture s_texture;
std::fs::path s_texturePath;
template<typename T>
void indicesForLines(std::vector<T> &vertexIndices) {
std::vector<u32> indices;
u32 vertexCount = vertexIndices.size() / 3;
indices.resize(vertexCount * 6);
for (u32 i = 0; i < vertexCount; ++i) {
indices[i * 6] = vertexIndices[3 * i];
indices[i * 6 + 1] = vertexIndices[3 * i + 1];
indices[i * 6 + 2] = vertexIndices[3 * i + 1];
indices[i * 6 + 3] = vertexIndices[3 * i + 2];
indices[i * 6 + 4] = vertexIndices[3 * i + 2];
indices[i * 6 + 5] = vertexIndices[3 * i];
}
vertexIndices.resize(indices.size());
for (u32 i = 0; i < indices.size(); ++i)
vertexIndices[i] = indices[i];
}
float getBoundingBox(const std::vector<float> &vertices) {
gl::Vector<float, 4> minWorld(std::numeric_limits<float>::infinity()), maxWorld(-std::numeric_limits<float>::infinity());
for (u32 i = 0; i < vertices.size(); i += 3) {
if (vertices[i] < minWorld[0]) minWorld[0] = vertices[i];
if (vertices[i + 1] < minWorld[1]) minWorld[1] = vertices[i + 1];
if (vertices[i + 2] < minWorld[2]) minWorld[2] = vertices[i + 2];
if (vertices[i] > maxWorld[0]) maxWorld[0] = vertices[i];
if (vertices[i + 1] > maxWorld[1]) maxWorld[1] = vertices[i + 1];
if (vertices[i + 2] > maxWorld[2]) maxWorld[2] = vertices[i + 2];
}
minWorld[3] = 1;
maxWorld[3] = 1;
gl::Vector<float, 4> minCamera = minWorld, maxCamera = maxWorld;
if (maxCamera[3] != 0)
maxCamera = maxCamera * (1.0f / maxCamera[3]);
if (minCamera[3] != 0)
minCamera = minCamera * (1.0f / minCamera[3]);
float maxx = std::max(std::fabs(minCamera[0]), std::fabs(maxCamera[0]));
float maxy = std::max(std::fabs(minCamera[1]), std::fabs(maxCamera[1]));
return std::max(maxx, maxy);
}
void setDefaultColors(std::vector<float> &colors, float size, u32 color) {
colors.resize(size / 3 * 4);
float red = float((color >> 0) & 0xFF) / 255.0F;
float green = float((color >> 8) & 0xFF) / 255.0F;
float blue = float((color >> 16) & 0xFF) / 255.0F;
float alpha = float((color >> 24) & 0xFF) / 255.0F;
for (u32 i = 0; i < colors.size(); i += 4) {
colors[i] = red;
colors[i + 1] = green;
colors[i + 2] = blue;
colors[i + 3] = alpha;
}
}
void setNormals(const std::vector<float> &vertices, std::vector<float> &normals) {
for (u32 i = 0; i < normals.size(); i += 9) {
auto v1 = gl::Vector<float, 3>({vertices[i], vertices[i + 1], vertices[i + 2]});
auto v2 = gl::Vector<float, 3>({vertices[i + 3], vertices[i + 4], vertices[i + 5]});
auto v3 = gl::Vector<float, 3>({vertices[i + 6], vertices[i + 7], vertices[i + 8]});
auto normal = ((v2 - v1).cross(v3 - v1));
normals[i] += normal[0];
normals[i + 1] += normal[1];
normals[i + 2] += normal[2];
normals[i + 3] += normal[0];
normals[i + 4] += normal[1];
normals[i + 5] += normal[2];
normals[i + 6] += normal[0];
normals[i + 7] += normal[1];
normals[i + 8] += normal[2];
}
for (u32 i = 0; i < normals.size(); i += 3) {
auto normal = gl::Vector<float, 3>({normals[i], normals[i + 1], normals[i + 2]});
normal.normalize();
normals[i] = normal[0];
normals[i + 1] = normal[1];
normals[i + 2] = normal[2];
}
}
void setNormalsWithIndices(const std::vector<float> &vertices, std::vector<float> &normals, const std::vector<u32> &indices) {
for (u32 i = 0; i < indices.size(); i += 3) {
auto idx = indices[i];
auto idx1 = indices[i + 1];
auto idx2 = indices[i + 2];
auto v1 = gl::Vector<float, 3>({vertices[3 * idx], vertices[3 * idx + 1], vertices[3 * idx + 2]});
auto v2 = gl::Vector<float, 3>(
{vertices[3 * idx1], vertices[3 * idx1 + 1], vertices[3 * idx1 + 2]});
auto v3 = gl::Vector<float, 3>(
{vertices[3 * idx2], vertices[3 * idx2 + 1], vertices[3 * idx2 + 2]});
auto weighted = ((v2 - v1).cross(v3 - v1));
normals[3 * idx] += weighted[0];
normals[3 * idx + 1] += weighted[1];
normals[3 * idx + 2] += weighted[2];
normals[3 * idx1] += weighted[0];
normals[3 * idx1 + 1] += weighted[1];
normals[3 * idx1 + 2] += weighted[2];
normals[3 * idx2] += weighted[0];
normals[3 * idx2 + 1] += weighted[1];
normals[3 * idx2 + 2] += weighted[2];
}
for (u32 i = 0; i < normals.size(); i += 3) {
auto normal = gl::Vector<float, 3>({normals[i], normals[i + 1], normals[i + 2]});
auto mag = normal.magnitude();
if (mag > 0.001F) {
normals[i] = normal[0] / mag;
normals[i + 1] = normal[1] / mag;
normals[i + 2] = normal[2] / mag;
}
}
}
void loadVectors(Vectors &vectors, IndexType indexType) {
s_max = getBoundingBox(vectors.vertices);
if (s_drawTexture)
setDefaultColors(vectors.colors, vectors.vertices.size(), 0x00000000);
else if (vectors.colors.empty())
setDefaultColors(vectors.colors, vectors.vertices.size(), 0xFF337FFF);
if (vectors.normals.empty()) {
vectors.normals.resize(vectors.vertices.size());
if ((indexType == IndexType::U8 && vectors.indices8.empty()) || (indexType == IndexType::Invalid) ||
(indexType == IndexType::U16 && vectors.indices16.empty()) ||
(indexType == IndexType::U32 && vectors.indices32.empty())) {
setNormals(vectors.vertices, vectors.normals);
} else {
std::vector<u32> indices;
if (indexType == IndexType::U16) {
indices.resize(vectors.indices16.size());
for (u32 i = 0; i < vectors.indices16.size(); ++i)
indices[i] = vectors.indices16[i];
} else if (indexType == IndexType::U8) {
indices.resize(vectors.indices8.size());
for (u32 i = 0; i < vectors.indices8.size(); ++i)
indices[i] = vectors.indices8[i];
} else {
indices.resize(vectors.indices32.size());
for (u32 i = 0; i < vectors.indices32.size(); ++i)
indices[i] = vectors.indices32[i];
}
setNormalsWithIndices(vectors.vertices, vectors.normals, indices);
}
}
}
void loadLineVectors(LineVectors &lineVectors, IndexType indexType) {
s_max = getBoundingBox(lineVectors.vertices);
if (lineVectors.colors.empty())
setDefaultColors(lineVectors.colors, lineVectors.vertices.size(), 0xFF337FFF);
std::vector<u32> indices;
if (indexType == IndexType::U8)
indicesForLines(lineVectors.indices8);
else if (indexType == IndexType::U16)
indicesForLines(lineVectors.indices16);
else
indicesForLines(lineVectors.indices32);
}
void processKeyEvent(ImGuiKey key, float &variable, float incr, float accel) {
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(key))) {
auto temp = variable + incr * accel;
if (variable * temp < 0.0F)
variable = 0.0F;
else
variable = temp;
}
}
void processInputEvents(gl::Vector<float, 3> &rotation, gl::Vector<float, 3> &translation, float &scaling, float &nearLimit, float &farLimit) {
auto accel = 1.0F;
if (ImGui::IsKeyDown(ImGui::GetKeyIndex(ImGuiKey_LeftShift)) ||
ImGui::IsKeyDown(ImGui::GetKeyIndex(ImGuiKey_RightShift)))
accel = 10.0F;
auto dragDelta = ImGui::GetMouseDragDelta(ImGuiMouseButton_Middle);
if (dragDelta.x != 0) {
rotation[1] += dragDelta.x * 0.0075F * accel;
}
if (dragDelta.y != 0) {
rotation[0] += dragDelta.y * 0.0075F * accel;
}
ImGui::ResetMouseDragDelta(ImGuiMouseButton_Middle);
dragDelta = ImGui::GetMouseDragDelta(ImGuiMouseButton_Right);
translation[0] += dragDelta.x * 0.0075F * accel;
translation[1] -= dragDelta.y * 0.0075F * accel;
ImGui::ResetMouseDragDelta(ImGuiMouseButton_Right);
auto scrollDelta = ImGui::GetIO().MouseWheel;
scaling += scrollDelta * 0.1F * accel;
if (scaling < 0.01F)
scaling = 0.01F;
processKeyEvent(ImGuiKey_Keypad4, translation[0], -0.1F, accel);
processKeyEvent(ImGuiKey_Keypad6, translation[0], 0.1F, accel);
processKeyEvent(ImGuiKey_Keypad8, translation[1], 0.1F, accel);
processKeyEvent(ImGuiKey_Keypad2, translation[1], -0.1F, accel);
processKeyEvent(ImGuiKey_Keypad1, translation[2], 0.1F, accel);
processKeyEvent(ImGuiKey_Keypad7, translation[2], -0.1F, accel);
processKeyEvent(ImGuiKey_Keypad9, nearLimit, -0.01F, accel);
processKeyEvent(ImGuiKey_Keypad3, nearLimit, 0.01F, accel);
if (ImHexApi::System::isDebugBuild()) {
processKeyEvent(ImGuiKey_KeypadDivide, farLimit, -1.0F, accel);
processKeyEvent(ImGuiKey_KeypadMultiply, farLimit, 1.0F, accel);
}
processKeyEvent(ImGuiKey_KeypadAdd, rotation[2], -0.075F, accel);
processKeyEvent(ImGuiKey_KeypadSubtract, rotation[2], 0.075F, accel);
rotation[2] = std::fmod(rotation[2], 2 * std::numbers::pi);
}
void bindBuffers(Buffers &buffers, const gl::VertexArray &vertexArray, Vectors vectors, IndexType indexType) {
buffers.vertices = {};
buffers.normals = {};
buffers.colors = {};
buffers.uv1 = {};
buffers.indices8 = {};
buffers.indices16 = {};
buffers.indices32 = {};
vertexArray.bind();
buffers.vertices = gl::Buffer<float>(gl::BufferType::Vertex, vectors.vertices);
buffers.colors = gl::Buffer<float>(gl::BufferType::Vertex, vectors.colors);
buffers.normals = gl::Buffer<float>(gl::BufferType::Vertex, vectors.normals);
if (indexType == IndexType::U8)
buffers.indices8 = gl::Buffer<u8>(gl::BufferType::Index, vectors.indices8);
else if (indexType == IndexType::U16)
buffers.indices16 = gl::Buffer<u16>(gl::BufferType::Index, vectors.indices16);
else
buffers.indices32 = gl::Buffer<u32>(gl::BufferType::Index, vectors.indices32);
if (!vectors.uv1.empty())
buffers.uv1 = gl::Buffer<float>(gl::BufferType::Vertex, vectors.uv1);
vertexArray.addBuffer(0, buffers.vertices);
vertexArray.addBuffer(1, buffers.colors, 4);
vertexArray.addBuffer(2, buffers.normals);
if (!vectors.uv1.empty())
vertexArray.addBuffer(3, buffers.uv1, 2);
buffers.vertices.unbind();
buffers.colors.unbind();
buffers.normals.unbind();
if (!vectors.uv1.empty())
buffers.uv1.unbind();
if (indexType == IndexType::U8)
buffers.indices8.unbind();
else if (indexType == IndexType::U16)
buffers.indices16.unbind();
else if (indexType == IndexType::U32)
buffers.indices32.unbind();
vertexArray.unbind();
}
void bindLineBuffers(LineBuffers &lineBuffers, const gl::VertexArray &vertexArray, const LineVectors &lineVectors, IndexType indexType) {
lineBuffers.vertices = {};
lineBuffers.colors = {};
lineBuffers.indices8 = {};
lineBuffers.indices16 = {};
lineBuffers.indices32 = {};
vertexArray.bind();
lineBuffers.vertices = gl::Buffer<float>(gl::BufferType::Vertex, lineVectors.vertices);
lineBuffers.colors = gl::Buffer<float>(gl::BufferType::Vertex, lineVectors.colors);
if (indexType == IndexType::U8)
lineBuffers.indices8 = gl::Buffer<u8>(gl::BufferType::Index, lineVectors.indices8);
else if (indexType == IndexType::U16)
lineBuffers.indices16 = gl::Buffer<u16>(gl::BufferType::Index, lineVectors.indices16);
else
lineBuffers.indices32 = gl::Buffer<u32>(gl::BufferType::Index, lineVectors.indices32);
vertexArray.addBuffer(0, lineBuffers.vertices);
vertexArray.addBuffer(1, lineBuffers.colors, 4);
lineBuffers.vertices.unbind();
lineBuffers.colors.unbind();
if (indexType == IndexType::U8)
lineBuffers.indices8.unbind();
else if (indexType == IndexType::U16)
lineBuffers.indices16.unbind();
else if (indexType == IndexType::U32)
lineBuffers.indices32.unbind();
vertexArray.unbind();
}
void drawWindow(const ImGuiExt::Texture &texture, ImVec2 &renderingWindowSize, const gl::Matrix<float, 4, 4> &mvp) {
auto textureSize = texture.getSize();
auto textureWidth = textureSize.x;
auto textureHeight = textureSize.y;
ImVec2 screenPos = ImGui::GetCursorScreenPos();
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
ImGui::SetNextWindowSizeConstraints(scaled({ 350, 350 }), ImVec2(FLT_MAX, FLT_MAX));
if (ImGui::BeginChild("##image", textureSize, ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY | ImGuiChildFlags_Border, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
renderingWindowSize = ImGui::GetContentRegionAvail();
ImGui::Image(texture, textureSize, ImVec2(0, 1), ImVec2(1, 0));
if (s_drawAxes) {
gl::Matrix<float, 4, 4> axes = gl::Matrix<float, 4, 4>::identity();
axes(0, 3) = 1.0f;
axes(1, 3) = 1.0f;
axes(2, 3) = 1.0f;
axes = axes * mvp;
bool showX = axes(0, 3) > 0.0f;
bool showY = axes(1, 3) > 0.0f;
bool showZ = axes(2, 3) > 0.0f;
axes.updateRow(0, axes.getRow(0) * (1.0f / axes(0, 3)));
axes.updateRow(1, axes.getRow(1) * (1.0f / axes(1, 3)));
axes.updateRow(2, axes.getRow(2) * (1.0f / axes(2, 3)));
auto axesPosx = (axes.getColumn(0) + 1.0f) * (textureWidth / 2.0f);
auto axesPosy = (axes.getColumn(1) + 1.0f) * (-textureHeight / 2.0f) + textureHeight;
ImDrawList *drawList = ImGui::GetWindowDrawList();
if (showX)
drawList->AddText(ImVec2(axesPosx[0], axesPosy[0]) + screenPos, IM_COL32(255, 0, 0, 255), "X");
if (showY)
drawList->AddText(ImVec2(axesPosx[1], axesPosy[1]) + screenPos, IM_COL32(0, 255, 0, 255), "Y");
if (showZ)
drawList->AddText(ImVec2(axesPosx[2], axesPosy[2]) + screenPos, IM_COL32(0, 0, 255, 255), "Z");
}
if (ImHexApi::System::isDebugBuild()) {
auto mousePos = ImClamp(ImGui::GetMousePos() - screenPos, { 0, 0 }, textureSize);
ImDrawList *drawList = ImGui::GetWindowDrawList();
drawList->AddText(
screenPos + scaled({ 5, 5 }),
ImGui::GetColorU32(ImGuiCol_Text),
hex::format("X: {:.5}\nY: {:.5}", mousePos.x, mousePos.y).c_str());
}
}
ImGui::EndChild();
ImGui::PopStyleVar();
// Draw axis arrows toggle
{
ImGui::PushID(1);
if (ImGuiExt::DimmedIconToggle(ICON_BI_EMPTY_ARROWS, &s_drawAxes))
s_shouldReset = true;
ImGui::PopID();
}
ImGui::SameLine();
// Draw grid toggle
{
ImGui::PushID(2);
if (ImGuiExt::DimmedIconToggle(s_isPerspective ? ICON_BI_GRID : ICON_VS_SYMBOL_NUMBER, &s_drawGrid))
s_shouldReset = true;
ImGui::PopID();
}
ImGui::SameLine();
// Draw light source toggle
{
ImGui::PushID(3);
if (ImGuiExt::DimmedIconToggle(ICON_VS_LIGHTBULB, &s_drawLightSource))
s_shouldReset = true;
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
ImGui::OpenPopup("LightSettings");
}
if (ImGui::BeginPopup("LightSettings")) {
if (ImGui::DragFloat3("hex.builtin.pl_visualizer.3d.light_position"_lang, s_lightPosition.data(), 0.05F)) {
s_shouldUpdateLightSource = true;
}
ImGui::SliderFloat("hex.builtin.pl_visualizer.3d.ambient_brightness"_lang, &s_lightBrightness.data()[0], 0, 2);
ImGui::SliderFloat("hex.builtin.pl_visualizer.3d.diffuse_brightness"_lang, &s_lightBrightness.data()[1], 0, 2);
ImGui::SliderFloat("hex.builtin.pl_visualizer.3d.specular_brightness"_lang, &s_lightBrightness.data()[2], 0, 2);
ImGui::SliderFloat("hex.builtin.pl_visualizer.3d.object_reflectiveness"_lang, &s_lightBrightness.data()[3], 0, 64);
if (ImGui::ColorEdit3("hex.builtin.pl_visualizer.3d.light_color"_lang, s_lightColor.data()))
s_shouldUpdateLightSource = true;
ImGui::EndPopup();
}
ImGui::PopID();
}
ImGui::SameLine();
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
ImGui::SameLine();
// Draw projection toggle
{
ImGui::PushID(4);
if (ImGuiExt::DimmedIconToggle(ICON_BI_VIEW_PERSPECTIVE, ICON_BI_VIEW_ORTHO, &s_isPerspective)) {
s_shouldReset = true;
}
ImGui::PopID();
}
ImGui::SameLine();
// Draw solid / line mode toggle
{
ImGui::PushID(4);
bool isSolid = s_drawMode == GL_TRIANGLES;
if (ImGuiExt::DimmedIconToggle(ICON_BI_MOD_SOLIDIFY, ICON_BI_CUBE , &isSolid)) {
s_shouldReset = true;
s_drawMode = isSolid ? GL_TRIANGLES : GL_LINES;
}
ImGui::PopID();
}
ImGui::SameLine();
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
ImGui::SameLine();
if (ImGuiExt::DimmedButton("hex.builtin.common.reset"_lang, ImVec2(ImGui::GetContentRegionAvail().x, 0))) {
s_translation = { { 0.0F, 0.0F, -3.0F } };
s_rotation = { { 0.0F, 0.0F, 0.0F } };
s_scaling = 1.0F;
}
// Draw more settings
if (ImGui::CollapsingHeader("hex.builtin.pl_visualizer.3d.more_settings"_lang)) {
if (ImGuiExt::InputFilePicker("hex.builtin.pl_visualizer.3d.texture_file"_lang, s_texturePath, {}))
s_shouldUpdateTexture = true;
}
}
}
void draw3DVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
static gl::LightSourceVectors sourceVectors(20);
static gl::VertexArray sourceVertexArray = gl::VertexArray();
static gl::LightSourceBuffers sourceBuffers(sourceVertexArray, sourceVectors);
static gl::VertexArray gridVertexArray = gl::VertexArray();
static gl::GridVectors gridVectors(9);
static gl::GridBuffers gridBuffers(gridVertexArray, gridVectors);
static gl::VertexArray axesVertexArray = gl::VertexArray();
static gl::AxesVectors axesVectors;
static gl::AxesBuffers axesBuffers(axesVertexArray, axesVectors);
static gl::VertexArray vertexArray = gl::VertexArray();
static Buffers buffers;
static LineBuffers lineBuffers;
std::shared_ptr<pl::ptrn::Pattern> verticesPattern = arguments[0].toPattern();
std::shared_ptr<pl::ptrn::Pattern> indicesPattern = arguments[1].toPattern();
std::shared_ptr<pl::ptrn::Pattern> normalsPattern = nullptr;
std::shared_ptr<pl::ptrn::Pattern> colorsPattern = nullptr;
std::shared_ptr<pl::ptrn::Pattern> uvPattern1 = nullptr;
std::string textureFile;
if (arguments.size() > 2) {
normalsPattern = arguments[2].toPattern();
if (arguments.size() > 3) {
colorsPattern = arguments[3].toPattern();
if (arguments.size() > 4) {
uvPattern1 = arguments[4].toPattern();
if (arguments.size() > 5)
textureFile = arguments[5].toString();
}
}
}
if (shouldReset)
s_shouldReset = true;
const auto fontSize = ImGui::GetFontSize();
const auto framePad = ImGui::GetStyle().FramePadding;
float minSize = fontSize * 8_scaled + framePad.x * 20_scaled;
minSize = minSize > 200_scaled ? minSize : 200_scaled;
if (s_renderingWindowSize.x <= 0 || s_renderingWindowSize.y <= 0)
s_renderingWindowSize = { minSize, minSize };
if (!textureFile.empty())
s_texturePath = textureFile;
else
s_drawTexture = false;
if (s_renderingWindowSize.x < minSize)
s_renderingWindowSize.x = minSize;
if (s_renderingWindowSize.y < minSize)
s_renderingWindowSize.y = minSize;
gl::Matrix<float, 4, 4> mvp(0);
processInputEvents(s_rotation, s_translation, s_scaling, s_nearLimit, s_farLimit);
if (s_shouldReset) {
s_shouldReset = false;
auto *iterable = dynamic_cast<pl::ptrn::IIterable*>(indicesPattern.get());
if (iterable != nullptr && iterable->getEntryCount() > 0) {
const auto &content = iterable->getEntry(0);
if (content->getSize() == 1) {
s_indexType = IndexType::U8;
} else if (content->getSize() == 2) {
s_indexType = IndexType::U16;
} else if (content->getSize() == 4) {
s_indexType = IndexType::U32;
} else {
s_indexType = IndexType::Invalid;
}
}
if (s_drawMode == GL_TRIANGLES) {
Vectors vectors;
vectors.vertices = patternToArray<float>(verticesPattern.get());
if (s_indexType == IndexType::U16)
vectors.indices16 = patternToArray<u16>(indicesPattern.get());
else if (s_indexType == IndexType::U32)
vectors.indices32 = patternToArray<u32>(indicesPattern.get());
else if (s_indexType == IndexType::U8)
vectors.indices8 = patternToArray<u8>(indicesPattern.get());
if (colorsPattern != nullptr)
vectors.colors = patternToArray<float>(colorsPattern.get());
if (normalsPattern != nullptr)
vectors.normals = patternToArray<float>(normalsPattern.get());
if (uvPattern1 != nullptr)
vectors.uv1 = patternToArray<float>(uvPattern1.get());
loadVectors(vectors, s_indexType);
bindBuffers(buffers, vertexArray, vectors, s_indexType);
} else {
LineVectors lineVectors;
lineVectors.vertices = patternToArray<float>(verticesPattern.get());
if (s_indexType == IndexType::U16)
lineVectors.indices16 = patternToArray<u16>(indicesPattern.get());
else if (s_indexType == IndexType::U32)
lineVectors.indices32 = patternToArray<u32>(indicesPattern.get());
else if (s_indexType == IndexType::U8)
lineVectors.indices8 = patternToArray<u8>(indicesPattern.get());
if (colorsPattern != nullptr)
lineVectors.colors = patternToArray<float>(colorsPattern.get());
loadLineVectors(lineVectors, s_indexType);
bindLineBuffers(lineBuffers, vertexArray, lineVectors, s_indexType);
}
}
if (s_shouldUpdateLightSource) {
s_shouldUpdateLightSource = false;
sourceVectors.moveTo(s_lightPosition);
sourceVectors.setColor(s_lightColor[0], s_lightColor[1], s_lightColor[2]);
sourceBuffers.moveVertices(sourceVertexArray, sourceVectors);
sourceBuffers.updateColors(sourceVertexArray, sourceVectors);
}
{
gl::Matrix<float, 4, 4> model(0);
gl::Matrix<float, 4, 4> scaledModel(0);
gl::Matrix<float, 4, 4> view(0);
gl::Matrix<float, 4, 4> projection(0);
unsigned width = std::floor(s_renderingWindowSize.x);
unsigned height = std::floor(s_renderingWindowSize.y);
gl::FrameBuffer frameBuffer(width, height);
gl::Texture renderTexture(width, height);
frameBuffer.attachTexture(renderTexture);
frameBuffer.bind();
s_rotate = gl::getRotationMatrix<float>(s_rotation, true, gl::RotationSequence::ZYX);
gl::Matrix<float, 4, 4> scale = gl::Matrix<float, 4, 4>::identity();
gl::Matrix<float, 4, 4> scaleForVertices = gl::Matrix<float, 4, 4>::identity();
gl::Matrix<float, 4, 4> translate = gl::Matrix<float, 4, 4>::identity();
float totalScale;
float viewWidth = s_renderingWindowSize.x / 500.0f;
float viewHeight = s_renderingWindowSize.y / 500.0f;
glViewport(0,0 , GLsizei(renderTexture.getWidth()), GLsizei(renderTexture.getHeight()));
glDepthRangef(s_nearLimit, s_farLimit);
glClearColor(0.00F, 0.00F, 0.00F, 0.00f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
if (s_isPerspective == 0) {
projection = gl::GetOrthographicMatrix(viewWidth, viewHeight, s_nearLimit, s_farLimit, false);
totalScale = s_scaling / (std::fabs(s_translation[2]));
scale(0, 0) = totalScale;
scale(1, 1) = totalScale;
scale(2, 2) = totalScale;
translate(3, 0) = s_translation[0] / std::fabs(s_translation[2]);
translate(3, 1) = s_translation[1] / std::fabs(s_translation[2]);
translate(3, 2) = s_translation[2];
} else {
projection = gl::GetPerspectiveMatrix(viewWidth, viewHeight, s_nearLimit, s_farLimit, false);
totalScale = s_scaling;
scale(0, 0) = totalScale;
scale(1, 1) = totalScale;
scale(2, 2) = totalScale;
translate(3, 0) = s_translation[0];
translate(3, 1) = s_translation[1];
translate(3, 2) = s_translation[2];
}
totalScale /= (3.0f * s_max);
scaleForVertices(0, 0) = totalScale;
scaleForVertices(1, 1) = totalScale;
scaleForVertices(2, 2) = totalScale;
model = s_rotate * scale;
scaledModel = s_rotate * scaleForVertices;
view = translate;
mvp = model * view * projection;
if (s_drawMode == GL_TRIANGLES) {
static gl::Shader shader = gl::Shader(romfs::get("shaders/default/vertex.glsl").string(),
romfs::get("shaders/default/fragment.glsl").string());
shader.bind();
shader.setUniform("modelScale", scaledModel);
shader.setUniform("modelMatrix", model);
shader.setUniform("viewMatrix", view);
shader.setUniform("projectionMatrix",projection);
shader.setUniform("lightPosition", s_lightPosition);
shader.setUniform("lightBrightness", s_lightBrightness);
shader.setUniform("lightColor", s_lightColor);
vertexArray.bind();
if (s_shouldUpdateTexture) {
s_shouldUpdateTexture = false;
s_modelTexture = ImGuiExt::Texture(s_texturePath, ImGuiExt::Texture::Filter::Nearest);
}
if (s_drawTexture)
glBindTexture(GL_TEXTURE_2D, s_modelTexture);
if (s_indexType == IndexType::U8) {
buffers.indices8.bind();
if (buffers.indices8.getSize() == 0)
buffers.vertices.draw(s_drawMode);
else
buffers.indices8.draw(s_drawMode);
buffers.indices8.unbind();
} else if (s_indexType == IndexType::U16) {
buffers.indices16.bind();
if (buffers.indices16.getSize() == 0)
buffers.vertices.draw(s_drawMode);
else
buffers.indices16.draw(s_drawMode);
buffers.indices16.unbind();
} else {
buffers.indices32.bind();
if (buffers.indices32.getSize() == 0)
buffers.vertices.draw(s_drawMode);
else
buffers.indices32.draw(s_drawMode);
buffers.indices32.unbind();
}
} else {
static gl::Shader lineShader = gl::Shader(
romfs::get("shaders/default/lineVertex.glsl").string(),
romfs::get("shaders/default/lineFragment.glsl").string());
lineShader.bind();
lineShader.setUniform("modelMatrix", scaledModel);
lineShader.setUniform("viewMatrix", view);
lineShader.setUniform("projectionMatrix", projection);
vertexArray.bind();
if (s_indexType == IndexType::U8) {
lineBuffers.indices8.bind();
if (lineBuffers.indices8.getSize() == 0)
lineBuffers.vertices.draw(s_drawMode);
else
lineBuffers.indices8.draw(s_drawMode);
lineBuffers.indices8.unbind();
} else if (s_indexType == IndexType::U16) {
lineBuffers.indices16.bind();
if (lineBuffers.indices16.getSize() == 0)
lineBuffers.vertices.draw(s_drawMode);
else
lineBuffers.indices16.draw(s_drawMode);
lineBuffers.indices16.unbind();
} else {
lineBuffers.indices32.bind();
if (lineBuffers.indices32.getSize() == 0)
lineBuffers.vertices.draw(s_drawMode);
else
lineBuffers.indices32.draw(s_drawMode);
lineBuffers.indices32.unbind();
}
}
if (s_drawGrid || s_drawAxes) {
static auto gridAxesShader = gl::Shader(
romfs::get("shaders/default/lineVertex.glsl").string(),
romfs::get("shaders/default/lineFragment.glsl").string());
gridAxesShader.bind();
gridAxesShader.setUniform("modelMatrix", model);
gridAxesShader.setUniform("viewMatrix", view);
gridAxesShader.setUniform("projectionMatrix", projection);
if (s_drawGrid) {
gridVertexArray.bind();
gridBuffers.getIndices().bind();
gridBuffers.getIndices().draw(GL_LINES);
gridBuffers.getIndices().unbind();
gridVertexArray.unbind();
}
if (s_drawAxes) {
axesVertexArray.bind();
axesBuffers.getIndices().bind();
axesBuffers.getIndices().draw(GL_LINES);
axesBuffers.getIndices().unbind();
axesVertexArray.unbind();
}
gridAxesShader.unbind();
}
if (s_drawLightSource) {
static auto sourceShader = gl::Shader(
romfs::get("shaders/default/lightVertex.glsl").string(),
romfs::get("shaders/default/lightFragment.glsl").string());
sourceShader.bind();
sourceShader.setUniform("modelMatrix", model);
sourceShader.setUniform("viewMatrix", view);
sourceShader.setUniform("projectionMatrix", projection);
sourceVertexArray.bind();
sourceBuffers.getIndices().bind();
sourceBuffers.getIndices().draw(GL_TRIANGLES);
sourceBuffers.getIndices().unbind();
sourceVertexArray.unbind();
sourceShader.unbind();
}
vertexArray.unbind();
frameBuffer.unbind();
s_texture = ImGuiExt::Texture(renderTexture.release(), GLsizei(renderTexture.getWidth()), GLsizei(renderTexture.getHeight()));
drawWindow(s_texture, s_renderingWindowSize, mvp);
}
}
}

View File

@@ -1,13 +1,11 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <implot.h>
#include <imgui.h>
#include <content/helpers/diagrams.hpp>
#include <hex/ui/imgui_imhex_extensions.h>
#include <pl/patterns/pattern.hpp>
namespace hex::plugin::builtin {
void drawChunkBasedEntropyVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {

View File

@@ -1,116 +0,0 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <imgui.h>
#include <hex/api/task_manager.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/helpers/http_requests.hpp>
#include <nlohmann/json.hpp>
#include <hex/ui/imgui_imhex_extensions.h>
#include <romfs/romfs.hpp>
namespace hex::plugin::builtin {
void drawCoordinateVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
static ImVec2 coordinate;
static double latitude, longitude;
static std::string address;
static std::mutex addressMutex;
static TaskHolder addressTask;
static auto mapTexture = ImGuiExt::Texture(romfs::get("assets/common/map.jpg").span(), ImGuiExt::Texture::Filter::Linear);
static ImVec2 mapSize = scaled(ImVec2(500, 500 / mapTexture.getAspectRatio()));
if (shouldReset) {
std::scoped_lock lock(addressMutex);
address.clear();
latitude = arguments[0].toFloatingPoint();
longitude = arguments[1].toFloatingPoint();
// Convert latitude and longitude to X/Y coordinates on the image
coordinate.x = float((longitude + 180) / 360 * mapSize.x);
coordinate.y = float((-latitude + 90) / 180 * mapSize.y);
}
const auto startPos = ImGui::GetWindowPos() + ImGui::GetCursorPos();
// Draw background image
ImGui::Image(mapTexture, mapSize);
// Draw Longitude / Latitude text below image
ImGui::PushTextWrapPos(startPos.x + mapSize.x);
ImGuiExt::TextFormattedWrapped("{}: {:.0f}° {:.0f}' {:.4f}\" {} | {}: {:.0f}° {:.0f}' {:.4f}\" {}",
"hex.builtin.pl_visualizer.coordinates.latitude"_lang,
std::floor(std::abs(latitude)),
std::floor(std::abs(latitude - std::floor(latitude)) * 60),
(std::abs(latitude - std::floor(latitude)) * 60 - std::floor(std::abs(latitude - std::floor(latitude)) * 60)) * 60,
latitude >= 0 ? "N" : "S",
"hex.builtin.pl_visualizer.coordinates.longitude"_lang,
std::floor(std::abs(longitude)),
std::floor(std::abs(longitude - std::floor(longitude)) * 60),
(std::abs(longitude - std::floor(longitude)) * 60 - std::floor(std::abs(longitude - std::floor(longitude)) * 60)) * 60,
longitude >= 0 ? "E" : "W"
);
ImGui::PopTextWrapPos();
if (addressTask.isRunning()) {
ImGuiExt::TextSpinner("hex.builtin.pl_visualizer.coordinates.querying"_lang);
} else if (address.empty()) {
if (ImGuiExt::DimmedButton("hex.builtin.pl_visualizer.coordinates.query"_lang)) {
addressTask = TaskManager::createBackgroundTask("hex.builtin.pl_visualizer.coordinates.querying"_lang, [lat = latitude, lon = longitude](auto &) {
constexpr static auto ApiURL = "https://geocode.maps.co/reverse?lat={}&lon={}&format=jsonv2";
HttpRequest request("GET", hex::format(ApiURL, lat, lon));
auto response = request.execute().get();
if (!response.isSuccess())
return;
try {
auto json = nlohmann::json::parse(response.getData());
auto jsonAddr = json["address"];
std::scoped_lock lock(addressMutex);
if (jsonAddr.contains("village")) {
address = hex::format("{} {}, {} {}",
jsonAddr["village"].get<std::string>(),
jsonAddr["county"].get<std::string>(),
jsonAddr["state"].get<std::string>(),
jsonAddr["country"].get<std::string>());
} else if (jsonAddr.contains("city")) {
address = hex::format("{}, {} {}, {} {}",
jsonAddr["road"].get<std::string>(),
jsonAddr["quarter"].get<std::string>(),
jsonAddr["city"].get<std::string>(),
jsonAddr["state"].get<std::string>(),
jsonAddr["country"].get<std::string>());
}
} catch (std::exception &) {
address = std::string("hex.builtin.pl_visualizer.coordinates.querying_no_address"_lang);
}
});
}
} else {
ImGui::PushTextWrapPos(startPos.x + mapSize.x);
ImGuiExt::TextFormattedWrapped("{}", address);
ImGui::PopTextWrapPos();
}
// Draw crosshair pointing to the coordinates
{
constexpr static u32 CrossHairColor = 0xFF00D0D0;
constexpr static u32 BorderColor = 0xFF000000;
auto drawList = ImGui::GetWindowDrawList();
drawList->AddLine(startPos + ImVec2(coordinate.x, 0), startPos + ImVec2(coordinate.x, mapSize.y), CrossHairColor, 2_scaled);
drawList->AddLine(startPos + ImVec2(0, coordinate.y), startPos + ImVec2(mapSize.x, coordinate.y), CrossHairColor, 2_scaled);
drawList->AddCircleFilled(startPos + coordinate, 5, CrossHairColor);
drawList->AddCircle(startPos + coordinate, 5, BorderColor);
}
}
}

View File

@@ -1,70 +0,0 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <imgui.h>
#include <capstone/capstone.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <hex/api/localization_manager.hpp>
namespace hex::plugin::builtin {
void drawDisassemblyVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
struct Disassembly {
u64 address;
std::vector<u8> bytes;
std::string instruction;
};
static std::vector<Disassembly> disassembly;
if (shouldReset) {
auto pattern = arguments[0].toPattern();
auto baseAddress = arguments[1].toUnsigned();
auto architecture = arguments[2].toUnsigned();
auto mode = arguments[3].toUnsigned();
disassembly.clear();
csh capstone;
if (cs_open(static_cast<cs_arch>(architecture), static_cast<cs_mode>(mode), &capstone) == CS_ERR_OK) {
cs_option(capstone, CS_OPT_SKIPDATA, CS_OPT_ON);
auto data = pattern->getBytes();
cs_insn *instructions = nullptr;
size_t instructionCount = cs_disasm(capstone, data.data(), data.size(), baseAddress, 0, &instructions);
for (size_t i = 0; i < instructionCount; i++) {
disassembly.push_back({ instructions[i].address, { instructions[i].bytes, instructions[i].bytes + instructions[i].size }, hex::format("{} {}", instructions[i].mnemonic, instructions[i].op_str) });
}
cs_free(instructions, instructionCount);
cs_close(&capstone);
}
}
if (ImGui::BeginTable("##disassembly", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_ScrollY, scaled(ImVec2(0, 300)))) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.common.address"_lang);
ImGui::TableSetupColumn("hex.builtin.common.bytes"_lang);
ImGui::TableSetupColumn("hex.builtin.common.instruction"_lang);
ImGui::TableHeadersRow();
for (auto &entry : disassembly) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("0x{0:08X}", entry.address);
ImGui::TableNextColumn();
std::string bytes;
for (auto byte : entry.bytes)
bytes += hex::format("{0:02X} ", byte);
ImGui::TextUnformatted(bytes.c_str());
ImGui::TableNextColumn();
ImGui::TextUnformatted(entry.instruction.c_str());
}
ImGui::EndTable();
}
}
}

View File

@@ -1,9 +1,10 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <imgui.h>
#include <pl/pattern_language.hpp>
#include <pl/patterns/pattern.hpp>
#include <hex/ui/imgui_imhex_extensions.h>
#include <ui/hex_editor.hpp>
#include <content/providers/memory_file_provider.hpp>

View File

@@ -1,61 +0,0 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <implot.h>
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
namespace hex::plugin::builtin {
void drawImageVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
static ImGuiExt::Texture texture;
static float scale = 1.0F;
if (shouldReset) {
auto pattern = arguments[0].toPattern();
auto data = pattern->getBytes();
texture = ImGuiExt::Texture(data.data(), data.size(), ImGuiExt::Texture::Filter::Nearest);
scale = 200_scaled / texture.getSize().x;
}
if (texture.isValid())
ImGui::Image(texture, texture.getSize() * scale);
if (ImGui::IsWindowHovered()) {
auto scrollDelta = ImGui::GetIO().MouseWheel;
if (scrollDelta != 0.0F) {
scale += scrollDelta * 0.1F;
scale = std::clamp(scale, 0.1F, 10.0F);
}
}
}
void drawBitmapVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
static ImGuiExt::Texture texture;
static float scale = 1.0F;
if (shouldReset) {
auto pattern = arguments[0].toPattern();
auto width = arguments[1].toUnsigned();
auto height = arguments[2].toUnsigned();
auto data = pattern->getBytes();
texture = ImGuiExt::Texture(data.data(), data.size(), ImGuiExt::Texture::Filter::Nearest, width, height);
}
if (texture.isValid())
ImGui::Image(texture, texture.getSize() * scale);
if (ImGui::IsWindowHovered()) {
auto scrollDelta = ImGui::GetIO().MouseWheel;
if (scrollDelta != 0.0F) {
scale += scrollDelta * 0.1F;
scale = std::clamp(scale, 0.1F, 10.0F);
}
}
}
}

View File

@@ -1,30 +0,0 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <implot.h>
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
namespace hex::plugin::builtin {
void drawLinePlotVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
static std::vector<float> values;
auto dataPattern = arguments[0].toPattern();
if (ImPlot::BeginPlot("##plot", ImVec2(400, 250), ImPlotFlags_CanvasOnly)) {
ImPlot::SetupAxes("X", "Y", ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
if (shouldReset) {
values.clear();
values = sampleData(patternToArray<float>(dataPattern.get()), ImPlot::GetPlotSize().x * 4);
}
ImPlot::PlotLine("##line", values.data(), values.size());
ImPlot::EndPlot();
}
}
}

View File

@@ -1,33 +0,0 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <implot.h>
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
namespace hex::plugin::builtin {
void drawScatterPlotVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
static std::vector<float> xValues, yValues;
auto xPattern = arguments[0].toPattern();
auto yPattern = arguments[1].toPattern();
if (ImPlot::BeginPlot("##plot", ImVec2(400, 250), ImPlotFlags_CanvasOnly)) {
ImPlot::SetupAxes("X", "Y", ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
if (shouldReset) {
xValues.clear(); yValues.clear();
xValues = sampleData(patternToArray<float>(xPattern.get()), ImPlot::GetPlotSize().x * 4);
yValues = sampleData(patternToArray<float>(yPattern.get()), ImPlot::GetPlotSize().x * 4);
}
ImPlot::PlotScatter("##scatter", xValues.data(), yValues.data(), xValues.size());
ImPlot::EndPlot();
}
}
}

View File

@@ -1,124 +0,0 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <implot.h>
#include <imgui.h>
#include <miniaudio.h>
#include <fonts/codicons_font.h>
#include <hex/api/task_manager.hpp>
#include <hex/ui/imgui_imhex_extensions.h>
namespace hex::plugin::builtin {
void drawSoundVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span<const pl::core::Token::Literal> arguments) {
auto wavePattern = arguments[0].toPattern();
auto channels = arguments[1].toUnsigned();
auto sampleRate = arguments[2].toUnsigned();
static std::vector<i16> waveData, sampledData;
static ma_device audioDevice;
static ma_device_config deviceConfig;
static bool shouldStop = false;
static u64 index = 0;
static TaskHolder resetTask;
if (sampleRate == 0)
throw std::logic_error(hex::format("Invalid sample rate: {}", sampleRate));
else if (channels == 0)
throw std::logic_error(hex::format("Invalid channel count: {}", channels));
if (shouldReset) {
waveData.clear();
resetTask = TaskManager::createTask("Visualizing...", TaskManager::NoProgress, [=](Task &) {
ma_device_stop(&audioDevice);
waveData = patternToArray<i16>(wavePattern.get());
sampledData = sampleData(waveData, 300_scaled * 4);
index = 0;
deviceConfig = ma_device_config_init(ma_device_type_playback);
deviceConfig.playback.format = ma_format_s16;
deviceConfig.playback.channels = channels;
deviceConfig.sampleRate = sampleRate;
deviceConfig.pUserData = &waveData;
deviceConfig.dataCallback = [](ma_device *device, void *pOutput, const void *, ma_uint32 frameCount) {
if (index >= waveData.size()) {
index = 0;
shouldStop = true;
return;
}
ma_copy_pcm_frames(pOutput, waveData.data() + index, frameCount, device->playback.format, device->playback.channels);
index += frameCount;
};
ma_device_init(nullptr, &deviceConfig, &audioDevice);
});
}
ImGui::BeginDisabled(resetTask.isRunning());
ImPlot::PushStyleVar(ImPlotStyleVar_PlotPadding, ImVec2(0, 0));
if (ImPlot::BeginPlot("##amplitude_plot", scaled(ImVec2(300, 80)), ImPlotFlags_CanvasOnly | ImPlotFlags_NoFrame | ImPlotFlags_NoInputs)) {
ImPlot::SetupAxes("##time", "##amplitude", ImPlotAxisFlags_NoDecorations | ImPlotAxisFlags_NoMenus, ImPlotAxisFlags_NoDecorations | ImPlotAxisFlags_NoMenus);
ImPlot::SetupAxesLimits(0, waveData.size(), std::numeric_limits<i16>::min(), std::numeric_limits<i16>::max(), ImGuiCond_Always);
double dragPos = index;
if (ImPlot::DragLineX(1, &dragPos, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
if (dragPos < 0) dragPos = 0;
if (dragPos >= waveData.size()) dragPos = waveData.size() - 1;
index = dragPos;
}
ImPlot::PlotLine("##audio", sampledData.data(), sampledData.size());
ImPlot::EndPlot();
}
ImPlot::PopStyleVar();
{
const u64 min = 0, max = waveData.size();
ImGui::PushItemWidth(300_scaled);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
ImGui::SliderScalar("##index", ImGuiDataType_U64, &index, &min, &max, "");
ImGui::PopStyleVar();
ImGui::PopItemWidth();
}
if (shouldStop) {
shouldStop = false;
ma_device_stop(&audioDevice);
}
bool playing = ma_device_is_started(&audioDevice);
if (ImGuiExt::IconButton(playing ? ICON_VS_DEBUG_PAUSE : ICON_VS_PLAY, ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_ToolbarGreen))) {
if (playing)
ma_device_stop(&audioDevice);
else
ma_device_start(&audioDevice);
}
ImGui::SameLine();
if (ImGuiExt::IconButton(ICON_VS_DEBUG_STOP, ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_ToolbarRed))) {
index = 0;
ma_device_stop(&audioDevice);
}
ImGui::EndDisabled();
ImGui::SameLine();
if (resetTask.isRunning())
ImGuiExt::TextSpinner("");
else
ImGuiExt::TextFormatted("{:02d}:{:02d} / {:02d}:{:02d}",
(index / sampleRate) / 60, (index / sampleRate) % 60,
(waveData.size() / sampleRate) / 60, (waveData.size() / sampleRate) % 60);
}
}

View File

@@ -1,107 +0,0 @@
#include <hex/helpers/utils.hpp>
#include <content/pl_visualizers/visualizer_helpers.hpp>
#include <numbers>
#include <imgui.h>
#include <hex/api/imhex_api.hpp>
#include <hex/ui/imgui_imhex_extensions.h>
#include <chrono>
#include <fmt/chrono.h>
namespace hex::plugin::builtin {
void drawTimestampVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool, std::span<const pl::core::Token::Literal> arguments) {
time_t timestamp = arguments[0].toUnsigned();
auto tm = fmt::gmtime(timestamp);
auto date = std::chrono::year_month_day(std::chrono::year(tm.tm_year + 1900), std::chrono::month(tm.tm_mon + 1), std::chrono::day(tm.tm_mday));
auto lastMonthDay = std::chrono::year_month_day_last(date.year(), date.month() / std::chrono::last);
auto firstWeekDay = std::chrono::weekday(std::chrono::year_month_day(date.year(), date.month(), std::chrono::day(1)));
const auto scale = 1_scaled * (ImHexApi::Fonts::getFontSize() / ImHexApi::Fonts::DefaultFontSize);
// Draw calendar
if (ImGui::BeginTable("##month_table", 2)) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
// Draw centered month name and year
ImGuiExt::TextFormattedCenteredHorizontal("{:%B %Y}", tm);
if (ImGui::BeginTable("##days_table", 7, ImGuiTableFlags_Borders | ImGuiTableFlags_NoHostExtendX, ImVec2(160, 120) * scale)) {
constexpr static auto ColumnFlags = ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize | ImGuiTableColumnFlags_NoReorder | ImGuiTableColumnFlags_NoHide;
ImGui::TableSetupColumn("M", ColumnFlags);
ImGui::TableSetupColumn("T", ColumnFlags);
ImGui::TableSetupColumn("W", ColumnFlags);
ImGui::TableSetupColumn("T", ColumnFlags);
ImGui::TableSetupColumn("F", ColumnFlags);
ImGui::TableSetupColumn("S", ColumnFlags);
ImGui::TableSetupColumn("S", ColumnFlags);
ImGui::TableHeadersRow();
ImGui::TableNextRow();
// Skip days before the first day of the month
for (u8 i = 0; i < firstWeekDay.c_encoding() - 1; ++i)
ImGui::TableNextColumn();
// Draw days
for (u8 i = 1; i <= u32(lastMonthDay.day()); ++i) {
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("{:02}", i);
if (std::chrono::day(i) == date.day())
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImGuiExt::GetCustomColorU32(ImGuiCustomCol_ToolbarRed));
if (std::chrono::weekday(std::chrono::year_month_day(date.year(), date.month(), std::chrono::day(i))) == std::chrono::Sunday)
ImGui::TableNextRow();
}
ImGui::EndTable();
}
ImGui::TableNextColumn();
// Draw analog clock
const auto size = ImVec2(120, 120) * scale;
if (ImGui::BeginChild("##clock", size + ImVec2(0, ImGui::GetTextLineHeightWithSpacing()))) {
// Draw centered digital hour, minute and seconds
ImGuiExt::TextFormattedCenteredHorizontal("{:%H:%M:%S}", tm);
auto drawList = ImGui::GetWindowDrawList();
const auto center = ImGui::GetWindowPos() + ImVec2(0, ImGui::GetTextLineHeightWithSpacing()) + size / 2;
// Draw clock face
drawList->AddCircle(center, size.x / 2, ImGui::GetColorU32(ImGuiCol_TextDisabled), 0);
auto sectionPos = [](float i) {
return ImVec2(std::sin(-i * 30.0F * std::numbers::pi / 180.0F + std::numbers::pi / 2), std::cos(-i * 30.0F * std::numbers::pi / 180.0F + std::numbers::pi / 2));
};
// Draw clock sections and numbers
for (u8 i = 0; i < 12; ++i) {
auto text = hex::format("{}", (((i + 2) % 12) + 1));
drawList->AddLine(center + sectionPos(i) * size / 2.2, center + sectionPos(i) * size / 2, ImGui::GetColorU32(ImGuiCol_TextDisabled), 1_scaled);
drawList->AddText(center + sectionPos(i) * size / 3 - ImGui::CalcTextSize(text.c_str()) / 2, ImGui::GetColorU32(ImGuiCol_Text), text.c_str());
}
// Draw hour hand
drawList->AddLine(center, center + sectionPos((tm.tm_hour + 9) % 12 + float(tm.tm_min) / 60.0) * size / 3.5, ImGui::GetColorU32(ImGuiCol_TextDisabled), 3_scaled);
// Draw minute hand
drawList->AddLine(center, center + sectionPos((float(tm.tm_min) / 5.0F) - 3) * size / 2.5, ImGui::GetColorU32(ImGuiCol_TextDisabled), 3_scaled);
// Draw second hand
drawList->AddLine(center, center + sectionPos((float(tm.tm_sec) / 5.0F) - 3) * size / 2.5, ImGuiExt::GetCustomColorU32(ImGuiCustomCol_ToolbarRed), 2_scaled);
}
ImGui::EndChild();
ImGui::EndTable();
}
}
}

View File

@@ -9,7 +9,7 @@
#include "content/providers/memory_file_provider.hpp"
#include "content/providers/view_provider.hpp"
#include <content/providers/process_memory_provider.hpp>
#include "content/popups/popup_notification.hpp"
#include <popups/popup_notification.hpp>
#include "content/helpers/notification.hpp"
#include <hex/api/project_file_manager.hpp>

View File

@@ -289,7 +289,7 @@ namespace hex::plugin::builtin {
ImGui::Separator();
ImGuiExt::InputHexadecimal("hex.builtin.common.size"_lang, &m_size, ImGuiInputTextFlags_CharsHexadecimal);
ImGuiExt::InputHexadecimal("hex.ui.common.size"_lang, &m_size, ImGuiInputTextFlags_CharsHexadecimal);
if (m_port < 0)
m_port = 0;

View File

@@ -1,6 +1,6 @@
#include "content/providers/memory_file_provider.hpp"
#include "content/providers/file_provider.hpp"
#include "content/popups/popup_text_input.hpp"
#include <popups/popup_text_input.hpp>
#include <cstring>
@@ -146,7 +146,7 @@ namespace hex::plugin::builtin {
}
void MemoryFileProvider::renameFile() {
PopupTextInput::open("hex.builtin.provider.mem_file.rename", "hex.builtin.provider.mem_file.rename.desc", [this](const std::string &name) {
ui::PopupTextInput::open("hex.builtin.provider.mem_file.rename", "hex.builtin.provider.mem_file.rename.desc", [this](const std::string &name) {
m_name = name;
RequestUpdateWindowTitle::post();
});

View File

@@ -252,9 +252,9 @@ namespace hex::plugin::builtin {
#endif
if (ImGui::BeginTable("##module_table", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_ScrollY, ImVec2(availableX, availableY))) {
ImGui::TableSetupColumn("hex.builtin.common.region"_lang);
ImGui::TableSetupColumn("hex.builtin.common.size"_lang);
ImGui::TableSetupColumn("hex.builtin.common.name"_lang);
ImGui::TableSetupColumn("hex.ui.common.region"_lang);
ImGui::TableSetupColumn("hex.ui.common.size"_lang);
ImGui::TableSetupColumn("hex.ui.common.name"_lang);
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();

View File

@@ -15,7 +15,7 @@
#include <wolv/utils/string.hpp>
#include <content/recent.hpp>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
#include <fonts/codicons_font.h>
namespace hex::plugin::builtin::recent {
@@ -131,7 +131,7 @@ namespace hex::plugin::builtin::recent {
if (!recentFile.isValid())
continue;
std::string displayName = hex::format("[{}] {}", "hex.builtin.common.project"_lang, wolv::util::toUTF8String(projectFileName));
std::string displayName = hex::format("[{}] {}", "hex.ui.common.project"_lang, wolv::util::toUTF8String(projectFileName));
nlohmann::json recentEntry {
{"type", "project"},
@@ -224,7 +224,7 @@ namespace hex::plugin::builtin::recent {
provider->loadSettings(recentEntry.data);
if (!provider->open() || !provider->isAvailable()) {
PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage()));
ui::PopupError::open(hex::format("hex.builtin.provider.error.open"_lang, provider->getErrorMessage()));
TaskManager::doLater([provider] { ImHexApi::Provider::remove(provider); });
return;
}
@@ -269,21 +269,21 @@ namespace hex::plugin::builtin::recent {
if (ImGui::BeginTable("##RecentEntryTooltip", 2, ImGuiTableFlags_RowBg)) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::TextUnformatted("hex.builtin.common.name"_lang);
ImGui::TextUnformatted("hex.ui.common.name"_lang);
ImGui::TableNextColumn();
ImGui::TextUnformatted(recentEntry.displayName.c_str());
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::TextUnformatted("hex.builtin.common.type"_lang);
ImGui::TextUnformatted("hex.ui.common.type"_lang);
ImGui::TableNextColumn();
if (isProject) {
ImGui::TextUnformatted("hex.builtin.common.project"_lang);
ImGui::TextUnformatted("hex.ui.common.project"_lang);
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::TextUnformatted("hex.builtin.common.path"_lang);
ImGui::TextUnformatted("hex.ui.common.path"_lang);
ImGui::TableNextColumn();
ImGui::TextUnformatted(recentEntry.data["path"].get<std::string>().c_str());
} else {
@@ -303,7 +303,7 @@ namespace hex::plugin::builtin::recent {
}
if (ImGui::BeginPopup(popupID.c_str())) {
if (ImGui::MenuItem("hex.builtin.common.remove"_lang)) {
if (ImGui::MenuItem("hex.ui.common.remove"_lang)) {
shouldRemove = true;
}
ImGui::EndPopup();

View File

@@ -197,7 +197,7 @@ namespace hex::plugin::builtin {
auto format = [this] -> std::string {
auto value = m_value * 30;
if (value == 0)
return "hex.builtin.common.off"_lang;
return "hex.ui.common.off"_lang;
else if (value < 60)
return hex::format("hex.builtin.setting.general.auto_backup_time.format.simple"_lang, value);
else

View File

@@ -9,7 +9,7 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
#include <wolv/io/file.hpp>
@@ -113,7 +113,7 @@ namespace hex::plugin::builtin {
wolv::io::File output(outputPath, wolv::io::File::Mode::Create);
if (!output.isValid()) {
PopupError::open("hex.builtin.tools.file_tools.combiner.error.open_output"_lang);
ui::PopupError::open("hex.builtin.tools.file_tools.combiner.error.open_output"_lang);
return;
}
@@ -126,7 +126,7 @@ namespace hex::plugin::builtin {
wolv::io::File input(file, wolv::io::File::Mode::Read);
if (!input.isValid()) {
PopupError::open(hex::format("hex.builtin.tools.file_tools.combiner.open_input"_lang, wolv::util::toUTF8String(file)));
ui::PopupError::open(hex::format("hex.builtin.tools.file_tools.combiner.open_input"_lang, wolv::util::toUTF8String(file)));
return;
}
@@ -142,7 +142,7 @@ namespace hex::plugin::builtin {
selectedIndex = 0;
outputPath.clear();
PopupInfo::open("hex.builtin.tools.file_tools.combiner.success"_lang);
ui::PopupInfo::open("hex.builtin.tools.file_tools.combiner.success"_lang);
});
}
}

View File

@@ -7,7 +7,7 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
#include <wolv/io/file.hpp>
#include <wolv/utils/guards.hpp>
@@ -54,7 +54,7 @@ namespace hex::plugin::builtin {
wolv::io::File file(selectedFile, wolv::io::File::Mode::Write);
if (!file.isValid()) {
PopupError::open("hex.builtin.tools.file_tools.shredder.error.open"_lang);
ui::PopupError::open("hex.builtin.tools.file_tools.shredder.error.open"_lang);
return;
}
@@ -128,7 +128,7 @@ namespace hex::plugin::builtin {
file.remove();
PopupInfo::open("hex.builtin.tools.file_tools.shredder.success"_lang);
ui::PopupInfo::open("hex.builtin.tools.file_tools.shredder.success"_lang);
});
}
}

View File

@@ -9,7 +9,7 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
#include <wolv/io/file.hpp>
#include <wolv/utils/guards.hpp>
@@ -101,12 +101,12 @@ namespace hex::plugin::builtin {
wolv::io::File file(selectedFile, wolv::io::File::Mode::Read);
if (!file.isValid()) {
PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.open"_lang);
ui::PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.open"_lang);
return;
}
if (file.getSize() < splitSize) {
PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.size"_lang);
ui::PopupError::open("hex.builtin.tools.file_tools.splitter.picker.error.size"_lang);
return;
}
@@ -122,7 +122,7 @@ namespace hex::plugin::builtin {
wolv::io::File partFile(path, wolv::io::File::Mode::Create);
if (!partFile.isValid()) {
PopupError::open(hex::format("hex.builtin.tools.file_tools.splitter.picker.error.create"_lang, index));
ui::PopupError::open(hex::format("hex.builtin.tools.file_tools.splitter.picker.error.create"_lang, index));
return;
}
@@ -135,7 +135,7 @@ namespace hex::plugin::builtin {
index++;
}
PopupInfo::open("hex.builtin.tools.file_tools.splitter.picker.success"_lang);
ui::PopupInfo::open("hex.builtin.tools.file_tools.splitter.picker.success"_lang);
});
}
}

View File

@@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
});
}
} else {
if (ImGui::Button("hex.builtin.common.cancel"_lang)) {
if (ImGui::Button("hex.ui.common.cancel"_lang)) {
request.cancel();
}
}
@@ -33,9 +33,9 @@ namespace hex::plugin::builtin {
ImGuiExt::Header("hex.builtin.tools.file_uploader.recent"_lang);
if (ImGui::BeginTable("##links", 3, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg, ImVec2(0, 200))) {
ImGui::TableSetupColumn("hex.builtin.common.file"_lang);
ImGui::TableSetupColumn("hex.builtin.common.link"_lang);
ImGui::TableSetupColumn("hex.builtin.common.size"_lang);
ImGui::TableSetupColumn("hex.ui.common.file"_lang);
ImGui::TableSetupColumn("hex.ui.common.link"_lang);
ImGui::TableSetupColumn("hex.ui.common.size"_lang);
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();
@@ -81,11 +81,11 @@ namespace hex::plugin::builtin {
json.at("data").at("file").at("metadata").at("size").at("readable")
});
} catch (...) {
PopupError::open("hex.builtin.tools.file_uploader.invalid_response"_lang);
ui::PopupError::open("hex.builtin.tools.file_uploader.invalid_response"_lang);
}
} else if (response.getStatusCode() == 0) {
// Canceled by user, no action needed
} else PopupError::open(hex::format("hex.builtin.tools.file_uploader.error"_lang, response.getStatusCode()));
} else ui::PopupError::open(hex::format("hex.builtin.tools.file_uploader.error"_lang, response.getStatusCode()));
uploadProcess = {};
currFile.clear();

View File

@@ -13,7 +13,7 @@
#include <implot.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
namespace hex::plugin::builtin {
@@ -46,7 +46,7 @@ namespace hex::plugin::builtin {
// Task exception popup
for (const auto &task : TaskManager::getRunningTasks()) {
if (task->hadException()) {
PopupError::open(hex::format("hex.builtin.popup.error.task_exception"_lang, Lang(task->getUnlocalizedName()), task->getExceptionMessage()));
ui::PopupError::open(hex::format("hex.builtin.popup.error.task_exception"_lang, Lang(task->getUnlocalizedName()), task->getExceptionMessage()));
task->clearException();
break;
}

View File

@@ -6,13 +6,11 @@
#include "content/views/view_about.hpp"
#include "content/views/view_tools.hpp"
#include "content/views/view_data_inspector.hpp"
#include "content/views/view_disassembler.hpp"
#include "content/views/view_bookmarks.hpp"
#include "content/views/view_patches.hpp"
#include "content/views/view_command_palette.hpp"
#include "content/views/view_settings.hpp"
#include "content/views/view_data_processor.hpp"
#include "content/views/view_yara.hpp"
#include "content/views/view_constants.hpp"
#include "content/views/view_store.hpp"
#include "content/views/view_diff.hpp"
@@ -33,7 +31,6 @@ namespace hex::plugin::builtin {
ContentRegistry::Views::add<ViewDataInspector>();
ContentRegistry::Views::add<ViewHashes>();
ContentRegistry::Views::add<ViewInformation>();
ContentRegistry::Views::add<ViewDisassembler>();
ContentRegistry::Views::add<ViewBookmarks>();
ContentRegistry::Views::add<ViewPatches>();
ContentRegistry::Views::add<ViewTools>();
@@ -41,7 +38,6 @@ namespace hex::plugin::builtin {
ContentRegistry::Views::add<ViewAbout>();
ContentRegistry::Views::add<ViewSettings>();
ContentRegistry::Views::add<ViewDataProcessor>();
ContentRegistry::Views::add<ViewYara>();
ContentRegistry::Views::add<ViewConstants>();
ContentRegistry::Views::add<ViewStore>();
ContentRegistry::Views::add<ViewDiff>();

View File

@@ -351,30 +351,24 @@ namespace hex::plugin::builtin {
ImGui::TableHeadersRow();
ImGuiListClipper clipper;
clipper.Begin(plugins.size());
for (const auto &plugin : plugins) {
if (plugin.isLibraryPlugin())
continue;
while (clipper.Step()) {
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) {
const auto &plugin = plugins[i];
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormattedColored(
plugin.isBuiltinPlugin() ? ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_Highlight) : ImGui::GetStyleColorVec4(ImGuiCol_Text),
"{}", plugin.getPluginName().c_str()
);
ImGui::TableNextColumn();
ImGui::TextUnformatted(plugin.getPluginAuthor().c_str());
ImGui::TableNextColumn();
ImGui::TextUnformatted(plugin.getPluginDescription().c_str());
ImGui::TableNextColumn();
ImGui::TextUnformatted(plugin.isLoaded() ? ICON_VS_CHECK : ICON_VS_CLOSE);
}
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormattedColored(
plugin.isBuiltinPlugin() ? ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_Highlight) : ImGui::GetStyleColorVec4(ImGuiCol_Text),
"{}", plugin.getPluginName().c_str()
);
ImGui::TableNextColumn();
ImGui::TextUnformatted(plugin.getPluginAuthor().c_str());
ImGui::TableNextColumn();
ImGui::TextUnformatted(plugin.getPluginDescription().c_str());
ImGui::TableNextColumn();
ImGui::TextUnformatted(plugin.isLoaded() ? ICON_VS_CHECK : ICON_VS_CLOSE);
}
clipper.End();
ImGui::EndTable();
}
}
@@ -480,7 +474,7 @@ namespace hex::plugin::builtin {
}
} else {
// Draw a spinner while the release notes are loading
ImGuiExt::TextSpinner("hex.builtin.common.loading"_lang);
ImGuiExt::TextSpinner("hex.ui.common.loading"_lang);
}
}
@@ -597,7 +591,7 @@ namespace hex::plugin::builtin {
} catch (std::exception &e) {
commits.emplace_back(
"hex.builtin.common.error"_lang,
"hex.ui.common.error"_lang,
e.what(),
"",
"",
@@ -607,7 +601,7 @@ namespace hex::plugin::builtin {
} else {
// An error occurred, display it
commits.emplace_back(
"hex.builtin.common.error"_lang,
"hex.ui.common.error"_lang,
"HTTP " + std::to_string(response.getStatusCode()),
"",
"",
@@ -616,7 +610,7 @@ namespace hex::plugin::builtin {
}
} else {
// Draw a spinner while the commits are loading
ImGuiExt::TextSpinner("hex.builtin.common.loading"_lang);
ImGuiExt::TextSpinner("hex.ui.common.loading"_lang);
}
}

View File

@@ -104,7 +104,7 @@ namespace hex::plugin::builtin {
// Draw region
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("{}: ", "hex.builtin.common.region"_lang.get());
ImGuiExt::TextFormatted("{}: ", "hex.ui.common.region"_lang.get());
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("[ 0x{:08X} - 0x{:08X} ] ", bookmark.region.getStartAddress(), bookmark.region.getEndAddress());
@@ -354,7 +354,7 @@ namespace hex::plugin::builtin {
ImGui::TableNextRow(ImGuiTableRowFlags_None, rowHeight);
ImGui::TableNextColumn();
ImGui::TextUnformatted("hex.builtin.common.address"_lang);
ImGui::TextUnformatted("hex.ui.common.address"_lang);
ImGui::TableNextColumn();
ImGui::TableNextColumn();
@@ -405,7 +405,7 @@ namespace hex::plugin::builtin {
ImGui::TableNextColumn();
// Draw size of the bookmark
ImGui::TextUnformatted("hex.builtin.common.size"_lang);
ImGui::TextUnformatted("hex.ui.common.size"_lang);
ImGui::TableNextColumn();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted(hex::toByteString(region.size));

View File

@@ -332,7 +332,7 @@ namespace hex::plugin::builtin {
ImGui::EndTable();
}
ImGuiExt::DimmedButtonToggle("hex.builtin.common.edit"_lang, &m_tableEditingModeEnabled, ImVec2(ImGui::GetContentRegionAvail().x, 0));
ImGuiExt::DimmedButtonToggle("hex.ui.common.edit"_lang, &m_tableEditingModeEnabled, ImVec2(ImGui::GetContentRegionAvail().x, 0));
ImGui::NewLine();
ImGui::Separator();
@@ -350,9 +350,9 @@ namespace hex::plugin::builtin {
}
}();
std::array options = { "hex.builtin.common.little"_lang, "hex.builtin.common.big"_lang };
std::array options = { "hex.ui.common.little"_lang, "hex.ui.common.big"_lang };
if (ImGui::SliderInt("hex.builtin.common.endian"_lang, &selection, 0, options.size() - 1, options[selection], ImGuiSliderFlags_NoInput)) {
if (ImGui::SliderInt("hex.ui.common.endian"_lang, &selection, 0, options.size() - 1, options[selection], ImGuiSliderFlags_NoInput)) {
m_shouldInvalidate = true;
switch (selection) {
@@ -373,9 +373,9 @@ namespace hex::plugin::builtin {
case NumberDisplayStyle::Octal: return 2;
}
}();
std::array options = { "hex.builtin.common.decimal"_lang, "hex.builtin.common.hexadecimal"_lang, "hex.builtin.common.octal"_lang };
std::array options = { "hex.ui.common.decimal"_lang, "hex.ui.common.hexadecimal"_lang, "hex.ui.common.octal"_lang };
if (ImGui::SliderInt("hex.builtin.common.number_format"_lang, &selection, 0, options.size() - 1, options[selection], ImGuiSliderFlags_NoInput)) {
if (ImGui::SliderInt("hex.ui.common.number_format"_lang, &selection, 0, options.size() - 1, options[selection], ImGuiSliderFlags_NoInput)) {
m_shouldInvalidate = true;
switch (selection) {
@@ -390,7 +390,7 @@ namespace hex::plugin::builtin {
// Draw invert setting
{
int selection = m_invert ? 1 : 0;
std::array options = { "hex.builtin.common.no"_lang, "hex.builtin.common.yes"_lang };
std::array options = { "hex.ui.common.no"_lang, "hex.ui.common.yes"_lang };
if (ImGui::SliderInt("hex.builtin.view.data_inspector.invert"_lang, &selection, 0, options.size() - 1, options[selection], ImGuiSliderFlags_NoInput)) {
m_shouldInvalidate = true;

View File

@@ -1,5 +1,5 @@
#include "content/views/view_data_processor.hpp"
#include "content/popups/popup_notification.hpp"
#include <popups/popup_notification.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/project_file_manager.hpp>
@@ -852,7 +852,7 @@ namespace hex::plugin::builtin {
int nodeId;
if (ImNodes::IsNodeHovered(&nodeId) && workspace.currNodeError.has_value() && workspace.currNodeError->node->getId() == nodeId) {
ImGui::BeginTooltip();
ImGui::TextUnformatted("hex.builtin.common.error"_lang);
ImGui::TextUnformatted("hex.ui.common.error"_lang);
ImGui::Separator();
ImGui::TextUnformatted(workspace.currNodeError->message.c_str());
ImGui::EndTooltip();
@@ -1194,7 +1194,7 @@ namespace hex::plugin::builtin {
m_updateNodePositions = true;
} catch (nlohmann::json::exception &e) {
PopupError::open(hex::format("Failed to load nodes: {}", e.what()));
ui::PopupError::open(hex::format("Failed to load nodes: {}", e.what()));
}
}

View File

@@ -262,9 +262,9 @@ namespace hex::plugin::builtin {
// Draw the differences table
if (ImGui::BeginTable("##differences", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_ScrollY | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Resizable, ImVec2(0, 200_scaled))) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.common.begin"_lang);
ImGui::TableSetupColumn("hex.builtin.common.end"_lang);
ImGui::TableSetupColumn("hex.builtin.common.type"_lang);
ImGui::TableSetupColumn("hex.ui.common.begin"_lang);
ImGui::TableSetupColumn("hex.ui.common.end"_lang);
ImGui::TableSetupColumn("hex.ui.common.type"_lang);
ImGui::TableHeadersRow();
// Draw the differences if the providers have been analyzed

View File

@@ -1,451 +0,0 @@
#include "content/views/view_disassembler.hpp"
#include <hex/providers/provider.hpp>
#include <hex/helpers/fmt.hpp>
#include <cstring>
using namespace std::literals::string_literals;
namespace hex::plugin::builtin {
ViewDisassembler::ViewDisassembler() : View::Window("hex.builtin.view.disassembler.name") {
EventProviderDeleted::subscribe(this, [this](const auto*) {
m_disassembly.clear();
});
}
ViewDisassembler::~ViewDisassembler() {
EventDataChanged::unsubscribe(this);
EventRegionSelected::unsubscribe(this);
EventProviderDeleted::unsubscribe(this);
}
void ViewDisassembler::disassemble() {
m_disassembly.clear();
m_disassemblerTask = TaskManager::createTask("hex.builtin.view.disassembler.disassembling", m_codeRegion.getSize(), [this](auto &task) {
csh capstoneHandle;
cs_insn *instructions = nullptr;
cs_mode mode = m_mode;
// Create a capstone disassembler instance
if (cs_open(Disassembler::toCapstoneArchitecture(m_architecture), mode, &capstoneHandle) == CS_ERR_OK) {
// Tell capstone to skip data bytes
cs_option(capstoneHandle, CS_OPT_SKIPDATA, CS_OPT_ON);
auto provider = ImHexApi::Provider::get();
std::vector<u8> buffer(2048, 0x00);
size_t size = m_codeRegion.getSize();
// Read the data in chunks and disassemble it
for (u64 address = 0; address < size; address += 2048) {
task.update(address);
// Read a chunk of data
size_t bufferSize = std::min(u64(2048), (size - address));
provider->read(m_codeRegion.getStartAddress() + address, buffer.data(), bufferSize);
// Ask capstone to disassemble the data
size_t instructionCount = cs_disasm(capstoneHandle, buffer.data(), bufferSize, m_baseAddress + address, 0, &instructions);
if (instructionCount == 0)
break;
// Reserve enough space for the disassembly
m_disassembly.reserve(m_disassembly.size() + instructionCount);
// Convert the capstone instructions to our disassembly format
u64 usedBytes = 0;
for (u32 i = 0; i < instructionCount; i++) {
const auto &instr = instructions[i];
Disassembly disassembly = { };
disassembly.address = instr.address;
disassembly.offset = m_codeRegion.getStartAddress() + address + usedBytes;
disassembly.size = instr.size;
disassembly.mnemonic = instr.mnemonic;
disassembly.operators = instr.op_str;
for (u16 j = 0; j < instr.size; j++)
disassembly.bytes += hex::format("{0:02X} ", instr.bytes[j]);
disassembly.bytes.pop_back();
m_disassembly.push_back(disassembly);
usedBytes += instr.size;
}
// If capstone couldn't disassemble all bytes in the buffer, we might have cut off an instruction
// Adjust the address,so it's being disassembled when we read the next chunk
if (instructionCount < bufferSize)
address -= (bufferSize - usedBytes);
// Clean up the capstone instructions
cs_free(instructions, instructionCount);
}
cs_close(&capstoneHandle);
}
});
}
void ViewDisassembler::drawContent() {
auto provider = ImHexApi::Provider::get();
if (ImHexApi::Provider::isValid() && provider->isReadable()) {
ImGuiExt::Header("hex.builtin.view.disassembler.position"_lang, true);
// Draw base address input
ImGuiExt::InputHexadecimal("hex.builtin.view.disassembler.base"_lang, &m_baseAddress, ImGuiInputTextFlags_CharsHexadecimal);
// Draw region selection picker
ui::regionSelectionPicker(&m_codeRegion, provider, &m_range);
// Draw settings
{
ImGuiExt::Header("hex.builtin.common.settings"_lang);
// Draw architecture selector
if (ImGui::Combo("hex.builtin.view.disassembler.arch"_lang, reinterpret_cast<int *>(&m_architecture), Disassembler::ArchitectureNames.data(), Disassembler::getArchitectureSupportedCount()))
m_mode = cs_mode(0);
// Draw sub-settings for each architecture
if (ImGuiExt::BeginBox()) {
// Draw endian radio buttons. This setting is available for all architectures
static int littleEndian = true;
ImGui::RadioButton("hex.builtin.common.little_endian"_lang, &littleEndian, true);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.common.big_endian"_lang, &littleEndian, false);
ImGui::NewLine();
// Draw architecture specific settings
switch (m_architecture) {
case Architecture::ARM:
{
static int mode = CS_MODE_ARM;
ImGui::RadioButton("hex.builtin.view.disassembler.arm.arm"_lang, &mode, CS_MODE_ARM);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.arm.thumb"_lang, &mode, CS_MODE_THUMB);
static int extraMode = 0;
ImGui::RadioButton("hex.builtin.view.disassembler.arm.default"_lang, &extraMode, 0);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.arm.cortex_m"_lang, &extraMode, CS_MODE_MCLASS);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.arm.armv8"_lang, &extraMode, CS_MODE_V8);
m_mode = cs_mode(mode | extraMode);
}
break;
case Architecture::MIPS:
{
static int mode = CS_MODE_MIPS32;
ImGui::RadioButton("hex.builtin.view.disassembler.mips.mips32"_lang, &mode, CS_MODE_MIPS32);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.mips.mips64"_lang, &mode, CS_MODE_MIPS64);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.mips.mips32R6"_lang, &mode, CS_MODE_MIPS32R6);
ImGui::RadioButton("hex.builtin.view.disassembler.mips.mips2"_lang, &mode, CS_MODE_MIPS2);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.mips.mips3"_lang, &mode, CS_MODE_MIPS3);
static bool microMode;
ImGui::Checkbox("hex.builtin.view.disassembler.mips.micro"_lang, &microMode);
m_mode = cs_mode(mode | (microMode ? CS_MODE_MICRO : cs_mode(0)));
}
break;
case Architecture::X86:
{
static int mode = CS_MODE_32;
ImGui::RadioButton("hex.builtin.view.disassembler.16bit"_lang, &mode, CS_MODE_16);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.32bit"_lang, &mode, CS_MODE_32);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.64bit"_lang, &mode, CS_MODE_64);
m_mode = cs_mode(mode);
}
break;
case Architecture::PPC:
{
static int mode = CS_MODE_32;
ImGui::RadioButton("hex.builtin.view.disassembler.32bit"_lang, &mode, CS_MODE_32);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.64bit"_lang, &mode, CS_MODE_64);
static bool qpx = false;
ImGui::Checkbox("hex.builtin.view.disassembler.ppc.qpx"_lang, &qpx);
#if CS_API_MAJOR >= 5
static bool spe = false;
ImGui::Checkbox("hex.builtin.view.disassembler.ppc.spe"_lang, &spe);
static bool booke = false;
ImGui::Checkbox("hex.builtin.view.disassembler.ppc.booke"_lang, &booke);
m_mode = cs_mode(mode | (qpx ? CS_MODE_QPX : cs_mode(0)) | (spe ? CS_MODE_SPE : cs_mode(0)) | (booke ? CS_MODE_BOOKE : cs_mode(0)));
#else
m_mode = cs_mode(mode | (qpx ? CS_MODE_QPX : cs_mode(0)));
#endif
}
break;
case Architecture::SPARC:
{
static bool v9Mode = false;
ImGui::Checkbox("hex.builtin.view.disassembler.sparc.v9"_lang, &v9Mode);
m_mode = cs_mode(v9Mode ? CS_MODE_V9 : cs_mode(0));
}
break;
#if CS_API_MAJOR >= 5
case Architecture::RISCV:
{
static int mode = CS_MODE_RISCV32;
ImGui::RadioButton("hex.builtin.view.disassembler.32bit"_lang, &mode, CS_MODE_RISCV32);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.64bit"_lang, &mode, CS_MODE_RISCV64);
static bool compressed = false;
ImGui::Checkbox("hex.builtin.view.disassembler.riscv.compressed"_lang, &compressed);
m_mode = cs_mode(mode | (compressed ? CS_MODE_RISCVC : cs_mode(0)));
}
break;
#endif
case Architecture::M68K:
{
static int selectedMode = 0;
std::pair<const char *, cs_mode> modes[] = {
{"hex.builtin.view.disassembler.m68k.000"_lang, CS_MODE_M68K_000},
{ "hex.builtin.view.disassembler.m68k.010"_lang, CS_MODE_M68K_010},
{ "hex.builtin.view.disassembler.m68k.020"_lang, CS_MODE_M68K_020},
{ "hex.builtin.view.disassembler.m68k.030"_lang, CS_MODE_M68K_030},
{ "hex.builtin.view.disassembler.m68k.040"_lang, CS_MODE_M68K_040},
{ "hex.builtin.view.disassembler.m68k.060"_lang, CS_MODE_M68K_060},
};
if (ImGui::BeginCombo("hex.builtin.view.disassembler.settings.mode"_lang, modes[selectedMode].first)) {
for (u32 i = 0; i < IM_ARRAYSIZE(modes); i++) {
if (ImGui::Selectable(modes[i].first))
selectedMode = i;
}
ImGui::EndCombo();
}
m_mode = cs_mode(modes[selectedMode].second);
}
break;
case Architecture::M680X:
{
static int selectedMode = 0;
std::pair<const char *, cs_mode> modes[] = {
{"hex.builtin.view.disassembler.m680x.6301"_lang, CS_MODE_M680X_6301 },
{ "hex.builtin.view.disassembler.m680x.6309"_lang, CS_MODE_M680X_6309 },
{ "hex.builtin.view.disassembler.m680x.6800"_lang, CS_MODE_M680X_6800 },
{ "hex.builtin.view.disassembler.m680x.6801"_lang, CS_MODE_M680X_6801 },
{ "hex.builtin.view.disassembler.m680x.6805"_lang, CS_MODE_M680X_6805 },
{ "hex.builtin.view.disassembler.m680x.6808"_lang, CS_MODE_M680X_6808 },
{ "hex.builtin.view.disassembler.m680x.6809"_lang, CS_MODE_M680X_6809 },
{ "hex.builtin.view.disassembler.m680x.6811"_lang, CS_MODE_M680X_6811 },
{ "hex.builtin.view.disassembler.m680x.cpu12"_lang, CS_MODE_M680X_CPU12},
{ "hex.builtin.view.disassembler.m680x.hcs08"_lang, CS_MODE_M680X_HCS08},
};
if (ImGui::BeginCombo("hex.builtin.view.disassembler.settings.mode"_lang, modes[selectedMode].first)) {
for (u32 i = 0; i < IM_ARRAYSIZE(modes); i++) {
if (ImGui::Selectable(modes[i].first))
selectedMode = i;
}
ImGui::EndCombo();
}
m_mode = cs_mode(modes[selectedMode].second);
}
break;
#if CS_API_MAJOR >= 5
case Architecture::MOS65XX:
{
static int selectedMode = 0;
std::pair<const char *, cs_mode> modes[] = {
{"hex.builtin.view.disassembler.mos65xx.6502"_lang, CS_MODE_MOS65XX_6502 },
{ "hex.builtin.view.disassembler.mos65xx.65c02"_lang, CS_MODE_MOS65XX_65C02 },
{ "hex.builtin.view.disassembler.mos65xx.w65c02"_lang, CS_MODE_MOS65XX_W65C02 },
{ "hex.builtin.view.disassembler.mos65xx.65816"_lang, CS_MODE_MOS65XX_65816 },
{ "hex.builtin.view.disassembler.mos65xx.65816_long_m"_lang, CS_MODE_MOS65XX_65816_LONG_M },
{ "hex.builtin.view.disassembler.mos65xx.65816_long_x"_lang, CS_MODE_MOS65XX_65816_LONG_X },
{ "hex.builtin.view.disassembler.mos65xx.65816_long_mx"_lang, CS_MODE_MOS65XX_65816_LONG_MX},
};
if (ImGui::BeginCombo("hex.builtin.view.disassembler.settings.mode"_lang, modes[selectedMode].first)) {
for (u32 i = 0; i < IM_ARRAYSIZE(modes); i++) {
if (ImGui::Selectable(modes[i].first))
selectedMode = i;
}
ImGui::EndCombo();
}
m_mode = cs_mode(modes[selectedMode].second);
}
break;
#endif
#if CS_API_MAJOR >= 5
case Architecture::BPF:
{
static int mode = CS_MODE_BPF_CLASSIC;
ImGui::RadioButton("hex.builtin.view.disassembler.bpf.classic"_lang, &mode, CS_MODE_BPF_CLASSIC);
ImGui::SameLine();
ImGui::RadioButton("hex.builtin.view.disassembler.bpf.extended"_lang, &mode, CS_MODE_BPF_EXTENDED);
m_mode = cs_mode(mode);
}
break;
case Architecture::SH:
{
static u32 selectionMode = 0;
static bool fpu = false;
static bool dsp = false;
std::pair<const char*, cs_mode> modes[] = {
{ "hex.builtin.view.disassembler.sh.sh2"_lang, CS_MODE_SH2 },
{ "hex.builtin.view.disassembler.sh.sh2a"_lang, CS_MODE_SH2A },
{ "hex.builtin.view.disassembler.sh.sh3"_lang, CS_MODE_SH3 },
{ "hex.builtin.view.disassembler.sh.sh4"_lang, CS_MODE_SH4 },
{ "hex.builtin.view.disassembler.sh.sh4a"_lang, CS_MODE_SH4A },
};
if (ImGui::BeginCombo("hex.builtin.view.disassembler.settings.mode"_lang, modes[selectionMode].first)) {
for (u32 i = 0; i < IM_ARRAYSIZE(modes); i++) {
if (ImGui::Selectable(modes[i].first))
selectionMode = i;
}
ImGui::EndCombo();
}
ImGui::Checkbox("hex.builtin.view.disassembler.sh.fpu"_lang, &fpu);
ImGui::SameLine();
ImGui::Checkbox("hex.builtin.view.disassembler.sh.dsp"_lang, &dsp);
m_mode = cs_mode(modes[selectionMode].second | (fpu ? CS_MODE_SHFPU : cs_mode(0)) | (dsp ? CS_MODE_SHDSP : cs_mode(0)));
}
break;
case Architecture::TRICORE:
{
static u32 selectionMode = 0;
std::pair<const char*, cs_mode> modes[] = {
{ "hex.builtin.view.disassembler.tricore.110"_lang, CS_MODE_TRICORE_110 },
{ "hex.builtin.view.disassembler.tricore.120"_lang, CS_MODE_TRICORE_120 },
{ "hex.builtin.view.disassembler.tricore.130"_lang, CS_MODE_TRICORE_130 },
{ "hex.builtin.view.disassembler.tricore.131"_lang, CS_MODE_TRICORE_131 },
{ "hex.builtin.view.disassembler.tricore.160"_lang, CS_MODE_TRICORE_160 },
{ "hex.builtin.view.disassembler.tricore.161"_lang, CS_MODE_TRICORE_161 },
{ "hex.builtin.view.disassembler.tricore.162"_lang, CS_MODE_TRICORE_162 },
};
if (ImGui::BeginCombo("hex.builtin.view.disassembler.settings.mode"_lang, modes[selectionMode].first)) {
for (u32 i = 0; i < IM_ARRAYSIZE(modes); i++) {
if (ImGui::Selectable(modes[i].first))
selectionMode = i;
}
ImGui::EndCombo();
}
m_mode = cs_mode(modes[selectionMode].second);
}
break;
case Architecture::WASM:
#endif
case Architecture::EVM:
case Architecture::TMS320C64X:
case Architecture::ARM64:
case Architecture::SYSZ:
case Architecture::XCORE:
m_mode = cs_mode(0);
break;
}
ImGuiExt::EndBox();
}
}
// Draw disassemble button
ImGui::BeginDisabled(m_disassemblerTask.isRunning());
{
if (ImGui::Button("hex.builtin.view.disassembler.disassemble"_lang))
this->disassemble();
}
ImGui::EndDisabled();
// Draw a spinner if the disassembler is running
if (m_disassemblerTask.isRunning()) {
ImGui::SameLine();
ImGuiExt::TextSpinner("hex.builtin.view.disassembler.disassembling"_lang);
}
ImGui::NewLine();
ImGui::TextUnformatted("hex.builtin.view.disassembler.disassembly.title"_lang);
ImGui::Separator();
// Draw disassembly table
if (ImGui::BeginTable("##disassembly", 4, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable)) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.view.disassembler.disassembly.address"_lang);
ImGui::TableSetupColumn("hex.builtin.view.disassembler.disassembly.offset"_lang);
ImGui::TableSetupColumn("hex.builtin.view.disassembler.disassembly.bytes"_lang);
ImGui::TableSetupColumn("hex.builtin.view.disassembler.disassembly.title"_lang);
if (!m_disassemblerTask.isRunning()) {
ImGuiListClipper clipper;
clipper.Begin(m_disassembly.size());
ImGui::TableHeadersRow();
while (clipper.Step()) {
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) {
const auto &instruction = m_disassembly[i];
ImGui::TableNextRow();
ImGui::TableNextColumn();
// Draw a selectable label for the address
ImGui::PushID(i);
if (ImGui::Selectable("##DisassemblyLine", false, ImGuiSelectableFlags_SpanAllColumns)) {
ImHexApi::HexEditor::setSelection(instruction.offset, instruction.size);
}
ImGui::PopID();
// Draw instruction address
ImGui::SameLine();
ImGuiExt::TextFormatted("0x{0:X}", instruction.address);
// Draw instruction offset
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("0x{0:X}", instruction.offset);
// Draw instruction bytes
ImGui::TableNextColumn();
ImGui::TextUnformatted(instruction.bytes.c_str());
// Draw instruction mnemonic and operands
ImGui::TableNextColumn();
ImGuiExt::TextFormattedColored(ImColor(0xFFD69C56), "{}", instruction.mnemonic);
ImGui::SameLine();
ImGui::TextUnformatted(instruction.operators.c_str());
}
}
clipper.End();
}
ImGui::EndTable();
}
}
}
}

View File

@@ -62,7 +62,7 @@ namespace hex::plugin::builtin {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("{}: ", "hex.builtin.common.region"_lang);
ImGuiExt::TextFormatted("{}: ", "hex.ui.common.region"_lang);
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("[ 0x{:08X} - 0x{:08X} ]", region.getStartAddress(), region.getEndAddress());
@@ -663,11 +663,11 @@ namespace hex::plugin::builtin {
if (ImGui::BeginTabBar("SearchMethods")) {
const std::array<std::string, 5> StringTypes = {
"hex.builtin.common.encoding.ascii"_lang,
"hex.builtin.common.encoding.utf16le"_lang,
"hex.builtin.common.encoding.utf16be"_lang,
hex::format("{} + {}", "hex.builtin.common.encoding.ascii"_lang, "hex.builtin.common.encoding.utf16le"_lang),
hex::format("{} + {}", "hex.builtin.common.encoding.ascii"_lang, "hex.builtin.common.encoding.utf16be"_lang)
"hex.ui.common.encoding.ascii"_lang,
"hex.ui.common.encoding.utf16le"_lang,
"hex.ui.common.encoding.utf16be"_lang,
hex::format("{} + {}", "hex.ui.common.encoding.ascii"_lang, "hex.ui.common.encoding.utf16le"_lang),
hex::format("{} + {}", "hex.ui.common.encoding.ascii"_lang, "hex.ui.common.encoding.utf16be"_lang)
};
auto &mode = m_searchSettings.mode;
@@ -679,7 +679,7 @@ namespace hex::plugin::builtin {
if (settings.minLength < 1)
settings.minLength = 1;
if (ImGui::BeginCombo("hex.builtin.common.type"_lang, StringTypes[std::to_underlying(settings.type)].c_str())) {
if (ImGui::BeginCombo("hex.ui.common.type"_lang, StringTypes[std::to_underlying(settings.type)].c_str())) {
for (size_t i = 0; i < StringTypes.size(); i++) {
auto type = static_cast<SearchSettings::StringType>(i);
@@ -711,9 +711,9 @@ namespace hex::plugin::builtin {
mode = SearchSettings::Mode::Sequence;
ImGuiExt::InputTextIcon("hex.builtin.common.value"_lang, ICON_VS_SYMBOL_KEY, settings.sequence);
ImGuiExt::InputTextIcon("hex.ui.common.value"_lang, ICON_VS_SYMBOL_KEY, settings.sequence);
if (ImGui::BeginCombo("hex.builtin.common.type"_lang, StringTypes[std::to_underlying(settings.type)].c_str())) {
if (ImGui::BeginCombo("hex.ui.common.type"_lang, StringTypes[std::to_underlying(settings.type)].c_str())) {
for (size_t i = 0; i < StringTypes.size() - 2; i++) {
auto type = static_cast<SearchSettings::StringType>(i);
@@ -738,7 +738,7 @@ namespace hex::plugin::builtin {
if (settings.minLength < 1)
settings.minLength = 1;
if (ImGui::BeginCombo("hex.builtin.common.type"_lang, StringTypes[std::to_underlying(settings.type)].c_str())) {
if (ImGui::BeginCombo("hex.ui.common.type"_lang, StringTypes[std::to_underlying(settings.type)].c_str())) {
for (size_t i = 0; i < StringTypes.size(); i++) {
auto type = static_cast<SearchSettings::StringType>(i);
@@ -794,7 +794,7 @@ namespace hex::plugin::builtin {
if (ImGuiExt::InputTextIcon("hex.builtin.view.find.value.min"_lang, ICON_VS_SYMBOL_NUMERIC, settings.inputMin)) edited = true;
if (ImGuiExt::InputTextIcon("hex.builtin.view.find.value.max"_lang, ICON_VS_SYMBOL_NUMERIC, settings.inputMax)) edited = true;
} else {
if (ImGuiExt::InputTextIcon("hex.builtin.common.value"_lang, ICON_VS_SYMBOL_NUMERIC, settings.inputMin)) {
if (ImGuiExt::InputTextIcon("hex.ui.common.value"_lang, ICON_VS_SYMBOL_NUMERIC, settings.inputMin)) {
edited = true;
settings.inputMax = settings.inputMin;
}
@@ -810,19 +810,19 @@ namespace hex::plugin::builtin {
ImGui::NewLine();
const std::array<std::string, 10> InputTypes = {
"hex.builtin.common.type.u8"_lang,
"hex.builtin.common.type.u16"_lang,
"hex.builtin.common.type.u32"_lang,
"hex.builtin.common.type.u64"_lang,
"hex.builtin.common.type.i8"_lang,
"hex.builtin.common.type.i16"_lang,
"hex.builtin.common.type.i32"_lang,
"hex.builtin.common.type.i64"_lang,
"hex.builtin.common.type.f32"_lang,
"hex.builtin.common.type.f64"_lang
"hex.ui.common.type.u8"_lang,
"hex.ui.common.type.u16"_lang,
"hex.ui.common.type.u32"_lang,
"hex.ui.common.type.u64"_lang,
"hex.ui.common.type.i8"_lang,
"hex.ui.common.type.i16"_lang,
"hex.ui.common.type.i32"_lang,
"hex.ui.common.type.i64"_lang,
"hex.ui.common.type.f32"_lang,
"hex.ui.common.type.f64"_lang
};
if (ImGui::BeginCombo("hex.builtin.common.type"_lang, InputTypes[std::to_underlying(settings.type)].c_str())) {
if (ImGui::BeginCombo("hex.ui.common.type"_lang, InputTypes[std::to_underlying(settings.type)].c_str())) {
for (size_t i = 0; i < InputTypes.size(); i++) {
auto type = static_cast<SearchSettings::Value::Type>(i);
@@ -843,8 +843,8 @@ namespace hex::plugin::builtin {
}
}();
std::array options = { "hex.builtin.common.little"_lang, "hex.builtin.common.big"_lang };
if (ImGui::SliderInt("hex.builtin.common.endian"_lang, &selection, 0, options.size() - 1, options[selection], ImGuiSliderFlags_NoInput)) {
std::array options = { "hex.ui.common.little"_lang, "hex.ui.common.big"_lang };
if (ImGui::SliderInt("hex.ui.common.endian"_lang, &selection, 0, options.size() - 1, options[selection], ImGuiSliderFlags_NoInput)) {
edited = true;
switch (selection) {
default:
@@ -932,9 +932,9 @@ namespace hex::plugin::builtin {
if (ImGui::BeginTable("##entries", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Sortable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_ScrollY, ImMax(ImGui::GetContentRegionAvail(), ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 5)))) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.common.offset"_lang, 0, -1, ImGui::GetID("offset"));
ImGui::TableSetupColumn("hex.builtin.common.size"_lang, 0, -1, ImGui::GetID("size"));
ImGui::TableSetupColumn("hex.builtin.common.value"_lang, 0, -1, ImGui::GetID("value"));
ImGui::TableSetupColumn("hex.ui.common.offset"_lang, 0, -1, ImGui::GetID("offset"));
ImGui::TableSetupColumn("hex.ui.common.size"_lang, 0, -1, ImGui::GetID("size"));
ImGui::TableSetupColumn("hex.ui.common.value"_lang, 0, -1, ImGui::GetID("value"));
auto sortSpecs = ImGui::TableGetSortSpecs();

View File

@@ -13,7 +13,7 @@
#include <wolv/math_eval/math_evaluator.hpp>
#include <content/providers/view_provider.hpp>
#include <content/popups/popup_file_chooser.hpp>
#include <popups/popup_file_chooser.hpp>
#include <imgui_internal.h>
#include <content/popups/popup_blocking_task.hpp>
@@ -214,7 +214,7 @@ namespace hex::plugin::builtin {
}
if (!m_searchTask.isRunning() && !searchSequence.empty() && m_shouldSearch) {
m_searchTask = TaskManager::createTask("hex.builtin.common.processing", ImHexApi::Provider::get()->getActualSize(), [this, editor, searchSequence](auto &) {
m_searchTask = TaskManager::createTask("hex.ui.common.processing", ImHexApi::Provider::get()->getActualSize(), [this, editor, searchSequence](auto &) {
for (u8 retry = 0; retry < 2; retry++) {
auto region = this->findSequence(searchSequence, m_backwards);
@@ -349,7 +349,7 @@ namespace hex::plugin::builtin {
editor->closePopup();
}
ImGuiExt::ConfirmButtons("hex.builtin.common.set"_lang, "hex.builtin.common.cancel"_lang,
ImGuiExt::ConfirmButtons("hex.ui.common.set"_lang, "hex.ui.common.cancel"_lang,
[&, this]{
setBaseAddress(m_baseAddress);
editor->closePopup();
@@ -383,7 +383,7 @@ namespace hex::plugin::builtin {
editor->closePopup();
}
ImGuiExt::ConfirmButtons("hex.builtin.common.set"_lang, "hex.builtin.common.cancel"_lang,
ImGuiExt::ConfirmButtons("hex.ui.common.set"_lang, "hex.ui.common.cancel"_lang,
[&, this]{
setPageSize(m_pageSize);
editor->closePopup();
@@ -421,7 +421,7 @@ namespace hex::plugin::builtin {
editor->closePopup();
}
ImGuiExt::ConfirmButtons("hex.builtin.common.set"_lang, "hex.builtin.common.cancel"_lang,
ImGuiExt::ConfirmButtons("hex.ui.common.set"_lang, "hex.ui.common.cancel"_lang,
[&, this]{
this->resize(m_size);
editor->closePopup();
@@ -448,10 +448,10 @@ namespace hex::plugin::builtin {
void draw(ViewHexEditor *editor) override {
ImGui::TextUnformatted("hex.builtin.view.hex_editor.menu.edit.insert"_lang);
ImGuiExt::InputHexadecimal("hex.builtin.common.address"_lang, &m_address);
ImGuiExt::InputHexadecimal("hex.builtin.common.size"_lang, &m_size);
ImGuiExt::InputHexadecimal("hex.ui.common.address"_lang, &m_address);
ImGuiExt::InputHexadecimal("hex.ui.common.size"_lang, &m_size);
ImGuiExt::ConfirmButtons("hex.builtin.common.set"_lang, "hex.builtin.common.cancel"_lang,
ImGuiExt::ConfirmButtons("hex.ui.common.set"_lang, "hex.ui.common.cancel"_lang,
[&, this]{
insert(m_address, m_size);
editor->closePopup();
@@ -479,10 +479,10 @@ namespace hex::plugin::builtin {
void draw(ViewHexEditor *editor) override {
ImGui::TextUnformatted("hex.builtin.view.hex_editor.menu.edit.remove"_lang);
ImGuiExt::InputHexadecimal("hex.builtin.common.address"_lang, &m_address);
ImGuiExt::InputHexadecimal("hex.builtin.common.size"_lang, &m_size);
ImGuiExt::InputHexadecimal("hex.ui.common.address"_lang, &m_address);
ImGuiExt::InputHexadecimal("hex.ui.common.size"_lang, &m_size);
ImGuiExt::ConfirmButtons("hex.builtin.common.set"_lang, "hex.builtin.common.cancel"_lang,
ImGuiExt::ConfirmButtons("hex.ui.common.set"_lang, "hex.ui.common.cancel"_lang,
[&, this]{
remove(m_address, m_size);
editor->closePopup();
@@ -510,14 +510,14 @@ namespace hex::plugin::builtin {
void draw(ViewHexEditor *editor) override {
ImGui::TextUnformatted("hex.builtin.view.hex_editor.menu.edit.fill"_lang);
ImGuiExt::InputHexadecimal("hex.builtin.common.address"_lang, &m_address);
ImGuiExt::InputHexadecimal("hex.builtin.common.size"_lang, &m_size);
ImGuiExt::InputHexadecimal("hex.ui.common.address"_lang, &m_address);
ImGuiExt::InputHexadecimal("hex.ui.common.size"_lang, &m_size);
ImGui::Separator();
ImGuiExt::InputTextIcon("hex.builtin.common.bytes"_lang, ICON_VS_SYMBOL_NAMESPACE, m_input);
ImGuiExt::InputTextIcon("hex.ui.common.bytes"_lang, ICON_VS_SYMBOL_NAMESPACE, m_input);
ImGuiExt::ConfirmButtons("hex.builtin.common.set"_lang, "hex.builtin.common.cancel"_lang,
ImGuiExt::ConfirmButtons("hex.ui.common.set"_lang, "hex.ui.common.cancel"_lang,
[&, this] {
fill(m_address, m_size, m_input);
editor->closePopup();
@@ -640,6 +640,9 @@ namespace hex::plugin::builtin {
EventProviderChanged::unsubscribe(this);
EventProviderOpened::unsubscribe(this);
EventHighlightingChanged::unsubscribe(this);
EventSettingsChanged::unsubscribe(this);
ContentRegistry::Settings::write("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.bytes_per_row", m_hexEditor.getBytesPerRow());
}
void ViewHexEditor::drawPopup() {
@@ -1037,6 +1040,14 @@ namespace hex::plugin::builtin {
return true;
}
});
m_hexEditor.setBytesPerRow(ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.bytes_per_row", m_hexEditor.getBytesPerRow()));
EventSettingsChanged::subscribe(this, [this] {
m_hexEditor.setSelectionColor(ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.highlight_color", 0x60C08080));
m_hexEditor.enableSyncScrolling(ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.sync_scrolling", false));
m_hexEditor.setByteCellPadding(ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.byte_padding", 0));
m_hexEditor.setCharacterCellPadding(ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.char_padding", 0));
});
}
void ViewHexEditor::registerMenuItems() {
@@ -1079,7 +1090,7 @@ namespace hex::plugin::builtin {
}
}
PopupFileChooser::open(basePaths, paths, std::vector<hex::fs::ItemFilter>{ {"Thingy Table File", "tbl"} }, false,
ui::PopupFileChooser::open(basePaths, paths, std::vector<hex::fs::ItemFilter>{ {"Thingy Table File", "tbl"} }, false,
[this](const auto &path) {
TaskManager::createTask("Loading encoding file", 0, [this, path](auto&) {
auto encoding = EncodingFile(EncodingFile::Type::Thingy, path);
@@ -1280,13 +1291,13 @@ namespace hex::plugin::builtin {
return (value >= provider->getBaseAddress()) && (value < (provider->getBaseAddress() + provider->getActualSize()));
};
if (ImGui::MenuItem(hex::format("0x{:08X}", littleEndianValue).c_str(), "hex.builtin.common.little_endian"_lang, false, canJumpTo(littleEndianValue))) {
if (ImGui::MenuItem(hex::format("0x{:08X}", littleEndianValue).c_str(), "hex.ui.common.little_endian"_lang, false, canJumpTo(littleEndianValue))) {
if (value < provider->getBaseAddress() + provider->getActualSize()) {
ImHexApi::HexEditor::setSelection(littleEndianValue, 1);
}
}
if (ImGui::MenuItem(hex::format("0x{:08X}", bigEndianValue).c_str(), "hex.builtin.common.big_endian"_lang, false, canJumpTo(bigEndianValue))) {
if (ImGui::MenuItem(hex::format("0x{:08X}", bigEndianValue).c_str(), "hex.ui.common.big_endian"_lang, false, canJumpTo(bigEndianValue))) {
if (value < provider->getBaseAddress() + provider->getActualSize()) {
ImHexApi::HexEditor::setSelection(bigEndianValue, 1);
}

View File

@@ -14,7 +14,7 @@
#include <implot.h>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
namespace hex::plugin::builtin {
@@ -48,7 +48,7 @@ namespace hex::plugin::builtin {
ContentRegistry::FileHandler::add({ ".mgc" }, [](const auto &path) {
for (const auto &destPath : fs::getDefaultPaths(fs::ImHexPath::Magic)) {
if (wolv::io::fs::copyFile(path, destPath / path.filename(), std::fs::copy_options::overwrite_existing)) {
PopupInfo::open("hex.builtin.view.information.magic_db_added"_lang);
ui::PopupInfo::open("hex.builtin.view.information.magic_db_added"_lang);
return true;
}
}
@@ -141,7 +141,7 @@ namespace hex::plugin::builtin {
auto provider = ImHexApi::Provider::get();
if (ImHexApi::Provider::isValid() && provider->isReadable()) {
ImGui::BeginDisabled(m_analyzerTask.isRunning());
ImGuiExt::BeginSubWindow("hex.builtin.common.settings"_lang);
ImGuiExt::BeginSubWindow("hex.ui.common.settings"_lang);
{
if (ImGui::BeginTable("SettingsTable", 2, ImGuiTableFlags_BordersInner | ImGuiTableFlags_SizingFixedSame, ImVec2(ImGui::GetContentRegionAvail().x, 0))) {
ImGui::TableSetupColumn("Left", ImGuiTableColumnFlags_WidthStretch, 0.5F);

View File

@@ -19,8 +19,8 @@
#include <hex/helpers/fmt.hpp>
#include <fmt/chrono.h>
#include <content/popups/popup_file_chooser.hpp>
#include <content/popups/popup_question.hpp>
#include <popups/popup_file_chooser.hpp>
#include <popups/popup_question.hpp>
#include <nlohmann/json.hpp>
#include <chrono>
@@ -360,7 +360,7 @@ namespace hex::plugin::builtin {
}
if (m_dangerousFunctionCalled && !ImGui::IsPopupOpen(ImGuiID(0), ImGuiPopupFlags_AnyPopup)) {
PopupQuestion::open("hex.builtin.view.pattern_editor.dangerous_function.desc"_lang,
ui::PopupQuestion::open("hex.builtin.view.pattern_editor.dangerous_function.desc"_lang,
[this] {
m_dangerousFunctionsAllowed = DangerousFunctionPerms::Allow;
}, [this] {
@@ -567,8 +567,8 @@ namespace hex::plugin::builtin {
if (ImGui::BeginTable("##sections_table", 3, ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_ScrollY, size)) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.common.name"_lang, ImGuiTableColumnFlags_WidthStretch, 0.5F);
ImGui::TableSetupColumn("hex.builtin.common.size"_lang, ImGuiTableColumnFlags_WidthStretch, 0.5F);
ImGui::TableSetupColumn("hex.ui.common.name"_lang, ImGuiTableColumnFlags_WidthStretch, 0.5F);
ImGui::TableSetupColumn("hex.ui.common.size"_lang, ImGuiTableColumnFlags_WidthStretch, 0.5F);
ImGui::TableSetupColumn("##button", ImGuiTableColumnFlags_WidthFixed, 20_scaled);
ImGui::TableHeadersRow();
@@ -903,32 +903,32 @@ namespace hex::plugin::builtin {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("{} ", "hex.builtin.common.type"_lang);
ImGuiExt::TextFormatted("{} ", "hex.ui.common.type"_lang);
ImGui::TableNextColumn();
ImGuiExt::TextFormatted(" {}", pattern->getTypeName());
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("{} ", "hex.builtin.common.address"_lang);
ImGuiExt::TextFormatted("{} ", "hex.ui.common.address"_lang);
ImGui::TableNextColumn();
ImGuiExt::TextFormatted(" 0x{:08X}", pattern->getOffset());
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("{} ", "hex.builtin.common.size"_lang);
ImGuiExt::TextFormatted("{} ", "hex.ui.common.size"_lang);
ImGui::TableNextColumn();
ImGuiExt::TextFormatted(" {}", hex::toByteString(pattern->getSize()));
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("{} ", "hex.builtin.common.endian"_lang);
ImGuiExt::TextFormatted("{} ", "hex.ui.common.endian"_lang);
ImGui::TableNextColumn();
ImGuiExt::TextFormatted(" {}", pattern->getEndian() == std::endian::little ? "hex.builtin.common.little"_lang : "hex.builtin.common.big"_lang);
ImGuiExt::TextFormatted(" {}", pattern->getEndian() == std::endian::little ? "hex.ui.common.little"_lang : "hex.ui.common.big"_lang);
if (const auto &comment = pattern->getComment(); !comment.empty()) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("{} ", "hex.builtin.common.comment"_lang);
ImGuiExt::TextFormatted("{} ", "hex.ui.common.comment"_lang);
ImGui::TableNextColumn();
ImGui::TextWrapped(" \"%s\"", comment.c_str());
}
@@ -1208,7 +1208,7 @@ namespace hex::plugin::builtin {
}
}
PopupFileChooser::open(basePaths, paths, std::vector<hex::fs::ItemFilter>{ { "Pattern File", "hexpat" } }, false,
ui::PopupFileChooser::open(basePaths, paths, std::vector<hex::fs::ItemFilter>{ { "Pattern File", "hexpat" } }, false,
[this, provider](const std::fs::path &path) {
this->loadPatternFile(path, provider);
AchievementManager::unlockAchievement("hex.builtin.achievement.patterns", "hex.builtin.achievement.patterns.load_existing.name");

View File

@@ -1,6 +1,6 @@
#include "content/views/view_provider_settings.hpp"
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
#include <hex/api/content_registry.hpp>
namespace hex::plugin::builtin {
@@ -37,7 +37,7 @@ namespace hex::plugin::builtin {
ImGui::Separator();
ImGui::BeginDisabled(!settingsValid);
if (ImGui::Button("hex.builtin.common.open"_lang)) {
if (ImGui::Button("hex.ui.common.open"_lang)) {
if (provider->open()) {
EventProviderOpened::post(provider);
@@ -49,9 +49,9 @@ namespace hex::plugin::builtin {
ImGui::CloseCurrentPopup();
auto errorMessage = provider->getErrorMessage();
if (errorMessage.empty()) {
PopupError::open("hex.builtin.view.provider_settings.load_error"_lang);
ui::PopupError::open("hex.builtin.view.provider_settings.load_error"_lang);
} else {
PopupError::open(hex::format("hex.builtin.view.provider_settings.load_error_details"_lang, errorMessage));
ui::PopupError::open(hex::format("hex.builtin.view.provider_settings.load_error_details"_lang, errorMessage));
}
TaskManager::doLater([=] { ImHexApi::Provider::remove(provider); });
}
@@ -60,7 +60,7 @@ namespace hex::plugin::builtin {
ImGui::SameLine();
if (ImGui::Button("hex.builtin.common.cancel"_lang)) {
if (ImGui::Button("hex.ui.common.cancel"_lang)) {
ImGui::CloseCurrentPopup();
this->getWindowOpenState() = false;
TaskManager::doLater([=] { ImHexApi::Provider::remove(provider); });

View File

@@ -5,7 +5,7 @@
#include <nlohmann/json.hpp>
#include <content/popups/popup_question.hpp>
#include <popups/popup_question.hpp>
namespace hex::plugin::builtin {
@@ -111,7 +111,7 @@ namespace hex::plugin::builtin {
// If a restart is required, ask the user if they want to restart
if (!this->getWindowOpenState() && m_triggerPopup) {
m_triggerPopup = false;
PopupQuestion::open("hex.builtin.view.settings.restart_question"_lang,
ui::PopupQuestion::open("hex.builtin.view.settings.restart_question"_lang,
ImHexApi::System::restartImHex,
[this]{
m_restartRequested = false;

View File

@@ -5,7 +5,7 @@
#include <hex/api/content_registry.hpp>
#include <content/popups/popup_notification.hpp>
#include <popups/popup_notification.hpp>
#include <imgui.h>
@@ -310,7 +310,7 @@ namespace hex::plugin::builtin {
}
if (!downloading) {
PopupError::open("hex.builtin.view.store.download_error"_lang);
ui::PopupError::open("hex.builtin.view.store.download_error"_lang);
return false;
}

View File

@@ -1,446 +0,0 @@
#include "content/views/view_yara.hpp"
#include <hex/api/content_registry.hpp>
#include <hex/api/project_file_manager.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fs.hpp>
#include <content/popups/popup_notification.hpp>
#include <content/popups/popup_file_chooser.hpp>
// <yara/types.h>'s RE type has a zero-sized array, which is not allowed in ISO C++.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#include <yara.h>
#pragma GCC diagnostic pop
#include <filesystem>
#include <thread>
#include <wolv/io/file.hpp>
#include <wolv/io/fs.hpp>
#include <wolv/utils/guards.hpp>
#include <wolv/literals.hpp>
namespace hex::plugin::builtin {
using namespace wolv::literals;
ViewYara::ViewYara() : View::Window("hex.builtin.view.yara.name") {
yr_initialize();
ContentRegistry::FileHandler::add({ ".yar", ".yara" }, [](const auto &path) {
for (const auto &destPath : fs::getDefaultPaths(fs::ImHexPath::Yara)) {
if (wolv::io::fs::copyFile(path, destPath / path.filename(), std::fs::copy_options::overwrite_existing)) {
PopupInfo::open("hex.builtin.view.yara.rule_added"_lang);
return true;
}
}
return false;
});
ProjectFile::registerPerProviderHandler({
.basePath = "yara.json",
.required = false,
.load = [this](prv::Provider *provider, const std::fs::path &basePath, Tar &tar) -> bool {
auto fileContent = tar.readString(basePath);
if (fileContent.empty())
return true;
auto data = nlohmann::json::parse(fileContent.begin(), fileContent.end());
if (!data.contains("rules"))
return false;
auto &rules = data["rules"];
if (!rules.is_array())
return false;
m_matches.get(provider).clear();
for (auto &rule : rules) {
if (!rule.contains("name") || !rule.contains("path"))
return false;
auto &name = rule["name"];
auto &path = rule["path"];
if (!name.is_string() || !path.is_string())
return false;
m_rules.get(provider).emplace_back(std::fs::path(name.get<std::string>()), std::fs::path(path.get<std::string>()));
}
return true;
},
.store = [this](prv::Provider *provider, const std::fs::path &basePath, Tar &tar) -> bool {
nlohmann::json data;
data["rules"] = nlohmann::json::array();
for (auto &[name, path] : m_rules.get(provider)) {
data["rules"].push_back({
{ "name", wolv::util::toUTF8String(name) },
{ "path", wolv::util::toUTF8String(path) }
});
}
tar.writeString(basePath, data.dump(4));
return true;
}
});
}
ViewYara::~ViewYara() {
yr_finalize();
}
void ViewYara::drawContent() {
ImGuiExt::Header("hex.builtin.view.yara.header.rules"_lang, true);
if (ImGui::BeginListBox("##rules", ImVec2(-FLT_MIN, ImGui::GetTextLineHeightWithSpacing() * 5))) {
for (u32 i = 0; i < m_rules->size(); i++) {
const bool selected = (m_selectedRule == i);
if (ImGui::Selectable(wolv::util::toUTF8String((*m_rules)[i].first).c_str(), selected)) {
m_selectedRule = i;
}
}
ImGui::EndListBox();
}
if (ImGuiExt::IconButton(ICON_VS_ADD, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
const auto basePaths = fs::getDefaultPaths(fs::ImHexPath::Yara);
std::vector<std::fs::path> paths;
for (const auto &path : basePaths) {
std::error_code error;
for (const auto &entry : std::fs::recursive_directory_iterator(path, error)) {
if (!entry.is_regular_file()) continue;
if (entry.path().extension() != ".yara" && entry.path().extension() != ".yar") continue;
paths.push_back(entry);
}
}
PopupFileChooser::open(basePaths, paths, std::vector<hex::fs::ItemFilter>{ { "Yara File", "yara" }, { "Yara File", "yar" } }, true,
[&](const auto &path) {
m_rules->push_back({ path.filename(), path });
});
}
ImGui::SameLine();
if (ImGuiExt::IconButton(ICON_VS_REMOVE, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
if (m_selectedRule < m_rules->size()) {
m_rules->erase(m_rules->begin() + m_selectedRule);
m_selectedRule = std::min(m_selectedRule, u32(m_rules->size() - 1));
}
}
ImGui::NewLine();
if (ImGui::Button("hex.builtin.view.yara.match"_lang)) this->applyRules();
ImGui::SameLine();
if (m_matcherTask.isRunning()) {
ImGui::SameLine();
ImGuiExt::TextSpinner("hex.builtin.view.yara.matching"_lang);
}
ImGuiExt::Header("hex.builtin.view.yara.header.matches"_lang);
auto matchesTableSize = ImGui::GetContentRegionAvail();
matchesTableSize.y *= 3.75 / 5.0;
matchesTableSize.y -= ImGui::GetTextLineHeightWithSpacing();
if (ImGui::BeginTable("matches", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_ScrollY, matchesTableSize)) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("hex.builtin.view.yara.matches.identifier"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("identifier"));
ImGui::TableSetupColumn("hex.builtin.view.yara.matches.variable"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("variable"));
ImGui::TableSetupColumn("hex.builtin.common.address"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("address"));
ImGui::TableSetupColumn("hex.builtin.common.size"_lang, ImGuiTableColumnFlags_PreferSortAscending, 0, ImGui::GetID("size"));
ImGui::TableHeadersRow();
auto sortSpecs = ImGui::TableGetSortSpecs();
if (!m_matches->empty() && (sortSpecs->SpecsDirty || m_sortedMatches->empty())) {
m_sortedMatches->clear();
std::transform(m_matches->begin(), m_matches->end(), std::back_inserter(*m_sortedMatches), [](auto &match) {
return &match;
});
std::sort(m_sortedMatches->begin(), m_sortedMatches->end(), [&sortSpecs](const YaraMatch *left, const YaraMatch *right) -> bool {
if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("identifier"))
return left->identifier < right->identifier;
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("variable"))
return left->variable < right->variable;
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("address"))
return left->address < right->address;
else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("size"))
return left->size < right->size;
else
return false;
});
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Descending)
std::reverse(m_sortedMatches->begin(), m_sortedMatches->end());
sortSpecs->SpecsDirty = false;
}
if (!m_matcherTask.isRunning()) {
ImGuiListClipper clipper;
clipper.Begin(m_sortedMatches->size());
while (clipper.Step()) {
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) {
auto &[identifier, variableName, address, size, wholeDataMatch, highlightId, tooltipId] = *(*m_sortedMatches)[i];
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::PushID(i);
if (ImGui::Selectable("match", false, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap)) {
ImHexApi::HexEditor::setSelection(address, size);
}
ImGui::PopID();
ImGui::SameLine();
ImGui::TextUnformatted(identifier.c_str());
ImGui::TableNextColumn();
ImGui::TextUnformatted(variableName.c_str());
if (!wholeDataMatch) {
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("0x{0:X} : 0x{1:X}", address, address + size - 1);
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("0x{0:X}", size);
} else {
ImGui::TableNextColumn();
ImGuiExt::TextFormattedColored(ImVec4(0.92F, 0.25F, 0.2F, 1.0F), "{}", "hex.builtin.view.yara.whole_data"_lang);
ImGui::TableNextColumn();
ImGui::TextUnformatted("");
}
}
}
clipper.End();
}
ImGui::EndTable();
}
auto consoleSize = ImGui::GetContentRegionAvail();
if (ImGui::BeginChild("##console", consoleSize, true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_HorizontalScrollbar)) {
ImGuiListClipper clipper;
clipper.Begin(m_consoleMessages.size());
while (clipper.Step())
for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) {
const auto &message = m_consoleMessages[i];
if (ImGui::Selectable(message.c_str()))
ImGui::SetClipboardText(message.c_str());
}
}
ImGui::EndChild();
}
void ViewYara::clearResult() {
for (const auto &match : *m_matches) {
ImHexApi::HexEditor::removeBackgroundHighlight(match.highlightId);
ImHexApi::HexEditor::removeTooltip(match.tooltipId);
}
m_matches->clear();
m_consoleMessages.clear();
}
void ViewYara::applyRules() {
this->clearResult();
m_matcherTask = TaskManager::createTask("hex.builtin.view.yara.matching", 0, [this](auto &task) {
if (!ImHexApi::Provider::isValid()) return;
struct ResultContext {
Task *task = nullptr;
std::vector<YaraMatch> newMatches;
std::vector<std::string> consoleMessages;
};
ResultContext resultContext;
resultContext.task = &task;
for (const auto &[fileName, filePath] : *m_rules) {
YR_COMPILER *compiler = nullptr;
yr_compiler_create(&compiler);
ON_SCOPE_EXIT {
yr_compiler_destroy(compiler);
};
auto currFilePath = wolv::util::toUTF8String(wolv::io::fs::toShortPath(filePath));
yr_compiler_set_include_callback(
compiler,
[](const char *includeName, const char *, const char *, void *userData) -> const char * {
wolv::io::File file(std::fs::path(static_cast<const char *>(userData)).parent_path() / includeName, wolv::io::File::Mode::Read);
if (!file.isValid())
return nullptr;
auto size = file.getSize();
char *buffer = new char[size + 1];
file.readBuffer(reinterpret_cast<u8 *>(buffer), size);
buffer[size] = 0x00;
return buffer;
},
[](const char *ptr, void *userData) {
hex::unused(userData);
delete[] ptr;
},
currFilePath.data()
);
wolv::io::File file((*m_rules)[m_selectedRule].second, wolv::io::File::Mode::Read);
if (!file.isValid()) return;
if (yr_compiler_add_file(compiler, file.getHandle(), nullptr, nullptr) != 0) {
std::string errorMessage(0xFFFF, '\x00');
yr_compiler_get_error_message(compiler, errorMessage.data(), errorMessage.size());
TaskManager::doLater([this, errorMessage = wolv::util::trim(errorMessage)] {
this->clearResult();
m_consoleMessages.push_back(hex::format("hex.builtin.view.yara.error"_lang, errorMessage));
});
return;
}
YR_RULES *yaraRules;
yr_compiler_get_rules(compiler, &yaraRules);
ON_SCOPE_EXIT { yr_rules_destroy(yaraRules); };
YR_MEMORY_BLOCK_ITERATOR iterator;
struct ScanContext {
Task *task = nullptr;
std::vector<u8> buffer;
YR_MEMORY_BLOCK currBlock = {};
};
ScanContext context;
context.task = &task;
context.currBlock.base = 0;
context.currBlock.fetch_data = [](auto *block) -> const u8 * {
auto &context = *static_cast<ScanContext *>(block->context);
auto provider = ImHexApi::Provider::get();
context.buffer.resize(context.currBlock.size);
if (context.buffer.empty())
return nullptr;
block->size = context.currBlock.size;
provider->read(context.currBlock.base + provider->getBaseAddress(), context.buffer.data(), context.buffer.size());
return context.buffer.data();
};
iterator.file_size = [](auto *iterator) -> u64 {
hex::unused(iterator);
return ImHexApi::Provider::get()->getActualSize();
};
iterator.context = &context;
iterator.first = [](YR_MEMORY_BLOCK_ITERATOR *iterator) -> YR_MEMORY_BLOCK *{
auto &context = *static_cast<ScanContext *>(iterator->context);
context.currBlock.base = 0;
context.currBlock.size = 0;
context.buffer.clear();
iterator->last_error = ERROR_SUCCESS;
return iterator->next(iterator);
};
iterator.next = [](YR_MEMORY_BLOCK_ITERATOR *iterator) -> YR_MEMORY_BLOCK * {
auto &context = *static_cast<ScanContext *>(iterator->context);
u64 address = context.currBlock.base + context.currBlock.size;
iterator->last_error = ERROR_SUCCESS;
context.currBlock.base = address;
context.currBlock.size = std::min<size_t>(ImHexApi::Provider::get()->getActualSize() - address, 10_MiB);
context.currBlock.context = &context;
context.task->update(address);
if (context.currBlock.size == 0) return nullptr;
return &context.currBlock;
};
yr_rules_scan_mem_blocks(
yaraRules, &iterator, 0, [](YR_SCAN_CONTEXT *context, int message, void *data, void *userData) -> int {
auto &results = *static_cast<ResultContext *>(userData);
switch (message) {
case CALLBACK_MSG_RULE_MATCHING:
{
auto rule = static_cast<YR_RULE *>(data);
if (rule->strings != nullptr) {
YR_STRING *string = nullptr;
YR_MATCH *match = nullptr;
yr_rule_strings_foreach(rule, string) {
yr_string_matches_foreach(context, string, match) {
results.newMatches.push_back({ rule->identifier, string->identifier, u64(match->offset), size_t(match->match_length), false, 0, 0 });
}
}
} else {
results.newMatches.push_back({ rule->identifier, "", 0, 0, true, 0, 0 });
}
}
break;
case CALLBACK_MSG_CONSOLE_LOG:
{
results.consoleMessages.emplace_back(static_cast<const char *>(data));
}
break;
default:
break;
}
return results.task->shouldInterrupt() ? CALLBACK_ABORT : CALLBACK_CONTINUE;
},
&resultContext,
0);
}
TaskManager::doLater([this, resultContext] {
for (const auto &match : *m_matches) {
ImHexApi::HexEditor::removeBackgroundHighlight(match.highlightId);
ImHexApi::HexEditor::removeTooltip(match.tooltipId);
}
m_consoleMessages = resultContext.consoleMessages;
std::move(resultContext.newMatches.begin(), resultContext.newMatches.end(), std::back_inserter(*m_matches));
auto uniques = std::set(m_matches->begin(), m_matches->end(), [](const auto &l, const auto &r) {
return std::tie(l.address, l.size, l.wholeDataMatch, l.identifier, l.variable) <
std::tie(r.address, r.size, r.wholeDataMatch, r.identifier, r.variable);
});
m_matches->clear();
std::move(uniques.begin(), uniques.end(), std::back_inserter(*m_matches));
constexpr static color_t YaraColor = 0x70B4771F;
for (auto &match : uniques) {
match.highlightId = ImHexApi::HexEditor::addBackgroundHighlight({ match.address, match.size }, YaraColor);
match.tooltipId = ImHexApi::HexEditor::addTooltip({ match. address, match.size }, hex::format("{0} [{1}]", match.identifier, match.variable), YaraColor);
}
});
});
}
}

View File

@@ -29,7 +29,7 @@
#include <string>
#include <random>
#include <content/popups/popup_question.hpp>
#include <popups/popup_question.hpp>
#include <hex/api/tutorial_manager.hpp>
#include <hex/api/workspace_manager.hpp>
@@ -126,13 +126,13 @@ namespace hex::plugin::builtin {
ImGui::NewLine();
static bool dontShowAgain = false;
if (ImGui::Checkbox("hex.builtin.common.dont_show_again"_lang, &dontShowAgain)) {
if (ImGui::Checkbox("hex.ui.common.dont_show_again"_lang, &dontShowAgain)) {
ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.show_tips", !dontShowAgain);
}
ImGui::SameLine((ImGui::GetMainViewport()->Size / 3 - ImGui::CalcTextSize("hex.builtin.common.close"_lang) - ImGui::GetStyle().FramePadding).x);
ImGui::SameLine((ImGui::GetMainViewport()->Size / 3 - ImGui::CalcTextSize("hex.ui.common.close"_lang) - ImGui::GetStyle().FramePadding).x);
if (ImGui::Button("hex.builtin.common.close"_lang) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape)))
if (ImGui::Button("hex.ui.common.close"_lang) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape)))
Popup::close();
}
};
@@ -508,7 +508,7 @@ namespace hex::plugin::builtin {
}
if (ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.prev_launch_version", "") == "") {
PopupQuestion::open("hex.builtin.popup.play_tutorial.desc"_lang,
ui::PopupQuestion::open("hex.builtin.popup.play_tutorial.desc"_lang,
[]{
TutorialManager::startTutorial("hex.builtin.tutorial.introduction");
},

View File

@@ -19,7 +19,6 @@ namespace hex::plugin::builtin {
void registerPatternLanguageFunctions();
void registerPatternLanguagePragmas();
void registerPatternLanguageVisualizers();
void registerPatternLanguageInlineVisualizers();
void registerCommandPaletteCommands();
void registerSettings();
void loadSettings();
@@ -91,7 +90,6 @@ IMHEX_PLUGIN_SETUP("Built-in", "WerWolv", "Default ImHex functionality") {
registerPatternLanguageFunctions();
registerPatternLanguagePragmas();
registerPatternLanguageVisualizers();
registerPatternLanguageInlineVisualizers();
registerCommandPaletteCommands();
registerThemes();
registerSettings();

View File

@@ -1,951 +0,0 @@
#include <ui/hex_editor.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/localization_manager.hpp>
#include <hex/helpers/encoding_file.hpp>
#include <hex/helpers/utils.hpp>
#include <wolv/utils/guards.hpp>
namespace hex::plugin::builtin::ui {
/* Data Visualizer */
class DataVisualizerAscii : public hex::ContentRegistry::HexEditor::DataVisualizer {
public:
DataVisualizerAscii() : DataVisualizer("ASCII", 1, 1) { }
void draw(u64 address, const u8 *data, size_t size, bool upperCase) override {
hex::unused(address, upperCase);
if (size == 1) {
const u8 c = data[0];
if (std::isprint(c))
ImGui::Text("%c", c);
else
ImGui::TextDisabled(".");
}
else
ImGui::TextDisabled(".");
}
bool drawEditing(u64 address, u8 *data, size_t size, bool upperCase, bool startedEditing) override {
hex::unused(address, startedEditing, upperCase);
if (size == 1) {
struct UserData {
u8 *data;
i32 maxChars;
bool editingDone;
};
UserData userData = {
.data = data,
.maxChars = this->getMaxCharsPerCell(),
.editingDone = false
};
ImGui::PushID(reinterpret_cast<void*>(address));
char buffer[2] = { std::isprint(data[0]) ? char(data[0]) : '.', 0x00 };
ImGui::InputText("##editing_input", buffer, 2, TextInputFlags | ImGuiInputTextFlags_CallbackEdit, [](ImGuiInputTextCallbackData *data) -> int {
auto &userData = *static_cast<UserData*>(data->UserData);
if (data->BufTextLen >= userData.maxChars) {
userData.editingDone = true;
userData.data[0] = data->Buf[0];
}
return 0;
}, &userData);
ImGui::PopID();
return userData.editingDone || ImGui::IsKeyPressed(ImGuiKey_Enter) || ImGui::IsKeyPressed(ImGuiKey_Escape);
}
else
return false;
}
};
/* Hex Editor */
HexEditor::HexEditor(prv::Provider *provider) : m_provider(provider) {
m_currDataVisualizer = ContentRegistry::HexEditor::getVisualizerByName("hex.builtin.visualizer.hexadecimal.8bit");
m_bytesPerRow = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.bytes_per_row", m_bytesPerRow);
EventSettingsChanged::subscribe(this, [this] {
m_selectionColor = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.highlight_color", 0x60C08080);
m_syncScrolling = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.sync_scrolling", false);
m_byteCellPadding = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.byte_padding", false);
m_characterCellPadding = ContentRegistry::Settings::read("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.char_padding", false);
});
}
HexEditor::~HexEditor() {
EventSettingsChanged::unsubscribe(this);
}
constexpr static u16 getByteColumnSeparatorCount(u16 columnCount) {
return (columnCount - 1) / 8;
}
constexpr static bool isColumnSeparatorColumn(u16 currColumn, u16 columnCount) {
return currColumn > 0 && (currColumn) < columnCount && ((currColumn) % 8) == 0;
}
std::optional<color_t> HexEditor::applySelectionColor(u64 byteAddress, std::optional<color_t> color) {
if (isSelectionValid()) {
auto selection = getSelection();
if (byteAddress >= selection.getStartAddress() && byteAddress <= selection.getEndAddress()) {
if (color.has_value())
color = (ImAlphaBlendColors(color.value(), m_selectionColor)) & 0x00FFFFFF;
else
color = m_selectionColor;
}
}
if (color.has_value())
color = (*color & 0x00FFFFFF) | (m_selectionColor & 0xFF000000);
return color;
}
struct CustomEncodingData {
std::string displayValue;
size_t advance;
ImColor color;
};
static CustomEncodingData queryCustomEncodingData(prv::Provider *provider, const EncodingFile &encodingFile, u64 address) {
const auto longestSequence = encodingFile.getLongestSequence();
if (longestSequence == 0)
return { ".", 1, 0xFFFF8000 };
size_t size = std::min<size_t>(longestSequence, provider->getActualSize() - address);
std::vector<u8> buffer(size);
provider->read(address, buffer.data(), size);
const auto [decoded, advance] = encodingFile.getEncodingFor(buffer);
const ImColor color = [&]{
if (decoded.length() == 1 && std::isalnum(decoded[0]))
return ImGuiExt::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingASCII);
else if (decoded.length() == 1 && advance == 1)
return ImGuiExt::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingSingleChar);
else if (decoded.length() > 1 && advance == 1)
return ImGuiExt::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingMultiChar);
else if (advance > 1)
return ImGui::GetColorU32(ImGuiCol_Text);
else
return ImGuiExt::GetCustomColorU32(ImGuiCustomCol_ToolbarBlue);
}();
return { std::string(decoded), advance, color };
}
static auto getCellPosition() {
return ImGui::GetCursorScreenPos() - ImGui::GetStyle().CellPadding;
}
void HexEditor::drawTooltip(u64 address, const u8 *data, size_t size) const {
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, scaled(ImVec2(5, 5)));
m_tooltipCallback(address, data, size);
ImGui::PopStyleVar();
}
void HexEditor::drawCell(u64 address, const u8 *data, size_t size, bool hovered, CellType cellType) {
static DataVisualizerAscii asciiVisualizer;
if (m_shouldUpdateEditingValue && address == m_editingAddress) {
m_shouldUpdateEditingValue = false;
if (m_editingBytes.size() < size) {
m_editingBytes.resize(size);
}
std::memcpy(m_editingBytes.data(), data, size);
}
if (m_editingAddress != address || m_editingCellType != cellType) {
if (cellType == CellType::Hex) {
std::vector<u8> buffer(size);
std::memcpy(buffer.data(), data, size);
if (m_dataVisualizerEndianness != std::endian::native)
std::reverse(buffer.begin(), buffer.end());
m_currDataVisualizer->draw(address, buffer.data(), buffer.size(), m_upperCaseHex);
} else {
asciiVisualizer.draw(address, data, size, m_upperCaseHex);
}
if (hovered && m_provider->isWritable()) {
// Enter editing mode when double-clicking a cell
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
m_editingAddress = address;
m_shouldModifyValue = false;
m_enteredEditingMode = true;
m_editingBytes.resize(size);
std::memcpy(m_editingBytes.data(), data, size);
m_editingCellType = cellType;
}
}
}
else {
if (m_enteredEditingMode) {
ImGui::SetKeyboardFocusHere();
ImGui::SetNextFrameWantCaptureKeyboard(true);
}
bool shouldExitEditingMode = true;
if (cellType == m_editingCellType && cellType == CellType::Hex) {
std::vector<u8> buffer = m_editingBytes;
if (m_dataVisualizerEndianness != std::endian::native)
std::reverse(buffer.begin(), buffer.end());
shouldExitEditingMode = m_currDataVisualizer->drawEditing(*m_editingAddress, buffer.data(), buffer.size(), m_upperCaseHex, m_enteredEditingMode);
if (m_dataVisualizerEndianness != std::endian::native)
std::reverse(buffer.begin(), buffer.end());
m_editingBytes = buffer;
} else if (cellType == m_editingCellType && cellType == CellType::ASCII) {
shouldExitEditingMode = asciiVisualizer.drawEditing(*m_editingAddress, m_editingBytes.data(), m_editingBytes.size(), m_upperCaseHex, m_enteredEditingMode);
}
if (shouldExitEditingMode || m_shouldModifyValue) {
{
std::vector<u8> oldData(m_editingBytes.size());
m_provider->read(*m_editingAddress, oldData.data(), oldData.size());
size_t writtenBytes = 0;
for (size_t i = 0; i < m_editingBytes.size(); i += 1) {
if (m_editingBytes[i] != oldData[i]) {
m_provider->write(*m_editingAddress + i, &m_editingBytes[i], 1);
writtenBytes += 1;
}
}
m_provider->getUndoStack().groupOperations(writtenBytes, "hex.builtin.undo_operation.modification");
}
if (!m_selectionChanged && !ImGui::IsMouseDown(ImGuiMouseButton_Left) && !ImGui::IsMouseClicked(ImGuiMouseButton_Left) && !ImGui::IsKeyDown(ImGuiKey_Escape)) {
auto nextEditingAddress = *m_editingAddress + m_currDataVisualizer->getBytesPerCell();
this->setSelection(nextEditingAddress, nextEditingAddress);
if (nextEditingAddress >= m_provider->getBaseAddress() + m_provider->getCurrentPageAddress() + m_provider->getSize())
m_editingAddress = std::nullopt;
else
m_editingAddress = nextEditingAddress;
} else {
m_editingAddress = std::nullopt;
}
m_shouldModifyValue = false;
m_shouldUpdateEditingValue = true;
}
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left) && !hovered && !m_enteredEditingMode && !ImGui::IsPopupOpen("", ImGuiPopupFlags_AnyPopup)) {
m_editingAddress = std::nullopt;
m_shouldModifyValue = false;
}
if (!m_editingAddress.has_value())
m_editingCellType = CellType::None;
m_enteredEditingMode = false;
}
}
void HexEditor::drawSelectionFrame(u32 x, u32 y, Region selection, u64 byteAddress, u16 bytesPerCell, const ImVec2 &cellPos, const ImVec2 &cellSize, const ImColor &backgroundColor) const {
auto drawList = ImGui::GetWindowDrawList();
// Draw background color
drawList->AddRectFilled(cellPos, cellPos + cellSize, backgroundColor);
if (!this->isSelectionValid()) return;
if (!Region { byteAddress, 1 }.isWithin(selection))
return;
const color_t SelectionFrameColor = ImGui::GetColorU32(ImGuiCol_Text);
// Draw vertical line at the left of first byte and the start of the line
if (x == 0 || byteAddress == selection.getStartAddress())
drawList->AddLine(cellPos, cellPos + ImVec2(0, cellSize.y), ImColor(SelectionFrameColor), 1_scaled);
// Draw vertical line at the right of the last byte and the end of the line
if (x == u16((m_bytesPerRow / bytesPerCell) - 1) || (byteAddress + bytesPerCell) > selection.getEndAddress())
drawList->AddLine(cellPos + ImVec2(cellSize.x, -1), cellPos + cellSize, ImColor(SelectionFrameColor), 1_scaled);
// Draw horizontal line at the top of the bytes
if (y == 0 || (byteAddress - m_bytesPerRow) < selection.getStartAddress())
drawList->AddLine(cellPos, cellPos + ImVec2(cellSize.x + 1, 0), ImColor(SelectionFrameColor), 1_scaled);
// Draw horizontal line at the bottom of the bytes
if ((byteAddress + m_bytesPerRow) > selection.getEndAddress())
drawList->AddLine(cellPos + ImVec2(0, cellSize.y), cellPos + cellSize + ImVec2(1, 0), ImColor(SelectionFrameColor), 1_scaled);
}
void HexEditor::drawEditor(const ImVec2 &size) {
const float SeparatorColumWidth = 6_scaled;
const auto CharacterSize = ImGui::CalcTextSize("0");
const auto bytesPerCell = m_currDataVisualizer->getBytesPerCell();
const u16 columnCount = m_bytesPerRow / bytesPerCell;
auto byteColumnCount = 2 + columnCount + getByteColumnSeparatorCount(columnCount) + 2 + 2;
if (byteColumnCount >= IMGUI_TABLE_MAX_COLUMNS) {
m_bytesPerRow = 64;
ContentRegistry::Settings::write("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.bytes_per_row", m_bytesPerRow);
return;
}
const auto selection = getSelection();
if (m_provider == nullptr || m_provider->getActualSize() == 0) {
ImGuiExt::TextFormattedCentered("{}", "hex.builtin.hex_editor.no_bytes"_lang);
}
if (ImGui::BeginChild("Hex View", size, ImGuiChildFlags_None, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
// Draw scrollbar
{
const auto window = ImGui::GetCurrentWindowRead();
const auto axis = ImGuiAxis_Y;
ImS64 numRows = (m_provider->getSize() / m_bytesPerRow) + ((m_provider->getSize() % m_bytesPerRow) == 0 ? 0 : 1);
const auto outerRect = window->Rect();
const auto innerRect = window->InnerRect;
const auto borderSize = window->WindowBorderSize;
const auto scrollbarWidth = ImGui::GetStyle().ScrollbarSize;
const ImRect bb = ImRect(ImMax(outerRect.Min.x, outerRect.Max.x - borderSize - scrollbarWidth), innerRect.Min.y, outerRect.Max.x, innerRect.Max.y);
const ImDrawFlags roundingCorners = ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomRight;
ImGui::ScrollbarEx(
bb,
ImGui::GetWindowScrollbarID(window, axis),
axis,
&m_scrollPosition,
(std::ceil(innerRect.Max.y - innerRect.Min.y) / CharacterSize.y) - (m_visibleRowCount - 1),
std::nextafterf(numRows, std::numeric_limits<float>::max()),
roundingCorners);
if (ImGui::IsWindowHovered()) {
m_scrollPosition += ImS64(ImGui::GetIO().MouseWheel * -5);
}
if (m_scrollPosition < 0)
m_scrollPosition = 0;
if (m_scrollPosition > (numRows - 1))
m_scrollPosition = numRows - 1;
}
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(0.5, 0));
if (ImGui::BeginTable("##hex", byteColumnCount, ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoKeepColumnsVisible, size)) {
View::discardNavigationRequests();
ImGui::TableSetupScrollFreeze(0, 2);
// Row address column
ImGui::TableSetupColumn("hex.builtin.common.address"_lang);
ImGui::TableSetupColumn("");
// Byte columns
for (u16 i = 0; i < columnCount; i++) {
if (isColumnSeparatorColumn(i, columnCount))
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, SeparatorColumWidth);
ImGui::TableSetupColumn(hex::format(m_upperCaseHex ? "{:0{}X}" : "{:0{}x}", i * bytesPerCell, m_currDataVisualizer->getMaxCharsPerCell()).c_str(), ImGuiTableColumnFlags_WidthFixed, CharacterSize.x * m_currDataVisualizer->getMaxCharsPerCell() + (6 + m_byteCellPadding) * 1_scaled);
}
// ASCII column
ImGui::TableSetupColumn("");
if (m_showAscii) {
ImGui::TableSetupColumn("hex.builtin.common.encoding.ascii"_lang, ImGuiTableColumnFlags_WidthFixed, (CharacterSize.x + m_characterCellPadding * 1_scaled) * m_bytesPerRow);
}
else
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 0);
ImGui::TableSetupColumn("");
// Custom encoding column
{
if (m_currCustomEncoding.has_value() && m_showCustomEncoding) {
ImGui::TableSetupColumn(m_currCustomEncoding->getName().c_str(), ImGuiTableColumnFlags_WidthStretch);
} else {
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 0);
}
}
ImGui::TableNextRow();
for (i32 i = 0; i < ImGui::TableGetColumnCount(); i++) {
ImGui::TableNextColumn();
ImGui::TextUnformatted(ImGui::TableGetColumnName(i));
ImGui::Dummy(ImVec2(0, CharacterSize.y / 2));
}
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (m_provider != nullptr && m_provider->isReadable()) {
const auto isCurrRegionValid = [this](u64 address) {
auto &[currRegion, currRegionValid] = m_currValidRegion;
if (!Region{ address, 1 }.isWithin(currRegion)) {
m_currValidRegion = m_provider->getRegionValidity(address);
}
return currRegionValid;
};
ImS64 numRows = (m_provider->getSize() / m_bytesPerRow) + ((m_provider->getSize() % m_bytesPerRow) == 0 ? 0 : 1);
if (numRows == 0) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted(" ");
}
m_visibleRowCount = ImGui::GetWindowSize().y / CharacterSize.y;
// Loop over rows
for (ImS64 y = m_scrollPosition; y < (m_scrollPosition + m_visibleRowCount + 5) && y < numRows; y++) {
// Draw address column
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGuiExt::TextFormatted(m_upperCaseHex ? "{:08X}: " : "{:08x}: ", y * m_bytesPerRow + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress());
ImGui::TableNextColumn();
const u8 validBytes = std::min<u64>(m_bytesPerRow, m_provider->getSize() - y * m_bytesPerRow);
std::vector<u8> bytes(m_bytesPerRow, 0x00);
m_provider->read(y * m_bytesPerRow + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress(), bytes.data(), validBytes);
std::vector<std::tuple<std::optional<color_t>, std::optional<color_t>>> cellColors;
{
for (u64 x = 0; x < std::ceil(float(validBytes) / bytesPerCell); x++) {
const u64 byteAddress = y * m_bytesPerRow + x * bytesPerCell + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress();
const auto cellBytes = std::min<u64>(validBytes, bytesPerCell);
// Query cell colors
if (x < std::ceil(float(validBytes) / bytesPerCell)) {
auto foregroundColor = m_foregroundColorCallback(byteAddress, &bytes[x * cellBytes], cellBytes);
auto backgroundColor = m_backgroundColorCallback(byteAddress, &bytes[x * cellBytes], cellBytes);
if (m_grayOutZero && !foregroundColor.has_value()) {
bool allZero = true;
for (u64 i = 0; i < cellBytes && (x * cellBytes + i) < bytes.size(); i++) {
if (bytes[x * cellBytes + i] != 0x00) {
allZero = false;
break;
}
}
if (allZero)
foregroundColor = ImGui::GetColorU32(ImGuiCol_TextDisabled);
}
cellColors.emplace_back(
foregroundColor,
backgroundColor
);
} else {
cellColors.emplace_back(
std::nullopt,
std::nullopt
);
}
}
}
// Draw byte columns
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, scaled(ImVec2(2.75F, 0.0F)));
for (u64 x = 0; x < columnCount; x++) {
const u64 byteAddress = y * m_bytesPerRow + x * bytesPerCell + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress();
ImGui::TableNextColumn();
if (isColumnSeparatorColumn(x, columnCount))
ImGui::TableNextColumn();
if (x < std::ceil(float(validBytes) / bytesPerCell)) {
auto cellStartPos = getCellPosition();
auto cellSize = (CharacterSize * ImVec2(m_currDataVisualizer->getMaxCharsPerCell(), 1)) + (ImVec2(2, 2) * ImGui::GetStyle().CellPadding) + scaled(ImVec2(1 + m_byteCellPadding, 0));
auto maxCharsPerCell = m_currDataVisualizer->getMaxCharsPerCell();
auto [foregroundColor, backgroundColor] = cellColors[x];
if (isColumnSeparatorColumn(x + 1, columnCount) && cellColors.size() > x + 1) {
auto separatorAddress = x + y * columnCount;
auto [nextForegroundColor, nextBackgroundColor] = cellColors[x + 1];
if ((isSelectionValid() && getSelection().overlaps({ separatorAddress, 1 }) && getSelection().getEndAddress() != separatorAddress) || backgroundColor == nextBackgroundColor)
cellSize.x += SeparatorColumWidth + 1;
}
if (y == m_scrollPosition)
cellSize.y -= (ImGui::GetStyle().CellPadding.y);
backgroundColor = applySelectionColor(byteAddress, backgroundColor);
// Draw highlights and selection
if (backgroundColor.has_value()) {
// Draw frame around mouse selection
this->drawSelectionFrame(x, y, selection, byteAddress, bytesPerCell, cellStartPos, cellSize, backgroundColor.value());
}
const bool cellHovered = ImGui::IsMouseHoveringRect(cellStartPos, cellStartPos + cellSize, false);
this->handleSelection(byteAddress, bytesPerCell, &bytes[x * bytesPerCell], cellHovered);
// Get byte foreground color
auto popForeground = SCOPE_GUARD { ImGui::PopStyleColor(); };
if (foregroundColor.has_value() && !m_editingAddress.has_value())
ImGui::PushStyleColor(ImGuiCol_Text, *foregroundColor);
else
popForeground.release();
// Draw cell content
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
ImGui::PushItemWidth((CharacterSize * maxCharsPerCell).x);
if (isCurrRegionValid(byteAddress))
this->drawCell(byteAddress, &bytes[x * bytesPerCell], bytesPerCell, cellHovered, CellType::Hex);
else
ImGuiExt::TextFormatted("{}", std::string(maxCharsPerCell, '?'));
ImGui::PopItemWidth();
ImGui::PopStyleVar();
}
}
ImGui::PopStyleVar();
ImGui::TableNextColumn();
ImGui::TableNextColumn();
// Draw ASCII column
if (m_showAscii) {
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(0, 0));
if (ImGui::BeginTable("##ascii_column", m_bytesPerRow)) {
for (u64 x = 0; x < m_bytesPerRow; x++)
ImGui::TableSetupColumn(hex::format("##ascii_cell{}", x).c_str(), ImGuiTableColumnFlags_WidthFixed, CharacterSize.x + m_characterCellPadding * 1_scaled);
ImGui::TableNextRow();
for (u64 x = 0; x < m_bytesPerRow; x++) {
ImGui::TableNextColumn();
const u64 byteAddress = y * m_bytesPerRow + x + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress();
const auto cellStartPos = getCellPosition();
const auto cellSize = CharacterSize + scaled(ImVec2(m_characterCellPadding, 0));
const bool cellHovered = ImGui::IsMouseHoveringRect(cellStartPos, cellStartPos + cellSize, true);
if (x < validBytes) {
this->handleSelection(byteAddress, bytesPerCell, &bytes[x], cellHovered);
auto [foregroundColor, backgroundColor] = cellColors[x / bytesPerCell];
backgroundColor = applySelectionColor(byteAddress, backgroundColor);
// Draw highlights and selection
if (backgroundColor.has_value()) {
this->drawSelectionFrame(x, y, selection, byteAddress, 1, cellStartPos, cellSize, backgroundColor.value());
}
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (m_characterCellPadding * 1_scaled) / 2);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
ImGui::PushItemWidth(CharacterSize.x);
if (!isCurrRegionValid(byteAddress))
ImGuiExt::TextFormattedDisabled("{}", m_unknownDataCharacter);
else
this->drawCell(byteAddress, &bytes[x], 1, cellHovered, CellType::ASCII);
ImGui::PopItemWidth();
ImGui::PopStyleVar();
}
}
ImGui::EndTable();
}
ImGui::PopStyleVar();
}
ImGui::TableNextColumn();
ImGui::TableNextColumn();
// Draw Custom encoding column
if (m_showCustomEncoding && m_currCustomEncoding.has_value()) {
if (m_encodingLineStartAddresses.empty()) {
m_encodingLineStartAddresses.push_back(0);
}
if (size_t(y) < m_encodingLineStartAddresses.size()) {
std::vector<std::pair<u64, CustomEncodingData>> encodingData;
if (m_encodingLineStartAddresses[y] >= m_bytesPerRow) {
encodingData.emplace_back(y * m_bytesPerRow + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress(), CustomEncodingData(".", 1, ImGuiExt::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingUnknown)));
m_encodingLineStartAddresses.push_back(0);
} else {
u32 offset = m_encodingLineStartAddresses[y];
do {
const u64 address = y * m_bytesPerRow + offset + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress();
auto result = queryCustomEncodingData(m_provider, *m_currCustomEncoding, address);
offset += result.advance;
encodingData.emplace_back(address, result);
} while (offset < m_bytesPerRow);
m_encodingLineStartAddresses.push_back(offset - m_bytesPerRow);
}
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(0, 0));
ImGui::PushID(y);
if (ImGui::BeginTable("##encoding_cell", encodingData.size(), ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoKeepColumnsVisible)) {
ImGui::TableNextRow();
for (const auto &[address, data] : encodingData) {
ImGui::TableNextColumn();
const auto cellStartPos = getCellPosition();
const auto cellSize = ImGui::CalcTextSize(data.displayValue.c_str()) * ImVec2(1, 0) + ImVec2(m_characterCellPadding * 1_scaled, CharacterSize.y);
const bool cellHovered = ImGui::IsMouseHoveringRect(cellStartPos, cellStartPos + cellSize, true);
const auto x = address % m_bytesPerRow;
if (x < validBytes && isCurrRegionValid(address)) {
auto [foregroundColor, backgroundColor] = cellColors[x / bytesPerCell];
backgroundColor = applySelectionColor(address, backgroundColor);
// Draw highlights and selection
if (backgroundColor.has_value()) {
this->drawSelectionFrame(x, y, selection, address, 1, cellStartPos, cellSize, backgroundColor.value());
}
auto startPos = ImGui::GetCursorPos();
ImGuiExt::TextFormattedColored(data.color, "{}", data.displayValue);
ImGui::SetCursorPosX(startPos.x + cellSize.x);
ImGui::SameLine(0, 0);
ImGui::Dummy({ 0, 0 });
this->handleSelection(address, data.advance, &bytes[address % m_bytesPerRow], cellHovered);
}
}
ImGui::EndTable();
}
ImGui::PopStyleVar();
ImGui::PopID();
}
}
// Scroll to the cursor if it's either at the top or bottom edge of the screen
if (m_shouldScrollToSelection && isSelectionValid()) {
// Make sure simply clicking on a byte at the edge of the screen won't cause scrolling
if ((ImGui::IsMouseDragging(ImGuiMouseButton_Left) && *m_selectionStart != *m_selectionEnd)) {
if (y == (m_scrollPosition + 3)) {
if (i128(m_selectionEnd.value() - m_provider->getBaseAddress() - m_provider->getCurrentPageAddress()) <= (ImS64(m_scrollPosition + 3) * m_bytesPerRow)) {
m_shouldScrollToSelection = false;
m_scrollPosition -= 3;
}
} else if (y == ((m_scrollPosition + m_visibleRowCount) - 1)) {
if (i128(m_selectionEnd.value() - m_provider->getBaseAddress() - m_provider->getCurrentPageAddress()) >= (ImS64((m_scrollPosition + m_visibleRowCount) - 2) * m_bytesPerRow)) {
m_shouldScrollToSelection = false;
m_scrollPosition += 3;
}
}
}
// If the cursor is off-screen, directly jump to the byte
if (m_shouldJumpWhenOffScreen) {
m_shouldJumpWhenOffScreen = false;
const auto pageAddress = m_provider->getCurrentPageAddress() + m_provider->getBaseAddress();
auto newSelection = getSelection();
newSelection.address -= pageAddress;
if ((newSelection.getStartAddress()) < u64(m_scrollPosition * m_bytesPerRow))
this->jumpToSelection(false);
if ((newSelection.getEndAddress()) > u64((m_scrollPosition + m_visibleRowCount) * m_bytesPerRow))
this->jumpToSelection(false);
}
}
}
// Handle jumping to selection
if (m_shouldJumpToSelection) {
m_shouldJumpToSelection = false;
auto newSelection = getSelection();
m_provider->setCurrentPage(m_provider->getPageOfAddress(newSelection.address).value_or(0));
const auto pageAddress = m_provider->getCurrentPageAddress() + m_provider->getBaseAddress();
if (m_centerOnJump) {
m_scrollPosition = (newSelection.getStartAddress() - pageAddress) / m_bytesPerRow;
m_scrollPosition -= (m_visibleRowCount / 2);
} else {
m_scrollPosition = (newSelection.getStartAddress() - pageAddress) / m_bytesPerRow;
}
m_centerOnJump = false;
}
}
ImGui::EndTable();
ImGui::PopStyleVar();
}
ImGui::EndChild();
}
m_shouldScrollToSelection = false;
}
void HexEditor::drawFooter(const ImVec2 &size) {
if (m_provider != nullptr && m_provider->isReadable()) {
const auto pageCount = std::max<u32>(1, m_provider->getPageCount());
constexpr static u32 MinPage = 1;
const auto windowEndPos = ImGui::GetWindowPos() + size - ImGui::GetStyle().WindowPadding;
ImGui::GetWindowDrawList()->AddLine(windowEndPos - ImVec2(0, size.y - 1_scaled), windowEndPos - size + ImVec2(0, 1_scaled), ImGui::GetColorU32(ImGuiCol_Separator), 2.0_scaled);
if (ImGui::BeginChild("##footer", size, false, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
if (ImGui::BeginTable("##footer_table", 3, ImGuiTableFlags_SizingFixedFit)) {
ImGui::TableSetupColumn("Left", ImGuiTableColumnFlags_WidthStretch, 0.5f);
ImGui::TableSetupColumn("Center", ImGuiTableColumnFlags_WidthFixed, 20_scaled);
ImGui::TableSetupColumn("Right", ImGuiTableColumnFlags_WidthStretch, 0.5F);
ImGui::TableNextRow();
// Page slider
ImGui::TableNextColumn();
{
u32 page = m_provider->getCurrentPage() + 1;
ImGuiExt::TextFormatted("{}: ", "hex.builtin.hex_editor.page"_lang);
ImGui::SameLine();
ImGui::BeginDisabled(pageCount <= 1);
{
ImGui::PushItemWidth(-1);
if (ImGui::SliderScalar("##page_selection", ImGuiDataType_U32, &page, &MinPage, &pageCount, hex::format("0x%02llX / 0x{:02X}", pageCount).c_str()))
m_provider->setCurrentPage(page - 1);
ImGui::PopItemWidth();
}
ImGui::EndDisabled();
}
// Collapse button
ImGui::TableNextColumn();
{
if (ImGuiExt::DimmedIconButton(m_footerCollapsed ? ICON_VS_FOLD_UP : ICON_VS_FOLD_DOWN, ImGui::GetStyleColorVec4(ImGuiCol_Text)))
m_footerCollapsed = !m_footerCollapsed;
}
// Page Address
ImGui::TableNextColumn();
{
const auto pageAddress = m_provider->getCurrentPageAddress();
const auto pageSize = m_provider->getSize();
ImGuiExt::TextFormatted("{}:", "hex.builtin.hex_editor.region"_lang);
ImGui::SameLine();
ImGuiExt::TextFormattedSelectable("0x{0:08X} - 0x{1:08X} ({0} - {1})",
pageAddress,
pageSize == 0 ? 0 : (pageAddress + pageSize - 1)
);
}
if (!m_footerCollapsed) {
ImGui::TableNextRow();
// Selection
ImGui::TableNextColumn();
{
auto selection = getSelection();
std::string value;
if (isSelectionValid()) {
value = hex::format("0x{0:08X} - 0x{1:08X} (0x{2:X} | {3})",
selection.getStartAddress(),
selection.getEndAddress(),
selection.getSize(),
m_showHumanReadableUnits
? hex::toByteString(selection.getSize())
: hex::format("{}", selection.getSize())
);
}
else
value = std::string("hex.builtin.hex_editor.selection.none"_lang);
ImGuiExt::TextFormatted("{}:", "hex.builtin.hex_editor.selection"_lang);
ImGui::SameLine();
ImGuiExt::TextFormattedSelectable(value);
}
ImGui::TableNextColumn();
// Loaded data size
ImGui::TableNextColumn();
{
ImGuiExt::TextFormatted("{}:", "hex.builtin.hex_editor.data_size"_lang);
ImGui::SameLine();
ImGuiExt::TextFormattedSelectable("0x{0:08X} (0x{1:X} | {2})",
m_provider->getBaseAddress(),
m_provider->getBaseAddress() + m_provider->getActualSize(),
m_showHumanReadableUnits
? hex::toByteString(m_provider->getActualSize())
: hex::format("{}", m_provider->getActualSize())
);
}
ImGui::TableNextRow();
ImGui::TableNextColumn();
{
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 2_scaled);
// Upper/lower case hex
ImGuiExt::DimmedIconToggle(ICON_VS_CASE_SENSITIVE, &m_upperCaseHex);
ImGuiExt::InfoTooltip("hex.builtin.hex_editor.uppercase_hex"_lang);
ImGui::SameLine();
// Grayed out zeros
ImGuiExt::DimmedIconToggle(ICON_VS_LIGHTBULB, &m_grayOutZero);
ImGuiExt::InfoTooltip("hex.builtin.hex_editor.gray_out_zero"_lang);
ImGui::SameLine();
// ASCII view
ImGuiExt::DimmedIconToggle(ICON_VS_SYMBOL_KEY, &m_showAscii);
ImGuiExt::InfoTooltip("hex.builtin.hex_editor.ascii_view"_lang);
ImGui::SameLine(0, 1_scaled);
// Custom encoding view
ImGui::BeginDisabled(!m_currCustomEncoding.has_value());
ImGuiExt::DimmedIconToggle(ICON_VS_WHITESPACE, &m_showCustomEncoding);
ImGui::EndDisabled();
ImGuiExt::InfoTooltip("hex.builtin.hex_editor.custom_encoding_view"_lang);
ImGui::SameLine();
// Human-readable units
ImGuiExt::DimmedIconToggle(ICON_VS_SYMBOL_NUMERIC, &m_showHumanReadableUnits);
ImGuiExt::InfoTooltip("hex.builtin.hex_editor.human_readable_units_footer"_lang);
}
ImGui::TableNextColumn();
ImGui::TableNextColumn();
// Visualizer
{
auto &visualizers = ContentRegistry::HexEditor::impl::getVisualizers();
ImGuiExt::TextFormatted("{}: ", "hex.builtin.hex_editor.visualizer"_lang);
ImGui::SameLine(0, 0);
{
bool hasEndianess = m_currDataVisualizer->getBytesPerCell() > 1;
if (!hasEndianess)
m_dataVisualizerEndianness = std::endian::native;
ImGui::BeginDisabled(!hasEndianess);
{
int sliderPos = m_dataVisualizerEndianness == std::endian::little ? 0 : 1;
ImGui::PushItemWidth(60_scaled);
ImGui::SliderInt("##visualizer_endianness", &sliderPos, 0, 1, sliderPos == 0 ? "hex.builtin.common.little"_lang : "hex.builtin.common.big"_lang);
ImGui::PopItemWidth();
m_dataVisualizerEndianness = sliderPos == 0 ? std::endian::little : std::endian::big;
}
ImGui::EndDisabled();
}
ImGui::SameLine(0, 2_scaled);
ImGui::PushItemWidth((ImGui::GetContentRegionAvail().x / 3) * 2);
if (ImGui::BeginCombo("##visualizer", Lang(m_currDataVisualizer->getUnlocalizedName()))) {
for (const auto &visualizer : visualizers) {
if (ImGui::Selectable(Lang(visualizer->getUnlocalizedName()))) {
m_currDataVisualizer = visualizer;
m_encodingLineStartAddresses.clear();
if (m_bytesPerRow < visualizer->getBytesPerCell())
m_bytesPerRow = visualizer->getBytesPerCell();
}
}
ImGui::EndCombo();
}
ImGui::PopItemWidth();
ImGui::SameLine(0, 2_scaled);
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
int bytesPerRow = m_bytesPerRow / this->getBytesPerCell();
if (ImGui::SliderInt("##row_size", &bytesPerRow, 1, 32 / this->getBytesPerCell(), hex::format("{}", bytesPerRow * this->getBytesPerCell()).c_str())) {
m_bytesPerRow = bytesPerRow * this->getBytesPerCell();
m_encodingLineStartAddresses.clear();
ContentRegistry::Settings::write("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.bytes_per_row", m_bytesPerRow);
}
ImGui::PopItemWidth();
}
}
ImGui::EndTable();
}
}
ImGui::EndChild();
}
}
void HexEditor::handleSelection(u64 address, u32 bytesPerCell, const u8 *data, bool cellHovered) {
if (ImGui::IsWindowHovered() && cellHovered) {
drawTooltip(address, data, bytesPerCell);
auto endAddress = address + bytesPerCell - 1;
auto &selectionStart = m_selectionStart;
if (ImGui::IsMouseDragging(ImGuiMouseButton_Left)) {
this->setSelection(selectionStart.value_or(address), endAddress);
this->scrollToSelection();
}
else if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
if (ImGui::GetIO().KeyShift)
this->setSelection(selectionStart.value_or(address), endAddress);
else
this->setSelection(address, endAddress);
this->scrollToSelection();
}
}
}
void HexEditor::draw(float height) {
const auto width = ImGui::GetContentRegionAvail().x;
auto footerSize = ImVec2(width, 0);
if (!m_footerCollapsed)
footerSize.y = ImGui::GetTextLineHeightWithSpacing() * 3.6F;
else
footerSize.y = ImGui::GetTextLineHeightWithSpacing() * 1.4F;
auto tableSize = ImVec2(width, height - footerSize.y);
if (tableSize.y <= 0)
tableSize.y = height;
this->drawEditor(tableSize);
if (tableSize.y > 0)
this->drawFooter(footerSize);
m_selectionChanged = false;
}
}

File diff suppressed because it is too large Load Diff