using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using TagLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CyberMetadata")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CyberMetadata")] [assembly: AssemblyTitle("CyberMetadata")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CyberMetadata { [BepInPlugin("CyberMetadata", "CyberMetadata", "1.0.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; new Harmony("CyberMetadata").PatchAll(); Logger.LogInfo((object)"Plugin CyberMetadata is loaded!"); } } [HarmonyPatch] public static class Patches { [HarmonyPrefix] [HarmonyPatch(typeof(CustomMusicPlaylistEditor), "GetSongMetadataFromFilepath")] public static bool GSMFP(SongIdentifier id, ref Sprite ___defaultIcon, ref SongMetadata __result) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) SongMetadata val = new SongMetadata(new FileInfo(id.path).Name, ___defaultIcon, 1); File val2 = File.Create(id.path); if (!string.IsNullOrEmpty(val2.Tag.Title)) { if (!string.IsNullOrEmpty(val2.Tag.FirstPerformer)) { val.displayName = val2.Tag.FirstPerformer + " - " + val2.Tag.Title; } else { val.displayName = val2.Tag.Title; } } if (val2.Tag.Pictures != null && val2.Tag.Pictures.Length != 0) { byte[] data = val2.Tag.Pictures[0].Data.Data; Texture2D val3 = new Texture2D(2, 2); if (ImageConversion.LoadImage(val3, data)) { Sprite icon = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), new Vector2(0.5f, 0.5f)); val.icon = icon; } } __result = val; return false; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "CyberMetadata"; public const string PLUGIN_NAME = "CyberMetadata"; public const string PLUGIN_VERSION = "1.0.0"; } }