From 6ac2fc54b2af7d01ae7c92d122fcba08a5e04d7b Mon Sep 17 00:00:00 2001 From: MichaelHinrichs Date: Wed, 8 Jan 2025 13:09:46 -0600 Subject: [PATCH] Unzip bzip2 files Closes #1. --- Generation-Streets-Extractor.csproj | 4 ++++ Program.cs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Generation-Streets-Extractor.csproj b/Generation-Streets-Extractor.csproj index 0677451..0b38c6a 100644 --- a/Generation-Streets-Extractor.csproj +++ b/Generation-Streets-Extractor.csproj @@ -6,4 +6,8 @@ Generation_Streets_Extractor + + + + diff --git a/Program.cs b/Program.cs index d9e41d0..b7c7fd4 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,5 @@ //Written for Generation Streets. https://store.steampowered.com/app/887970 +using ICSharpCode.SharpZipLib.BZip2; using System.IO; using System.IO.Compression; @@ -43,7 +44,7 @@ namespace Generation_Streets_Extractor } else if (sub.isCompressed == 2) { - bw.Write(br.ReadBytes(sub.sizeCompressed)); + BZip2.Decompress(new MemoryStream(br.ReadBytes(sub.sizeCompressed)), bw.BaseStream, true); bw.Close(); n++; continue;