diff --git a/BizHawk.Emulation.Cores/Waterbox/PeWrapper.cs b/BizHawk.Emulation.Cores/Waterbox/PeWrapper.cs index 14bba95a76..8f2e5d3d28 100644 --- a/BizHawk.Emulation.Cores/Waterbox/PeWrapper.cs +++ b/BizHawk.Emulation.Cores/Waterbox/PeWrapper.cs @@ -344,6 +344,13 @@ namespace BizHawk.Emulation.Cores.Waterbox Marshal.Copy(Z.US(_imports.Start), impData, 0, (int)_imports.Size); WaterboxUtils.ZeroMemory(Z.US(_imports.Start), (long)_imports.Size); } + byte[] invData = null; + if (_invisible != null) + { + invData = new byte[_invisible.Size]; + Marshal.Copy(Z.US(_invisible.Start), invData, 0, (int)_invisible.Size); + WaterboxUtils.ZeroMemory(Z.US(_invisible.Start), (long)_invisible.Size); + } Memory.SaveXorSnapshot(); if (_imports != null) { @@ -351,6 +358,10 @@ namespace BizHawk.Emulation.Cores.Waterbox _imports.W = false; Memory.Protect(_imports.Start, _imports.Size, _imports.Prot); } + if (_invisible != null) + { + Marshal.Copy(invData, 0, Z.US(_invisible.Start), (int)_invisible.Size); + } if (_sealed != null) { _sealed.W = false;