diff --git a/BinaryObjectScanner/FileType/SGA.cs b/BinaryObjectScanner/FileType/SGA.cs index 0049920b..225ca2c8 100644 --- a/BinaryObjectScanner/FileType/SGA.cs +++ b/BinaryObjectScanner/FileType/SGA.cs @@ -230,7 +230,6 @@ namespace BinaryObjectScanner.FileType { // Inflate the data into the buffer var zstream = new ZLib.z_stream_s(); - var state = new ZLib.inflate_state(); data = new byte[outputFileSize]; unsafe { @@ -244,10 +243,7 @@ namespace BinaryObjectScanner.FileType zstream.avail_out = (uint)data.Length; zstream.total_out = 0; - state.strm = zstream; - state.mode = ZLib.inflate_mode.HEAD; - - zstream.i_state = state; + ZLib.inflateInit_(zstream, ZLib.zlibVersion(), compressedData.Length); int zret = ZLib.inflate(zstream, 1); } } diff --git a/BinaryObjectScanner/Packer/CExe.cs b/BinaryObjectScanner/Packer/CExe.cs index b6db5d0e..4365b1c5 100644 --- a/BinaryObjectScanner/Packer/CExe.cs +++ b/BinaryObjectScanner/Packer/CExe.cs @@ -88,7 +88,6 @@ namespace BinaryObjectScanner.Packer { // Inflate the data into the buffer var zstream = new ZLib.z_stream_s(); - var state = new ZLib.inflate_state(); data = new byte[payload.Length * 4]; unsafe { @@ -102,10 +101,7 @@ namespace BinaryObjectScanner.Packer zstream.avail_out = (uint)data.Length; zstream.total_out = 0; - state.strm = zstream; - state.mode = ZLib.inflate_mode.HEAD; - - zstream.i_state = state; + ZLib.inflateInit_(zstream, ZLib.zlibVersion(), payload.Length); int zret = ZLib.inflate(zstream, 1); } }