mirror of
https://github.com/LisherSong/ps5-web-file-manager.git
synced 2026-10-06 10:00:24 +02:00
New RAR engine for v1.9, replacing dmc_unrar 1.7.0. dmc_unrar only
dispatches RAR5 compression version 5 (switch(file->version) case
0x5000); WinRAR 6.x/7.x writes version 6 -> DMC_UNRAR_FILE_UNSUPPORTED_VERSION
-> user-facing "corrupt archive" on real v6 archives (diagnosed 2026-09-05
from a v6:8M:m0:m3 test file). unrar 7.20.1 natively supports v6,
encrypted and multi-volume RAR.
Vendored into third_party/unrar7/ (new dir) so the tree stays buildable
while src/rar_extract.c still references the dmc facade. Contents are a
verbatim copy of opello/unrar @97e1780 (159 files, v7.20.1) plus two
project files:
- unrar_c_api.h (C facade shim: platform types + dll.hpp re-export)
- VENDORED.md (source pin, build model, license notes)
Build model verified on host (MinGW g++ 16.2, Windows):
- all 49 UnRARDll.vcxproj sources compile with
-std=c++17 -DRARDLL -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
- links + runs: RARGetDllVersion() = 9 (smoke binary in .build/, ignored)
- Windows link additionally needs -lpowrprof
License: UnRAR freeware license (not GPL) - free to use for handling RAR
archives; cannot be used to build a RAR-compatible archiver. THIRD_PARTY_NOTICES
update lands with the engine swap commit.
Next (v1.9 work items): engine swap in rar_extract.c, Makefile .cpp rules,
fixtures + host tests, frontend password/multi-volume, then ELF build.
56 lines
859 B
C++
56 lines
859 B
C++
#include "rar.hpp"
|
|
|
|
void FileHeader::Reset(size_t SubDataSize)
|
|
{
|
|
SubData.resize(SubDataSize);
|
|
BaseBlock::Reset();
|
|
FileHash.Init(HASH_NONE);
|
|
mtime.Reset();
|
|
atime.Reset();
|
|
ctime.Reset();
|
|
SplitBefore=false;
|
|
SplitAfter=false;
|
|
|
|
UnknownUnpSize=0;
|
|
|
|
SubFlags=0; // Important for RAR 3.0 subhead.
|
|
|
|
CryptMethod=CRYPT_NONE;
|
|
Encrypted=false;
|
|
SaltSet=false;
|
|
UsePswCheck=false;
|
|
UseHashKey=false;
|
|
Lg2Count=0;
|
|
|
|
Solid=false;
|
|
Dir=false;
|
|
WinSize=0;
|
|
Inherited=false;
|
|
SubBlock=false;
|
|
CommentInHeader=false;
|
|
Version=false;
|
|
LargeFile=false;
|
|
|
|
RedirType=FSREDIR_NONE;
|
|
DirTarget=false;
|
|
UnixOwnerSet=false;
|
|
}
|
|
|
|
|
|
/*
|
|
FileHeader& FileHeader::operator = (FileHeader &hd)
|
|
{
|
|
SubData.Reset();
|
|
memcpy(this,&hd,sizeof(*this));
|
|
SubData.CleanData();
|
|
SubData=hd.SubData;
|
|
return *this;
|
|
}
|
|
*/
|
|
|
|
|
|
void MainHeader::Reset()
|
|
{
|
|
*this={};
|
|
}
|