diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-04-02 08:32:39 -0600 |
|---|---|---|
| committer | Lywx <kiritodev01@gmail.com> | 2024-04-02 09:00:56 -0600 |
| commit | 3eebd9d5aaeef4adfa62d95cd6f4f60b917a48c2 (patch) | |
| tree | f6bf05a1e5a81bf254662484ada4ee90d4f1c3e9 /src/utils/Decompressor.h | |
| parent | 4e53fac09cd92ddad447d4f73dc828d90537622d (diff) | |
Removed header, values and indices with just offset
Diffstat (limited to 'src/utils/Decompressor.h')
| -rw-r--r-- | src/utils/Decompressor.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/Decompressor.h b/src/utils/Decompressor.h index 0cb5a01..d7671a4 100644 --- a/src/utils/Decompressor.h +++ b/src/utils/Decompressor.h @@ -6,6 +6,7 @@ #include <yaml-cpp/yaml.h> #include <optional> #include <cstdint> +#include "BinaryReader.h" enum class CompressionType { None, @@ -23,12 +24,17 @@ struct DataChunk { struct DecompressedData { DataChunk* root; DataChunk segment; + + LUS::BinaryReader GetReader() { + return LUS::BinaryReader(reinterpret_cast<char*>(segment.data), segment.size); + } }; class Decompressor { public: static DataChunk* Decode(const std::vector<uint8_t>& buffer, uint32_t offset, CompressionType type); static DecompressedData AutoDecode(YAML::Node& node, std::vector<uint8_t>& buffer, std::optional<size_t> size = std::nullopt); + static DecompressedData AutoDecode(uint32_t offset, std::optional<size_t> size, std::vector<uint8_t>& buffer); static uint32_t TranslateAddr(uint32_t addr, bool baseAddress = false); static bool IsSegmented(uint32_t addr); |
