public void InitFlash() { if (!EoLHook.IsHooked) { EoLHook.Hook(); } FlashUtil.Flash?.Dispose(); AxShockwaveFlash flash = new AxShockwaveFlash(); flash.BeginInit(); flash.Name = "flash"; flash.Dock = DockStyle.Fill; flash.TabIndex = 0; flash.FlashCall += FlashUtil.CallHandler; gameContainer.Controls.Add(flash); flash.EndInit(); FlashUtil.Flash = flash; byte[] swf = File.ReadAllBytes("rbot.swf"); using (MemoryStream stream = new MemoryStream()) using (BinaryWriter writer = new BinaryWriter(stream)) { writer.Write(8 + swf.Length); writer.Write(1432769894); writer.Write(swf.Length); writer.Write(swf); writer.Seek(0, SeekOrigin.Begin); flash.OcxState = new AxHost.State(stream, 1, false, null); } EoLHook.Unhook(); }
private void InitFlashMovie() { byte[] aqlitegrimoire = Resources.aqlitegrimoire; using (MemoryStream memoryStream = new MemoryStream()) { using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream)) { binaryWriter.Write(8 + aqlitegrimoire.Length); binaryWriter.Write(1432769894); binaryWriter.Write(aqlitegrimoire.Length); binaryWriter.Write(aqlitegrimoire); memoryStream.Seek(0L, SeekOrigin.Begin); this.flashPlayer.OcxState = new AxHost.State(memoryStream, 1, false, null); } } EoLHook.Unhook(); }