diff --git a/plugins/builtin/source/content/data_processor_nodes.cpp b/plugins/builtin/source/content/data_processor_nodes.cpp index c82ab4dfa..fca09eb88 100644 --- a/plugins/builtin/source/content/data_processor_nodes.cpp +++ b/plugins/builtin/source/content/data_processor_nodes.cpp @@ -383,6 +383,29 @@ namespace hex::plugin::builtin { } }; + class NodeDataSelection : public dp::Node { + public: + NodeDataSelection() : Node("hex.builtin.nodes.data_access.selection.header", { dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.data_access.selection.address"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.data_access.selection.size") }) { + EventManager::subscribe(this, [this](const Region ®ion) { + this->m_address = region.address; + this->m_size = region.size; + }); + } + + ~NodeDataSelection() override { + EventManager::unsubscribe(this); + } + + void process() override { + this->setIntegerOnOutput(0, this->m_address); + this->setIntegerOnOutput(1, this->m_size); + } + + private: + u64 m_address = 0; + size_t m_size = 0; + }; + class NodeCastIntegerToBuffer : public dp::Node { public: NodeCastIntegerToBuffer() : Node("hex.builtin.nodes.casting.int_to_buffer.header", { dp::Attribute(dp::Attribute::IOType::In, dp::Attribute::Type::Integer, "hex.builtin.nodes.common.input"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Buffer, "hex.builtin.nodes.common.output") }) { } @@ -988,6 +1011,7 @@ namespace hex::plugin::builtin { ContentRegistry::DataProcessorNode::add("hex.builtin.nodes.data_access", "hex.builtin.nodes.data_access.read"); ContentRegistry::DataProcessorNode::add("hex.builtin.nodes.data_access", "hex.builtin.nodes.data_access.write"); ContentRegistry::DataProcessorNode::add("hex.builtin.nodes.data_access", "hex.builtin.nodes.data_access.size"); + ContentRegistry::DataProcessorNode::add("hex.builtin.nodes.data_access", "hex.builtin.nodes.data_access.selection"); ContentRegistry::DataProcessorNode::add("hex.builtin.nodes.casting", "hex.builtin.nodes.casting.int_to_buffer"); ContentRegistry::DataProcessorNode::add("hex.builtin.nodes.casting", "hex.builtin.nodes.casting.buffer_to_int"); diff --git a/plugins/builtin/source/lang/de_DE.cpp b/plugins/builtin/source/lang/de_DE.cpp index 0d1478d8b..7b0d99922 100644 --- a/plugins/builtin/source/lang/de_DE.cpp +++ b/plugins/builtin/source/lang/de_DE.cpp @@ -463,6 +463,10 @@ namespace hex::plugin::builtin { { "hex.builtin.nodes.data_access.size", "Datengrösse"}, { "hex.builtin.nodes.data_access.size.header", "Datengrösse"}, { "hex.builtin.nodes.data_access.size.size", "Grösse"}, + { "hex.builtin.nodes.data_access.selection", "Angewählte Region"}, + { "hex.builtin.nodes.data_access.selection.header", "Angewählte Region"}, + { "hex.builtin.nodes.data_access.selection.address", "Adresse"}, + { "hex.builtin.nodes.data_access.selection.size", "Grösse"}, { "hex.builtin.nodes.casting", "Datenumwandlung" }, { "hex.builtin.nodes.casting.int_to_buffer", "Integral zu Buffer" }, diff --git a/plugins/builtin/source/lang/en_US.cpp b/plugins/builtin/source/lang/en_US.cpp index 96ceccce7..20e67c534 100644 --- a/plugins/builtin/source/lang/en_US.cpp +++ b/plugins/builtin/source/lang/en_US.cpp @@ -468,6 +468,10 @@ namespace hex::plugin::builtin { { "hex.builtin.nodes.data_access.size", "Data Size"}, { "hex.builtin.nodes.data_access.size.header", "Data Size"}, { "hex.builtin.nodes.data_access.size.size", "Size"}, + { "hex.builtin.nodes.data_access.selection", "Selected Region"}, + { "hex.builtin.nodes.data_access.selection.header", "Selected Region"}, + { "hex.builtin.nodes.data_access.selection.address", "Address"}, + { "hex.builtin.nodes.data_access.selection.size", "Size"}, { "hex.builtin.nodes.casting", "Data conversion" }, { "hex.builtin.nodes.casting.int_to_buffer", "Integer to Buffer" }, diff --git a/plugins/builtin/source/lang/it_IT.cpp b/plugins/builtin/source/lang/it_IT.cpp index 629e56c87..95d76c55d 100644 --- a/plugins/builtin/source/lang/it_IT.cpp +++ b/plugins/builtin/source/lang/it_IT.cpp @@ -464,6 +464,10 @@ namespace hex::plugin::builtin { { "hex.builtin.nodes.data_access.size", "Dati Dimensione"}, { "hex.builtin.nodes.data_access.size.header", "Dati Dimensione"}, { "hex.builtin.nodes.data_access.size.size", "Dimensione"}, + //{ "hex.builtin.nodes.data_access.selection", "Selected Region"}, + //{ "hex.builtin.nodes.data_access.selection.header", "Selected Region"}, + //{ "hex.builtin.nodes.data_access.selection.address", "Address"}, + //{ "hex.builtin.nodes.data_access.selection.size", "Size"}, { "hex.builtin.nodes.casting", "Conversione Dati" }, { "hex.builtin.nodes.casting.int_to_buffer", "Da Intero a Buffer" }, diff --git a/plugins/builtin/source/lang/ja_JP.cpp b/plugins/builtin/source/lang/ja_JP.cpp index f5dc7c935..e39331c22 100644 --- a/plugins/builtin/source/lang/ja_JP.cpp +++ b/plugins/builtin/source/lang/ja_JP.cpp @@ -467,6 +467,10 @@ namespace hex::plugin::builtin { { "hex.builtin.nodes.data_access.size", "データサイズ"}, { "hex.builtin.nodes.data_access.size.header", "データサイズ"}, { "hex.builtin.nodes.data_access.size.size", "サイズ"}, + //{ "hex.builtin.nodes.data_access.selection", "Selected Region"}, + //{ "hex.builtin.nodes.data_access.selection.header", "Selected Region"}, + //{ "hex.builtin.nodes.data_access.selection.address", "Address"}, + //{ "hex.builtin.nodes.data_access.selection.size", "Size"}, { "hex.builtin.nodes.casting", "データ変換" }, { "hex.builtin.nodes.casting.int_to_buffer", "整数からバッファ" }, diff --git a/plugins/builtin/source/lang/zh_CN.cpp b/plugins/builtin/source/lang/zh_CN.cpp index f86c88d9c..51b06c672 100644 --- a/plugins/builtin/source/lang/zh_CN.cpp +++ b/plugins/builtin/source/lang/zh_CN.cpp @@ -459,6 +459,10 @@ namespace hex::plugin::builtin { { "hex.builtin.nodes.data_access.size", "数据大小"}, { "hex.builtin.nodes.data_access.size.header", "数据大小"}, { "hex.builtin.nodes.data_access.size.size", "大小"}, + //{ "hex.builtin.nodes.data_access.selection", "Selected Region"}, + //{ "hex.builtin.nodes.data_access.selection.header", "Selected Region"}, + //{ "hex.builtin.nodes.data_access.selection.address", "Address"}, + //{ "hex.builtin.nodes.data_access.selection.size", "Size"}, { "hex.builtin.nodes.casting", "数据转换" }, { "hex.builtin.nodes.casting.int_to_buffer", "整数到缓冲区" },