diff --git a/.gitmodules b/.gitmodules index c4614ad52..a5ad8e724 100644 --- a/.gitmodules +++ b/.gitmodules @@ -33,3 +33,6 @@ path = lib/external/libwolv url = https://github.com/WerWolv/libwolv +[submodule "lib/third_party/HashLibPlus"] + path = lib/third_party/HashLibPlus + url = https://github.com/WerWolv/HashLibPlus diff --git a/lib/libimhex/CMakeLists.txt b/lib/libimhex/CMakeLists.txt index bcb2a63cf..6da4b1d07 100644 --- a/lib/libimhex/CMakeLists.txt +++ b/lib/libimhex/CMakeLists.txt @@ -40,6 +40,7 @@ set(LIBIMHEX_SOURCES source/helpers/debugging.cpp source/providers/provider.cpp + source/providers/memory_provider.cpp source/providers/undo/stack.cpp source/ui/imgui_imhex_extensions.cpp diff --git a/lib/libimhex/include/hex/providers/memory_provider.hpp b/lib/libimhex/include/hex/providers/memory_provider.hpp new file mode 100644 index 000000000..ff24727b8 --- /dev/null +++ b/lib/libimhex/include/hex/providers/memory_provider.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include + +namespace hex::prv { + + /** + * This is a simple mock provider that can be used to pass in-memory data to APIs that require a provider. + * It's NOT a provider that can be loaded by the user. + */ + class MemoryProvider : public hex::prv::Provider { + public: + MemoryProvider() = default; + explicit MemoryProvider(std::vector data) : m_data(std::move(data)) { } + ~MemoryProvider() override = default; + + [[nodiscard]] bool isAvailable() const override { return true; } + [[nodiscard]] bool isReadable() const override { return true; } + [[nodiscard]] bool isWritable() const override { return true; } + [[nodiscard]] bool isResizable() const override { return true; } + [[nodiscard]] bool isSavable() const override { return m_name.empty(); } + [[nodiscard]] bool isSavableAsRecent() const override { return false; } + + [[nodiscard]] bool open() override; + void close() override { } + + void readRaw(u64 offset, void *buffer, size_t size) override; + void writeRaw(u64 offset, const void *buffer, size_t size) override; + [[nodiscard]] u64 getActualSize() const override { return m_data.size(); } + + void resizeRaw(u64 newSize) override; + void insertRaw(u64 offset, u64 size) override; + void removeRaw(u64 offset, u64 size) override; + + [[nodiscard]] std::string getName() const override { return ""; } + + [[nodiscard]] std::string getTypeName() const override { return "MemoryProvider"; } + + private: + void renameFile(); + + private: + std::vector m_data; + std::string m_name; + }; + +} \ No newline at end of file diff --git a/lib/libimhex/source/providers/memory_provider.cpp b/lib/libimhex/source/providers/memory_provider.cpp new file mode 100644 index 000000000..37cb6547e --- /dev/null +++ b/lib/libimhex/source/providers/memory_provider.cpp @@ -0,0 +1,71 @@ +#include + +#include + +namespace hex::prv { + + bool MemoryProvider::open() { + if (m_data.empty()) { + m_data.resize(1); + } + + return true; + } + + void MemoryProvider::readRaw(u64 offset, void *buffer, size_t size) { + auto actualSize = this->getActualSize(); + if (actualSize == 0 || (offset + size) > actualSize || buffer == nullptr || size == 0) + return; + + std::memcpy(buffer, &m_data.front() + offset, size); + } + + void MemoryProvider::writeRaw(u64 offset, const void *buffer, size_t size) { + if ((offset + size) > this->getActualSize() || buffer == nullptr || size == 0) + return; + + std::memcpy(&m_data.front() + offset, buffer, size); + } + + void MemoryProvider::resizeRaw(u64 newSize) { + m_data.resize(newSize); + } + + void MemoryProvider::insertRaw(u64 offset, u64 size) { + auto oldSize = this->getActualSize(); + this->resizeRaw(oldSize + size); + + std::vector buffer(0x1000); + const std::vector zeroBuffer(0x1000); + + auto position = oldSize; + while (position > offset) { + const auto readSize = std::min(position - offset, buffer.size()); + + position -= readSize; + + this->readRaw(position, buffer.data(), readSize); + this->writeRaw(position, zeroBuffer.data(), readSize); + this->writeRaw(position + size, buffer.data(), readSize); + } + } + + void MemoryProvider::removeRaw(u64 offset, u64 size) { + auto oldSize = this->getActualSize(); + std::vector buffer(0x1000); + + const auto newSize = oldSize - size; + auto position = offset; + while (position < newSize) { + const auto readSize = std::min(newSize - position, buffer.size()); + + this->readRaw(position + size, buffer.data(), readSize); + this->writeRaw(position, buffer.data(), readSize); + + position += readSize; + } + + this->resizeRaw(oldSize - size); + } + +} diff --git a/lib/third_party/HashLibPlus b/lib/third_party/HashLibPlus new file mode 160000 index 000000000..f9d85855e --- /dev/null +++ b/lib/third_party/HashLibPlus @@ -0,0 +1 @@ +Subproject commit f9d85855ed5caa1d024634fa24dbfe81f3e00f3e diff --git a/plugins/builtin/CMakeLists.txt b/plugins/builtin/CMakeLists.txt index 4725ca739..a91a7abc7 100644 --- a/plugins/builtin/CMakeLists.txt +++ b/plugins/builtin/CMakeLists.txt @@ -32,7 +32,6 @@ add_imhex_plugin( source/content/welcome_screen.cpp source/content/data_visualizers.cpp source/content/events.cpp - source/content/hashes.cpp source/content/global_actions.cpp source/content/themes.cpp source/content/recent.cpp @@ -90,7 +89,6 @@ add_imhex_plugin( source/content/views/view_hex_editor.cpp source/content/views/view_pattern_editor.cpp source/content/views/view_pattern_data.cpp - source/content/views/view_hashes.cpp source/content/views/view_information.cpp source/content/views/view_about.cpp source/content/views/view_tools.cpp diff --git a/plugins/builtin/romfs/auto_extract/workspaces/default.hexws b/plugins/builtin/romfs/auto_extract/workspaces/default.hexws index 7083966c8..3efea8f5b 100644 --- a/plugins/builtin/romfs/auto_extract/workspaces/default.hexws +++ b/plugins/builtin/romfs/auto_extract/workspaces/default.hexws @@ -1,4 +1,4 @@ { - "layout": "[Window][ImHexDockSpace]\nPos=0,19\nSize=1393,765\nCollapsed=0\n\n[Window][Debug##Default]\nPos=0,55\nSize=400,400\nCollapsed=0\n\n[Window][###hex.builtin.view.settings.name]\nPos=346,191\nSize=700,400\nCollapsed=0\n\n[Window][Question]\nPos=496,338\nSize=400,105\nCollapsed=0\n\n[Window][Welcome Screen]\nPos=0,37\nSize=1393,728\nCollapsed=0\n\n[Window][###hex.builtin.view.hex_editor.name]\nPos=0,38\nSize=619,468\nCollapsed=0\nDockId=0x00000007,0\n\n[Window][###hex.builtin.view.data_inspector.name]\nPos=621,38\nSize=124,468\nCollapsed=0\nDockId=0x00000008,0\n\n[Window][###hex.builtin.view.pattern_data.name]\nPos=0,508\nSize=745,252\nCollapsed=0\nDockId=0x00000006,0\n\n[Window][###hex.builtin.view.pattern_editor.name]\nPos=747,38\nSize=646,722\nCollapsed=0\nDockId=0x00000009,0\n\n[Window][###hex.builtin.view.hashes.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000009,4\n\n[Window][###hex.builtin.view.find.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000009,3\n\n[Window][###hex.builtin.view.bookmarks.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000009,2\n\n[Window][###hex.builtin.view.information.name]\nPos=-1889,-120\nSize=510,420\nCollapsed=0\n\n[Window][###hex.yara_rules.view.yara.name]\nPos=720,38\nSize=560,660\nCollapsed=0\n\n[Window][###hex.builtin.view.store.name]\nViewportPos=564,236\nViewportId=0xB51F9C4A\nSize=900,700\nCollapsed=0\n\n[Window][###hex.builtin.view.diff.name]\nPos=1372,38\nSize=1188,1333\nCollapsed=0\nDockId=0x00000009,1\n\n[Window][###hex.builtin.view.provider_settings.load_popup]\nPos=585,322\nSize=314,208\nCollapsed=0\n\n[Window][###hex.builtin.view.patches.name]\nPos=-1889,-120\nSize=510,420\nCollapsed=0\n\n[Window][###hex.builtin.view.data_processor.name]\nPos=747,38\nSize=646,722\nCollapsed=0\nDockId=0x00000009,1\n\n[Window][###hex.builtin.view.tools.name]\nPos=849,268\nSize=431,430\nCollapsed=0\nDockId=0x0000000A,0\n\n[Window][###hex.builtin.view.theme_manager.name]\nPos=391,302\nSize=469,400\nCollapsed=0\n\n[Window][###hex.builtin.tools.invariant_multiplication]\nPos=-1826,300\nSize=600,232\nCollapsed=0\n\n[Window][###hex.builtin.tools.regex_replacer]\nPos=-2091,104\nSize=600,305\nCollapsed=0\n\n[Window][###hex.builtin.tools.calc]\nPos=-1811,118\nSize=600,402\nCollapsed=0\n\n[Window][###hex.builtin.tools.permissions]\nPos=423,296\nSize=600,220\nCollapsed=0\n\n[Window][###hex.builtin.view.help.about.name]\nPos=377,193\nSize=677,400\nCollapsed=0\n\n[Window][###hex.builtin.view.constants.name]\nPos=419,-124\nSize=652,660\nCollapsed=0\n\n[Window][###hex.disassembler.view.disassembler.name]\nPos=1004,-204\nSize=1336,1320\nCollapsed=0\n\n[Window][##achievement_unlocked]\nPos=1093,0\nSize=200,55\nCollapsed=0\n\n[Window][hex.builtin.popup.blocking_task.title]\nPos=506,305\nSize=20,40\nCollapsed=0\n\n[Window][Waiting for Tasks]\nPos=60,60\nSize=16,35\nCollapsed=0\n\n[Window][Restore lost data]\nPos=555,349\nSize=283,84\nCollapsed=0\n\n[Window][Error]\nPos=440,301\nSize=400,118\nCollapsed=0\n\n[Window][###hex.builtin.view.highlight_rules.name]\nViewportPos=724,217\nViewportId=0x31C07F88\nSize=700,400\nCollapsed=0\n\n[Window][SideBarWindow]\nPos=19,37\nSize=660,1345\nCollapsed=0\n\n[Window][SideBarWindow/##Content_53A061AE]\nIsChild=1\nSize=644,1329\n\n[Window][Choose file]\nPos=382,131\nSize=516,458\nCollapsed=0\n\n[Window][###hex.builtin.view.logs.name]\nPos=60,60\nSize=549,466\nCollapsed=0\n\n[Window][###hex.builtin.view.achievements.name]\nPos=60,60\nSize=800,600\nCollapsed=0\n\n[Window][hex.builtin.welcome.start.recent.auto_backups]\nPos=580,365\nSize=233,52\nCollapsed=0\n\n[Window][Auto Backups]\nPos=580,331\nSize=233,120\nCollapsed=0\n\n[Window][hex.builtin.popup.create_workspace.title]\nPos=496,325\nSize=400,132\nCollapsed=0\n\n[Table][0x6A4694E4,3]\nRefScale=13\nColumn 0 Sort=0v\n\n[Table][0x7EE28D79,8]\nRefScale=13\nColumn 0 Width=13\nColumn 1 Weight=1.0000\nColumn 2 Weight=1.0000\nColumn 3 Weight=1.0000 Sort=0v\nColumn 4 Weight=1.0000\nColumn 5 Weight=1.0000\nColumn 6 Weight=1.0000\nColumn 7 Weight=1.0000\n\n[Table][0x6190819E,3]\nColumn 0 Weight=1.0000\nColumn 1 Weight=1.0000\nColumn 2 Weight=1.0000\n\n[Docking][Data]\nDockSpace ID=0x81A8BB71 Window=0xF9B0A590 Pos=225,133 Size=1393,722 Split=X\n DockNode ID=0x00000001 Parent=0x81A8BB71 SizeRef=1370,0 Split=Y\n DockNode ID=0x00000005 Parent=0x00000001 SizeRef=0,825 Split=X Selected=0x5708C63F\n DockNode ID=0x00000007 Parent=0x00000005 SizeRef=1140,701 Selected=0x5708C63F\n DockNode ID=0x00000008 Parent=0x00000005 SizeRef=228,701 Selected=0xFBA7A393\n DockNode ID=0x00000006 Parent=0x00000001 SizeRef=0,444 Selected=0x7AD1CDDD\n DockNode ID=0x00000002 Parent=0x81A8BB71 SizeRef=1188,0 Split=X\n DockNode ID=0x00000003 Parent=0x00000002 SizeRef=12,0\n DockNode ID=0x00000004 Parent=0x00000002 SizeRef=52,0 Split=Y Selected=0xCACA884B\n DockNode ID=0x00000009 Parent=0x00000004 SizeRef=420,228 Selected=0xCACA884B\n DockNode ID=0x0000000A Parent=0x00000004 SizeRef=420,430 Selected=0x1F041AD3\n\n[ImHex][General]\nhex.builtin.view.achievements.name=0\nhex.builtin.view.bookmarks.name=0\nhex.builtin.view.command_palette.name=0\nhex.builtin.view.constants.name=0\nhex.builtin.view.data_inspector.name=1\nhex.builtin.view.data_processor.name=1\nhex.builtin.view.diff.name=0\nhex.disassembler.view.disassembler.name=0\nhex.builtin.view.find.name=0\nhex.builtin.view.hashes.name=0\nhex.builtin.view.help.about.name=0\nhex.builtin.view.hex_editor.name=1\nhex.builtin.view.highlight_rules.name=0\nhex.builtin.view.information.name=0\nhex.builtin.view.logs.name=0\nhex.builtin.view.patches.name=0\nhex.builtin.view.pattern_data.name=1\nhex.builtin.view.pattern_editor.name=1\nhex.builtin.view.provider_settings.name=0\nhex.builtin.view.settings.name=0\nhex.builtin.view.store.name=0\nhex.builtin.view.theme_manager.name=0\nhex.builtin.view.tools.name=0\nhex.yara_rules.view.yara.name=0\nhex.windows.view.tty_console.name=0\nhex.builtin.tools.demangler=0\nhex.builtin.tools.ascii_table=0\nhex.builtin.tools.regex_replacer=0\nhex.builtin.tools.color=0\nhex.builtin.tools.calc=0\nhex.builtin.tools.graphing=0\nhex.builtin.tools.base_converter=0\nhex.builtin.tools.byte_swapper=0\nhex.builtin.tools.permissions=0\nhex.builtin.tools.wiki_explain=0\nhex.builtin.tools.file_tools=0\nhex.builtin.tools.ieee754=0\nhex.builtin.tools.invariant_multiplication=0\nhex.builtin.tools.tcp_client_server=0\nhex.builtin.tools.euclidean_algorithm=0\n\n", + "layout": "[Window][ImHexDockSpace]\nPos=0,19\nSize=1393,765\nCollapsed=0\n\n[Window][Debug##Default]\nPos=0,55\nSize=400,400\nCollapsed=0\n\n[Window][###hex.builtin.view.settings.name]\nPos=346,191\nSize=700,400\nCollapsed=0\n\n[Window][Question]\nPos=496,338\nSize=400,105\nCollapsed=0\n\n[Window][Welcome Screen]\nPos=0,37\nSize=1393,728\nCollapsed=0\n\n[Window][###hex.builtin.view.hex_editor.name]\nPos=0,38\nSize=619,468\nCollapsed=0\nDockId=0x00000007,0\n\n[Window][###hex.builtin.view.data_inspector.name]\nPos=621,38\nSize=124,468\nCollapsed=0\nDockId=0x00000008,0\n\n[Window][###hex.builtin.view.pattern_data.name]\nPos=0,508\nSize=745,252\nCollapsed=0\nDockId=0x00000006,0\n\n[Window][###hex.builtin.view.pattern_editor.name]\nPos=747,38\nSize=646,722\nCollapsed=0\nDockId=0x00000009,0\n\n[Window][###hex.hashes.view.hashes.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000009,4\n\n[Window][###hex.builtin.view.find.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000009,3\n\n[Window][###hex.builtin.view.bookmarks.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000009,2\n\n[Window][###hex.builtin.view.information.name]\nPos=-1889,-120\nSize=510,420\nCollapsed=0\n\n[Window][###hex.yara_rules.view.yara.name]\nPos=720,38\nSize=560,660\nCollapsed=0\n\n[Window][###hex.builtin.view.store.name]\nViewportPos=564,236\nViewportId=0xB51F9C4A\nSize=900,700\nCollapsed=0\n\n[Window][###hex.builtin.view.diff.name]\nPos=1372,38\nSize=1188,1333\nCollapsed=0\nDockId=0x00000009,1\n\n[Window][###hex.builtin.view.provider_settings.load_popup]\nPos=585,322\nSize=314,208\nCollapsed=0\n\n[Window][###hex.builtin.view.patches.name]\nPos=-1889,-120\nSize=510,420\nCollapsed=0\n\n[Window][###hex.builtin.view.data_processor.name]\nPos=747,38\nSize=646,722\nCollapsed=0\nDockId=0x00000009,1\n\n[Window][###hex.builtin.view.tools.name]\nPos=849,268\nSize=431,430\nCollapsed=0\nDockId=0x0000000A,0\n\n[Window][###hex.builtin.view.theme_manager.name]\nPos=391,302\nSize=469,400\nCollapsed=0\n\n[Window][###hex.builtin.tools.invariant_multiplication]\nPos=-1826,300\nSize=600,232\nCollapsed=0\n\n[Window][###hex.builtin.tools.regex_replacer]\nPos=-2091,104\nSize=600,305\nCollapsed=0\n\n[Window][###hex.builtin.tools.calc]\nPos=-1811,118\nSize=600,402\nCollapsed=0\n\n[Window][###hex.builtin.tools.permissions]\nPos=423,296\nSize=600,220\nCollapsed=0\n\n[Window][###hex.builtin.view.help.about.name]\nPos=377,193\nSize=677,400\nCollapsed=0\n\n[Window][###hex.builtin.view.constants.name]\nPos=419,-124\nSize=652,660\nCollapsed=0\n\n[Window][###hex.disassembler.view.disassembler.name]\nPos=1004,-204\nSize=1336,1320\nCollapsed=0\n\n[Window][##achievement_unlocked]\nPos=1093,0\nSize=200,55\nCollapsed=0\n\n[Window][hex.builtin.popup.blocking_task.title]\nPos=506,305\nSize=20,40\nCollapsed=0\n\n[Window][Waiting for Tasks]\nPos=60,60\nSize=16,35\nCollapsed=0\n\n[Window][Restore lost data]\nPos=555,349\nSize=283,84\nCollapsed=0\n\n[Window][Error]\nPos=440,301\nSize=400,118\nCollapsed=0\n\n[Window][###hex.builtin.view.highlight_rules.name]\nViewportPos=724,217\nViewportId=0x31C07F88\nSize=700,400\nCollapsed=0\n\n[Window][SideBarWindow]\nPos=19,37\nSize=660,1345\nCollapsed=0\n\n[Window][SideBarWindow/##Content_53A061AE]\nIsChild=1\nSize=644,1329\n\n[Window][Choose file]\nPos=382,131\nSize=516,458\nCollapsed=0\n\n[Window][###hex.builtin.view.logs.name]\nPos=60,60\nSize=549,466\nCollapsed=0\n\n[Window][###hex.builtin.view.achievements.name]\nPos=60,60\nSize=800,600\nCollapsed=0\n\n[Window][hex.builtin.welcome.start.recent.auto_backups]\nPos=580,365\nSize=233,52\nCollapsed=0\n\n[Window][Auto Backups]\nPos=580,331\nSize=233,120\nCollapsed=0\n\n[Window][hex.builtin.popup.create_workspace.title]\nPos=496,325\nSize=400,132\nCollapsed=0\n\n[Table][0x6A4694E4,3]\nRefScale=13\nColumn 0 Sort=0v\n\n[Table][0x7EE28D79,8]\nRefScale=13\nColumn 0 Width=13\nColumn 1 Weight=1.0000\nColumn 2 Weight=1.0000\nColumn 3 Weight=1.0000 Sort=0v\nColumn 4 Weight=1.0000\nColumn 5 Weight=1.0000\nColumn 6 Weight=1.0000\nColumn 7 Weight=1.0000\n\n[Table][0x6190819E,3]\nColumn 0 Weight=1.0000\nColumn 1 Weight=1.0000\nColumn 2 Weight=1.0000\n\n[Docking][Data]\nDockSpace ID=0x81A8BB71 Window=0xF9B0A590 Pos=225,133 Size=1393,722 Split=X\n DockNode ID=0x00000001 Parent=0x81A8BB71 SizeRef=1370,0 Split=Y\n DockNode ID=0x00000005 Parent=0x00000001 SizeRef=0,825 Split=X Selected=0x5708C63F\n DockNode ID=0x00000007 Parent=0x00000005 SizeRef=1140,701 Selected=0x5708C63F\n DockNode ID=0x00000008 Parent=0x00000005 SizeRef=228,701 Selected=0xFBA7A393\n DockNode ID=0x00000006 Parent=0x00000001 SizeRef=0,444 Selected=0x7AD1CDDD\n DockNode ID=0x00000002 Parent=0x81A8BB71 SizeRef=1188,0 Split=X\n DockNode ID=0x00000003 Parent=0x00000002 SizeRef=12,0\n DockNode ID=0x00000004 Parent=0x00000002 SizeRef=52,0 Split=Y Selected=0xCACA884B\n DockNode ID=0x00000009 Parent=0x00000004 SizeRef=420,228 Selected=0xCACA884B\n DockNode ID=0x0000000A Parent=0x00000004 SizeRef=420,430 Selected=0x1F041AD3\n\n[ImHex][General]\nhex.builtin.view.achievements.name=0\nhex.builtin.view.bookmarks.name=0\nhex.builtin.view.command_palette.name=0\nhex.builtin.view.constants.name=0\nhex.builtin.view.data_inspector.name=1\nhex.builtin.view.data_processor.name=1\nhex.builtin.view.diff.name=0\nhex.disassembler.view.disassembler.name=0\nhex.builtin.view.find.name=0\nhex.hashes.view.hashes.name=0\nhex.builtin.view.help.about.name=0\nhex.builtin.view.hex_editor.name=1\nhex.builtin.view.highlight_rules.name=0\nhex.builtin.view.information.name=0\nhex.builtin.view.logs.name=0\nhex.builtin.view.patches.name=0\nhex.builtin.view.pattern_data.name=1\nhex.builtin.view.pattern_editor.name=1\nhex.builtin.view.provider_settings.name=0\nhex.builtin.view.settings.name=0\nhex.builtin.view.store.name=0\nhex.builtin.view.theme_manager.name=0\nhex.builtin.view.tools.name=0\nhex.yara_rules.view.yara.name=0\nhex.windows.view.tty_console.name=0\nhex.builtin.tools.demangler=0\nhex.builtin.tools.ascii_table=0\nhex.builtin.tools.regex_replacer=0\nhex.builtin.tools.color=0\nhex.builtin.tools.calc=0\nhex.builtin.tools.graphing=0\nhex.builtin.tools.base_converter=0\nhex.builtin.tools.byte_swapper=0\nhex.builtin.tools.permissions=0\nhex.builtin.tools.wiki_explain=0\nhex.builtin.tools.file_tools=0\nhex.builtin.tools.ieee754=0\nhex.builtin.tools.invariant_multiplication=0\nhex.builtin.tools.tcp_client_server=0\nhex.builtin.tools.euclidean_algorithm=0\n\n", "name": "Default" } \ No newline at end of file diff --git a/plugins/builtin/romfs/auto_extract/workspaces/minimal.hexws b/plugins/builtin/romfs/auto_extract/workspaces/minimal.hexws index 6d9623985..dc7d5d73f 100644 --- a/plugins/builtin/romfs/auto_extract/workspaces/minimal.hexws +++ b/plugins/builtin/romfs/auto_extract/workspaces/minimal.hexws @@ -1,4 +1,4 @@ { - "layout": "[Window][ImHexDockSpace]\nPos=0,19\nSize=600,783\nCollapsed=0\n\n[Window][Debug##Default]\nPos=0,55\nSize=400,400\nCollapsed=0\n\n[Window][###hex.builtin.view.settings.name]\nPos=259,200\nSize=700,400\nCollapsed=0\n\n[Window][Question]\nPos=496,338\nSize=400,105\nCollapsed=0\n\n[Window][Welcome Screen]\nPos=0,37\nSize=1393,728\nCollapsed=0\n\n[Window][###hex.builtin.view.hex_editor.name]\nPos=0,38\nSize=600,740\nCollapsed=0\nDockId=0x00000007,0\n\n[Window][###hex.builtin.view.data_inspector.name]\nPos=1142,76\nSize=553,980\nCollapsed=0\nDockId=0x00000008,0\n\n[Window][###hex.builtin.view.pattern_data.name]\nPos=0,1058\nSize=1695,445\nCollapsed=0\nDockId=0x00000006,0\n\n[Window][###hex.builtin.view.pattern_editor.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,0\n\n[Window][###hex.builtin.view.hashes.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,4\n\n[Window][###hex.builtin.view.find.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,3\n\n[Window][###hex.builtin.view.bookmarks.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,2\n\n[Window][###hex.builtin.view.information.name]\nPos=-1889,-120\nSize=510,420\nCollapsed=0\n\n[Window][###hex.yara_rules.view.yara.name]\nPos=720,38\nSize=560,660\nCollapsed=0\n\n[Window][###hex.builtin.view.store.name]\nPos=562,201\nSize=900,700\nCollapsed=0\n\n[Window][###hex.builtin.view.diff.name]\nPos=1233,38\nSize=687,1021\nCollapsed=0\n\n[Window][###hex.builtin.view.provider_settings.load_popup]\nPos=585,322\nSize=314,208\nCollapsed=0\n\n[Window][###hex.builtin.view.patches.name]\nPos=-1889,-120\nSize=510,420\nCollapsed=0\n\n[Window][###hex.builtin.view.data_processor.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,1\n\n[Window][###hex.builtin.view.tools.name]\nViewportPos=952,218\nViewportId=0x9B385D8A\nSize=1306,1600\nCollapsed=0\n\n[Window][###hex.builtin.view.theme_manager.name]\nPos=391,302\nSize=469,400\nCollapsed=0\n\n[Window][###hex.builtin.tools.invariant_multiplication]\nPos=-1826,300\nSize=600,232\nCollapsed=0\n\n[Window][###hex.builtin.tools.regex_replacer]\nPos=-2091,104\nSize=600,305\nCollapsed=0\n\n[Window][###hex.builtin.tools.calc]\nPos=-1811,118\nSize=600,402\nCollapsed=0\n\n[Window][###hex.builtin.tools.permissions]\nPos=423,296\nSize=600,220\nCollapsed=0\n\n[Window][###hex.builtin.view.help.about.name]\nPos=214,201\nSize=600,350\nCollapsed=0\n\n[Window][###hex.builtin.view.constants.name]\nPos=419,-124\nSize=652,660\nCollapsed=0\n\n[Window][###hex.disassembler.view.disassembler.name]\nPos=1004,-204\nSize=1336,1320\nCollapsed=0\n\n[Window][##achievement_unlocked]\nPos=1093,0\nSize=200,55\nCollapsed=0\n\n[Window][hex.builtin.popup.blocking_task.title]\nPos=506,305\nSize=20,40\nCollapsed=0\n\n[Window][Waiting for Tasks]\nPos=60,60\nSize=16,35\nCollapsed=0\n\n[Window][Restore lost data]\nPos=555,349\nSize=283,84\nCollapsed=0\n\n[Window][Error]\nPos=440,301\nSize=400,118\nCollapsed=0\n\n[Window][###hex.builtin.view.highlight_rules.name]\nViewportPos=724,217\nViewportId=0x31C07F88\nSize=700,400\nCollapsed=0\n\n[Window][SideBarWindow]\nPos=19,37\nSize=660,1345\nCollapsed=0\n\n[Window][SideBarWindow/##Content_53A061AE]\nIsChild=1\nSize=644,1329\n\n[Window][Choose file]\nPos=382,131\nSize=516,458\nCollapsed=0\n\n[Window][###hex.builtin.view.logs.name]\nPos=60,60\nSize=549,466\nCollapsed=0\n\n[Window][###hex.builtin.view.achievements.name]\nPos=60,60\nSize=800,600\nCollapsed=0\n\n[Window][hex.builtin.welcome.start.recent.auto_backups]\nPos=580,365\nSize=233,52\nCollapsed=0\n\n[Window][Auto Backups]\nPos=580,331\nSize=233,120\nCollapsed=0\n\n[Window][hex.builtin.popup.create_workspace.title]\nPos=100,334\nSize=400,132\nCollapsed=0\n\n[Table][0x6A4694E4,3]\nRefScale=13\nColumn 0 Sort=0v\n\n[Table][0x7EE28D79,8]\nRefScale=13\nColumn 0 Width=13\nColumn 1 Weight=1.0000\nColumn 2 Weight=1.0000\nColumn 3 Weight=1.0000 Sort=0v\nColumn 4 Weight=1.0000\nColumn 5 Weight=1.0000\nColumn 6 Weight=1.0000\nColumn 7 Weight=1.0000\n\n[Table][0x6190819E,3]\nColumn 0 Weight=1.0000\nColumn 1 Weight=1.0000\nColumn 2 Weight=1.0000\n\n[Docking][Data]\nDockSpace ID=0x81A8BB71 Window=0xF9B0A590 Pos=220,131 Size=600,740 Split=X\n DockNode ID=0x00000001 Parent=0x81A8BB71 SizeRef=847,0 Split=Y\n DockNode ID=0x00000005 Parent=0x00000001 SizeRef=0,44 Split=X Selected=0x5708C63F\n DockNode ID=0x00000007 Parent=0x00000005 SizeRef=1140,701 Selected=0x5708C63F\n DockNode ID=0x00000008 Parent=0x00000005 SizeRef=553,701 Selected=0xFBA7A393\n DockNode ID=0x00000006 Parent=0x00000001 SizeRef=0,20 Selected=0x7AD1CDDD\n DockNode ID=0x00000002 Parent=0x81A8BB71 SizeRef=431,0 Split=X\n DockNode ID=0x00000003 Parent=0x00000002 SizeRef=12,0\n DockNode ID=0x00000004 Parent=0x00000002 SizeRef=52,0 Selected=0xCACA884B\n\n[ImHex][General]\nhex.builtin.view.achievements.name=0\nhex.builtin.view.bookmarks.name=0\nhex.builtin.view.command_palette.name=0\nhex.builtin.view.constants.name=0\nhex.builtin.view.data_inspector.name=0\nhex.builtin.view.data_processor.name=0\nhex.builtin.view.diff.name=0\nhex.disassembler.view.disassembler.name=0\nhex.builtin.view.find.name=0\nhex.builtin.view.hashes.name=0\nhex.builtin.view.help.about.name=0\nhex.builtin.view.hex_editor.name=1\nhex.builtin.view.highlight_rules.name=0\nhex.builtin.view.information.name=0\nhex.builtin.view.logs.name=0\nhex.builtin.view.patches.name=0\nhex.builtin.view.pattern_data.name=0\nhex.builtin.view.pattern_editor.name=0\nhex.builtin.view.provider_settings.name=0\nhex.builtin.view.settings.name=0\nhex.builtin.view.store.name=0\nhex.builtin.view.theme_manager.name=0\nhex.builtin.view.tools.name=0\nhex.yara_rules.view.yara.name=0\nhex.windows.view.tty_console.name=0\nhex.builtin.tools.demangler=0\nhex.builtin.tools.ascii_table=0\nhex.builtin.tools.regex_replacer=0\nhex.builtin.tools.color=0\nhex.builtin.tools.calc=0\nhex.builtin.tools.graphing=0\nhex.builtin.tools.base_converter=0\nhex.builtin.tools.byte_swapper=0\nhex.builtin.tools.permissions=0\nhex.builtin.tools.wiki_explain=0\nhex.builtin.tools.file_tools=0\nhex.builtin.tools.ieee754=0\nhex.builtin.tools.invariant_multiplication=0\nhex.builtin.tools.tcp_client_server=0\nhex.builtin.tools.euclidean_algorithm=0\n\n", + "layout": "[Window][ImHexDockSpace]\nPos=0,19\nSize=600,783\nCollapsed=0\n\n[Window][Debug##Default]\nPos=0,55\nSize=400,400\nCollapsed=0\n\n[Window][###hex.builtin.view.settings.name]\nPos=259,200\nSize=700,400\nCollapsed=0\n\n[Window][Question]\nPos=496,338\nSize=400,105\nCollapsed=0\n\n[Window][Welcome Screen]\nPos=0,37\nSize=1393,728\nCollapsed=0\n\n[Window][###hex.builtin.view.hex_editor.name]\nPos=0,38\nSize=600,740\nCollapsed=0\nDockId=0x00000007,0\n\n[Window][###hex.builtin.view.data_inspector.name]\nPos=1142,76\nSize=553,980\nCollapsed=0\nDockId=0x00000008,0\n\n[Window][###hex.builtin.view.pattern_data.name]\nPos=0,1058\nSize=1695,445\nCollapsed=0\nDockId=0x00000006,0\n\n[Window][###hex.builtin.view.pattern_editor.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,0\n\n[Window][###hex.hashes.view.hashes.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,4\n\n[Window][###hex.builtin.view.find.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,3\n\n[Window][###hex.builtin.view.bookmarks.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,2\n\n[Window][###hex.builtin.view.information.name]\nPos=-1889,-120\nSize=510,420\nCollapsed=0\n\n[Window][###hex.yara_rules.view.yara.name]\nPos=720,38\nSize=560,660\nCollapsed=0\n\n[Window][###hex.builtin.view.store.name]\nPos=562,201\nSize=900,700\nCollapsed=0\n\n[Window][###hex.builtin.view.diff.name]\nPos=1233,38\nSize=687,1021\nCollapsed=0\n\n[Window][###hex.builtin.view.provider_settings.load_popup]\nPos=585,322\nSize=314,208\nCollapsed=0\n\n[Window][###hex.builtin.view.patches.name]\nPos=-1889,-120\nSize=510,420\nCollapsed=0\n\n[Window][###hex.builtin.view.data_processor.name]\nPos=1697,76\nSize=863,1427\nCollapsed=0\nDockId=0x00000004,1\n\n[Window][###hex.builtin.view.tools.name]\nViewportPos=952,218\nViewportId=0x9B385D8A\nSize=1306,1600\nCollapsed=0\n\n[Window][###hex.builtin.view.theme_manager.name]\nPos=391,302\nSize=469,400\nCollapsed=0\n\n[Window][###hex.builtin.tools.invariant_multiplication]\nPos=-1826,300\nSize=600,232\nCollapsed=0\n\n[Window][###hex.builtin.tools.regex_replacer]\nPos=-2091,104\nSize=600,305\nCollapsed=0\n\n[Window][###hex.builtin.tools.calc]\nPos=-1811,118\nSize=600,402\nCollapsed=0\n\n[Window][###hex.builtin.tools.permissions]\nPos=423,296\nSize=600,220\nCollapsed=0\n\n[Window][###hex.builtin.view.help.about.name]\nPos=214,201\nSize=600,350\nCollapsed=0\n\n[Window][###hex.builtin.view.constants.name]\nPos=419,-124\nSize=652,660\nCollapsed=0\n\n[Window][###hex.disassembler.view.disassembler.name]\nPos=1004,-204\nSize=1336,1320\nCollapsed=0\n\n[Window][##achievement_unlocked]\nPos=1093,0\nSize=200,55\nCollapsed=0\n\n[Window][hex.builtin.popup.blocking_task.title]\nPos=506,305\nSize=20,40\nCollapsed=0\n\n[Window][Waiting for Tasks]\nPos=60,60\nSize=16,35\nCollapsed=0\n\n[Window][Restore lost data]\nPos=555,349\nSize=283,84\nCollapsed=0\n\n[Window][Error]\nPos=440,301\nSize=400,118\nCollapsed=0\n\n[Window][###hex.builtin.view.highlight_rules.name]\nViewportPos=724,217\nViewportId=0x31C07F88\nSize=700,400\nCollapsed=0\n\n[Window][SideBarWindow]\nPos=19,37\nSize=660,1345\nCollapsed=0\n\n[Window][SideBarWindow/##Content_53A061AE]\nIsChild=1\nSize=644,1329\n\n[Window][Choose file]\nPos=382,131\nSize=516,458\nCollapsed=0\n\n[Window][###hex.builtin.view.logs.name]\nPos=60,60\nSize=549,466\nCollapsed=0\n\n[Window][###hex.builtin.view.achievements.name]\nPos=60,60\nSize=800,600\nCollapsed=0\n\n[Window][hex.builtin.welcome.start.recent.auto_backups]\nPos=580,365\nSize=233,52\nCollapsed=0\n\n[Window][Auto Backups]\nPos=580,331\nSize=233,120\nCollapsed=0\n\n[Window][hex.builtin.popup.create_workspace.title]\nPos=100,334\nSize=400,132\nCollapsed=0\n\n[Table][0x6A4694E4,3]\nRefScale=13\nColumn 0 Sort=0v\n\n[Table][0x7EE28D79,8]\nRefScale=13\nColumn 0 Width=13\nColumn 1 Weight=1.0000\nColumn 2 Weight=1.0000\nColumn 3 Weight=1.0000 Sort=0v\nColumn 4 Weight=1.0000\nColumn 5 Weight=1.0000\nColumn 6 Weight=1.0000\nColumn 7 Weight=1.0000\n\n[Table][0x6190819E,3]\nColumn 0 Weight=1.0000\nColumn 1 Weight=1.0000\nColumn 2 Weight=1.0000\n\n[Docking][Data]\nDockSpace ID=0x81A8BB71 Window=0xF9B0A590 Pos=220,131 Size=600,740 Split=X\n DockNode ID=0x00000001 Parent=0x81A8BB71 SizeRef=847,0 Split=Y\n DockNode ID=0x00000005 Parent=0x00000001 SizeRef=0,44 Split=X Selected=0x5708C63F\n DockNode ID=0x00000007 Parent=0x00000005 SizeRef=1140,701 Selected=0x5708C63F\n DockNode ID=0x00000008 Parent=0x00000005 SizeRef=553,701 Selected=0xFBA7A393\n DockNode ID=0x00000006 Parent=0x00000001 SizeRef=0,20 Selected=0x7AD1CDDD\n DockNode ID=0x00000002 Parent=0x81A8BB71 SizeRef=431,0 Split=X\n DockNode ID=0x00000003 Parent=0x00000002 SizeRef=12,0\n DockNode ID=0x00000004 Parent=0x00000002 SizeRef=52,0 Selected=0xCACA884B\n\n[ImHex][General]\nhex.builtin.view.achievements.name=0\nhex.builtin.view.bookmarks.name=0\nhex.builtin.view.command_palette.name=0\nhex.builtin.view.constants.name=0\nhex.builtin.view.data_inspector.name=0\nhex.builtin.view.data_processor.name=0\nhex.builtin.view.diff.name=0\nhex.disassembler.view.disassembler.name=0\nhex.builtin.view.find.name=0\nhex.hashes.view.hashes.name=0\nhex.builtin.view.help.about.name=0\nhex.builtin.view.hex_editor.name=1\nhex.builtin.view.highlight_rules.name=0\nhex.builtin.view.information.name=0\nhex.builtin.view.logs.name=0\nhex.builtin.view.patches.name=0\nhex.builtin.view.pattern_data.name=0\nhex.builtin.view.pattern_editor.name=0\nhex.builtin.view.provider_settings.name=0\nhex.builtin.view.settings.name=0\nhex.builtin.view.store.name=0\nhex.builtin.view.theme_manager.name=0\nhex.builtin.view.tools.name=0\nhex.yara_rules.view.yara.name=0\nhex.windows.view.tty_console.name=0\nhex.builtin.tools.demangler=0\nhex.builtin.tools.ascii_table=0\nhex.builtin.tools.regex_replacer=0\nhex.builtin.tools.color=0\nhex.builtin.tools.calc=0\nhex.builtin.tools.graphing=0\nhex.builtin.tools.base_converter=0\nhex.builtin.tools.byte_swapper=0\nhex.builtin.tools.permissions=0\nhex.builtin.tools.wiki_explain=0\nhex.builtin.tools.file_tools=0\nhex.builtin.tools.ieee754=0\nhex.builtin.tools.invariant_multiplication=0\nhex.builtin.tools.tcp_client_server=0\nhex.builtin.tools.euclidean_algorithm=0\n\n", "name": "Minimal" } \ No newline at end of file diff --git a/plugins/builtin/romfs/lang/de_DE.json b/plugins/builtin/romfs/lang/de_DE.json index 065e85853..80cf5fbdb 100644 --- a/plugins/builtin/romfs/lang/de_DE.json +++ b/plugins/builtin/romfs/lang/de_DE.json @@ -56,30 +56,11 @@ "hex.builtin.achievement.misc.analyze_file.desc": "", "hex.builtin.achievement.misc.download_from_store.name": "", "hex.builtin.achievement.misc.download_from_store.desc": "", - "hex.builtin.achievement.misc.create_hash.name": "", - "hex.builtin.achievement.misc.create_hash.desc": "", "hex.builtin.command.calc.desc": "Rechner", "hex.builtin.command.cmd.desc": "Befehl", "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.hash.crc.iv": "Initialwert", - "hex.builtin.hash.crc.poly": "Polynom", - "hex.builtin.hash.crc.refl_in": "Reflect In", - "hex.builtin.hash.crc.refl_out": "Reflect Out", - "hex.builtin.hash.crc.xor_out": "XOR Out", - "hex.builtin.hash.crc16": "CRC-16", - "hex.builtin.hash.crc32": "CRC-32", - "hex.builtin.hash.crc32c": "CRC-32C", - "hex.builtin.hash.crc32mpeg": "CRC-32/MPEG", - "hex.builtin.hash.crc32posix": "CRC-32/POSIX", - "hex.builtin.hash.crc8": "CRC-8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "ASCII Zeichen", "hex.builtin.inspector.binary": "Binär (8 bit)", "hex.builtin.inspector.bool": "bool", @@ -628,15 +609,6 @@ "hex.builtin.view.find.value.max": "Maximalwert", "hex.builtin.view.find.value.min": "Minimalwert", "hex.builtin.view.find.value.range": "", - "hex.builtin.view.hashes.function": "Hashfunktion", - "hex.builtin.view.hashes.hash": "Hash", - "hex.builtin.view.hashes.hover_info": "Bewege die Maus über die ausgewählten Bytes im Hex Editor und halte SHIFT gedrückt, um die Hashes dieser Region anzuzeigen.", - "hex.builtin.view.hashes.name": "Hashes", - "hex.builtin.view.hashes.no_settings": "Keine Einstellungen verfügbar", - "hex.builtin.view.hashes.remove": "Hash entfernen", - "hex.builtin.view.hashes.table.name": "Name", - "hex.builtin.view.hashes.table.result": "Resultat", - "hex.builtin.view.hashes.table.type": "Typ", "hex.builtin.view.help.about.contributor": "Mitwirkende", "hex.builtin.view.help.about.donations": "Spenden", "hex.builtin.view.help.about.libs": "Benutzte Libraries", diff --git a/plugins/builtin/romfs/lang/en_US.json b/plugins/builtin/romfs/lang/en_US.json index d3eab0467..1df4dcb0c 100644 --- a/plugins/builtin/romfs/lang/en_US.json +++ b/plugins/builtin/romfs/lang/en_US.json @@ -58,8 +58,6 @@ "hex.builtin.achievement.misc.analyze_file.desc": "Analyze the bytes of your data by using the 'Analyze' option in the Data Information view.", "hex.builtin.achievement.misc.download_from_store.name": "There's an app for that", "hex.builtin.achievement.misc.download_from_store.desc": "Download any item from the Content Store", - "hex.builtin.achievement.misc.create_hash.name": "Hash browns", - "hex.builtin.achievement.misc.create_hash.desc": "Create a new hash function in the Hash view by selecting the type, giving it a name and clicking on the Plus button next to it.", "hex.builtin.command.calc.desc": "Calculator", "hex.builtin.command.convert.desc": "Unit conversion", "hex.builtin.command.convert.hexadecimal": "hexadecimal", @@ -75,23 +73,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.hash.crc.iv": "Initial Value", - "hex.builtin.hash.crc.poly": "Polynomial", - "hex.builtin.hash.crc.refl_in": "Reflect In", - "hex.builtin.hash.crc.refl_out": "Reflect Out", - "hex.builtin.hash.crc.xor_out": "XOR Out", - "hex.builtin.hash.crc16": "CRC-16", - "hex.builtin.hash.crc32": "CRC-32", - "hex.builtin.hash.crc32c": "CRC-32C", - "hex.builtin.hash.crc32mpeg": "CRC-32/MPEG", - "hex.builtin.hash.crc32posix": "CRC-32/POSIX", - "hex.builtin.hash.crc8": "CRC-8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "ASCII Character", "hex.builtin.inspector.binary": "Binary (8 bit)", "hex.builtin.inspector.bool": "bool", @@ -725,15 +706,6 @@ "hex.builtin.view.find.value.max": "Maximum Value", "hex.builtin.view.find.value.min": "Minimum Value", "hex.builtin.view.find.value.range": "Ranged Search", - "hex.builtin.view.hashes.function": "Hash function", - "hex.builtin.view.hashes.hash": "Hash", - "hex.builtin.view.hashes.hover_info": "Hover over the Hex Editor selection and hold down SHIFT to view the hashes of that region.", - "hex.builtin.view.hashes.name": "Hashes", - "hex.builtin.view.hashes.no_settings": "No settings available", - "hex.builtin.view.hashes.remove": "Remove hash", - "hex.builtin.view.hashes.table.name": "Name", - "hex.builtin.view.hashes.table.result": "Result", - "hex.builtin.view.hashes.table.type": "Type", "hex.builtin.view.help.about.commits": "Commit History", "hex.builtin.view.help.about.contributor": "Contributors", "hex.builtin.view.help.about.donations": "Donations", diff --git a/plugins/builtin/romfs/lang/es_ES.json b/plugins/builtin/romfs/lang/es_ES.json index 2264ed6be..105c79c32 100644 --- a/plugins/builtin/romfs/lang/es_ES.json +++ b/plugins/builtin/romfs/lang/es_ES.json @@ -56,30 +56,11 @@ "hex.builtin.achievement.misc.analyze_file.desc": "", "hex.builtin.achievement.misc.download_from_store.name": "", "hex.builtin.achievement.misc.download_from_store.desc": "", - "hex.builtin.achievement.misc.create_hash.name": "", - "hex.builtin.achievement.misc.create_hash.desc": "", "hex.builtin.command.calc.desc": "Calculadora", "hex.builtin.command.cmd.desc": "Comando", "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.hash.crc.iv": "Valor Inicial", - "hex.builtin.hash.crc.poly": "Polinomio", - "hex.builtin.hash.crc.refl_in": "Reflect In", - "hex.builtin.hash.crc.refl_out": "Reflect Out", - "hex.builtin.hash.crc.xor_out": "XOR Out", - "hex.builtin.hash.crc16": "CRC-16", - "hex.builtin.hash.crc32": "CRC-32", - "hex.builtin.hash.crc32c": "CRC-32Cç", - "hex.builtin.hash.crc32mpeg": "CRC-32/MPEG", - "hex.builtin.hash.crc32posix": "CRC-32/POSIX", - "hex.builtin.hash.crc8": "CRC-8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "Carácter ASCII", "hex.builtin.inspector.binary": "Binario (8 bit)", "hex.builtin.inspector.bool": "bool", @@ -627,15 +608,6 @@ "hex.builtin.view.find.value.max": "Valor máximo", "hex.builtin.view.find.value.min": "Valor Mínimo", "hex.builtin.view.find.value.range": "Búsqueda en Rango", - "hex.builtin.view.hashes.function": "Función de Hash", - "hex.builtin.view.hashes.hash": "Hash", - "hex.builtin.view.hashes.hover_info": "Sitúe el ratón sobre la selección del Editor Hexadecimal y mantenga SHIFT para ver los hashes de esa región.", - "hex.builtin.view.hashes.name": "Hashes", - "hex.builtin.view.hashes.no_settings": "No hay ajustes disponibles", - "hex.builtin.view.hashes.remove": "Eliminar hash", - "hex.builtin.view.hashes.table.name": "Nombre", - "hex.builtin.view.hashes.table.result": "Resultado", - "hex.builtin.view.hashes.table.type": "Tipo", "hex.builtin.view.help.about.contributor": "Contribuidores", "hex.builtin.view.help.about.donations": "Donaciones", "hex.builtin.view.help.about.libs": "Librerías utilizadas", diff --git a/plugins/builtin/romfs/lang/it_IT.json b/plugins/builtin/romfs/lang/it_IT.json index 023e7ff23..232e4befd 100644 --- a/plugins/builtin/romfs/lang/it_IT.json +++ b/plugins/builtin/romfs/lang/it_IT.json @@ -56,30 +56,11 @@ "hex.builtin.achievement.misc.analyze_file.desc": "", "hex.builtin.achievement.misc.download_from_store.name": "", "hex.builtin.achievement.misc.download_from_store.desc": "", - "hex.builtin.achievement.misc.create_hash.name": "", - "hex.builtin.achievement.misc.create_hash.desc": "", "hex.builtin.command.calc.desc": "Calcolatrice", "hex.builtin.command.cmd.desc": "Comando", "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.hash.crc.iv": "Valore Iniziale", - "hex.builtin.hash.crc.poly": "Polinomio", - "hex.builtin.hash.crc.refl_in": "", - "hex.builtin.hash.crc.refl_out": "", - "hex.builtin.hash.crc.xor_out": "", - "hex.builtin.hash.crc16": "CRC16", - "hex.builtin.hash.crc32": "CRC32", - "hex.builtin.hash.crc32c": "", - "hex.builtin.hash.crc32mpeg": "", - "hex.builtin.hash.crc32posix": "", - "hex.builtin.hash.crc8": "CRC8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "ASCII Character", "hex.builtin.inspector.binary": "Binary (8 bit)", "hex.builtin.inspector.bool": "bool", @@ -627,15 +608,6 @@ "hex.builtin.view.find.value.max": "", "hex.builtin.view.find.value.min": "", "hex.builtin.view.find.value.range": "", - "hex.builtin.view.hashes.function": "Funzioni di Hash", - "hex.builtin.view.hashes.hash": "Hash", - "hex.builtin.view.hashes.hover_info": "", - "hex.builtin.view.hashes.name": "Hash", - "hex.builtin.view.hashes.no_settings": "", - "hex.builtin.view.hashes.remove": "", - "hex.builtin.view.hashes.table.name": "", - "hex.builtin.view.hashes.table.result": "Risultato", - "hex.builtin.view.hashes.table.type": "", "hex.builtin.view.help.about.contributor": "Collaboratori", "hex.builtin.view.help.about.donations": "Donazioni", "hex.builtin.view.help.about.libs": "Librerie usate", diff --git a/plugins/builtin/romfs/lang/ja_JP.json b/plugins/builtin/romfs/lang/ja_JP.json index 8fa3d6433..5b3f69ec8 100644 --- a/plugins/builtin/romfs/lang/ja_JP.json +++ b/plugins/builtin/romfs/lang/ja_JP.json @@ -56,30 +56,11 @@ "hex.builtin.achievement.misc.analyze_file.desc": "", "hex.builtin.achievement.misc.download_from_store.name": "", "hex.builtin.achievement.misc.download_from_store.desc": "", - "hex.builtin.achievement.misc.create_hash.name": "", - "hex.builtin.achievement.misc.create_hash.desc": "", "hex.builtin.command.calc.desc": "電卓", "hex.builtin.command.cmd.desc": "コマンド", "hex.builtin.command.cmd.result": "コマンド '{0}' を実行", "hex.builtin.command.web.desc": "ウェブサイト参照", "hex.builtin.command.web.result": "'{0}' を開く", - "hex.builtin.hash.crc.iv": "初期値", - "hex.builtin.hash.crc.poly": "多項式", - "hex.builtin.hash.crc.refl_in": "入力を反映", - "hex.builtin.hash.crc.refl_out": "出力を反映", - "hex.builtin.hash.crc.xor_out": "最終XOR値", - "hex.builtin.hash.crc16": "CRC16", - "hex.builtin.hash.crc32": "CRC32", - "hex.builtin.hash.crc32c": "", - "hex.builtin.hash.crc32mpeg": "", - "hex.builtin.hash.crc32posix": "", - "hex.builtin.hash.crc8": "CRC8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "ASCII", "hex.builtin.inspector.binary": "バイナリ (8 bit)", "hex.builtin.inspector.bool": "bool", @@ -627,15 +608,6 @@ "hex.builtin.view.find.value.max": "最大値", "hex.builtin.view.find.value.min": "最小値", "hex.builtin.view.find.value.range": "", - "hex.builtin.view.hashes.function": "ハッシュ関数", - "hex.builtin.view.hashes.hash": "", - "hex.builtin.view.hashes.hover_info": "", - "hex.builtin.view.hashes.name": "ハッシュ", - "hex.builtin.view.hashes.no_settings": "", - "hex.builtin.view.hashes.remove": "", - "hex.builtin.view.hashes.table.name": "", - "hex.builtin.view.hashes.table.result": "結果", - "hex.builtin.view.hashes.table.type": "", "hex.builtin.view.help.about.contributor": "ご協力頂いた方々", "hex.builtin.view.help.about.donations": "寄付", "hex.builtin.view.help.about.libs": "使用しているライブラリ", diff --git a/plugins/builtin/romfs/lang/ko_KR.json b/plugins/builtin/romfs/lang/ko_KR.json index aebf7f7c8..44379cead 100644 --- a/plugins/builtin/romfs/lang/ko_KR.json +++ b/plugins/builtin/romfs/lang/ko_KR.json @@ -56,30 +56,11 @@ "hex.builtin.achievement.misc.analyze_file.desc": "데이터 정보 보기의 '분석' 옵션을 사용하여 데이터의 바이트를 분석합니다.", "hex.builtin.achievement.misc.download_from_store.name": "그걸 위한 앱이 있죠", "hex.builtin.achievement.misc.download_from_store.desc": "콘텐츠 스토어에서 아무 항목이나 다운로드합니다.", - "hex.builtin.achievement.misc.create_hash.name": "해시 브라운", - "hex.builtin.achievement.misc.create_hash.desc": "해시 보기에서 유형을 선택하고 이름을 지정한 다음 옆에 있는 더하기 버튼을 클릭하여 새 해시 함수를 만듭니다.", "hex.builtin.command.calc.desc": "계산기", "hex.builtin.command.cmd.desc": "명령", "hex.builtin.command.cmd.result": "'{0}' 명령 실행", "hex.builtin.command.web.desc": "웹사이트 탐색", "hex.builtin.command.web.result": "'{0}'(으)로 이동", - "hex.builtin.hash.crc.iv": "초기 값", - "hex.builtin.hash.crc.poly": "다항식", - "hex.builtin.hash.crc.refl_in": "입력에 반영", - "hex.builtin.hash.crc.refl_out": "출력에 반영", - "hex.builtin.hash.crc.xor_out": "XOR 출력", - "hex.builtin.hash.crc16": "CRC-16", - "hex.builtin.hash.crc32": "CRC-32", - "hex.builtin.hash.crc32c": "CRC-32C", - "hex.builtin.hash.crc32mpeg": "CRC-32/MPEG", - "hex.builtin.hash.crc32posix": "CRC-32/POSIX", - "hex.builtin.hash.crc8": "CRC-8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "ASCII 문자", "hex.builtin.inspector.binary": "2진수 (8비트)", "hex.builtin.inspector.bool": "부울", @@ -648,15 +629,6 @@ "hex.builtin.view.find.value.max": "최댓값", "hex.builtin.view.find.value.min": "최솟값", "hex.builtin.view.find.value.range": "범위 검색", - "hex.builtin.view.hashes.function": "해시 함수", - "hex.builtin.view.hashes.hash": "해시", - "hex.builtin.view.hashes.hover_info": "헥스 에디터 선택 영역 위로 마우스를 가져간 상태에서 Shift를 길게 누르면 해당 영역의 해시를 볼 수 있습니다.", - "hex.builtin.view.hashes.name": "해시", - "hex.builtin.view.hashes.no_settings": "설정이 없습니다", - "hex.builtin.view.hashes.remove": "해시 제거", - "hex.builtin.view.hashes.table.name": "이름", - "hex.builtin.view.hashes.table.result": "결과", - "hex.builtin.view.hashes.table.type": "유형", "hex.builtin.view.help.about.contributor": "기여자", "hex.builtin.view.help.about.donations": "후원", "hex.builtin.view.help.about.libs": "사용한 라이브러리", diff --git a/plugins/builtin/romfs/lang/pt_BR.json b/plugins/builtin/romfs/lang/pt_BR.json index a0ded7fc2..336d0787e 100644 --- a/plugins/builtin/romfs/lang/pt_BR.json +++ b/plugins/builtin/romfs/lang/pt_BR.json @@ -56,30 +56,11 @@ "hex.builtin.achievement.misc.analyze_file.desc": "", "hex.builtin.achievement.misc.download_from_store.name": "", "hex.builtin.achievement.misc.download_from_store.desc": "", - "hex.builtin.achievement.misc.create_hash.name": "", - "hex.builtin.achievement.misc.create_hash.desc": "", "hex.builtin.command.calc.desc": "Calculadora", "hex.builtin.command.cmd.desc": "Comando", "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.hash.crc.iv": "Initial Value", - "hex.builtin.hash.crc.poly": "Polynomial", - "hex.builtin.hash.crc.refl_in": "Reflect In", - "hex.builtin.hash.crc.refl_out": "Reflect Out", - "hex.builtin.hash.crc.xor_out": "XOR Out", - "hex.builtin.hash.crc16": "CRC16", - "hex.builtin.hash.crc32": "CRC32", - "hex.builtin.hash.crc32c": "", - "hex.builtin.hash.crc32mpeg": "", - "hex.builtin.hash.crc32posix": "", - "hex.builtin.hash.crc8": "CRC8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "ASCII Character", "hex.builtin.inspector.binary": "Binary (8 bit)", "hex.builtin.inspector.bool": "bool", @@ -627,15 +608,6 @@ "hex.builtin.view.find.value.max": "", "hex.builtin.view.find.value.min": "", "hex.builtin.view.find.value.range": "", - "hex.builtin.view.hashes.function": "Função Hash", - "hex.builtin.view.hashes.hash": "Hash", - "hex.builtin.view.hashes.hover_info": "Passe o mouse sobre a seleção Hex Editor e mantenha pressionada a tecla SHIFT para visualizar os hashes dessa região.", - "hex.builtin.view.hashes.name": "Hashes", - "hex.builtin.view.hashes.no_settings": "Nenhuma configuração disponivel", - "hex.builtin.view.hashes.remove": "Remover hash", - "hex.builtin.view.hashes.table.name": "Nome", - "hex.builtin.view.hashes.table.result": "Resultado", - "hex.builtin.view.hashes.table.type": "Tipo", "hex.builtin.view.help.about.contributor": "Contribuidores", "hex.builtin.view.help.about.donations": "Doações", "hex.builtin.view.help.about.libs": "Bibliotecas usadas", diff --git a/plugins/builtin/romfs/lang/zh_CN.json b/plugins/builtin/romfs/lang/zh_CN.json index 16cd7a0f5..805b253b1 100644 --- a/plugins/builtin/romfs/lang/zh_CN.json +++ b/plugins/builtin/romfs/lang/zh_CN.json @@ -56,30 +56,11 @@ "hex.builtin.achievement.misc.analyze_file.desc": "使用数据信息视图中的“分析”选项来分析数据。", "hex.builtin.achievement.misc.download_from_store.name": "就是这样用的", "hex.builtin.achievement.misc.download_from_store.desc": "从内容商店下载任何内容", - "hex.builtin.achievement.misc.create_hash.name": "Hash!", - "hex.builtin.achievement.misc.create_hash.desc": "通过选择类型、为其命名并单击旁边的加号按钮,在“哈希”视图中创建新的哈希函数。", "hex.builtin.command.calc.desc": "计算器", "hex.builtin.command.cmd.desc": "指令", "hex.builtin.command.cmd.result": "运行指令 '{0}'", "hex.builtin.command.web.desc": "网站解析", "hex.builtin.command.web.result": "导航到 '{0}'", - "hex.builtin.hash.crc.iv": "初始值", - "hex.builtin.hash.crc.poly": "多项式", - "hex.builtin.hash.crc.refl_in": "输入值取反", - "hex.builtin.hash.crc.refl_out": "输出值取反", - "hex.builtin.hash.crc.xor_out": "结果异或值", - "hex.builtin.hash.crc16": "CRC-16", - "hex.builtin.hash.crc32": "CRC-32", - "hex.builtin.hash.crc32c": "CRC-32C", - "hex.builtin.hash.crc32mpeg": "CRC-32/MPEG", - "hex.builtin.hash.crc32posix": "CRC-32/POSIX", - "hex.builtin.hash.crc8": "CRC-8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "ASCII 字符", "hex.builtin.inspector.binary": "二进制(8 位)", "hex.builtin.inspector.bool": "bool", @@ -641,15 +622,6 @@ "hex.builtin.view.find.value.max": "最大值", "hex.builtin.view.find.value.min": "最小值", "hex.builtin.view.find.value.range": "范围搜索", - "hex.builtin.view.hashes.function": "哈希函数", - "hex.builtin.view.hashes.hash": "哈希", - "hex.builtin.view.hashes.hover_info": "将鼠标放在 Hex 编辑器的选区上,按住 SHIFT 来查看其哈希。", - "hex.builtin.view.hashes.name": "哈希", - "hex.builtin.view.hashes.no_settings": "没有可用哈希设置", - "hex.builtin.view.hashes.remove": "移除哈希", - "hex.builtin.view.hashes.table.name": "名称", - "hex.builtin.view.hashes.table.result": "结果", - "hex.builtin.view.hashes.table.type": "类型", "hex.builtin.view.help.about.contributor": "贡献者", "hex.builtin.view.help.about.donations": "赞助", "hex.builtin.view.help.about.libs": "使用的库", diff --git a/plugins/builtin/romfs/lang/zh_TW.json b/plugins/builtin/romfs/lang/zh_TW.json index 0846d202a..b0eba8ace 100644 --- a/plugins/builtin/romfs/lang/zh_TW.json +++ b/plugins/builtin/romfs/lang/zh_TW.json @@ -56,30 +56,11 @@ "hex.builtin.achievement.misc.analyze_file.desc": "使用資料資訊檢視的 '分析' 選項來分析您資料中的位元組。", "hex.builtin.achievement.misc.download_from_store.name": "There's an app for that", "hex.builtin.achievement.misc.download_from_store.desc": "從內容商店下載任何東西", - "hex.builtin.achievement.misc.create_hash.name": "Hash browns", - "hex.builtin.achievement.misc.create_hash.desc": "Create a new hash function in the Hash view by selecting the type, giving it a name and clicking on the Plus button next to it.", "hex.builtin.command.calc.desc": "計算機", "hex.builtin.command.cmd.desc": "命令", "hex.builtin.command.cmd.result": "執行命令 '{0}'", "hex.builtin.command.web.desc": "網站查詢", "hex.builtin.command.web.result": "前往 '{0}'", - "hex.builtin.hash.crc.iv": "初始數值", - "hex.builtin.hash.crc.poly": "多項式", - "hex.builtin.hash.crc.refl_in": "Reflect In", - "hex.builtin.hash.crc.refl_out": "Reflect Out", - "hex.builtin.hash.crc.xor_out": "XOR Out", - "hex.builtin.hash.crc16": "CRC16", - "hex.builtin.hash.crc32": "CRC32", - "hex.builtin.hash.crc32c": "CRC-32C", - "hex.builtin.hash.crc32mpeg": "CRC-32/MPEG", - "hex.builtin.hash.crc32posix": "CRC-32/POSIX", - "hex.builtin.hash.crc8": "CRC8", - "hex.builtin.hash.md5": "MD5", - "hex.builtin.hash.sha1": "SHA1", - "hex.builtin.hash.sha224": "SHA224", - "hex.builtin.hash.sha256": "SHA256", - "hex.builtin.hash.sha384": "SHA384", - "hex.builtin.hash.sha512": "SHA512", "hex.builtin.inspector.ascii": "ASCII 字元", "hex.builtin.inspector.binary": "二進位 (8 位元)", "hex.builtin.inspector.bool": "bool", @@ -641,15 +622,6 @@ "hex.builtin.view.find.value.max": "最大值", "hex.builtin.view.find.value.min": "最小值", "hex.builtin.view.find.value.range": "", - "hex.builtin.view.hashes.function": "雜湊函式", - "hex.builtin.view.hashes.hash": "雜湊", - "hex.builtin.view.hashes.hover_info": "懸停在十六進位編輯器的選取範圍上,並按住 Shift 以查看該區域的雜湊。", - "hex.builtin.view.hashes.name": "雜湊", - "hex.builtin.view.hashes.no_settings": "無可用設定", - "hex.builtin.view.hashes.remove": "移除雜湊", - "hex.builtin.view.hashes.table.name": "名稱", - "hex.builtin.view.hashes.table.result": "結果", - "hex.builtin.view.hashes.table.type": "類型", "hex.builtin.view.help.about.contributor": "貢獻者", "hex.builtin.view.help.about.donations": "贊助", "hex.builtin.view.help.about.libs": "使用的程式庫", diff --git a/plugins/builtin/romfs/layouts/default.hexlyt b/plugins/builtin/romfs/layouts/default.hexlyt index 79ea56677..8d789ba9c 100644 --- a/plugins/builtin/romfs/layouts/default.hexlyt +++ b/plugins/builtin/romfs/layouts/default.hexlyt @@ -32,7 +32,7 @@ Size=863,1427 Collapsed=0 DockId=0x00000004,0 -[Window][###hex.builtin.view.hashes.name] +[Window][###hex.hashes.view.hashes.name] Pos=1697,76 Size=863,1427 Collapsed=0 @@ -152,7 +152,7 @@ hex.builtin.view.data_processor.name=0 hex.builtin.view.diff.name=0 hex.disassembler.view.disassembler.name=0 hex.builtin.view.find.name=0 -hex.builtin.view.hashes.name=0 +hex.hashes.view.hashes.name=0 hex.builtin.view.help.about.name=0 hex.builtin.view.hex_editor.name=1 hex.builtin.view.information.name=0 diff --git a/plugins/builtin/romfs/layouts/minimal.hexlyt b/plugins/builtin/romfs/layouts/minimal.hexlyt index d856cc544..b0779a81b 100644 --- a/plugins/builtin/romfs/layouts/minimal.hexlyt +++ b/plugins/builtin/romfs/layouts/minimal.hexlyt @@ -32,7 +32,7 @@ Size=863,1427 Collapsed=0 DockId=0x00000004,0 -[Window][###hex.builtin.view.hashes.name] +[Window][###hex.hashes.view.hashes.name] Pos=1697,76 Size=863,1427 Collapsed=0 @@ -153,7 +153,7 @@ hex.builtin.view.data_processor.name=0 hex.builtin.view.diff.name=0 hex.disassembler.view.disassembler.name=0 hex.builtin.view.find.name=0 -hex.builtin.view.hashes.name=0 +hex.hashes.view.hashes.name=0 hex.builtin.view.help.about.name=0 hex.builtin.view.hex_editor.name=1 hex.builtin.view.highlight_rules.name=0 diff --git a/plugins/builtin/source/content/achievements.cpp b/plugins/builtin/source/content/achievements.cpp index 24b69b3eb..ff344cea8 100644 --- a/plugins/builtin/source/content/achievements.cpp +++ b/plugins/builtin/source/content/achievements.cpp @@ -178,11 +178,6 @@ namespace hex::plugin::builtin { .setDescription("hex.builtin.achievement.misc.download_from_store.desc") .setIcon(romfs::get("assets/achievements/package.png").span()) .addRequirement("hex.builtin.achievement.starting_out.open_file.name"); - - AchievementManager::addAchievement("hex.builtin.achievement.misc.create_hash.name") - .setDescription("hex.builtin.achievement.misc.create_hash.desc") - .setIcon(romfs::get("assets/achievements/fortune-cookie.png").span()) - .addRequirement("hex.builtin.achievement.starting_out.open_file.name"); } diff --git a/plugins/builtin/source/content/hashes.cpp b/plugins/builtin/source/content/hashes.cpp deleted file mode 100644 index 84eeb8894..000000000 --- a/plugins/builtin/source/content/hashes.cpp +++ /dev/null @@ -1,187 +0,0 @@ -#include -#include -#include - -#include - -#include - -namespace hex::plugin::builtin { - - class HashMD5 : public ContentRegistry::Hashes::Hash { - public: - HashMD5() : Hash("hex.builtin.hash.md5") {} - - Function create(std::string name) override { - return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { - auto array = crypt::md5(provider, region.address, region.size); - - return { array.begin(), array.end() }; - }); - } - - [[nodiscard]] nlohmann::json store() const override { return { }; } - void load(const nlohmann::json &) override {} - }; - - class HashSHA1 : public ContentRegistry::Hashes::Hash { - public: - HashSHA1() : Hash("hex.builtin.hash.sha1") {} - - Function create(std::string name) override { - return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { - auto array = crypt::sha1(provider, region.address, region.size); - - return { array.begin(), array.end() }; - }); - } - - [[nodiscard]] nlohmann::json store() const override { return { }; } - void load(const nlohmann::json &) override {} - }; - - class HashSHA224 : public ContentRegistry::Hashes::Hash { - public: - HashSHA224() : Hash("hex.builtin.hash.sha224") {} - - Function create(std::string name) override { - return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { - auto array = crypt::sha224(provider, region.address, region.size); - - return { array.begin(), array.end() }; - }); - } - - [[nodiscard]] nlohmann::json store() const override { return { }; } - void load(const nlohmann::json &) override {} - }; - - class HashSHA256 : public ContentRegistry::Hashes::Hash { - public: - HashSHA256() : Hash("hex.builtin.hash.sha256") {} - - Function create(std::string name) override { - return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { - auto array = crypt::sha256(provider, region.address, region.size); - - return { array.begin(), array.end() }; - }); - } - - [[nodiscard]] nlohmann::json store() const override { return { }; } - void load(const nlohmann::json &) override {} - }; - - class HashSHA384 : public ContentRegistry::Hashes::Hash { - public: - HashSHA384() : Hash("hex.builtin.hash.sha384") {} - - Function create(std::string name) override { - return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { - auto array = crypt::sha384(provider, region.address, region.size); - - return { array.begin(), array.end() }; - }); - } - - [[nodiscard]] nlohmann::json store() const override { return { }; } - void load(const nlohmann::json &) override {} - }; - - class HashSHA512 : public ContentRegistry::Hashes::Hash { - public: - HashSHA512() : Hash("hex.builtin.hash.sha512") {} - - Function create(std::string name) override { - return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { - auto array = crypt::sha512(provider, region.address, region.size); - - return { array.begin(), array.end() }; - }); - } - - [[nodiscard]] nlohmann::json store() const override { return { }; } - void load(const nlohmann::json &) override {} - }; - - template - class HashCRC : public ContentRegistry::Hashes::Hash { - public: - using CRCFunction = T(*)(prv::Provider*&, u64, size_t, u32, u32, u32, bool, bool); - HashCRC(const std::string &name, const CRCFunction &crcFunction, u32 polynomial, u32 initialValue, u32 xorOut, bool reflectIn = false, bool reflectOut = false) - : Hash(name), m_crcFunction(crcFunction), m_polynomial(polynomial), m_initialValue(initialValue), m_xorOut(xorOut), m_reflectIn(reflectIn), m_reflectOut(reflectOut) {} - - void draw() override { - ImGuiExt::InputHexadecimal("hex.builtin.hash.crc.poly"_lang, &m_polynomial); - ImGuiExt::InputHexadecimal("hex.builtin.hash.crc.iv"_lang, &m_initialValue); - ImGuiExt::InputHexadecimal("hex.builtin.hash.crc.xor_out"_lang, &m_xorOut); - - ImGui::NewLine(); - - ImGui::Checkbox("hex.builtin.hash.crc.refl_in"_lang, &m_reflectIn); - ImGui::Checkbox("hex.builtin.hash.crc.refl_out"_lang, &m_reflectOut); - } - - Function create(std::string name) override { - return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { - auto result = hash.m_crcFunction(provider, region.address, region.size, hash.m_polynomial, hash.m_initialValue, hash.m_xorOut, hash.m_reflectIn, hash.m_reflectOut); - - std::vector bytes(sizeof(result), 0x00); - std::memcpy(bytes.data(), &result, bytes.size()); - - if constexpr (std::endian::native == std::endian::little) - std::reverse(bytes.begin(), bytes.end()); - - return bytes; - }); - } - - [[nodiscard]] nlohmann::json store() const override { - nlohmann::json result; - - result["polynomial"] = m_polynomial; - result["initialValue"] = m_initialValue; - result["xorOut"] = m_xorOut; - result["reflectIn"] = m_reflectIn; - result["reflectOut"] = m_reflectOut; - - return result; - } - - void load(const nlohmann::json &json) override { - try { - m_polynomial = json.at("polynomial"); - m_initialValue = json.at("initialValue"); - m_xorOut = json.at("xorOut"); - m_reflectIn = json.at("reflectIn"); - m_reflectOut = json.at("reflectOut"); - } catch (std::exception&) { } - } - - private: - CRCFunction m_crcFunction; - - u32 m_polynomial; - u32 m_initialValue; - u32 m_xorOut; - bool m_reflectIn = false, m_reflectOut = false; - }; - - void registerHashes() { - ContentRegistry::Hashes::add(); - - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - ContentRegistry::Hashes::add(); - - ContentRegistry::Hashes::add>("hex.builtin.hash.crc8", crypt::crc8, 0x07, 0x0000, 0x0000); - ContentRegistry::Hashes::add>("hex.builtin.hash.crc16", crypt::crc16, 0x8005, 0x0000, 0x0000); - ContentRegistry::Hashes::add>("hex.builtin.hash.crc32", crypt::crc32, 0x04C1'1DB7, 0xFFFF'FFFF, 0xFFFF'FFFF, true, true); - ContentRegistry::Hashes::add>("hex.builtin.hash.crc32mpeg", crypt::crc32, 0x04C1'1DB7, 0xFFFF'FFFF, 0x0000'0000, false, false); - ContentRegistry::Hashes::add>("hex.builtin.hash.crc32posix", crypt::crc32, 0x04C1'1DB7, 0x0000'0000, 0xFFFF'FFFF, false, false); - ContentRegistry::Hashes::add>("hex.builtin.hash.crc32c", crypt::crc32, 0x1EDC'6F41, 0xFFFF'FFFF, 0xFFFF'FFFF, true, true); - } - -} \ No newline at end of file diff --git a/plugins/builtin/source/content/pl_visualizers/hex_viewer.cpp b/plugins/builtin/source/content/pl_visualizers/hex_viewer.cpp index 921dd1b3f..eb07a54d5 100644 --- a/plugins/builtin/source/content/pl_visualizers/hex_viewer.cpp +++ b/plugins/builtin/source/content/pl_visualizers/hex_viewer.cpp @@ -1,5 +1,7 @@ #include +#include + #include #include @@ -7,31 +9,28 @@ #include #include -#include namespace hex::plugin::builtin { void drawHexVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span arguments) { static ui::HexEditor editor; - static std::unique_ptr dataProvider; + static prv::MemoryProvider dataProvider; if (shouldReset) { auto pattern = arguments[0].toPattern(); std::vector data; - dataProvider = std::make_unique(); try { data = pattern->getBytes(); } catch (const std::exception &) { - dataProvider->resize(0); + dataProvider.resize(0); throw; } - dataProvider->resize(data.size()); - dataProvider->writeRaw(0x00, data.data(), data.size()); - dataProvider->setReadOnly(true); + dataProvider.resize(data.size()); + dataProvider.writeRaw(0x00, data.data(), data.size()); - editor.setProvider(dataProvider.get()); + editor.setProvider(&dataProvider); } if (ImGui::BeginChild("##editor", scaled(ImVec2(600, 400)), false, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) { diff --git a/plugins/builtin/source/content/views.cpp b/plugins/builtin/source/content/views.cpp index 60e3f39ed..f970c6bc2 100644 --- a/plugins/builtin/source/content/views.cpp +++ b/plugins/builtin/source/content/views.cpp @@ -1,7 +1,6 @@ #include "content/views/view_hex_editor.hpp" #include "content/views/view_pattern_editor.hpp" #include "content/views/view_pattern_data.hpp" -#include "content/views/view_hashes.hpp" #include "content/views/view_information.hpp" #include "content/views/view_about.hpp" #include "content/views/view_tools.hpp" @@ -29,7 +28,6 @@ namespace hex::plugin::builtin { ContentRegistry::Views::add(); ContentRegistry::Views::add(); ContentRegistry::Views::add(); - ContentRegistry::Views::add(); ContentRegistry::Views::add(); ContentRegistry::Views::add(); ContentRegistry::Views::add(); diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index c32fbfb9d..a8dc75d05 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -16,6 +16,8 @@ #include #include +#include + #include #include @@ -588,11 +590,7 @@ namespace hex::plugin::builtin { ImGuiExt::TextFormatted("{} | 0x{:02X}", hex::toByteString(section.data.size()), section.data.size()); ImGui::TableNextColumn(); if (ImGuiExt::IconButton(ICON_VS_OPEN_PREVIEW, ImGui::GetStyleColorVec4(ImGuiCol_Text))) { - auto dataProvider = std::make_shared(); - dataProvider->resize(section.data.size()); - dataProvider->writeRaw(0x00, section.data.data(), section.data.size()); - dataProvider->setReadOnly(true); - + auto dataProvider = std::make_shared(section.data); auto hexEditor = auto(m_sectionHexEditor); hexEditor.setBackgroundHighlightCallback([this, id, &runtime](u64 address, const u8 *, size_t) -> std::optional { diff --git a/plugins/builtin/source/plugin_builtin.cpp b/plugins/builtin/source/plugin_builtin.cpp index 37843de7b..bbea1f24a 100644 --- a/plugins/builtin/source/plugin_builtin.cpp +++ b/plugins/builtin/source/plugin_builtin.cpp @@ -23,7 +23,6 @@ namespace hex::plugin::builtin { void registerSettings(); void loadSettings(); void registerDataProcessorNodes(); - void registerHashes(); void registerProviders(); void registerDataFormatters(); void registerMainMenuEntries(); @@ -95,7 +94,6 @@ IMHEX_PLUGIN_SETUP("Built-in", "WerWolv", "Default ImHex functionality") { registerSettings(); loadSettings(); registerDataProcessorNodes(); - registerHashes(); registerProviders(); registerDataFormatters(); createWelcomeScreen(); diff --git a/plugins/hashes/CMakeLists.txt b/plugins/hashes/CMakeLists.txt new file mode 100644 index 000000000..173b2ada3 --- /dev/null +++ b/plugins/hashes/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.16) + +include(ImHexPlugin) + +add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/HashLibPlus ${CMAKE_CURRENT_BINARY_DIR}/HashLibPlus) + +add_imhex_plugin( + NAME + hashes + SOURCES + source/plugin_hashes.cpp + + source/content/hashes.cpp + + source/content/views/view_hashes.cpp + INCLUDES + include + + LIBRARIES + hashplus +) diff --git a/plugins/builtin/include/content/views/view_hashes.hpp b/plugins/hashes/include/content/views/view_hashes.hpp similarity index 95% rename from plugins/builtin/include/content/views/view_hashes.hpp rename to plugins/hashes/include/content/views/view_hashes.hpp index bd64094eb..7e6acb425 100644 --- a/plugins/builtin/include/content/views/view_hashes.hpp +++ b/plugins/hashes/include/content/views/view_hashes.hpp @@ -4,7 +4,7 @@ #include -namespace hex::plugin::builtin { +namespace hex::plugin::hashes { class ViewHashes : public View::Window { public: diff --git a/plugins/builtin/romfs/assets/achievements/fortune-cookie.png b/plugins/hashes/romfs/assets/achievements/fortune-cookie.png similarity index 100% rename from plugins/builtin/romfs/assets/achievements/fortune-cookie.png rename to plugins/hashes/romfs/assets/achievements/fortune-cookie.png diff --git a/plugins/hashes/romfs/lang/de_DE.json b/plugins/hashes/romfs/lang/de_DE.json new file mode 100644 index 000000000..ba330e021 --- /dev/null +++ b/plugins/hashes/romfs/lang/de_DE.json @@ -0,0 +1,36 @@ +{ + "code": "de-DE", + "language": "German", + "country": "Germany", + "fallback": false, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "", + "hex.hashes.achievement.misc.create_hash.desc": "", + "hex.hashes.view.hashes.function": "Hashfunktion", + "hex.hashes.view.hashes.hash": "Hash", + "hex.hashes.view.hashes.hover_info": "Bewege die Maus über die ausgewählten Bytes im Hex Editor und halte SHIFT gedrückt, um die Hashes dieser Region anzuzeigen.", + "hex.hashes.view.hashes.name": "Hashes", + "hex.hashes.view.hashes.no_settings": "Keine Einstellungen verfügbar", + "hex.hashes.view.hashes.remove": "Hash entfernen", + "hex.hashes.view.hashes.table.name": "Name", + "hex.hashes.view.hashes.table.result": "Resultat", + "hex.hashes.view.hashes.table.type": "Typ", + "hex.hashes.hash.common.iv": "Initialwert", + "hex.hashes.hash.common.poly": "Polynom", + "hex.hashes.hash.common.refl_in": "Reflect In", + "hex.hashes.hash.common.refl_out": "Reflect Out", + "hex.hashes.hash.common.xor_out": "XOR Out", + "hex.hashes.hash.crc16": "CRC-16", + "hex.hashes.hash.crc32": "CRC-32", + "hex.hashes.hash.crc32c": "CRC-32C", + "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", + "hex.hashes.hash.crc32posix": "CRC-32/POSIX", + "hex.hashes.hash.crc8": "CRC-8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512" + } +} diff --git a/plugins/hashes/romfs/lang/en_US.json b/plugins/hashes/romfs/lang/en_US.json new file mode 100644 index 000000000..05e247fef --- /dev/null +++ b/plugins/hashes/romfs/lang/en_US.json @@ -0,0 +1,46 @@ +{ + "code": "en-US", + "language": "English", + "country": "United States", + "fallback": true, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "Hash browns", + "hex.hashes.achievement.misc.create_hash.desc": "Create a new hash function in the Hash view by selecting the type, giving it a name and clicking on the Plus button next to it.", + "hex.hashes.view.hashes.function": "Hash function", + "hex.hashes.view.hashes.hash": "Hash", + "hex.hashes.view.hashes.hover_info": "Hover over the Hex Editor selection and hold down SHIFT to view the hashes of that region.", + "hex.hashes.view.hashes.name": "Hashes", + "hex.hashes.view.hashes.no_settings": "No settings available", + "hex.hashes.view.hashes.remove": "Remove hash", + "hex.hashes.view.hashes.table.name": "Name", + "hex.hashes.view.hashes.table.result": "Result", + "hex.hashes.view.hashes.table.type": "Type", + "hex.hashes.hash.common.iv": "Initial Value", + "hex.hashes.hash.common.poly": "Polynomial", + "hex.hashes.hash.common.key": "Key", + "hex.hashes.hash.common.size": "Hash Size", + "hex.hashes.hash.common.rounds": "Hash Rounds", + "hex.hashes.hash.common.salt": "Salt", + "hex.hashes.hash.common.personalization": "Personalization", + "hex.hashes.hash.common.refl_in": "Reflect In", + "hex.hashes.hash.common.refl_out": "Reflect Out", + "hex.hashes.hash.common.xor_out": "XOR Out", + "hex.hashes.hash.crc16": "CRC-16", + "hex.hashes.hash.crc32": "CRC-32", + "hex.hashes.hash.crc32c": "CRC-32C", + "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", + "hex.hashes.hash.crc32posix": "CRC-32/POSIX", + "hex.hashes.hash.crc8": "CRC-8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512", + "hex.hashes.hash.tiger": "Tiger", + "hex.hashes.hash.tiger2": "Tiger2", + "hex.hashes.hash.blake2b": "Blake2B", + "hex.hashes.hash.blake2s": "Blake2S" + + } +} diff --git a/plugins/hashes/romfs/lang/es_ES.json b/plugins/hashes/romfs/lang/es_ES.json new file mode 100644 index 000000000..9310619df --- /dev/null +++ b/plugins/hashes/romfs/lang/es_ES.json @@ -0,0 +1,36 @@ +{ + "code": "es_ES", + "language": "Spanish", + "country": "Spain", + "fallback": false, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "", + "hex.hashes.achievement.misc.create_hash.desc": "", + "hex.hashes.view.hashes.function": "Función de Hash", + "hex.hashes.view.hashes.hash": "Hash", + "hex.hashes.view.hashes.hover_info": "Sitúe el ratón sobre la selección del Editor Hexadecimal y mantenga SHIFT para ver los hashes de esa región.", + "hex.hashes.view.hashes.name": "Hashes", + "hex.hashes.view.hashes.no_settings": "No hay ajustes disponibles", + "hex.hashes.view.hashes.remove": "Eliminar hash", + "hex.hashes.view.hashes.table.name": "Nombre", + "hex.hashes.view.hashes.table.result": "Resultado", + "hex.hashes.view.hashes.table.type": "Tipo", + "hex.hashes.hash.common.iv": "Valor Inicial", + "hex.hashes.hash.common.poly": "Polinomio", + "hex.hashes.hash.common.refl_in": "Reflect In", + "hex.hashes.hash.common.refl_out": "Reflect Out", + "hex.hashes.hash.common.xor_out": "XOR Out", + "hex.hashes.hash.crc16": "CRC-16", + "hex.hashes.hash.crc32": "CRC-32", + "hex.hashes.hash.crc32c": "CRC-32C", + "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", + "hex.hashes.hash.crc32posix": "CRC-32/POSIX", + "hex.hashes.hash.crc8": "CRC-8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512" + } +} diff --git a/plugins/hashes/romfs/lang/it_IT.json b/plugins/hashes/romfs/lang/it_IT.json new file mode 100644 index 000000000..124ac4c9d --- /dev/null +++ b/plugins/hashes/romfs/lang/it_IT.json @@ -0,0 +1,36 @@ +{ + "code": "it-IT", + "language": "Italian", + "country": "Italy", + "fallback": false, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "", + "hex.hashes.achievement.misc.create_hash.desc": "", + "hex.hashes.view.hashes.function": "Funzioni di Hash", + "hex.hashes.view.hashes.hash": "Hash", + "hex.hashes.view.hashes.hover_info": "", + "hex.hashes.view.hashes.name": "Hash", + "hex.hashes.view.hashes.no_settings": "", + "hex.hashes.view.hashes.remove": "", + "hex.hashes.view.hashes.table.name": "", + "hex.hashes.view.hashes.table.result": "Risultato", + "hex.hashes.view.hashes.table.type": "", + "hex.hashes.hash.common.iv": "Valore Iniziale", + "hex.hashes.hash.common.poly": "Polinomio", + "hex.hashes.hash.common.refl_in": "", + "hex.hashes.hash.common.refl_out": "", + "hex.hashes.hash.common.xor_out": "", + "hex.hashes.hash.crc16": "CRC16", + "hex.hashes.hash.crc32": "CRC32", + "hex.hashes.hash.crc32c": "", + "hex.hashes.hash.crc32mpeg": "", + "hex.hashes.hash.crc32posix": "", + "hex.hashes.hash.crc8": "CRC8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512" + } +} diff --git a/plugins/hashes/romfs/lang/ja_JP.json b/plugins/hashes/romfs/lang/ja_JP.json new file mode 100644 index 000000000..e96bb1952 --- /dev/null +++ b/plugins/hashes/romfs/lang/ja_JP.json @@ -0,0 +1,36 @@ +{ + "code": "ja-JP", + "language": "Japanese", + "country": "Japan", + "fallback": false, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "", + "hex.hashes.achievement.misc.create_hash.desc": "", + "hex.hashes.view.hashes.function": "ハッシュ関数", + "hex.hashes.view.hashes.hash": "", + "hex.hashes.view.hashes.hover_info": "", + "hex.hashes.view.hashes.name": "ハッシュ", + "hex.hashes.view.hashes.no_settings": "", + "hex.hashes.view.hashes.remove": "", + "hex.hashes.view.hashes.table.name": "", + "hex.hashes.view.hashes.table.result": "結果", + "hex.hashes.view.hashes.table.type": "", + "hex.hashes.hash.common.iv": "初期値", + "hex.hashes.hash.common.poly": "多項式", + "hex.hashes.hash.common.refl_in": "入力を反映", + "hex.hashes.hash.common.refl_out": "出力を反映", + "hex.hashes.hash.common.xor_out": "最終XOR値", + "hex.hashes.hash.crc16": "CRC16", + "hex.hashes.hash.crc32": "CRC32", + "hex.hashes.hash.crc32c": "", + "hex.hashes.hash.crc32mpeg": "", + "hex.hashes.hash.crc32posix": "", + "hex.hashes.hash.crc8": "CRC8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512" + } +} diff --git a/plugins/hashes/romfs/lang/ko_KR.json b/plugins/hashes/romfs/lang/ko_KR.json new file mode 100644 index 000000000..06630059d --- /dev/null +++ b/plugins/hashes/romfs/lang/ko_KR.json @@ -0,0 +1,36 @@ +{ + "code": "ko-KR", + "language": "Korean", + "country": "Korea", + "fallback": false, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "해시 브라운", + "hex.hashes.achievement.misc.create_hash.desc": "해시 보기에서 유형을 선택하고 이름을 지정한 다음 옆에 있는 더하기 버튼을 클릭하여 새 해시 함수를 만듭니다.", + "hex.hashes.view.hashes.function": "해시 함수", + "hex.hashes.view.hashes.hash": "해시", + "hex.hashes.view.hashes.hover_info": "헥스 에디터 선택 영역 위로 마우스를 가져간 상태에서 Shift를 길게 누르면 해당 영역의 해시를 볼 수 있습니다.", + "hex.hashes.view.hashes.name": "해시", + "hex.hashes.view.hashes.no_settings": "설정이 없습니다", + "hex.hashes.view.hashes.remove": "해시 제거", + "hex.hashes.view.hashes.table.name": "이름", + "hex.hashes.view.hashes.table.result": "결과", + "hex.hashes.view.hashes.table.type": "유형", + "hex.hashes.hash.common.iv": "초기 값", + "hex.hashes.hash.common.poly": "다항식", + "hex.hashes.hash.common.refl_in": "입력에 반영", + "hex.hashes.hash.common.refl_out": "출력에 반영", + "hex.hashes.hash.common.xor_out": "XOR 출력", + "hex.hashes.hash.crc16": "CRC-16", + "hex.hashes.hash.crc32": "CRC-32", + "hex.hashes.hash.crc32c": "CRC-32C", + "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", + "hex.hashes.hash.crc32posix": "CRC-32/POSIX", + "hex.hashes.hash.crc8": "CRC-8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512" + } +} diff --git a/plugins/hashes/romfs/lang/pt_BR.json b/plugins/hashes/romfs/lang/pt_BR.json new file mode 100644 index 000000000..f52121f0c --- /dev/null +++ b/plugins/hashes/romfs/lang/pt_BR.json @@ -0,0 +1,36 @@ +{ + "code": "pt-BR", + "language": "Portuguese", + "country": "Brazil", + "fallback": false, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "", + "hex.hashes.achievement.misc.create_hash.desc": "", + "hex.hashes.view.hashes.function": "Função Hash", + "hex.hashes.view.hashes.hash": "Hash", + "hex.hashes.view.hashes.hover_info": "Passe o mouse sobre a seleção Hex Editor e mantenha pressionada a tecla SHIFT para visualizar os hashes dessa região.", + "hex.hashes.view.hashes.name": "Hashes", + "hex.hashes.view.hashes.no_settings": "Nenhuma configuração disponivel", + "hex.hashes.view.hashes.remove": "Remover hash", + "hex.hashes.view.hashes.table.name": "Nome", + "hex.hashes.view.hashes.table.result": "Resultado", + "hex.hashes.view.hashes.table.type": "Tipo", + "hex.hashes.hash.common.iv": "Initial Value", + "hex.hashes.hash.common.poly": "Polynomial", + "hex.hashes.hash.common.refl_in": "Reflect In", + "hex.hashes.hash.common.refl_out": "Reflect Out", + "hex.hashes.hash.common.xor_out": "XOR Out", + "hex.hashes.hash.crc16": "CRC16", + "hex.hashes.hash.crc32": "CRC32", + "hex.hashes.hash.crc32c": "", + "hex.hashes.hash.crc32mpeg": "", + "hex.hashes.hash.crc32posix": "", + "hex.hashes.hash.crc8": "CRC8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512" + } +} diff --git a/plugins/hashes/romfs/lang/zh_CN.json b/plugins/hashes/romfs/lang/zh_CN.json new file mode 100644 index 000000000..9052fdc88 --- /dev/null +++ b/plugins/hashes/romfs/lang/zh_CN.json @@ -0,0 +1,36 @@ +{ + "code": "zh-CN", + "language": "Chinese (Simplified)", + "country": "China", + "fallback": false, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "Hash!", + "hex.hashes.achievement.misc.create_hash.desc": "通过选择类型、为其命名并单击旁边的加号按钮,在“哈希”视图中创建新的哈希函数。", + "hex.hashes.view.hashes.function": "哈希函数", + "hex.hashes.view.hashes.hash": "哈希", + "hex.hashes.view.hashes.hover_info": "将鼠标放在 Hex 编辑器的选区上,按住 SHIFT 来查看其哈希。", + "hex.hashes.view.hashes.name": "哈希", + "hex.hashes.view.hashes.no_settings": "没有可用哈希设置", + "hex.hashes.view.hashes.remove": "移除哈希", + "hex.hashes.view.hashes.table.name": "名称", + "hex.hashes.view.hashes.table.result": "结果", + "hex.hashes.view.hashes.table.type": "类型", + "hex.hashes.hash.common.iv": "初始值", + "hex.hashes.hash.common.poly": "多项式", + "hex.hashes.hash.common.refl_in": "输入值取反", + "hex.hashes.hash.common.refl_out": "输出值取反", + "hex.hashes.hash.common.xor_out": "结果异或值", + "hex.hashes.hash.crc16": "CRC-16", + "hex.hashes.hash.crc32": "CRC-32", + "hex.hashes.hash.crc32c": "CRC-32C", + "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", + "hex.hashes.hash.crc32posix": "CRC-32/POSIX", + "hex.hashes.hash.crc8": "CRC-8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512" + } +} diff --git a/plugins/hashes/romfs/lang/zh_TW.json b/plugins/hashes/romfs/lang/zh_TW.json new file mode 100644 index 000000000..968e6cd72 --- /dev/null +++ b/plugins/hashes/romfs/lang/zh_TW.json @@ -0,0 +1,36 @@ +{ + "code": "zh-TW", + "language": "Chinese (Traditional)", + "country": "Taiwan", + "fallback": false, + "translations": { + "hex.hashes.achievement.misc.create_hash.name": "Hash browns", + "hex.hashes.achievement.misc.create_hash.desc": "Create a new hash function in the Hash view by selecting the type, giving it a name and clicking on the Plus button next to it.", + "hex.hashes.view.hashes.function": "雜湊函式", + "hex.hashes.view.hashes.hash": "雜湊", + "hex.hashes.view.hashes.hover_info": "懸停在十六進位編輯器的選取範圍上,並按住 Shift 以查看該區域的雜湊。", + "hex.hashes.view.hashes.name": "雜湊", + "hex.hashes.view.hashes.no_settings": "無可用設定", + "hex.hashes.view.hashes.remove": "移除雜湊", + "hex.hashes.view.hashes.table.name": "名稱", + "hex.hashes.view.hashes.table.result": "結果", + "hex.hashes.view.hashes.table.type": "類型", + "hex.hashes.hash.common.iv": "初始數值", + "hex.hashes.hash.common.poly": "多項式", + "hex.hashes.hash.common.refl_in": "Reflect In", + "hex.hashes.hash.common.refl_out": "Reflect Out", + "hex.hashes.hash.common.xor_out": "XOR Out", + "hex.hashes.hash.crc16": "CRC16", + "hex.hashes.hash.crc32": "CRC32", + "hex.hashes.hash.crc32c": "CRC-32C", + "hex.hashes.hash.crc32mpeg": "CRC-32/MPEG", + "hex.hashes.hash.crc32posix": "CRC-32/POSIX", + "hex.hashes.hash.crc8": "CRC8", + "hex.hashes.hash.md5": "MD5", + "hex.hashes.hash.sha1": "SHA1", + "hex.hashes.hash.sha224": "SHA224", + "hex.hashes.hash.sha256": "SHA256", + "hex.hashes.hash.sha384": "SHA384", + "hex.hashes.hash.sha512": "SHA512" + } +} diff --git a/plugins/hashes/source/content/hashes.cpp b/plugins/hashes/source/content/hashes.cpp new file mode 100644 index 000000000..4f4a3f0a4 --- /dev/null +++ b/plugins/hashes/source/content/hashes.cpp @@ -0,0 +1,440 @@ +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include + +namespace hex::plugin::hashes { + + namespace { + + using namespace wolv::literals; + + std::vector hashProviderRegion(const Region& region, prv::Provider *provider, auto &hashFunction) { + auto reader = prv::ProviderReader(provider); + reader.seek(region.getStartAddress()); + reader.setEndAddress(region.getEndAddress()); + + for (u64 address = region.getStartAddress(); address < region.getEndAddress(); address += 1_MiB) { + u64 readSize = std::min(1_MiB, (region.getEndAddress() - address) + 1); + + auto data = reader.read(address, readSize); + hashFunction->TransformBytes({ data.begin(), data.end() }, address - region.getStartAddress(), data.size()); + } + + auto result = hashFunction->TransformFinal(); + + auto bytes = result->GetBytes(); + return { bytes.begin(), bytes.end() }; + } + + } + + class HashMD5 : public ContentRegistry::Hashes::Hash { + public: + HashMD5() : Hash("hex.hashes.hash.md5") {} + + Function create(std::string name) override { + return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { + auto array = crypt::md5(provider, region.address, region.size); + + return { array.begin(), array.end() }; + }); + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + }; + + class HashSHA1 : public ContentRegistry::Hashes::Hash { + public: + HashSHA1() : Hash("hex.hashes.hash.sha1") {} + + Function create(std::string name) override { + return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { + auto array = crypt::sha1(provider, region.address, region.size); + + return { array.begin(), array.end() }; + }); + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + }; + + class HashSHA224 : public ContentRegistry::Hashes::Hash { + public: + HashSHA224() : Hash("hex.hashes.hash.sha224") {} + + Function create(std::string name) override { + return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { + auto array = crypt::sha224(provider, region.address, region.size); + + return { array.begin(), array.end() }; + }); + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + }; + + class HashSHA256 : public ContentRegistry::Hashes::Hash { + public: + HashSHA256() : Hash("hex.hashes.hash.sha256") {} + + Function create(std::string name) override { + return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { + auto array = crypt::sha256(provider, region.address, region.size); + + return { array.begin(), array.end() }; + }); + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + }; + + class HashSHA384 : public ContentRegistry::Hashes::Hash { + public: + HashSHA384() : Hash("hex.hashes.hash.sha384") {} + + Function create(std::string name) override { + return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { + auto array = crypt::sha384(provider, region.address, region.size); + + return { array.begin(), array.end() }; + }); + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + }; + + class HashSHA512 : public ContentRegistry::Hashes::Hash { + public: + HashSHA512() : Hash("hex.hashes.hash.sha512") {} + + Function create(std::string name) override { + return Hash::create(name, [](const Region& region, prv::Provider *provider) -> std::vector { + auto array = crypt::sha512(provider, region.address, region.size); + + return { array.begin(), array.end() }; + }); + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + }; + + template + class HashCRC : public ContentRegistry::Hashes::Hash { + public: + using CRCFunction = T(*)(prv::Provider*&, u64, size_t, u32, u32, u32, bool, bool); + HashCRC(const std::string &name, const CRCFunction &crcFunction, u32 polynomial, u32 initialValue, u32 xorOut, bool reflectIn = false, bool reflectOut = false) + : Hash(name), m_crcFunction(crcFunction), m_polynomial(polynomial), m_initialValue(initialValue), m_xorOut(xorOut), m_reflectIn(reflectIn), m_reflectOut(reflectOut) {} + + void draw() override { + ImGuiExt::InputHexadecimal("hex.hashes.hash.common.poly"_lang, &this->m_polynomial); + ImGuiExt::InputHexadecimal("hex.hashes.hash.common.iv"_lang, &this->m_initialValue); + ImGuiExt::InputHexadecimal("hex.hashes.hash.common.xor_out"_lang, &this->m_xorOut); + + ImGui::NewLine(); + + ImGui::Checkbox("hex.hashes.hash.common.refl_in"_lang, &this->m_reflectIn); + ImGui::Checkbox("hex.hashes.hash.common.refl_out"_lang, &this->m_reflectOut); + } + + Function create(std::string name) override { + return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { + auto result = hash.m_crcFunction(provider, region.address, region.size, hash.m_polynomial, hash.m_initialValue, hash.m_xorOut, hash.m_reflectIn, hash.m_reflectOut); + + std::vector bytes(sizeof(result), 0x00); + std::memcpy(bytes.data(), &result, bytes.size()); + + if constexpr (std::endian::native == std::endian::little) + std::reverse(bytes.begin(), bytes.end()); + + return bytes; + }); + } + + [[nodiscard]] nlohmann::json store() const override { + nlohmann::json result; + + result["polynomial"] = this->m_polynomial; + result["initialValue"] = this->m_initialValue; + result["xorOut"] = this->m_xorOut; + result["reflectIn"] = this->m_reflectIn; + result["reflectOut"] = this->m_reflectOut; + + return result; + } + + void load(const nlohmann::json &json) override { + try { + this->m_polynomial = json.at("polynomial"); + this->m_initialValue = json.at("initialValue"); + this->m_xorOut = json.at("xorOut"); + this->m_reflectIn = json.at("reflectIn"); + this->m_reflectOut = json.at("reflectOut"); + } catch (std::exception&) { } + } + + private: + CRCFunction m_crcFunction; + + u32 m_polynomial; + u32 m_initialValue; + u32 m_xorOut; + bool m_reflectIn = false, m_reflectOut = false; + }; + + class HashBasic : public ContentRegistry::Hashes::Hash { + public: + using FactoryFunction = IHash(*)(); + + explicit HashBasic(FactoryFunction function) : Hash(function()->GetName()), m_factoryFunction(function) {} + + Function create(std::string name) override { + return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { + IHash hashFunction = hash.m_factoryFunction(); + + hashFunction->Initialize(); + + return hashProviderRegion(region, provider, hashFunction); + }); + + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + + private: + FactoryFunction m_factoryFunction; + }; + + class HashWithKey : public ContentRegistry::Hashes::Hash { + public: + using FactoryFunction = IHashWithKey(*)(); + + explicit HashWithKey(FactoryFunction function) : Hash(function()->GetName()), m_factoryFunction(function) {} + + void draw() override { + ImGui::InputText("hex.hashes.hash.common.key"_lang, this->m_key, ImGuiInputTextFlags_CharsHexadecimal); + } + + Function create(std::string name) override { + return Hash::create(name, [hash = *this, key = hex::parseByteString(this->m_key)](const Region& region, prv::Provider *provider) -> std::vector { + IHashWithKey hashFunction = hash.m_factoryFunction(); + + hashFunction->Initialize(); + hashFunction->SetKey(key); + + return hashProviderRegion(region, provider, hashFunction); + }); + + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + + private: + FactoryFunction m_factoryFunction; + + std::string m_key; + }; + + class HashInitialValue : public ContentRegistry::Hashes::Hash { + public: + using FactoryFunction = IHash(*)(const Int32); + + explicit HashInitialValue(FactoryFunction function) : Hash(function(0)->GetName()), m_factoryFunction(function) {} + + void draw() override { + ImGuiExt::InputHexadecimal("hex.hashes.hash.common.iv"_lang, &this->m_initialValue); + } + + Function create(std::string name) override { + return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { + IHash hashFunction = hash.m_factoryFunction(Int32(hash.m_initialValue)); + + hashFunction->Initialize(); + + return hashProviderRegion(region, provider, hashFunction); + }); + + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + + private: + FactoryFunction m_factoryFunction; + u32 m_initialValue = 0x00; + }; + + class HashTiger : public ContentRegistry::Hashes::Hash { + public: + using FactoryFunction = IHash(*)(const Int32, const HashRounds&); + + explicit HashTiger(std::string name, FactoryFunction function) : Hash(std::move(name)), m_factoryFunction(function) {} + void draw() override { + ImGui::Combo("hex.hashes.hash.common.size"_lang, &this->m_hashSize, "128 Bits\0" "160 Bits\0" "192 Bits\0"); + ImGui::Combo("hex.hashes.hash.common.rounds"_lang, &this->m_hashRounds, "3 Rounds\0" "4 Rounds\0" "5 Rounds\0" "8 Rounds\0"); + } + + Function create(std::string name) override { + return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { + Int32 hashSize = 16; + switch (hash.m_hashSize) { + case 0: hashSize = 16; break; + case 1: hashSize = 20; break; + case 2: hashSize = 24; break; + } + + HashRounds hashRounds = HashRounds::Rounds3; + switch (hash.m_hashRounds) { + case 0: hashRounds = HashRounds::Rounds3; break; + case 1: hashRounds = HashRounds::Rounds4; break; + case 2: hashRounds = HashRounds::Rounds5; break; + case 3: hashRounds = HashRounds::Rounds8; break; + } + + IHash hashFunction = hash.m_factoryFunction(hashSize, hashRounds); + + hashFunction->Initialize(); + + return hashProviderRegion(region, provider, hashFunction); + }); + + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + + private: + FactoryFunction m_factoryFunction; + + int m_hashSize = 0, m_hashRounds = 0; + }; + + template + class HashBlake2 : public ContentRegistry::Hashes::Hash { + public: + using FactoryFunction = IHash(*)(T1 a_Config, T2 a_TreeConfig); + + explicit HashBlake2(std::string name, FactoryFunction function) : Hash(std::move(name)), m_factoryFunction(function) {} + void draw() override { + ImGui::InputText("hex.hashes.hash.common.salt"_lang, this->m_salt, ImGuiInputTextFlags_CharsHexadecimal); + ImGui::InputText("hex.hashes.hash.common.key"_lang, this->m_key, ImGuiInputTextFlags_CharsHexadecimal); + ImGui::InputText("hex.hashes.hash.common.personalization"_lang, this->m_personalization, ImGuiInputTextFlags_CharsHexadecimal); + ImGui::Combo("hex.hashes.hash.common.size"_lang, &this->m_hashSize, "128 Bits\0" "160 Bits\0" "192 Bits\0" "224 Bits\0" "256 Bits\0" "288 Bits\0" "384 Bits\0" "512 Bits\0"); + + } + + Function create(std::string name) override { + return Hash::create(name, [hash = *this, key = hex::parseByteString(this->m_key), salt = hex::parseByteString(this->m_salt), personalization = hex::parseByteString(this->m_personalization)](const Region& region, prv::Provider *provider) -> std::vector { + u32 hashSize = 16; + switch (hash.m_hashSize) { + case 0: hashSize = 16; break; + case 1: hashSize = 20; break; + case 2: hashSize = 24; break; + case 3: hashSize = 28; break; + case 4: hashSize = 32; break; + case 5: hashSize = 36; break; + case 6: hashSize = 48; break; + case 7: hashSize = 64; break; + } + + auto config = Config::GetDefaultConfig(); + config->SetKey(key); + config->SetSalt(salt); + config->SetPersonalization(personalization); + config->SetHashSize(hashSize); + IHash hashFunction = hash.m_factoryFunction(config, nullptr); + + hashFunction->Initialize(); + + return hashProviderRegion(region, provider, hashFunction); + }); + + } + + [[nodiscard]] nlohmann::json store() const override { return { }; } + void load(const nlohmann::json &) override {} + + private: + FactoryFunction m_factoryFunction; + std::string m_salt, m_key, m_personalization; + int m_hashSize = 0; + }; + + void registerHashes() { + ContentRegistry::Hashes::add(); + + ContentRegistry::Hashes::add(); + ContentRegistry::Hashes::add(); + ContentRegistry::Hashes::add(); + ContentRegistry::Hashes::add(); + ContentRegistry::Hashes::add(); + + ContentRegistry::Hashes::add>("hex.hashes.hash.crc8", crypt::crc8, 0x07, 0x0000, 0x0000); + ContentRegistry::Hashes::add>("hex.hashes.hash.crc16", crypt::crc16, 0x8005, 0x0000, 0x0000); + ContentRegistry::Hashes::add>("hex.hashes.hash.crc32", crypt::crc32, 0x04C1'1DB7, 0xFFFF'FFFF, 0xFFFF'FFFF, true, true); + ContentRegistry::Hashes::add>("hex.hashes.hash.crc32mpeg", crypt::crc32, 0x04C1'1DB7, 0xFFFF'FFFF, 0x0000'0000, false, false); + ContentRegistry::Hashes::add>("hex.hashes.hash.crc32posix", crypt::crc32, 0x04C1'1DB7, 0x0000'0000, 0xFFFF'FFFF, false, false); + ContentRegistry::Hashes::add>("hex.hashes.hash.crc32c", crypt::crc32, 0x1EDC'6F41, 0xFFFF'FFFF, 0xFFFF'FFFF, true, true); + + hex::ContentRegistry::Hashes::add(HashFactory::Checksum::CreateAdler32); + + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateAP); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBKDR); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBernstein); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateBernstein1); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateDEK); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateDJB); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateELF); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateFNV1a_32); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateFNV32); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateJS); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateOneAtTime); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreatePJW); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateRotating); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateRS); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateSDBM); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateShiftAndXor); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateSuperFast); + + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateMurmur2_32); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateMurmurHash3_x86_32); + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateXXHash32); + + hex::ContentRegistry::Hashes::add(HashFactory::Hash32::CreateJenkins3); + + hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateFNV64); + hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateFNV1a_64); + + hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateMurmur2_64); + hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateSipHash64_2_4); + hex::ContentRegistry::Hashes::add(HashFactory::Hash64::CreateXXHash64); + + hex::ContentRegistry::Hashes::add(HashFactory::Hash128::CreateSipHash128_2_4); + hex::ContentRegistry::Hashes::add(HashFactory::Hash128::CreateMurmurHash3_x86_128); + hex::ContentRegistry::Hashes::add(HashFactory::Hash128::CreateMurmurHash3_x64_128); + + hex::ContentRegistry::Hashes::add("hex.hashes.hash.tiger", HashFactory::Crypto::CreateTiger); + hex::ContentRegistry::Hashes::add("hex.hashes.hash.tiger2", HashFactory::Crypto::CreateTiger2); + + hex::ContentRegistry::Hashes::add>("hex.hashes.hash.blake2b", HashFactory::Crypto::CreateBlake2B); + hex::ContentRegistry::Hashes::add>("hex.hashes.hash.blake2s", HashFactory::Crypto::CreateBlake2S); + } + +} \ No newline at end of file diff --git a/plugins/builtin/source/content/views/view_hashes.cpp b/plugins/hashes/source/content/views/view_hashes.cpp similarity index 88% rename from plugins/builtin/source/content/views/view_hashes.cpp rename to plugins/hashes/source/content/views/view_hashes.cpp index 2024b6322..aa04e6880 100644 --- a/plugins/builtin/source/content/views/view_hashes.cpp +++ b/plugins/hashes/source/content/views/view_hashes.cpp @@ -1,16 +1,15 @@ #include "content/views/view_hashes.hpp" -#include "content/providers/memory_file_provider.hpp" - #include #include +#include #include #include #include -namespace hex::plugin::builtin { +namespace hex::plugin::hashes { class PopupTextHash : public Popup { public: @@ -23,12 +22,10 @@ namespace hex::plugin::builtin { ImGui::PushItemWidth(-1); if (ImGui::InputTextMultiline("##input", m_input)) { - auto provider = std::make_unique(); - provider->resize(m_input.size()); - provider->writeRaw(0x00, m_input.data(), m_input.size()); + prv::MemoryProvider provider({ m_input.begin(), m_input.end() }); m_hash.reset(); - auto bytes = m_hash.get(Region { 0x00, provider->getActualSize() }, provider.get()); + auto bytes = m_hash.get(Region { 0x00, provider.getActualSize() }, &provider); m_result = crypt::encode16(bytes); } @@ -57,7 +54,7 @@ namespace hex::plugin::builtin { ContentRegistry::Hashes::Hash::Function m_hash; }; - ViewHashes::ViewHashes() : View::Window("hex.builtin.view.hashes.name") { + ViewHashes::ViewHashes() : View::Window("hex.hashes.view.hashes.name") { EventRegionSelected::subscribe(this, [this](const auto &providerRegion) { for (auto &function : m_hashFunctions.get(providerRegion.getProvider())) function.reset(); @@ -77,7 +74,7 @@ namespace hex::plugin::builtin { ImGui::TableNextRow(); ImGui::TableNextColumn(); - ImGui::TextUnformatted("hex.builtin.view.hashes.name"_lang); + ImGui::TextUnformatted("hex.hashes.view.hashes.name"_lang); ImGui::Separator(); ImGui::Indent(); @@ -144,7 +141,7 @@ namespace hex::plugin::builtin { m_selectedHash = hashes.front().get(); } - if (ImGui::BeginCombo("hex.builtin.view.hashes.function"_lang, m_selectedHash != nullptr ? Lang(m_selectedHash->getUnlocalizedName()) : "")) { + if (ImGui::BeginCombo("hex.hashes.view.hashes.function"_lang, m_selectedHash != nullptr ? Lang(m_selectedHash->getUnlocalizedName()) : "")) { for (const auto &hash : hashes) { if (ImGui::Selectable(Lang(hash->getUnlocalizedName()), m_selectedHash == hash.get())) { @@ -157,7 +154,7 @@ namespace hex::plugin::builtin { } if (m_newHashName.empty() && m_selectedHash != nullptr) - m_newHashName = hex::format("{} {}", Lang(m_selectedHash->getUnlocalizedName()), static_cast("hex.builtin.view.hashes.hash"_lang)); + m_newHashName = hex::format("{} {}", Lang(m_selectedHash->getUnlocalizedName()), static_cast("hex.hashes.view.hashes.hash"_lang)); if (ImGui::BeginChild("##settings", ImVec2(ImGui::GetContentRegionAvail().x, 200_scaled), true)) { if (m_selectedHash != nullptr) { @@ -166,7 +163,7 @@ namespace hex::plugin::builtin { // Check if no elements have been added if (startPos == ImGui::GetCursorPosY()) { - ImGuiExt::TextFormattedCentered("hex.builtin.view.hashes.no_settings"_lang); + ImGuiExt::TextFormattedCentered("hex.hashes.view.hashes.no_settings"_lang); } } } @@ -180,18 +177,18 @@ namespace hex::plugin::builtin { if (ImGuiExt::IconButton(ICON_VS_ADD, ImGui::GetStyleColorVec4(ImGuiCol_Text))) { if (m_selectedHash != nullptr) { m_hashFunctions->push_back(m_selectedHash->create(m_newHashName)); - AchievementManager::unlockAchievement("hex.builtin.achievement.misc", "hex.builtin.achievement.misc.create_hash.name"); + AchievementManager::unlockAchievement("hex.builtin.achievement.misc", "hex.hashes.achievement.misc.create_hash.name"); } } ImGui::EndDisabled(); ImGui::SameLine(); - ImGuiExt::HelpHover("hex.builtin.view.hashes.hover_info"_lang); + ImGuiExt::HelpHover("hex.hashes.view.hashes.hover_info"_lang); if (ImGui::BeginTable("##hashes", 4, ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Borders | ImGuiTableFlags_ScrollY)) { - ImGui::TableSetupColumn("hex.builtin.view.hashes.table.name"_lang); - ImGui::TableSetupColumn("hex.builtin.view.hashes.table.type"_lang); - ImGui::TableSetupColumn("hex.builtin.view.hashes.table.result"_lang, ImGuiTableColumnFlags_WidthStretch); + ImGui::TableSetupColumn("hex.hashes.view.hashes.table.name"_lang); + ImGui::TableSetupColumn("hex.hashes.view.hashes.table.type"_lang); + ImGui::TableSetupColumn("hex.hashes.view.hashes.table.result"_lang, ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("##buttons", ImGuiTableColumnFlags_WidthFixed, 50_scaled); ImGui::TableHeadersRow(); diff --git a/plugins/hashes/source/plugin_hashes.cpp b/plugins/hashes/source/plugin_hashes.cpp new file mode 100644 index 000000000..1c6f693c0 --- /dev/null +++ b/plugins/hashes/source/plugin_hashes.cpp @@ -0,0 +1,33 @@ +#include + +#include +#include + +#include + +#include + +#include + +namespace hex::plugin::hashes { + + void registerHashes(); + +} + +using namespace hex; +using namespace hex::plugin::hashes; + +IMHEX_PLUGIN_SETUP("Hashes", "WerWolv", "Hashing algorithms") { + hex::log::debug("Using romfs: '{}'", romfs::name()); + for (auto &path : romfs::list("lang")) + hex::ContentRegistry::Language::addLocalization(nlohmann::json::parse(romfs::get(path).string())); + + registerHashes(); + ContentRegistry::Views::add(); + + AchievementManager::addAchievement("hex.builtin.achievement.misc", "hex.hashes.achievement.misc.create_hash.name") + .setDescription("hex.hashes.achievement.misc.create_hash.desc") + .setIcon(romfs::get("assets/achievements/fortune-cookie.png").span()) + .addRequirement("hex.builtin.achievement.starting_out.open_file.name"); +}