Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions NETReactorSlayer.Core/Helper/DeobUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License

using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Security.Cryptography;
using dnlib.DotNet;
Expand Down Expand Up @@ -89,5 +90,20 @@ public static byte[] Inflate(byte[] data, int start, int len, Inflater inflater)

return memStream.ToArray();
}

public static byte[] BrotliDecompress(byte[] data)
{
#if (NETSTANDARD || NET)
var memoryStream = new MemoryStream();
using (var brotliStream = new BrotliStream(new MemoryStream(data), CompressionMode.Decompress))
{
brotliStream.CopyTo(memoryStream);
}

return memoryStream.ToArray();
#else
throw new ApplicationException("Brotli decompression not available on .NET Framework version. Use .NET6+ version");
#endif
}
}
}
Loading