forked from akioukun/Chaos-Zero-Nightmare-ASSet-Ripper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDBParser.h
More file actions
40 lines (34 loc) · 786 Bytes
/
DBParser.h
File metadata and controls
40 lines (34 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <vector>
#include <string>
#include <cstdint>
namespace DBParser
{
struct Header
{
std::vector<uint8_t> magic; // 5 bytes
uint8_t version;
uint16_t headerSize;
uint8_t unk;
uint64_t unk1;
uint32_t defaultFileCount;
uint32_t hashTableCount;
uint64_t hashTableOffset; // UInt40
uint64_t unk5;
};
struct HashTableEntry
{
uint64_t entryOffset; // UInt40
};
struct FileChunkHeader
{
uint32_t entrySize;
uint8_t entryType;
uint8_t fileNameLength;
uint32_t fileSize;
uint64_t nextEntry; // UInt40
};
std::vector<uint8_t> DecryptDB(const std::vector<uint8_t> &data);
std::string ConvertToJson(const std::vector<uint8_t> &decrypted);
bool ConvertToJsonToStream(const std::vector<uint8_t>& data, std::ostream& out) noexcept;
}