Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few fixes for .NET Core and Reactor v6.9.8.0 and 7.0.0.0 #96

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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