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
12
Program.cs
12
Program.cs
|
@ -3,15 +3,15 @@ internal class Program
|
||||||
{
|
{
|
||||||
private static void Main(string[] args)
|
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();
|
int count = br.ReadInt32();
|
||||||
for (int i = 0; i < size; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
string name = br.ReadString();
|
string name = br.ReadString();
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(args[0]) + "//" + Path.GetFileNameWithoutExtension(args[0]) + "//" + Path.GetDirectoryName(name));
|
Directory.CreateDirectory(path + Path.GetDirectoryName(name));
|
||||||
using FileStream FS = File.Create(Path.GetDirectoryName(args[0]) + "//" + Path.GetFileNameWithoutExtension(args[0]) + "//" + name);
|
BinaryWriter bw = new(File.Create(path + name));
|
||||||
BinaryWriter bw = new(FS);
|
|
||||||
bw.Write(br.ReadBytes(br.ReadInt32()));
|
bw.Write(br.ReadBytes(br.ReadInt32()));
|
||||||
bw.Close();
|
bw.Close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue