Skip to content

Commit

Permalink
Try a different way to extract 7z files
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeliux committed Aug 16, 2024
1 parent 5f7c8d3 commit 4250c2b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions cli/Kryptor.Cli.Shared/Wordlist/DownloadSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
using System.Threading;
using System.Threading.Tasks;

using Aspose.Zip.SevenZip;

using Downloader;

using MoreLinq;

using Newtonsoft.Json;

using SAPTeam.Kryptor.Client;
using SAPTeam.Kryptor.Client.Security;
using SAPTeam.Kryptor.Extensions;

using SharpCompress.Archives;
using SharpCompress.Readers;

namespace SAPTeam.Kryptor.Cli.Wordlist
Expand Down Expand Up @@ -108,11 +105,15 @@ private void SetEndStatus(object sender, System.ComponentModel.AsyncCompletedEve

if (Downloader.Package.FileName.ToLower().EndsWith(".7z"))
{
var destStream = OutputFile.Create();
var svenZipReader = new SevenZipArchive(Downloader.Package.FileName);
svenZipReader.Entries.ForEach(x => x.Extract(destStream));
svenZipReader.Dispose();
destStream.Dispose();
//var destStream = OutputFile.Create();
//var svenZipReader = new SevenZipArchive(Downloader.Package.FileName);
//svenZipReader.Entries.ForEach(x => x.Extract(destStream));
//svenZipReader.Dispose();
//destStream.Dispose();

var reader = SharpCompress.Archives.SevenZip.SevenZipArchive.Open(Downloader.Package.FileName);
reader.Entries.First().WriteToFile(OutputFile.FullName);
reader.Dispose();
}
else
{
Expand Down

0 comments on commit 4250c2b

Please sign in to comment.