mirror of
https://github.com/MichaelHinrichs/FEZ-Unpacker.git
synced 2024-12-22 07:10:03 +02:00
refactor
This commit is contained in:
parent
92f6a24432
commit
53c0d198e4
1 changed files with 7 additions and 7 deletions
14
Program.cs
14
Program.cs
|
@ -3,17 +3,17 @@ internal class Program
|
|||
{
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
BinaryReader br = new BinaryReader(File.OpenRead(args[0]));
|
||||
BinaryReader br = new(File.OpenRead(args[0]));
|
||||
string path = Path.GetDirectoryName(args[0]) + "//" + Path.GetFileNameWithoutExtension(args[0]) + "//";
|
||||
|
||||
int size = br.ReadInt32();
|
||||
for (int i = 0; i < size; i++)
|
||||
int count = br.ReadInt32();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
string name = br.ReadString();
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(args[0]) + "//" + Path.GetFileNameWithoutExtension(args[0]) + "//" + Path.GetDirectoryName(name));
|
||||
using FileStream FS = File.Create(Path.GetDirectoryName(args[0]) + "//" + Path.GetFileNameWithoutExtension(args[0]) + "//" + name);
|
||||
BinaryWriter bw = new(FS);
|
||||
Directory.CreateDirectory(path + Path.GetDirectoryName(name));
|
||||
BinaryWriter bw = new(File.Create(path + name));
|
||||
bw.Write(br.ReadBytes(br.ReadInt32()));
|
||||
bw.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue