diff --git a/lib/libimhex/include/hex/providers/provider.hpp b/lib/libimhex/include/hex/providers/provider.hpp index 6a4aa3d5f..a85e60923 100644 --- a/lib/libimhex/include/hex/providers/provider.hpp +++ b/lib/libimhex/include/hex/providers/provider.hpp @@ -137,7 +137,7 @@ namespace hex::prv { * @brief Get the full size of the data in this provider * @return The size of the entire available data of this provider */ - [[nodiscard]] virtual size_t getActualSize() const = 0; + [[nodiscard]] virtual u64 getActualSize() const = 0; /** * @brief Gets the type name of this provider diff --git a/lib/libimhex/source/helpers/patches.cpp b/lib/libimhex/source/helpers/patches.cpp index fa9b16ea7..1f26655dd 100644 --- a/lib/libimhex/source/helpers/patches.cpp +++ b/lib/libimhex/source/helpers/patches.cpp @@ -36,7 +36,7 @@ namespace hex { this->m_patches[offset] = static_cast(buffer)[i]; } - [[nodiscard]] size_t getActualSize() const override { + [[nodiscard]] u64 getActualSize() const override { if (this->m_patches.empty()) return 0; else diff --git a/plugins/builtin/include/content/providers/disk_provider.hpp b/plugins/builtin/include/content/providers/disk_provider.hpp index f3728c205..b2d2f0c36 100644 --- a/plugins/builtin/include/content/providers/disk_provider.hpp +++ b/plugins/builtin/include/content/providers/disk_provider.hpp @@ -22,7 +22,7 @@ namespace hex::plugin::builtin { void readRaw(u64 offset, void *buffer, size_t size) override; void writeRaw(u64 offset, const void *buffer, size_t size) override; - [[nodiscard]] size_t getActualSize() const override; + [[nodiscard]] u64 getActualSize() const override; void setPath(const std::fs::path &path); diff --git a/plugins/builtin/include/content/providers/file_provider.hpp b/plugins/builtin/include/content/providers/file_provider.hpp index ebd2f9e1e..4d165ce76 100644 --- a/plugins/builtin/include/content/providers/file_provider.hpp +++ b/plugins/builtin/include/content/providers/file_provider.hpp @@ -27,7 +27,7 @@ namespace hex::plugin::builtin { void readRaw(u64 offset, void *buffer, size_t size) override; void writeRaw(u64 offset, const void *buffer, size_t size) override; - [[nodiscard]] size_t getActualSize() const override; + [[nodiscard]] u64 getActualSize() const override; void save() override; void saveAs(const std::fs::path &path) override; diff --git a/plugins/builtin/include/content/providers/gdb_provider.hpp b/plugins/builtin/include/content/providers/gdb_provider.hpp index 7c506e32b..22f7529ad 100644 --- a/plugins/builtin/include/content/providers/gdb_provider.hpp +++ b/plugins/builtin/include/content/providers/gdb_provider.hpp @@ -24,7 +24,7 @@ namespace hex::plugin::builtin { void readRaw(u64 offset, void *buffer, size_t size) override; void writeRaw(u64 offset, const void *buffer, size_t size) override; - [[nodiscard]] size_t getActualSize() const override; + [[nodiscard]] u64 getActualSize() const override; void save() override; diff --git a/plugins/builtin/include/content/providers/intel_hex_provider.hpp b/plugins/builtin/include/content/providers/intel_hex_provider.hpp index bb02bf1ca..cab93dfdd 100644 --- a/plugins/builtin/include/content/providers/intel_hex_provider.hpp +++ b/plugins/builtin/include/content/providers/intel_hex_provider.hpp @@ -21,7 +21,7 @@ namespace hex::plugin::builtin { void readRaw(u64 offset, void *buffer, size_t size) override; void writeRaw(u64 offset, const void *buffer, size_t size) override; - [[nodiscard]] size_t getActualSize() const override; + [[nodiscard]] u64 getActualSize() const override; bool open() override; void close() override; diff --git a/plugins/builtin/include/content/providers/memory_file_provider.hpp b/plugins/builtin/include/content/providers/memory_file_provider.hpp index de957ae0d..d3c6ada9b 100644 --- a/plugins/builtin/include/content/providers/memory_file_provider.hpp +++ b/plugins/builtin/include/content/providers/memory_file_provider.hpp @@ -21,7 +21,7 @@ namespace hex::plugin::builtin { void readRaw(u64 offset, void *buffer, size_t size) override; void writeRaw(u64 offset, const void *buffer, size_t size) override; - [[nodiscard]] size_t getActualSize() const override { return this->m_data.size(); } + [[nodiscard]] u64 getActualSize() const override { return this->m_data.size(); } void resizeRaw(size_t newSize) override; void insertRaw(u64 offset, size_t size) override; diff --git a/plugins/builtin/include/content/providers/null_provider.hpp b/plugins/builtin/include/content/providers/null_provider.hpp index 00c7769b5..2a8747230 100644 --- a/plugins/builtin/include/content/providers/null_provider.hpp +++ b/plugins/builtin/include/content/providers/null_provider.hpp @@ -31,7 +31,7 @@ namespace hex::plugin::builtin { void readRaw(u64 offset, void *buffer, size_t size) override { hex::unused(offset, buffer, size); } void writeRaw(u64 offset, const void *buffer, size_t size) override { hex::unused(offset, buffer, size); } - [[nodiscard]] size_t getActualSize() const override { return 0x00; } + [[nodiscard]] u64 getActualSize() const override { return 0x00; } [[nodiscard]] std::string getName() const override { return "None"; } [[nodiscard]] std::vector getDataDescription() const override { return { }; } diff --git a/plugins/builtin/include/content/providers/view_provider.hpp b/plugins/builtin/include/content/providers/view_provider.hpp index 7dd4ce98b..0f8afec8b 100644 --- a/plugins/builtin/include/content/providers/view_provider.hpp +++ b/plugins/builtin/include/content/providers/view_provider.hpp @@ -86,7 +86,7 @@ namespace hex::plugin::builtin { this->m_provider->write(offset + this->m_startAddress, buffer, size); } - [[nodiscard]] size_t getActualSize() const override { return this->m_size; } + [[nodiscard]] u64 getActualSize() const override { return this->m_size; } [[nodiscard]] std::string getName() const override { if (this->m_provider == nullptr) diff --git a/plugins/builtin/source/content/command_line_interface.cpp b/plugins/builtin/source/content/command_line_interface.cpp index d55d291de..659995c4f 100644 --- a/plugins/builtin/source/content/command_line_interface.cpp +++ b/plugins/builtin/source/content/command_line_interface.cpp @@ -295,7 +295,7 @@ namespace hex::plugin::builtin { u64 startAddress = args.size() >= 2 ? std::stoull(args[1], nullptr, 0) : 0x00; u64 size = args.size() >= 3 ? std::stoull(args[2], nullptr, 0) : provider.getActualSize(); - size = std::min(size, provider.getActualSize()); + size = std::min(size, provider.getActualSize()); log::print("{}", hex::generateHexView(startAddress, size - startAddress, &provider)); diff --git a/plugins/builtin/source/content/providers/disk_provider.cpp b/plugins/builtin/source/content/providers/disk_provider.cpp index 9bd7d49cb..8a3a66c3e 100644 --- a/plugins/builtin/source/content/providers/disk_provider.cpp +++ b/plugins/builtin/source/content/providers/disk_provider.cpp @@ -335,7 +335,7 @@ namespace hex::plugin::builtin { #endif } - size_t DiskProvider::getActualSize() const { + u64 DiskProvider::getActualSize() const { return this->m_diskSize; } diff --git a/plugins/builtin/source/content/providers/file_provider.cpp b/plugins/builtin/source/content/providers/file_provider.cpp index fd3dc96d8..ba92dc772 100644 --- a/plugins/builtin/source/content/providers/file_provider.cpp +++ b/plugins/builtin/source/content/providers/file_provider.cpp @@ -138,7 +138,7 @@ namespace hex::plugin::builtin { this->resizeRaw(newSize); } - size_t FileProvider::getActualSize() const { + u64 FileProvider::getActualSize() const { return this->m_fileSize; } diff --git a/plugins/builtin/source/content/providers/gdb_provider.cpp b/plugins/builtin/source/content/providers/gdb_provider.cpp index 2231ca4a8..909616870 100644 --- a/plugins/builtin/source/content/providers/gdb_provider.cpp +++ b/plugins/builtin/source/content/providers/gdb_provider.cpp @@ -199,7 +199,7 @@ namespace hex::plugin::builtin { Provider::save(); } - size_t GDBProvider::getActualSize() const { + u64 GDBProvider::getActualSize() const { return this->m_size; } diff --git a/plugins/builtin/source/content/providers/intel_hex_provider.cpp b/plugins/builtin/source/content/providers/intel_hex_provider.cpp index e33108f5c..a28c7c9bc 100644 --- a/plugins/builtin/source/content/providers/intel_hex_provider.cpp +++ b/plugins/builtin/source/content/providers/intel_hex_provider.cpp @@ -187,7 +187,7 @@ namespace hex::plugin::builtin { hex::unused(offset, buffer, size); } - size_t IntelHexProvider::getActualSize() const { + u64 IntelHexProvider::getActualSize() const { return this->m_dataSize; } diff --git a/plugins/windows/include/content/providers/process_memory_provider.hpp b/plugins/windows/include/content/providers/process_memory_provider.hpp index 12c77d318..a058ba301 100644 --- a/plugins/windows/include/content/providers/process_memory_provider.hpp +++ b/plugins/windows/include/content/providers/process_memory_provider.hpp @@ -25,7 +25,7 @@ namespace hex::plugin::windows { void readRaw(u64 address, void *buffer, size_t size) override; void writeRaw(u64 address, const void *buffer, size_t size) override; - [[nodiscard]] size_t getActualSize() const override { return 0xFFFF'FFFF'FFFF; } + [[nodiscard]] u64 getActualSize() const override { return std::numeric_limits::max(); } void save() override {} diff --git a/tests/common/include/hex/test/test_provider.hpp b/tests/common/include/hex/test/test_provider.hpp index b1cf01aee..242a03855 100644 --- a/tests/common/include/hex/test/test_provider.hpp +++ b/tests/common/include/hex/test/test_provider.hpp @@ -43,7 +43,7 @@ namespace hex::test { std::memcpy(m_data->data() + offset, buffer, size); } - [[nodiscard]] size_t getActualSize() const override { + [[nodiscard]] u64 getActualSize() const override { return this->m_data->size(); }