81 lines
No EOL
1.9 KiB
C++
81 lines
No EOL
1.9 KiB
C++
/*
|
|
* This file is part of VoidArchiveTool.
|
|
*
|
|
* Copyright (C) 2025 Yanczi
|
|
*
|
|
* Void Archive Toolis free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
#define EXTENSION "pak"
|
|
#define SIGNATURE "XPAK"
|
|
|
|
#define SIGNATURE_KEY_FILE "XKEY"
|
|
|
|
#define VERSION 0x03
|
|
|
|
// WielkoϾ pojedynczego bloku strumienia
|
|
#define CHUNK_STREAM_512KB 524288 // 512KB
|
|
#define CHUNK_STREAM_16MB 16777216 // 16MB
|
|
#define CHUNK_STREAM_256MB 268435456 // 256MB
|
|
|
|
enum StoreMethod
|
|
{
|
|
FILTERING = -1,
|
|
RAW = 0,
|
|
COMPRESS = 1,
|
|
ENCRYPT = 2,
|
|
COMPRESSxENCRYPT = 3
|
|
};
|
|
|
|
#define FILE_FLAG_RAW 0x00
|
|
#define FILE_FLAG_COMPRESS 0x01
|
|
#define FILE_FLAG_ENCRYPT 0x02
|
|
#define FILE_FLAG_ZIPENC 0x03
|
|
#define FILE_FLAG_CHUNK 0x04
|
|
|
|
|
|
//Prgoram title
|
|
#define PROGRAM_TITLE "eXtendet PAK"
|
|
#define PROGRAM_VERSION "v0.4"
|
|
#define PROGRAM_AUTHOR "Yanczi"
|
|
#define PROGRAM_COMPILING "12 December 2025"
|
|
#define PROGRAM_LICENSE "GNU LGPL v3"
|
|
|
|
//Limity
|
|
#define MAX_FILE_SIZE 8589934592 // 8GB
|
|
#define MAX_PAK_SIZE 8796093022208 // 8TB
|
|
|
|
struct CargoHead
|
|
{
|
|
std::string signature;
|
|
int8_t version;
|
|
uint32_t files;
|
|
uint64_t table;
|
|
};
|
|
|
|
struct FilesTable
|
|
{
|
|
uint8_t nameLen;
|
|
std::string nameFile;
|
|
uint64_t hashName;
|
|
uint64_t offset;
|
|
uint64_t size;
|
|
uint64_t crc;
|
|
int8_t flag;
|
|
}; |