Initial commit

This commit is contained in:
2026-07-03 16:37:12 +07:00
commit 63b8c1ea8b
1931 changed files with 640587 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using System.Reflection;
namespace RobotNet10.ScriptEditor.Helpers.Webcil;
public class WasmWebcilWrapper
{
private static readonly FieldInfo FieldInfoPrefix = typeof(WebcilWasmWrapper).GetField("s_wasmWrapperPrefix", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.GetField)!;
public static byte[] GetPrefix()
{
#if NET7_0_OR_GREATER
return GetPrefixValue<ReadOnlyMemory<byte>>().ToArray();
#else
return GetPrefixValue<byte[]>();
#endif
}
private static T GetPrefixValue<T>()
{
return (T)FieldInfoPrefix.GetValue(null)!;
}
}