Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to unRAR version 5.5 file #503

Open
xuejf-super opened this issue Mar 26, 2020 · 6 comments
Open

Unable to unRAR version 5.5 file #503

xuejf-super opened this issue Mar 26, 2020 · 6 comments
Labels

Comments

@xuejf-super
Copy link

No description provided.

@adamhathcock
Copy link
Owner

Going to need more detail.

Don’t believe they’ve changed the format again but I could be wrong.

@xuejf-super
Copy link
Author

The following code is used to decompress the compressed file of RAR 5.5, and an exception "file crc mismatch" is thrown

string path = @"C:\Users\Administrator\Desktop\1\1\2222.rar";
string fpath = @"C:\Users\Administrator\Desktop\1\1\2222";
using (Stream stream = File.OpenRead(path))
{
var reader = ReaderFactory.Open(stream, new ReaderOptions() { Password = "cxmt1508" });
while (reader.MoveToNextEntry())
{
if (!reader.Entry.IsDirectory)
{
Console.WriteLine(reader.Entry.Key);
reader.WriteEntryToDirectory(fpath, new ExtractionOptions() { ExtractFullPath = true, Overwrite = true });
}
}
}

@adamhathcock
Copy link
Owner

RAR5 decryption isn't currently implemented

@xuejf-super
Copy link
Author

okay, thank you

@atiq-cs
Copy link

atiq-cs commented Dec 19, 2022

SharpCompress Version="0.32.2"

Likewise, getting error on unrar / decryption,

Unhandled exception. System.InvalidOperationException: TODO rar5
   at SharpCompress.Common.Rar.Headers.FileHeader.get_FileCrc()
   at SharpCompress.Compressors.Rar.MultiVolumeReadOnlyStream.InitializeNextFilePart()
   at SharpCompress.Compressors.Rar.MultiVolumeReadOnlyStream..ctor(IEnumerable`1 parts, IExtractionListener streamListener)
   at SharpCompress.Archives.Rar.RarArchiveEntry.OpenEntryStream()
   at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo)
   at SharpCompress.Archives.IArchiveEntryExtensions.<>c__DisplayClass2_0.<WriteToFile>b__0(String x, FileMode fm)
   at SharpCompress.Common.ExtractionMethods.WriteEntryToFile(IEntry entry, String destinationFileName, ExtractionOptions options, Action`2 openAndWrite)
   at SharpCompress.Archives.IArchiveEntryExtensions.WriteToFile(IArchiveEntry entry, String destinationFileName, ExtractionOptions options)
   at SharpCompress.Common.ExtractionMethods.WriteEntryToDirectory(IEntry entry, String destinationDirectory, ExtractionOptions options, Action`2 write)
   at SharpCompress.Archives.IArchiveEntryExtensions.WriteToDirectory(IArchiveEntry entry, String destinationDirectory, ExtractionOptions options)
   at ConsoleApp.MediaTool.ExtractRar(String filePath) in D:\Code\CS\MediaTool\ConsoleApp\MediaTool.cs:line 104

@adamhathcock
Copy link
Owner

So we think there's a 5.5 specification change?

That exception is because the RAR 5 CRC isn't implemented properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants