/* * 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 . */ #pragma once #include #include #include #include #include #include #include #include #include #include #include "DataStruct.h" #include "ChunkManager.h" #include "EncryptionManager.h" class ExtractCargo { public: ExtractCargo(); virtual ~ExtractCargo(); // Punkt wejścia bool Extract(const std::string&); private: std::filesystem::path cargoFileName; uint32_t filesLen; uint64_t tablePosition; int filesHeadsOffset; const int8_t version; const std::string signature; std::vector filesHeads; std::ifstream cargoFile; EncryptionManager eman; // Sprawdzenie poprawności archiwum bool CheckCargoFile(); // Wypakowywanie plików void ExtractingFilesFromCargo(); // Pobieranie nagłówków plików void LoadFilesTable(); // Sprawdzanie sumy kontrolnej bool HashValid(const std::vector&, const uint64_t&); // Utwórz katalog void CreateDirections(std::filesystem::path); // Magiczna funkcja do dekompresji i deszyfracji danych void computingBytes(const std::vector&, std::vector&, const uint8_t&); };