public override void Init(byte[] code, byte[] pdb) { appdomain = new ILRuntime.Runtime.Enviorment.AppDomain(); codeStream = new MemoryStream(code); if (pdb != null) { pdbStream = new MemoryStream(pdb); PdbReaderProvider pv = new ILRuntime.Mono.Cecil.Pdb.PdbReaderProvider(); appdomain.LoadAssembly(codeStream, pdbStream, pv); } else { appdomain.LoadAssembly(codeStream); } InitILRuntime(appdomain); }
private void LoadHotfixAssemblyWithPDB() { TextAsset dllAsset = LoadDLL(); TextAsset pdbAsset = LoadPDB(); if (_isEnableILRuntime) { _dllStream = new MemoryStream(dllAsset.bytes); _pdbStream = new MemoryStream(pdbAsset.bytes); var symbolReader = new ILRuntime.Mono.Cecil.Pdb.PdbReaderProvider(); ILRDomain = new ILRuntime.Runtime.Enviorment.AppDomain(); ILRDomain.LoadAssembly(_dllStream, _pdbStream, symbolReader); } else { #if ENABLE_IL2CPP throw new NotImplementedException("You must enable ILRuntime when with IL2CPP mode."); #endif _monoAssembly = Assembly.Load(dllAsset.bytes, pdbAsset.bytes); } }