diff --git a/BizHawk.Emulation.Cores/Waterbox/PeRunner.cs b/BizHawk.Emulation.Cores/Waterbox/PeRunner.cs index 5fbf1d1362..8852d3588d 100644 --- a/BizHawk.Emulation.Cores/Waterbox/PeRunner.cs +++ b/BizHawk.Emulation.Cores/Waterbox/PeRunner.cs @@ -5,6 +5,7 @@ using PeNet; using System; using System.Collections.Generic; using System.IO; +using System.IO.Compression; using System.Linq; using System.Runtime.InteropServices; using System.Text; @@ -671,7 +672,30 @@ namespace BizHawk.Emulation.Cores.Waterbox var moduleName = todoModules.Dequeue(); if (!_exports.ContainsKey(moduleName)) { - var module = new PeWrapper(moduleName, File.ReadAllBytes(Path.Combine(opt.Path, moduleName)), _nextStart); + var path = Path.Combine(opt.Path, moduleName); + var gzpath = path + ".gz"; + byte[] data; + if (File.Exists(gzpath)) + { + using (var fs = new FileStream(gzpath, FileMode.Open, FileAccess.Read)) + { + var tmp = new byte[4]; + fs.Seek(-4, SeekOrigin.End); + fs.Read(tmp, 0, 4); + int size = BitConverter.ToInt32(tmp, 0); + data = new byte[size]; + var ms = new MemoryStream(data); + fs.Seek(0, SeekOrigin.Begin); + using (var gs = new GZipStream(fs, CompressionMode.Decompress)) + gs.CopyTo(ms); + } + } + else + { + data = File.ReadAllBytes(path); + } + + var module = new PeWrapper(moduleName, data, _nextStart); ComputeNextStart(module.Size); AddMemoryBlock(module.Memory); _savestateComponents.Add(module); diff --git a/output64/dll/ss.wbx b/output64/dll/ss.wbx deleted file mode 100644 index 983245e4ef..0000000000 Binary files a/output64/dll/ss.wbx and /dev/null differ diff --git a/output64/dll/ss.wbx.gz b/output64/dll/ss.wbx.gz new file mode 100644 index 0000000000..f74e860f06 Binary files /dev/null and b/output64/dll/ss.wbx.gz differ