Delikatne zmiany w strukturze PAK. signed char zamiast short
This commit is contained in:
parent
b4f6d3a85a
commit
a84a69cbd6
12 changed files with 330 additions and 73 deletions
|
|
@ -89,7 +89,7 @@ bool ExtractCargo::Extract(const std::string& cFile)
|
|||
bool ExtractCargo::CheckCargoFile()
|
||||
{
|
||||
std::vector<char> magic(signature.size());
|
||||
short cargoVer = 0;
|
||||
int8_t cargoVer = 0;
|
||||
|
||||
if (!cargoFile.is_open())
|
||||
{
|
||||
|
|
@ -124,7 +124,7 @@ bool ExtractCargo::CheckCargoFile()
|
|||
//-----------------------------------------------------------------------------
|
||||
bool ExtractCargo::HashValid(const std::vector<char>& data, const uint64_t& crc)
|
||||
{
|
||||
uint64_t actualCrc = XXH64(data.data(), data.size(), VERSION);
|
||||
uint64_t actualCrc = XXH64(data.data(), data.size(), 0);
|
||||
|
||||
if (actualCrc != crc)
|
||||
{
|
||||
|
|
@ -137,25 +137,25 @@ bool ExtractCargo::HashValid(const std::vector<char>& data, const uint64_t& crc)
|
|||
//-----------------------------------------------------------------------------
|
||||
// Magiczna funkcja do dekompresji i deszyfracji danych
|
||||
//-----------------------------------------------------------------------------
|
||||
void ExtractCargo::computingBytes(const std::vector<char>& input, std::vector<char>& output, const int16_t& flag)
|
||||
void ExtractCargo::computingBytes(const std::vector<char>& input, std::vector<char>& output, const int8_t& flag)
|
||||
{
|
||||
ChunkManager cm(eman);
|
||||
|
||||
switch (flag)
|
||||
{
|
||||
case 1:
|
||||
case FILE_FLAG_COMPRESS:
|
||||
output = cm.dechunked(input, true, false);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case FILE_FLAG_ENCRYPT:
|
||||
output = cm.dechunked(input, false, true);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case FILE_FLAG_ZIPENC:
|
||||
output = cm.dechunked(input, true, true);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case FILE_FLAG_CHUNK:
|
||||
output = cm.dechunked(input, false, false);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue