Skip to content

Commit

Permalink
Warning on trying to read encrypted file content from pck
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyyrylainen committed May 23, 2024
1 parent 7ae22cb commit bbc06d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/pck/PckFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ bool PckFile::Load()
if(FormatVersion == 2) {
entry.Flags = Read32();

// TODO: check encrypted flag
if(entry.Flags & PCK_FILE_ENCRYPTED) {
std::cout << "WARNING: pck file (" << entry.Path
<< ") is marked as encrypted, decoding the encryption is not "
"implemented\n";
}
}

entry.GetData = [offset = entry.Offset, size = entry.Size, this]() {
Expand Down
5 changes: 3 additions & 2 deletions src/pck/PckFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace pcktool {

// Pck magic
constexpr uint32_t PCK_HEADER_MAGIC = 0x43504447;
constexpr uint32_t PACK_DIR_ENCRYPTED = 1;
constexpr uint32_t PACK_DIR_ENCRYPTED = 1 << 0;
constexpr uint32_t PCK_FILE_ENCRYPTED = 1 << 0;

// Highest pck version supported by this tool
constexpr int MAX_SUPPORTED_PCK_VERSION_LOAD = 2;
Expand All @@ -39,7 +40,7 @@ class PckFile {
};

public:
explicit PckFile(std::string path);
explicit PckFile(std::string path);
PckFile(PckFile&& other) = delete;
PckFile(const PckFile& other) = delete;

Expand Down

0 comments on commit bbc06d3

Please sign in to comment.