Skip to content

Commit

Permalink
Change the extractor library
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeliux committed Aug 16, 2024
1 parent c6bcd48 commit b999bdf
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 5 deletions.
1 change: 1 addition & 0 deletions cli/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Downloader" Version="3.1.2" />
<PackageReference Include="SharpCompress" Version="0.37.2" />
<PackageReference Include="Aspose.Zip" Version="24.7.0" />

<ProjectReference Include="$(CliRootPath)..\src\Kryptor\Kryptor.csproj" />
<ProjectReference Include="$(CliRootPath)..\src\Kryptor.Client\Kryptor.Client.csproj" />
Expand Down
27 changes: 27 additions & 0 deletions cli/Kryptor.Cli.Legacy/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
"version": 1,
"dependencies": {
".NETFramework,Version=v4.6.2": {
"Aspose.Zip": {
"type": "Direct",
"requested": "[24.7.0, )",
"resolved": "24.7.0",
"contentHash": "/GJ3J21peZrZ4BoONkm+xOGkUh6X96rQO1bhUjgI5DRr8Kq6nC9hJHqeL+ZS/DSuK826WNIQFg7qDVSUzwZPUg==",
"dependencies": {
"System.Text.Encoding.CodePages": "4.5.0"
}
},
"CommandLineParser": {
"type": "Direct",
"requested": "[2.9.1, )",
Expand Down Expand Up @@ -315,6 +324,15 @@
}
},
".NETFramework,Version=v4.7.2": {
"Aspose.Zip": {
"type": "Direct",
"requested": "[24.7.0, )",
"resolved": "24.7.0",
"contentHash": "/GJ3J21peZrZ4BoONkm+xOGkUh6X96rQO1bhUjgI5DRr8Kq6nC9hJHqeL+ZS/DSuK826WNIQFg7qDVSUzwZPUg==",
"dependencies": {
"System.Text.Encoding.CodePages": "4.5.0"
}
},
"CommandLineParser": {
"type": "Direct",
"requested": "[2.9.1, )",
Expand Down Expand Up @@ -644,6 +662,15 @@
}
},
".NETFramework,Version=v4.8.1": {
"Aspose.Zip": {
"type": "Direct",
"requested": "[24.7.0, )",
"resolved": "24.7.0",
"contentHash": "/GJ3J21peZrZ4BoONkm+xOGkUh6X96rQO1bhUjgI5DRr8Kq6nC9hJHqeL+ZS/DSuK826WNIQFg7qDVSUzwZPUg==",
"dependencies": {
"System.Text.Encoding.CodePages": "4.5.0"
}
},
"CommandLineParser": {
"type": "Direct",
"requested": "[2.9.1, )",
Expand Down
18 changes: 13 additions & 5 deletions cli/Kryptor.Cli.Shared/Wordlist/DownloadSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Threading;
using System.Threading.Tasks;

using Aspose.Zip;

using Downloader;

using Newtonsoft.Json;
Expand All @@ -13,8 +15,6 @@
using SAPTeam.Kryptor.Client.Security;
using SAPTeam.Kryptor.Extensions;

using SharpCompress.Readers;

namespace SAPTeam.Kryptor.Cli.Wordlist
{
public class DownloadSession : Session
Expand Down Expand Up @@ -92,6 +92,8 @@ private void SetEndStatus(object sender, System.ComponentModel.AsyncCompletedEve
{
IndexEntry.Size = Downloader.Package.TotalFileSize;

Progress = -1;

Description = $"{IndexEntry.Id}: Verifying file";

VerifyHash(File.OpenRead(Downloader.Package.FileName), CancellationToken).Wait();
Expand All @@ -100,9 +102,13 @@ private void SetEndStatus(object sender, System.ComponentModel.AsyncCompletedEve
{
Description = $"{IndexEntry.Id}: Extracting file";

var reader = ReaderFactory.Open(File.OpenRead(Downloader.Package.FileName));
reader.MoveToNextEntry();
reader.WriteEntryTo(OutputFile);
//var reader = ReaderFactory.Open(File.OpenRead(Downloader.Package.FileName));
//reader.MoveToNextEntry();
//reader.WriteEntryTo(OutputFile);
//reader.Dispose();

var reader = new Archive(Downloader.Package.FileName);
reader.Entries.First().Extract(OutputFile.FullName);
reader.Dispose();
}
else
Expand All @@ -120,6 +126,8 @@ private void SetEndStatus(object sender, System.ComponentModel.AsyncCompletedEve
File.Delete(Downloader.Package.FileName);
}

Progress = 100;

Description = $"{IndexEntry.Id}: Download completed";
}
}
Expand Down
56 changes: 56 additions & 0 deletions cli/Kryptor.Cli/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
"resolved": "2.5.0",
"contentHash": "xVszQd1HA/EusmX/xGeomPBy6YIY5soaCKPuoqbOpZHP5Sfvg2xYdliBIQtcKVDUgNj+5G++LkFPP2Mtm0DITA=="
},
"Aspose.Zip": {
"type": "Direct",
"requested": "[24.7.0, )",
"resolved": "24.7.0",
"contentHash": "/GJ3J21peZrZ4BoONkm+xOGkUh6X96rQO1bhUjgI5DRr8Kq6nC9hJHqeL+ZS/DSuK826WNIQFg7qDVSUzwZPUg==",
"dependencies": {
"System.Text.Encoding.CodePages": "4.5.0"
}
},
"CommandLineParser": {
"type": "Direct",
"requested": "[2.9.1, )",
Expand Down Expand Up @@ -74,6 +83,11 @@
"resolved": "1.1.1",
"contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "VdLJOCXhZaEMY7Hm2GKiULmn7IEPFE4XC5LPSfBVCUIA8YLZVh846gtfBJalsPQF2PlzdD7ecX7DZEulJ402ZQ=="
},
"Microsoft.SourceLink.AzureRepos.Git": {
"type": "Transitive",
"resolved": "1.1.1",
Expand Down Expand Up @@ -147,6 +161,20 @@
"resolved": "4.5.5",
"contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw=="
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "YrzNWduCDHhUaSRBxHxL11UkM2fD6y8hITHis4/LbQZ6vj3vdRjoH3IoPWWC9uDXK2wHIqn+b5gv1Np/VKyM1g=="
},
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "S0wEUiKcLvRlkFUXca8uio1UQ5bYQzYgOmOKtCqaBQC3GR9AJjh43otcM32IGsAyvadFTaAMw9Irm6dS4Evfng==",
"dependencies": {
"Microsoft.NETCore.Platforms": "2.0.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.0"
}
},
"System.ValueTuple": {
"type": "Transitive",
"resolved": "4.5.0",
Expand Down Expand Up @@ -183,6 +211,15 @@
"resolved": "2.5.0",
"contentHash": "xVszQd1HA/EusmX/xGeomPBy6YIY5soaCKPuoqbOpZHP5Sfvg2xYdliBIQtcKVDUgNj+5G++LkFPP2Mtm0DITA=="
},
"Aspose.Zip": {
"type": "Direct",
"requested": "[24.7.0, )",
"resolved": "24.7.0",
"contentHash": "/GJ3J21peZrZ4BoONkm+xOGkUh6X96rQO1bhUjgI5DRr8Kq6nC9hJHqeL+ZS/DSuK826WNIQFg7qDVSUzwZPUg==",
"dependencies": {
"System.Text.Encoding.CodePages": "4.5.0"
}
},
"CommandLineParser": {
"type": "Direct",
"requested": "[2.9.1, )",
Expand Down Expand Up @@ -249,6 +286,11 @@
"resolved": "1.1.1",
"contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q=="
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "VdLJOCXhZaEMY7Hm2GKiULmn7IEPFE4XC5LPSfBVCUIA8YLZVh846gtfBJalsPQF2PlzdD7ecX7DZEulJ402ZQ=="
},
"Microsoft.SourceLink.AzureRepos.Git": {
"type": "Transitive",
"resolved": "1.1.1",
Expand Down Expand Up @@ -322,6 +364,20 @@
"resolved": "4.5.5",
"contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw=="
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "YrzNWduCDHhUaSRBxHxL11UkM2fD6y8hITHis4/LbQZ6vj3vdRjoH3IoPWWC9uDXK2wHIqn+b5gv1Np/VKyM1g=="
},
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "S0wEUiKcLvRlkFUXca8uio1UQ5bYQzYgOmOKtCqaBQC3GR9AJjh43otcM32IGsAyvadFTaAMw9Irm6dS4Evfng==",
"dependencies": {
"Microsoft.NETCore.Platforms": "2.0.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.0"
}
},
"System.ValueTuple": {
"type": "Transitive",
"resolved": "4.5.0",
Expand Down

0 comments on commit b999bdf

Please sign in to comment.