summaryrefslogtreecommitdiff
path: root/src/utils/Decompressor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/Decompressor.h')
-rw-r--r--src/utils/Decompressor.h6
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);