mirror of
https://github.com/MichaelHinrichs/Ratalaika-Games-Spiller-Engine-Extractor.git
synced 2024-11-09 15:57:51 +00:00
Read file table and file data in parallel.
This commit is contained in:
parent
4be341e718
commit
822d591ce6
1 changed files with 8 additions and 11 deletions
19
Program.cs
19
Program.cs
|
@ -42,22 +42,19 @@ namespace Ratalaika_Games_Spiller_Engine_Extractor
|
||||||
|
|
||||||
br = new(fileTable);
|
br = new(fileTable);
|
||||||
br.BaseStream.Position = 0;
|
br.BaseStream.Position = 0;
|
||||||
System.Collections.Generic.List<FileTableEntry> table = new();
|
BinaryReader data = new(fileData);
|
||||||
while (br.BaseStream.Position < br.BaseStream.Length)
|
|
||||||
table.Add(new());
|
|
||||||
br.Close();
|
|
||||||
|
|
||||||
br = new(fileData);
|
|
||||||
string path = Path.GetDirectoryName(args[0]) + "\\" + Path.GetFileNameWithoutExtension(args[0]) + "\\";
|
string path = Path.GetDirectoryName(args[0]) + "\\" + Path.GetFileNameWithoutExtension(args[0]) + "\\";
|
||||||
foreach(FileTableEntry file in table)
|
|
||||||
|
while (br.BaseStream.Position < br.BaseStream.Length)
|
||||||
{
|
{
|
||||||
br.BaseStream.Position = file.end - file.Size;
|
FileTableEntry file = new();
|
||||||
|
data.BaseStream.Position = file.end - file.Size;
|
||||||
Directory.CreateDirectory(path + Path.GetDirectoryName(file.name));
|
Directory.CreateDirectory(path + Path.GetDirectoryName(file.name));
|
||||||
using FileStream FS = File.Create(path + file.name);
|
BinaryWriter bw = new(File.Create(path + file.name));
|
||||||
BinaryWriter bw = new(FS);
|
bw.Write(data.ReadBytes(file.Size));
|
||||||
bw.Write(br.ReadBytes(file.Size));
|
|
||||||
bw.Close();
|
bw.Close();
|
||||||
}
|
}
|
||||||
|
data.Close();
|
||||||
br.Close();
|
br.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue