Skip to content

Commit 1e69ea7

Browse files
committed
fix decompress #150
1 parent e25a60e commit 1e69ea7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

FreeMote.PsBuild/PsbDecompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public static void ExtractArchive(string filePath, string key, Dictionary<string
586586
var fileLength = new FileInfo(body).Length;
587587
using var mmFile =
588588
MemoryMappedFile.CreateFromFile(body, FileMode.Open, name, 0, MemoryMappedFileAccess.Read);
589-
Parallel.ForEach(dic.OrderByDescending(kv => PsbExtension.ArchiveInfo_GetLengthFromRangeList((PsbList) kv.Value, archiveInfoType)), new ParallelOptions { MaxDegreeOfParallelism = 4}, pair => //Math.Max(Environment.ProcessorCount / 2, 2)
589+
Parallel.ForEach(dic.OrderByDescending(kv => PsbExtension.ArchiveInfo_GetLengthFromRangeList((PsbList) kv.Value, archiveInfoType)), new ParallelOptions { MaxDegreeOfParallelism = Math.Max(Environment.ProcessorCount / 2, 2) }, pair => //Math.Max(Environment.ProcessorCount / 2, 2)
590590
{
591591
//Console.WriteLine($"{(extractAll ? "Decompiling" : "Extracting")} {pair.Key} ...");
592592
var range = (PsbList) pair.Value;

FreeMote.Psb/Plugins/MdfShell.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static void ToPsb(Stream stream, byte[] outBuffer, Dictionary<string, obj
108108
toBeDecompressedStream.Position = pos;
109109
}
110110

111-
toBeDecompressedStream.Seek(10, SeekOrigin.Current);
111+
toBeDecompressedStream.Seek(10, SeekOrigin.Begin);
112112
ZlibCompress.Decompress(toBeDecompressedStream, outBuffer);
113113
if (encoded)
114114
{

0 commit comments

Comments
 (0)