From 31c38fced3d0e4d26fba4b9b9415e450108535ac Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Tue, 27 Jan 2026 18:24:36 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E3=80=90=E5=8F=8D=E7=A0=B4=E8=A7=A3?= =?UTF-8?q?=E3=80=91=E6=8E=A5=E5=85=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectNLD/Assets/Editor/KedrExtension.meta | 3 + .../Assets/Editor/KedrExtension/HashUtil.cs | 16 ++ .../Editor/KedrExtension/HashUtil.cs.meta | 3 + .../Editor/KedrExtension/KedrExtensionMenu.cs | 47 ++++ .../KedrExtension/KedrExtensionMenu.cs.meta | 3 + .../KedrExtension/KedrExtensionSettings.cs | 68 +++++ .../KedrExtensionSettings.cs.meta | 3 + .../KedrExtension/OpCodeShuffleCommand.cs | 50 ++++ .../OpCodeShuffleCommand.cs.meta | 3 + .../Assets/Editor/KedrExtension/Opcode.cs | 263 ++++++++++++++++++ .../Editor/KedrExtension/Opcode.cs.meta | 3 + .../Assets/Editor/KedrExtension/Patches.cs | 96 +++++++ .../Editor/KedrExtension/Patches.cs.meta | 3 + .../Assets/Editor/KedrExtension/RandomUtil.cs | 13 + .../Editor/KedrExtension/RandomUtil.cs.meta | 3 + .../Editor/KedrExtension/Templates.meta | 3 + .../KedrExtension/Templates/Opcodes.cpp.tpl | 100 +++++++ .../Templates/Opcodes.cpp.tpl.meta | 3 + .../KedrExtension/Templates/Opcodes.h.tpl | 106 +++++++ .../Templates/Opcodes.h.tpl.meta | 3 + .../Editor/KedrExtension/ThirdParty.meta | 8 + .../KedrExtension/ThirdParty/0Harmony.dll | 3 + .../ThirdParty/0Harmony.dll.meta | 33 +++ 23 files changed, 836 insertions(+) create mode 100644 ProjectNLD/Assets/Editor/KedrExtension.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/HashUtil.cs create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/HashUtil.cs.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionMenu.cs create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionMenu.cs.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionSettings.cs create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionSettings.cs.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/OpCodeShuffleCommand.cs create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/OpCodeShuffleCommand.cs.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Opcode.cs create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Opcode.cs.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Patches.cs create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Patches.cs.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/RandomUtil.cs create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/RandomUtil.cs.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Templates.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.cpp.tpl create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.cpp.tpl.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.h.tpl create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.h.tpl.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/ThirdParty.meta create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll create mode 100644 ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll.meta diff --git a/ProjectNLD/Assets/Editor/KedrExtension.meta b/ProjectNLD/Assets/Editor/KedrExtension.meta new file mode 100644 index 00000000000..fb3ee5bfdf8 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2f924162a120446a945bec50417f2be6 +timeCreated: 1769251206 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/HashUtil.cs b/ProjectNLD/Assets/Editor/KedrExtension/HashUtil.cs new file mode 100644 index 00000000000..d6481ffd55b --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/HashUtil.cs @@ -0,0 +1,16 @@ +internal static class HashUtil +{ + public static uint Hash(string str) + { + const uint prime = 0x1000193; + var hash = 0x811c9dc5; + + foreach (var ch in str) + { + hash ^= ch; + hash *= prime; + } + + return hash; + } +} \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/HashUtil.cs.meta b/ProjectNLD/Assets/Editor/KedrExtension/HashUtil.cs.meta new file mode 100644 index 00000000000..47e12e1957d --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/HashUtil.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a54fc1c229504366b92fee8c196aff41 +timeCreated: 1769351453 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionMenu.cs b/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionMenu.cs new file mode 100644 index 00000000000..c2d1506a7b6 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionMenu.cs @@ -0,0 +1,47 @@ +using HybridCLR.Editor.Commands; +using Obfuz.Settings; +using Obfuz4HybridCLR; +using HybridCLR.Editor.Installer; +using UnityEditor; +using UnityEditor.Build; +using UnityEngine; + +public class KedrExtensionMenu +{ + [MenuItem("HybridCLR/KedrExtension/Settings...")] + public static void OpenSettings() => SettingsService.OpenProjectSettings("Project/KedrExtension"); + + [MenuItem("HybridCLR/KedrExtension/GenerateAll")] + public static void GenerateAll() + { + var installer = new InstallerController(); + if (!installer.HasInstalledHybridCLR()) + { + throw new BuildFailedException("You have not initialized HybridCLR, please install it via menu 'HybridCLR/Installer'"); + } + + var target = EditorUserBuildSettings.activeBuildTarget; + CompileDllCommand.CompileDll(target); + Il2CppDefGeneratorCommand.GenerateIl2CppDef(); + + if (ObfuzSettings.Instance.polymorphicDllSettings.enable) + { + PrebuildCommandExt.GeneratePolymorphicCodes(); + } + else + { + Debug.LogWarning("Polymorphic code generation is disabled."); + } + + // New + OpCodeShuffleCommand.GenerateOpCodes(); + + LinkGeneratorCommand.GenerateLinkXml(target); + StripAOTDllCommand.GenerateStripedAOTDlls(target); + + var obfuscatedHotUpdateDllPath = PrebuildCommandExt.GetObfuscatedHotUpdateAssemblyOutputPath(target); + ObfuscateUtil.ObfuscateHotUpdateAssemblies(target, obfuscatedHotUpdateDllPath); + PrebuildCommandExt.GenerateMethodBridgeAndReversePInvokeWrapper(target, obfuscatedHotUpdateDllPath); + PrebuildCommandExt.GenerateAOTGenericReference(target, obfuscatedHotUpdateDllPath); + } +} \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionMenu.cs.meta b/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionMenu.cs.meta new file mode 100644 index 00000000000..d1ca1661dc9 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionMenu.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4bdc7a464a314b2697cf26e0619285f6 +timeCreated: 1769251133 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionSettings.cs b/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionSettings.cs new file mode 100644 index 00000000000..7e46b04d136 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionSettings.cs @@ -0,0 +1,68 @@ +using System.IO; +using UnityEditor; +using UnityEditorInternal; +using UnityEngine; + +public class KedrExtensionSettings : ScriptableObject +{ + private static string SettingsPath => "ProjectSettings/KedrExtensionSettings.asset"; + private static KedrExtensionSettings _instance; + + public bool enableOpcodeShuffle = false; + + public static KedrExtensionSettings Instance + { + get + { + if (_instance) return _instance; + var arr = InternalEditorUtility.LoadSerializedFileAndForget(SettingsPath); + + if (arr.Length == 1 && arr[0] is KedrExtensionSettings settings) + { + _instance = settings; + } + else + { + _instance = CreateInstance(); + } + + return _instance; + } + } + + public static void Save() + { + if (!_instance) return; + Directory.CreateDirectory(Path.GetDirectoryName(SettingsPath)!); + Object[] obj = { _instance }; + InternalEditorUtility.SaveToSerializedFileAndForget(obj, SettingsPath, true); + } +} + +public class KedrExtensionSettingsProvider : SettingsProvider +{ + private SerializedObject _serializedObject; + + [SettingsProvider] + public static SettingsProvider CreateProvider() => new KedrExtensionSettingsProvider(); + + private KedrExtensionSettingsProvider() : base("Project/KedrExtension", SettingsScope.Project) + { + } + + public override void OnGUI(string searchContext) + { + _serializedObject ??= new SerializedObject(KedrExtensionSettings.Instance); + _serializedObject.Update(); + + EditorGUI.BeginChangeCheck(); + + EditorGUILayout.PropertyField(_serializedObject.FindProperty("enableOpcodeShuffle")); + + if (EditorGUI.EndChangeCheck()) + { + _serializedObject.ApplyModifiedProperties(); + KedrExtensionSettings.Save(); + } + } +} \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionSettings.cs.meta b/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionSettings.cs.meta new file mode 100644 index 00000000000..97698f454b8 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/KedrExtensionSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f7ff0cf4c5c64d5fa0937a7be361d73f +timeCreated: 1769360995 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/OpCodeShuffleCommand.cs b/ProjectNLD/Assets/Editor/KedrExtension/OpCodeShuffleCommand.cs new file mode 100644 index 00000000000..aa07159362a --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/OpCodeShuffleCommand.cs @@ -0,0 +1,50 @@ +using System.IO; +using System.Linq; +using HarmonyLib; +using HybridCLR.Editor; +using HybridCLR.Editor.Template; +using Obfuz.Settings; +using UnityEditor; + +public static class OpCodeShuffleCommand +{ + private static string TemplatePath => "Assets/Editor/KedrExtension/Templates"; + + [InitializeOnLoadMethod] + private static void Init() + { + var harmony = new Harmony("kedr.polymorphic.il"); + harmony.PatchAll(); + } + + public static void GenerateOpCodes() + { + var opcodeMapping = Enumerable.Range(0, 248).Select(x => (byte)x).ToArray(); + + if (ObfuzSettings.Instance.polymorphicDllSettings.enable && KedrExtensionSettings.Instance.enableOpcodeShuffle) + { + var seed = HashUtil.Hash(ObfuzSettings.Instance.polymorphicDllSettings.codeGenerationSecretKey); + var rng = new System.Random((int)seed); + RandomUtil.Shuffle(opcodeMapping, rng); + } + + var reverseOpcodeMapping = new byte[opcodeMapping.Length]; + for (byte i = 0; i < opcodeMapping.Length; i++) reverseOpcodeMapping[opcodeMapping[i]] = i; + + { + var frr = new FileRegionReplace(File.ReadAllText($"{TemplatePath}/Opcodes.h.tpl")); + var lines = Opcode.List.Select((op, i) => $"{op.Name} = {opcodeMapping[i]},"); + frr.Replace("OPCODE_VALUE", string.Join('\n', lines)); + var opcodesPath = $"{SettingsUtil.LocalIl2CppDir}/libil2cpp/hybridclr/metadata/Opcodes.h"; + frr.Commit(opcodesPath); + } + + { + var frr = new FileRegionReplace(File.ReadAllText($"{TemplatePath}/Opcodes.cpp.tpl")); + var lines = reverseOpcodeMapping.Select(i => Opcode.List[i].Info); + frr.Replace("OPCODE_INFO", string.Join('\n', lines)); + var opcodesPath = $"{SettingsUtil.LocalIl2CppDir}/libil2cpp/hybridclr/metadata/Opcodes.cpp"; + frr.Commit(opcodesPath); + } + } +} \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/OpCodeShuffleCommand.cs.meta b/ProjectNLD/Assets/Editor/KedrExtension/OpCodeShuffleCommand.cs.meta new file mode 100644 index 00000000000..9953e366324 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/OpCodeShuffleCommand.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d379f53cce6e47908894ad3dae565fd4 +timeCreated: 1769359627 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Opcode.cs b/ProjectNLD/Assets/Editor/KedrExtension/Opcode.cs new file mode 100644 index 00000000000..23edc7588fe --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Opcode.cs @@ -0,0 +1,263 @@ +public class Opcode +{ + public string Name { get; private set; } + public string Info { get; private set; } + + private Opcode(string name, string info) + { + Name = name; + Info = info; + } + + public static readonly Opcode[] List = + { + new Opcode("NOP", "{ ArgType::None, 0, 255, OpcodeValue::NOP, FlowType::Next, 0 },"), + new Opcode("BREAK", "{ ArgType::None, 0, 255, OpcodeValue::BREAK, FlowType::Break, 0 },"), + new Opcode("LDARG_0", "{ ArgType::None, 0, 255, OpcodeValue::LDARG_0, FlowType::Next, 0 },"), + new Opcode("LDARG_1", "{ ArgType::None, 0, 255, OpcodeValue::LDARG_1, FlowType::Next, 1 },"), + new Opcode("LDARG_2", "{ ArgType::None, 0, 255, OpcodeValue::LDARG_2, FlowType::Next, 2 },"), + new Opcode("LDARG_3", "{ ArgType::None, 0, 255, OpcodeValue::LDARG_3, FlowType::Next, 3 },"), + new Opcode("LDLOC_0", "{ ArgType::None, 0, 255, OpcodeValue::LDLOC_0, FlowType::Next, 0 },"), + new Opcode("LDLOC_1", "{ ArgType::None, 0, 255, OpcodeValue::LDLOC_1, FlowType::Next, 1 },"), + new Opcode("LDLOC_2", "{ ArgType::None, 0, 255, OpcodeValue::LDLOC_2, FlowType::Next, 2 },"), + new Opcode("LDLOC_3", "{ ArgType::None, 0, 255, OpcodeValue::LDLOC_3, FlowType::Next, 3 },"), + new Opcode("STLOC_0", "{ ArgType::None, 0, 255, OpcodeValue::STLOC_0, FlowType::Next, 0 },"), + new Opcode("STLOC_1", "{ ArgType::None, 0, 255, OpcodeValue::STLOC_1, FlowType::Next, 1 },"), + new Opcode("STLOC_2", "{ ArgType::None, 0, 255, OpcodeValue::STLOC_2, FlowType::Next, 2 },"), + new Opcode("STLOC_3", "{ ArgType::None, 0, 255, OpcodeValue::STLOC_3, FlowType::Next, 3 },"), + new Opcode("LDARG_S", "{ ArgType::Data, 1, 255, OpcodeValue::LDARG_S, FlowType::Next, 0 },"), + new Opcode("LDARGA_S", "{ ArgType::Data, 1, 255, OpcodeValue::LDARGA_S, FlowType::Next, 0 },"), + new Opcode("STARG_S", "{ ArgType::Data, 1, 255, OpcodeValue::STARG_S, FlowType::Next, 0 },"), + new Opcode("LDLOC_S", "{ ArgType::Data, 1, 255, OpcodeValue::LDLOC_S, FlowType::Next, 0 },"), + new Opcode("LDLOCA_S", "{ ArgType::Data, 1, 255, OpcodeValue::LDLOCA_S, FlowType::Next, 0 },"), + new Opcode("STLOC_S", "{ ArgType::Data, 1, 255, OpcodeValue::STLOC_S, FlowType::Next, 0 },"), + new Opcode("LDNULL", "{ ArgType::None, 0, 255, OpcodeValue::LDNULL, FlowType::Next, 0 },"), + new Opcode("LDC_I4_M1", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_M1, FlowType::Next, -1 },"), + new Opcode("LDC_I4_0", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_0, FlowType::Next, 0 },"), + new Opcode("LDC_I4_1", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_1, FlowType::Next, 1 },"), + new Opcode("LDC_I4_2", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_2, FlowType::Next, 2 },"), + new Opcode("LDC_I4_3", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_3, FlowType::Next, 3 },"), + new Opcode("LDC_I4_4", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_4, FlowType::Next, 4 },"), + new Opcode("LDC_I4_5", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_5, FlowType::Next, 5 },"), + new Opcode("LDC_I4_6", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_6, FlowType::Next, 6 },"), + new Opcode("LDC_I4_7", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_7, FlowType::Next, 7 },"), + new Opcode("LDC_I4_8", "{ ArgType::None, 0, 255, OpcodeValue::LDC_I4_8, FlowType::Next, 8 },"), + new Opcode("LDC_I4_S", "{ ArgType::Data, 1, 255, OpcodeValue::LDC_I4_S, FlowType::Next, 0 },"), + new Opcode("LDC_I4", "{ ArgType::Data, 4, 255, OpcodeValue::LDC_I4, FlowType::Next, 0 },"), + new Opcode("LDC_I8", "{ ArgType::Data, 8, 255, OpcodeValue::LDC_I8, FlowType::Next, 0 },"), + new Opcode("LDC_R4", "{ ArgType::Data, 4, 255, OpcodeValue::LDC_R4, FlowType::Next, 0 },"), + new Opcode("LDC_R8", "{ ArgType::Data, 8, 255, OpcodeValue::LDC_R8, FlowType::Next, 0 },"), + new Opcode("UNUSED99", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED99, FlowType::Next, 0 },"), + new Opcode("DUP", "{ ArgType::None, 0, 255, OpcodeValue::DUP, FlowType::Next, 0 },"), + new Opcode("POP", "{ ArgType::None, 0, 255, OpcodeValue::POP, FlowType::Next, 0 },"), + new Opcode("JMP", "{ ArgType::Data, 4, 255, OpcodeValue::JMP, FlowType::Call, 0 },"), + new Opcode("CALL", "{ ArgType::Data, 4, 255, OpcodeValue::CALL, FlowType::Call, 0 },"), + new Opcode("CALLI", "{ ArgType::Data, 4, 255, OpcodeValue::CALLI, FlowType::Call, 0 },"), + new Opcode("RET", "{ ArgType::StaticBranch, 0, 255, OpcodeValue::RET, FlowType::Return, 0 },"), + new Opcode("BR_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BR_S, FlowType::Branch, 0 },"), + new Opcode("BRFALSE_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BRFALSE_S, FlowType::CondBranch, 0 },"), + new Opcode("BRTRUE_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BRTRUE_S, FlowType::CondBranch, 0 },"), + new Opcode("BEQ_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BEQ_S, FlowType::CondBranch, 0 },"), + new Opcode("BGE_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BGE_S, FlowType::CondBranch, 0 },"), + new Opcode("BGT_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BGT_S, FlowType::CondBranch, 0 },"), + new Opcode("BLE_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BLE_S, FlowType::CondBranch, 0 },"), + new Opcode("BLT_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BLT_S, FlowType::CondBranch, 0 },"), + new Opcode("BNE_UN_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BNE_UN_S, FlowType::CondBranch, 0 },"), + new Opcode("BGE_UN_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BGE_UN_S, FlowType::CondBranch, 0 },"), + new Opcode("BGT_UN_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BGT_UN_S, FlowType::CondBranch, 0 },"), + new Opcode("BLE_UN_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BLE_UN_S, FlowType::CondBranch, 0 },"), + new Opcode("BLT_UN_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::BLT_UN_S, FlowType::CondBranch, 0 },"), + new Opcode("BR", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BR, FlowType::Branch, 0 },"), + new Opcode("BRFALSE", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BRFALSE, FlowType::CondBranch, 0 },"), + new Opcode("BRTRUE", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BRTRUE, FlowType::CondBranch, 0 },"), + new Opcode("BEQ", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BEQ, FlowType::CondBranch, 0 },"), + new Opcode("BGE", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BGE, FlowType::CondBranch, 0 },"), + new Opcode("BGT", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BGT, FlowType::CondBranch, 0 },"), + new Opcode("BLE", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BLE, FlowType::CondBranch, 0 },"), + new Opcode("BLT", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BLT, FlowType::CondBranch, 0 },"), + new Opcode("BNE_UN", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BNE_UN, FlowType::CondBranch, 0 },"), + new Opcode("BGE_UN", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BGE_UN, FlowType::CondBranch, 0 },"), + new Opcode("BGT_UN", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BGT_UN, FlowType::CondBranch, 0 },"), + new Opcode("BLE_UN", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BLE_UN, FlowType::CondBranch, 0 },"), + new Opcode("BLT_UN", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::BLT_UN, FlowType::CondBranch, 0 },"), + new Opcode("SWITCH", "{ ArgType::Switch, -1, 255, OpcodeValue::SWITCH, FlowType::CondBranch, 0 },"), + new Opcode("LDIND_I1", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_I1, FlowType::Next, 0 },"), + new Opcode("LDIND_U1", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_U1, FlowType::Next, 0 },"), + new Opcode("LDIND_I2", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_I2, FlowType::Next, 0 },"), + new Opcode("LDIND_U2", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_U2, FlowType::Next, 0 },"), + new Opcode("LDIND_I4", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_I4, FlowType::Next, 0 },"), + new Opcode("LDIND_U4", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_U4, FlowType::Next, 0 },"), + new Opcode("LDIND_I8", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_I8, FlowType::Next, 0 },"), + new Opcode("LDIND_I", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_I, FlowType::Next, 0 },"), + new Opcode("LDIND_R4", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_R4, FlowType::Next, 0 },"), + new Opcode("LDIND_R8", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_R8, FlowType::Next, 0 },"), + new Opcode("LDIND_REF", "{ ArgType::None, 0, 255, OpcodeValue::LDIND_REF, FlowType::Next, 0 },"), + new Opcode("STIND_REF", "{ ArgType::None, 0, 255, OpcodeValue::STIND_REF, FlowType::Next, 0 },"), + new Opcode("STIND_I1", "{ ArgType::None, 0, 255, OpcodeValue::STIND_I1, FlowType::Next, 0 },"), + new Opcode("STIND_I2", "{ ArgType::None, 0, 255, OpcodeValue::STIND_I2, FlowType::Next, 0 },"), + new Opcode("STIND_I4", "{ ArgType::None, 0, 255, OpcodeValue::STIND_I4, FlowType::Next, 0 },"), + new Opcode("STIND_I8", "{ ArgType::None, 0, 255, OpcodeValue::STIND_I8, FlowType::Next, 0 },"), + new Opcode("STIND_R4", "{ ArgType::None, 0, 255, OpcodeValue::STIND_R4, FlowType::Next, 0 },"), + new Opcode("STIND_R8", "{ ArgType::None, 0, 255, OpcodeValue::STIND_R8, FlowType::Next, 0 },"), + new Opcode("ADD", "{ ArgType::None, 0, 255, OpcodeValue::ADD, FlowType::Next, 0 },"), + new Opcode("SUB", "{ ArgType::None, 0, 255, OpcodeValue::SUB, FlowType::Next, 0 },"), + new Opcode("MUL", "{ ArgType::None, 0, 255, OpcodeValue::MUL, FlowType::Next, 0 },"), + new Opcode("DIV", "{ ArgType::None, 0, 255, OpcodeValue::DIV, FlowType::Next, 0 },"), + new Opcode("DIV_UN", "{ ArgType::None, 0, 255, OpcodeValue::DIV_UN, FlowType::Next, 0 },"), + new Opcode("REM", "{ ArgType::None, 0, 255, OpcodeValue::REM, FlowType::Next, 0 },"), + new Opcode("REM_UN", "{ ArgType::None, 0, 255, OpcodeValue::REM_UN, FlowType::Next, 0 },"), + new Opcode("AND", "{ ArgType::None, 0, 255, OpcodeValue::AND, FlowType::Next, 0 },"), + new Opcode("OR", "{ ArgType::None, 0, 255, OpcodeValue::OR, FlowType::Next, 0 },"), + new Opcode("XOR", "{ ArgType::None, 0, 255, OpcodeValue::XOR, FlowType::Next, 0 },"), + new Opcode("SHL", "{ ArgType::None, 0, 255, OpcodeValue::SHL, FlowType::Next, 0 },"), + new Opcode("SHR", "{ ArgType::None, 0, 255, OpcodeValue::SHR, FlowType::Next, 0 },"), + new Opcode("SHR_UN", "{ ArgType::None, 0, 255, OpcodeValue::SHR_UN, FlowType::Next, 0 },"), + new Opcode("NEG", "{ ArgType::None, 0, 255, OpcodeValue::NEG, FlowType::Next, 0 },"), + new Opcode("NOT", "{ ArgType::None, 0, 255, OpcodeValue::NOT, FlowType::Next, 0 },"), + new Opcode("CONV_I1", "{ ArgType::None, 0, 255, OpcodeValue::CONV_I1, FlowType::Next, 0 },"), + new Opcode("CONV_I2", "{ ArgType::None, 0, 255, OpcodeValue::CONV_I2, FlowType::Next, 0 },"), + new Opcode("CONV_I4", "{ ArgType::None, 0, 255, OpcodeValue::CONV_I4, FlowType::Next, 0 },"), + new Opcode("CONV_I8", "{ ArgType::None, 0, 255, OpcodeValue::CONV_I8, FlowType::Next, 0 },"), + new Opcode("CONV_R4", "{ ArgType::None, 0, 255, OpcodeValue::CONV_R4, FlowType::Next, 0 },"), + new Opcode("CONV_R8", "{ ArgType::None, 0, 255, OpcodeValue::CONV_R8, FlowType::Next, 0 },"), + new Opcode("CONV_U4", "{ ArgType::None, 0, 255, OpcodeValue::CONV_U4, FlowType::Next, 0 },"), + new Opcode("CONV_U8", "{ ArgType::None, 0, 255, OpcodeValue::CONV_U8, FlowType::Next, 0 },"), + new Opcode("CALLVIRT", "{ ArgType::Data, 4, 255, OpcodeValue::CALLVIRT, FlowType::Call, 0 },"), + new Opcode("CPOBJ", "{ ArgType::Data, 4, 255, OpcodeValue::CPOBJ, FlowType::Next, 0 },"), + new Opcode("LDOBJ", "{ ArgType::Data, 4, 255, OpcodeValue::LDOBJ, FlowType::Next, 0 },"), + new Opcode("LDSTR", "{ ArgType::Data, 4, 255, OpcodeValue::LDSTR, FlowType::Next, 0 },"), + new Opcode("NEWOBJ", "{ ArgType::Data, 4, 255, OpcodeValue::NEWOBJ, FlowType::Call, 0 },"), + new Opcode("CASTCLASS", "{ ArgType::Data, 4, 255, OpcodeValue::CASTCLASS, FlowType::Next, 0 },"), + new Opcode("ISINST", "{ ArgType::Data, 4, 255, OpcodeValue::ISINST, FlowType::Next, 0 },"), + new Opcode("CONV_R_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_R_UN, FlowType::Next, 0 },"), + new Opcode("UNUSED58", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED58, FlowType::Next, 0 },"), + new Opcode("UNUSED1", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED1, FlowType::Next, 0 },"), + new Opcode("UNBOX", "{ ArgType::Data, 4, 255, OpcodeValue::UNBOX, FlowType::Next, 0 },"), + new Opcode("THROW", "{ ArgType::StaticBranch, 0, 255, OpcodeValue::THROW, FlowType::Throw, 0 },"), + new Opcode("LDFLD", "{ ArgType::Data, 4, 255, OpcodeValue::LDFLD, FlowType::Next, 0 },"), + new Opcode("LDFLDA", "{ ArgType::Data, 4, 255, OpcodeValue::LDFLDA, FlowType::Next, 0 },"), + new Opcode("STFLD", "{ ArgType::Data, 4, 255, OpcodeValue::STFLD, FlowType::Next, 0 },"), + new Opcode("LDSFLD", "{ ArgType::Data, 4, 255, OpcodeValue::LDSFLD, FlowType::Next, 0 },"), + new Opcode("LDSFLDA", "{ ArgType::Data, 4, 255, OpcodeValue::LDSFLDA, FlowType::Next, 0 },"), + new Opcode("STSFLD", "{ ArgType::Data, 4, 255, OpcodeValue::STSFLD, FlowType::Next, 0 },"), + new Opcode("STOBJ", "{ ArgType::Data, 4, 255, OpcodeValue::STOBJ, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I1_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I1_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I2_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I2_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I4_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I4_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I8_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I8_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U1_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U1_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U2_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U2_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U4_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U4_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U8_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U8_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I_UN, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U_UN", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U_UN, FlowType::Next, 0 },"), + new Opcode("BOX", "{ ArgType::Data, 4, 255, OpcodeValue::BOX, FlowType::Next, 0 },"), + new Opcode("NEWARR", "{ ArgType::Data, 4, 255, OpcodeValue::NEWARR, FlowType::Next, 0 },"), + new Opcode("LDLEN", "{ ArgType::None, 0, 255, OpcodeValue::LDLEN, FlowType::Next, 0 },"), + new Opcode("LDELEMA", "{ ArgType::Data, 4, 255, OpcodeValue::LDELEMA, FlowType::Next, 0 },"), + new Opcode("LDELEM_I1", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_I1, FlowType::Next, 0 },"), + new Opcode("LDELEM_U1", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_U1, FlowType::Next, 0 },"), + new Opcode("LDELEM_I2", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_I2, FlowType::Next, 0 },"), + new Opcode("LDELEM_U2", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_U2, FlowType::Next, 0 },"), + new Opcode("LDELEM_I4", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_I4, FlowType::Next, 0 },"), + new Opcode("LDELEM_U4", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_U4, FlowType::Next, 0 },"), + new Opcode("LDELEM_I8", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_I8, FlowType::Next, 0 },"), + new Opcode("LDELEM_I", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_I, FlowType::Next, 0 },"), + new Opcode("LDELEM_R4", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_R4, FlowType::Next, 0 },"), + new Opcode("LDELEM_R8", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_R8, FlowType::Next, 0 },"), + new Opcode("LDELEM_REF", "{ ArgType::None, 0, 255, OpcodeValue::LDELEM_REF, FlowType::Next, 0 },"), + new Opcode("STELEM_I", "{ ArgType::None, 0, 255, OpcodeValue::STELEM_I, FlowType::Next, 0 },"), + new Opcode("STELEM_I1", "{ ArgType::None, 0, 255, OpcodeValue::STELEM_I1, FlowType::Next, 0 },"), + new Opcode("STELEM_I2", "{ ArgType::None, 0, 255, OpcodeValue::STELEM_I2, FlowType::Next, 0 },"), + new Opcode("STELEM_I4", "{ ArgType::None, 0, 255, OpcodeValue::STELEM_I4, FlowType::Next, 0 },"), + new Opcode("STELEM_I8", "{ ArgType::None, 0, 255, OpcodeValue::STELEM_I8, FlowType::Next, 0 },"), + new Opcode("STELEM_R4", "{ ArgType::None, 0, 255, OpcodeValue::STELEM_R4, FlowType::Next, 0 },"), + new Opcode("STELEM_R8", "{ ArgType::None, 0, 255, OpcodeValue::STELEM_R8, FlowType::Next, 0 },"), + new Opcode("STELEM_REF", "{ ArgType::None, 0, 255, OpcodeValue::STELEM_REF, FlowType::Next, 0 },"), + new Opcode("LDELEM", "{ ArgType::Data, 4, 255, OpcodeValue::LDELEM, FlowType::Next, 0 },"), + new Opcode("STELEM", "{ ArgType::Data, 4, 255, OpcodeValue::STELEM, FlowType::Next, 0 },"), + new Opcode("UNBOX_ANY", "{ ArgType::Data, 4, 255, OpcodeValue::UNBOX_ANY, FlowType::Next, 0 },"), + new Opcode("UNUSED5", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED5, FlowType::Next, 0 },"), + new Opcode("UNUSED6", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED6, FlowType::Next, 0 },"), + new Opcode("UNUSED7", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED7, FlowType::Next, 0 },"), + new Opcode("UNUSED8", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED8, FlowType::Next, 0 },"), + new Opcode("UNUSED9", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED9, FlowType::Next, 0 },"), + new Opcode("UNUSED10", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED10, FlowType::Next, 0 },"), + new Opcode("UNUSED11", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED11, FlowType::Next, 0 },"), + new Opcode("UNUSED12", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED12, FlowType::Next, 0 },"), + new Opcode("UNUSED13", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED13, FlowType::Next, 0 },"), + new Opcode("UNUSED14", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED14, FlowType::Next, 0 },"), + new Opcode("UNUSED15", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED15, FlowType::Next, 0 },"), + new Opcode("UNUSED16", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED16, FlowType::Next, 0 },"), + new Opcode("UNUSED17", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED17, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I1", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I1, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U1", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U1, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I2", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I2, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U2", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U2, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I4", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I4, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U4", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U4, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I8", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I8, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U8", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U8, FlowType::Next, 0 },"), + new Opcode("UNUSED50", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED50, FlowType::Next, 0 },"), + new Opcode("UNUSED18", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED18, FlowType::Next, 0 },"), + new Opcode("UNUSED19", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED19, FlowType::Next, 0 },"), + new Opcode("UNUSED20", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED20, FlowType::Next, 0 },"), + new Opcode("UNUSED21", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED21, FlowType::Next, 0 },"), + new Opcode("UNUSED22", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED22, FlowType::Next, 0 },"), + new Opcode("UNUSED23", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED23, FlowType::Next, 0 },"), + new Opcode("REFANYVAL", "{ ArgType::Data, 4, 255, OpcodeValue::REFANYVAL, FlowType::Next, 0 },"), + new Opcode("CKFINITE", "{ ArgType::None, 0, 255, OpcodeValue::CKFINITE, FlowType::Next, 0 },"), + new Opcode("UNUSED24", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED24, FlowType::Next, 0 },"), + new Opcode("UNUSED25", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED25, FlowType::Next, 0 },"), + new Opcode("MKREFANY", "{ ArgType::Data, 4, 255, OpcodeValue::MKREFANY, FlowType::Next, 0 },"), + new Opcode("UNUSED59", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED59, FlowType::Next, 0 },"), + new Opcode("UNUSED60", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED60, FlowType::Next, 0 },"), + new Opcode("UNUSED61", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED61, FlowType::Next, 0 },"), + new Opcode("UNUSED62", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED62, FlowType::Next, 0 },"), + new Opcode("UNUSED63", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED63, FlowType::Next, 0 },"), + new Opcode("UNUSED64", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED64, FlowType::Next, 0 },"), + new Opcode("UNUSED65", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED65, FlowType::Next, 0 },"), + new Opcode("UNUSED66", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED66, FlowType::Next, 0 },"), + new Opcode("UNUSED67", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED67, FlowType::Next, 0 },"), + new Opcode("LDTOKEN", "{ ArgType::Data, 4, 255, OpcodeValue::LDTOKEN, FlowType::Next, 0 },"), + new Opcode("CONV_U2", "{ ArgType::None, 0, 255, OpcodeValue::CONV_U2, FlowType::Next, 0 },"), + new Opcode("CONV_U1", "{ ArgType::None, 0, 255, OpcodeValue::CONV_U1, FlowType::Next, 0 },"), + new Opcode("CONV_I", "{ ArgType::None, 0, 255, OpcodeValue::CONV_I, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_I", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_I, FlowType::Next, 0 },"), + new Opcode("CONV_OVF_U", "{ ArgType::None, 0, 255, OpcodeValue::CONV_OVF_U, FlowType::Next, 0 },"), + new Opcode("ADD_OVF", "{ ArgType::None, 0, 255, OpcodeValue::ADD_OVF, FlowType::Next, 0 },"), + new Opcode("ADD_OVF_UN", "{ ArgType::None, 0, 255, OpcodeValue::ADD_OVF_UN, FlowType::Next, 0 },"), + new Opcode("MUL_OVF", "{ ArgType::None, 0, 255, OpcodeValue::MUL_OVF, FlowType::Next, 0 },"), + new Opcode("MUL_OVF_UN", "{ ArgType::None, 0, 255, OpcodeValue::MUL_OVF_UN, FlowType::Next, 0 },"), + new Opcode("SUB_OVF", "{ ArgType::None, 0, 255, OpcodeValue::SUB_OVF, FlowType::Next, 0 },"), + new Opcode("SUB_OVF_UN", "{ ArgType::None, 0, 255, OpcodeValue::SUB_OVF_UN, FlowType::Next, 0 },"), + new Opcode("ENDFINALLY", "{ ArgType::StaticBranch, 0, 255, OpcodeValue::ENDFINALLY, FlowType::Return, 0 },"), + new Opcode("LEAVE", "{ ArgType::BranchTarget, 4, 255, OpcodeValue::LEAVE, FlowType::Branch, 0 },"), + new Opcode("LEAVE_S", "{ ArgType::BranchTarget, 1, 255, OpcodeValue::LEAVE_S, FlowType::Branch, 0 },"), + new Opcode("STIND_I", "{ ArgType::None, 0, 255, OpcodeValue::STIND_I, FlowType::Next, 0 },"), + new Opcode("CONV_U", "{ ArgType::None, 0, 255, OpcodeValue::CONV_U, FlowType::Next, 0 },"), + new Opcode("UNUSED26", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED26, FlowType::Next, 0 },"), + new Opcode("UNUSED27", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED27, FlowType::Next, 0 },"), + new Opcode("UNUSED28", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED28, FlowType::Next, 0 },"), + new Opcode("UNUSED29", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED29, FlowType::Next, 0 },"), + new Opcode("UNUSED30", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED30, FlowType::Next, 0 },"), + new Opcode("UNUSED31", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED31, FlowType::Next, 0 },"), + new Opcode("UNUSED32", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED32, FlowType::Next, 0 },"), + new Opcode("UNUSED33", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED33, FlowType::Next, 0 },"), + new Opcode("UNUSED34", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED34, FlowType::Next, 0 },"), + new Opcode("UNUSED35", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED35, FlowType::Next, 0 },"), + new Opcode("UNUSED36", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED36, FlowType::Next, 0 },"), + new Opcode("UNUSED37", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED37, FlowType::Next, 0 },"), + new Opcode("UNUSED38", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED38, FlowType::Next, 0 },"), + new Opcode("UNUSED39", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED39, FlowType::Next, 0 },"), + new Opcode("UNUSED40", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED40, FlowType::Next, 0 },"), + new Opcode("UNUSED41", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED41, FlowType::Next, 0 },"), + new Opcode("UNUSED42", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED42, FlowType::Next, 0 },"), + new Opcode("UNUSED43", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED43, FlowType::Next, 0 },"), + new Opcode("UNUSED44", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED44, FlowType::Next, 0 },"), + new Opcode("UNUSED45", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED45, FlowType::Next, 0 },"), + new Opcode("UNUSED46", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED46, FlowType::Next, 0 },"), + new Opcode("UNUSED47", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED47, FlowType::Next, 0 },"), + new Opcode("UNUSED48", "{ ArgType::None, 0, 255, OpcodeValue::UNUSED48, FlowType::Next, 0 },"), + }; +} \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Opcode.cs.meta b/ProjectNLD/Assets/Editor/KedrExtension/Opcode.cs.meta new file mode 100644 index 00000000000..8c68205be13 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Opcode.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 93278fac1f0d4baea60db599f3f6affb +timeCreated: 1769252314 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Patches.cs b/ProjectNLD/Assets/Editor/KedrExtension/Patches.cs new file mode 100644 index 00000000000..89c8c7a4608 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Patches.cs @@ -0,0 +1,96 @@ +using System; +using System.Linq; +using dnlib.DotNet.Emit; +using dnlib.DotNet.PolymorphicWriter; +using dnlib.DotNet.Writer; +using HarmonyLib; +using Obfuz.Settings; + +internal static class DnlibPolymorphicContext +{ + [ThreadStatic] public static byte[] OpcodeMapping; +} + +[HarmonyPatch(typeof(PolymorphicMetadata), "WriteMethodBodies")] +static class WriteMethodBodiesPatch +{ + static void Prefix() + { + if (!KedrExtensionSettings.Instance.enableOpcodeShuffle) + return; + + var seed = HashUtil.Hash(ObfuzSettings.Instance.polymorphicDllSettings.codeGenerationSecretKey); + var opcodeMapping = Enumerable.Range(0, 248).Select(x => (byte)x).ToArray(); + var rng = new System.Random((int)seed); + RandomUtil.Shuffle(opcodeMapping, rng); + + DnlibPolymorphicContext.OpcodeMapping = opcodeMapping; + } + + static void Finalizer() + { + DnlibPolymorphicContext.OpcodeMapping = null; + } +} + +[HarmonyPatch(typeof(MethodBodyWriterBase), "WriteOpCode")] +static class WriteOpCodePatch +{ + static bool Prefix(ref ArrayWriter writer, Instruction instr) + { + if (DnlibPolymorphicContext.OpcodeMapping is null) + return true; + + WriteOpCode(ref writer, instr); + return false; + } + + private static void WriteOpCode(ref ArrayWriter writer, Instruction instr) + { + var code = (int)instr.OpCode.Code; + int num = code >> 8; + + if (code <= 255) + { + if (code < (int)dnlib.DotNet.Emit.Code.Prefix7) + { + code = DnlibPolymorphicContext.OpcodeMapping[code]; + } + + writer.WriteByte((byte)code); + return; + } + + switch (num) + { + case 240: + case 241: + case 242: + case 243: + case 244: + case 245: + case 246: + case 247: + case 248: + case 249: + case 250: + case 251: + case 254: + writer.WriteByte((byte)num); + writer.WriteByte((byte)instr.OpCode.Code); + return; + } + + switch (instr.OpCode.Code) + { + case dnlib.DotNet.Emit.Code.UNKNOWN1: + writer.WriteByte(0); + break; + case dnlib.DotNet.Emit.Code.UNKNOWN2: + writer.WriteUInt16(0); + break; + default: + throw new Exception("Unknown opcode"); + } + } +} \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Patches.cs.meta b/ProjectNLD/Assets/Editor/KedrExtension/Patches.cs.meta new file mode 100644 index 00000000000..35e38d63dc3 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Patches.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d90bfe061d4540ae98a5874651d08765 +timeCreated: 1769346479 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/RandomUtil.cs b/ProjectNLD/Assets/Editor/KedrExtension/RandomUtil.cs new file mode 100644 index 00000000000..13075a05205 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/RandomUtil.cs @@ -0,0 +1,13 @@ +using System; + +internal static class RandomUtil +{ + public static void Shuffle(T[] array, Random random) + { + for (var num = array.Length - 1; num > 0; num--) + { + var index = random.Next(num + 1); + (array[num], array[index]) = (array[index], array[num]); + } + } +} \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/RandomUtil.cs.meta b/ProjectNLD/Assets/Editor/KedrExtension/RandomUtil.cs.meta new file mode 100644 index 00000000000..e7ce0fefc08 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/RandomUtil.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 46e5ded5306d4193a357f9646d60a114 +timeCreated: 1769350665 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Templates.meta b/ProjectNLD/Assets/Editor/KedrExtension/Templates.meta new file mode 100644 index 00000000000..b871e5f6b89 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Templates.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 45073aab7c974d87a6d7ba3ba2e3b23c +timeCreated: 1769251223 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.cpp.tpl b/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.cpp.tpl new file mode 100644 index 00000000000..09be04318e5 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.cpp.tpl @@ -0,0 +1,100 @@ +#include "Opcodes.h" + +#include "MetadataUtil.h" + +namespace hybridclr +{ +namespace metadata +{ + OpCodeInfo g_opcodeInfos[OpcodeCount] = + { + //!!!{{OPCODE_INFO + + //!!!}}OPCODE_INFO + { ArgType::None, 0, 255, OpcodeValue::PREFIX7, FlowType::Meta, 0 }, + { ArgType::None, 0, 255, OpcodeValue::PREFIX6, FlowType::Meta, 0 }, + { ArgType::None, 0, 255, OpcodeValue::PREFIX5, FlowType::Meta, 0 }, + { ArgType::None, 0, 255, OpcodeValue::PREFIX4, FlowType::Meta, 0 }, + { ArgType::None, 0, 255, OpcodeValue::PREFIX3, FlowType::Meta, 0 }, + { ArgType::None, 0, 255, OpcodeValue::PREFIX2, FlowType::Meta, 0 }, + { ArgType::None, 0, 255, OpcodeValue::PREFIX1, FlowType::Meta, 0 }, + { ArgType::None, 0, 255, OpcodeValue::PREFIXREF, FlowType::Meta, 0 }, + { ArgType::None, 0, 254, OpcodeValue::ARGLIST, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::CEQ, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::CGT, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::CGT_UN, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::CLT, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::CLT_UN, FlowType::Next, 0 }, + { ArgType::Data, 4, 254, OpcodeValue::LDFTN, FlowType::Next, 0 }, + { ArgType::Data, 4, 254, OpcodeValue::LDVIRTFTN, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::UNUSED56, FlowType::Next, 0 }, + { ArgType::Data, 2, 254, OpcodeValue::LDARG, FlowType::Next, 0 }, + { ArgType::Data, 2, 254, OpcodeValue::LDARGA, FlowType::Next, 0 }, + { ArgType::Data, 2, 254, OpcodeValue::STARG, FlowType::Next, 0 }, + { ArgType::Data, 2, 254, OpcodeValue::LDLOC, FlowType::Next, 0 }, + { ArgType::Data, 2, 254, OpcodeValue::LDLOCA, FlowType::Next, 0 }, + { ArgType::Data, 2, 254, OpcodeValue::STLOC, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::LOCALLOC, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::UNUSED57, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::ENDFILTER, FlowType::Return, 0 }, + { ArgType::Data, 1, 254, OpcodeValue::UNALIGNED_, FlowType::Meta, 0 }, + { ArgType::None, 0, 254, OpcodeValue::VOLATILE_, FlowType::Meta, 0 }, + { ArgType::None, 0, 254, OpcodeValue::TAIL_, FlowType::Meta, 0 }, + { ArgType::Data, 4, 254, OpcodeValue::INITOBJ, FlowType::Next, 0 }, + { ArgType::Data, 4, 254, OpcodeValue::CONSTRAINED_, FlowType::Meta, 0 }, + { ArgType::None, 0, 254, OpcodeValue::CPBLK, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::INITBLK, FlowType::Next, 0 }, + { ArgType::Data, 1, 254, OpcodeValue::NO_, FlowType::Next, 0 }, + { ArgType::StaticBranch, 0, 254, OpcodeValue::RETHROW, FlowType::Throw, 0 }, + { ArgType::None, 0, 254, OpcodeValue::UNUSED, FlowType::Next, 0 }, + { ArgType::Data, 4, 254, OpcodeValue::SIZEOF, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::REFANYTYPE, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::READONLY_, FlowType::Meta, 0 }, + { ArgType::None, 0, 254, OpcodeValue::UNUSED53, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::UNUSED54, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::UNUSED55, FlowType::Next, 0 }, + { ArgType::None, 0, 254, OpcodeValue::UNUSED70, FlowType::Next, 0 }, + { ArgType::None, 0, 0, OpcodeValue::ILLEGAL, FlowType::Meta, 0 }, + { ArgType::None, 0, 0, OpcodeValue::ENDMAC, FlowType::Meta, 0 }, + }; + + const OpCodeInfo* DecodeOpCodeInfo(const byte*& ip, const byte* end) + { + if (ip >= end) + { + return nullptr; + } + byte c = *ip; + if (c < (byte)OpcodeValue::PREFIX7) + { + return &g_opcodeInfos[c]; + } + else if (c == (byte)OpcodeValue::PREFIX1) + { + ++ip; + if (ip >= end) + { + return nullptr; + } + return &g_opcodeInfos[(int)(*ip) + (int)256]; + } + else + { + IL2CPP_ASSERT(false && "unknown prefix"); + return nullptr; + } + } + + uint32_t GetOpCodeSize(const byte*& ip, const OpCodeInfo* opCodeInfo) + { + if (opCodeInfo->inlineType != ArgType::Switch) + { + return 1 + opCodeInfo->inlineParam; + } + else + { + return metadata::GetI4LittleEndian(ip + 1) * 4 + 5; + } + } +} +} \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.cpp.tpl.meta b/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.cpp.tpl.meta new file mode 100644 index 00000000000..e51c12aadea --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.cpp.tpl.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5bb248beffc141cc9de9051b74dc1114 +timeCreated: 1769348363 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.h.tpl b/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.h.tpl new file mode 100644 index 00000000000..7122d953155 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.h.tpl @@ -0,0 +1,106 @@ +#pragma once + +#include "../CommonDef.h" + +namespace hybridclr +{ +namespace metadata +{ + enum class OpcodeValue : uint8_t + { + //!!!{{OPCODE_VALUE + + //!!!}}OPCODE_VALUE + PREFIX7 = 248, + PREFIX6 = 249, + PREFIX5 = 250, + PREFIX4 = 251, + PREFIX3 = 252, + PREFIX2 = 253, + PREFIX1 = 254, + PREFIXREF = 255, + ARGLIST = 0, + CEQ = 1, + CGT = 2, + CGT_UN = 3, + CLT = 4, + CLT_UN = 5, + LDFTN = 6, + LDVIRTFTN = 7, + UNUSED56 = 8, + LDARG = 9, + LDARGA = 10, + STARG = 11, + LDLOC = 12, + LDLOCA = 13, + STLOC = 14, + LOCALLOC = 15, + UNUSED57 = 16, + ENDFILTER = 17, + UNALIGNED_ = 18, + VOLATILE_ = 19, + TAIL_ = 20, + INITOBJ = 21, + CONSTRAINED_ = 22, + CPBLK = 23, + INITBLK = 24, + NO_ = 25, + RETHROW = 26, + UNUSED = 27, + SIZEOF = 28, + REFANYTYPE = 29, + READONLY_ = 30, + UNUSED53 = 31, + UNUSED54 = 32, + UNUSED55 = 33, + UNUSED70 = 34, + ILLEGAL = 0, + ENDMAC = 0, + }; + + enum class FlowType + { + Next, + Branch, + CondBranch, + Call, + Return, + Meta, + Throw, + Break, + }; + + enum class ArgType + { + None, + Data, + StaticBranch, + BranchTarget, + Switch, + }; + + enum class OpCodeKind + { + Primitive, + ObjModel, + Macro, + Prefix, + Nternal, + }; + + struct OpCodeInfo + { + ArgType inlineType; + int32_t inlineParam; + uint8_t flag; + OpcodeValue baseOpValue; + FlowType flow; + int32_t constValue; + }; + + const int OpcodeCount = 293; + extern OpCodeInfo g_opcodeInfos[OpcodeCount]; + const OpCodeInfo* DecodeOpCodeInfo(const byte*& ip, const byte* end); + uint32_t GetOpCodeSize(const byte*& ip, const OpCodeInfo* opCodeInfo); +} +} diff --git a/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.h.tpl.meta b/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.h.tpl.meta new file mode 100644 index 00000000000..bae382a83e8 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/Templates/Opcodes.h.tpl.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: aac9ffefb7d94ade9f9b20c3b7d72119 +timeCreated: 1769251256 \ No newline at end of file diff --git a/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty.meta b/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty.meta new file mode 100644 index 00000000000..78bb02c0f12 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 476d5384fffe3ae49aec8684c3f03a8e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll b/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll new file mode 100644 index 00000000000..a5faa02772b --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77e6901ecc606aec66c2a972782a3779e4f50c037d2d165eb7ececdd4d8f794d +size 2461696 diff --git a/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll.meta b/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll.meta new file mode 100644 index 00000000000..63d6ecbe069 --- /dev/null +++ b/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: c79e180049bafa24bba6eca16558f653 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: From 7142e268594188d0c62472c29c7a5e91fe8ef9d7 Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Tue, 27 Jan 2026 18:27:24 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E3=80=90=E6=89=93=E5=8C=85=E3=80=91?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Editor/Common/BuildLauncherInEditor.cs | 4 +++- .../ProjectSettings/KedrExtensionSettings.asset | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ProjectNLD/ProjectSettings/KedrExtensionSettings.asset diff --git a/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs b/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs index d6c38745720..9fa2b69ca1b 100644 --- a/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs +++ b/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs @@ -77,7 +77,9 @@ class BuildLauncher ObfuzMenu.GenerateEncryptionVM(); ObfuzMenu.SaveSecretFile(); - PrebuildCommandExt.GenerateAll(); + // obfuz 的 generate all + // PrebuildCommandExt.GenerateAll(); + KedrExtensionMenu.GenerateAll(); // Obfuz 需要重新混淆热更后的dll而不是直接拷贝 HotUpadeEditorHelper.CompileAndObfuscateAndCopyDllToTarget(); diff --git a/ProjectNLD/ProjectSettings/KedrExtensionSettings.asset b/ProjectNLD/ProjectSettings/KedrExtensionSettings.asset new file mode 100644 index 00000000000..39ac2b318b6 --- /dev/null +++ b/ProjectNLD/ProjectSettings/KedrExtensionSettings.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f7ff0cf4c5c64d5fa0937a7be361d73f, type: 3} + m_Name: + m_EditorClassIdentifier: + enableOpcodeShuffle: 1 From 0e741a134abbe543d8484f44e00cd886cfeff585 Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Tue, 27 Jan 2026 18:31:33 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E3=80=90=E5=8F=8D=E7=A0=B4=E8=A7=A3?= =?UTF-8?q?=E3=80=91=E5=A2=9E=E5=8A=A0=E6=B8=A0=E9=81=93=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tool/Channels/dev_anti/ChannelSetting.yaml | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Tool/Channels/dev_anti/ChannelSetting.yaml diff --git a/Tool/Channels/dev_anti/ChannelSetting.yaml b/Tool/Channels/dev_anti/ChannelSetting.yaml new file mode 100644 index 00000000000..dc3fb440fde --- /dev/null +++ b/Tool/Channels/dev_anti/ChannelSetting.yaml @@ -0,0 +1,64 @@ +# 宏定义列表,供脚本添加到 PlayerSettings 的宏定义中 +Define_list: + - BI_PHXH # BI + - LOGIN_PHONE # 手机登录 + +# 应用包名 +PackageName: "com.phxh.nlddev" + +# 是否海外渠道 +IsOversea: false + +# 多语言配置 +Language: "Lan_CN" + +# 当前版本号 +Version: "0.8.0" + +# BuildCode +BuildCode: 4 + +# 构建资源远程上传路径 +OssRemoteUploadPath: "oss://nld-dev-yhpxkqgzatnrmbws/client_res/Build" +AssetsEndPoint: "oss-cn-chengdu.aliyuncs.com" + +# 阿里云 OSS 配置 +ConfigAccessKeyId: "LTAI5tPLKwa1cSD1woBLvNBq" +ConfigAccessKeySecret: "aPvNg3waBzXas8nnn2lo46o1TEQY8X" +ConfigBucketName: "nld-dev-yhpxkqgzatnrmbws" +ConfigURL: "http://yhpxkqgzatnrmbws.kedrgame.com" + +# http请求配置 +AppAccessKey: "0SoE48O9sayjkG8J" +AppKey: "uUi_UI1oMKWo0VOSN1zme17Z70-FlAv3Lcx2mNhoYe4=" + +# 崩溃监控配置(仅 Android) +CrashSight_Android: + id: "669a94ce69" # 崩溃上报的 App ID + key: "d9412717-2416-4270-b8bc-f7a0805f988f" # 崩溃上报的 Key + +# TalkingData初始化 +TalkingData: + appid: "2D0025FE20F34810BADABEFC00D32D22" # 测试包的App ID + channel: "Dev" # 上报渠道 + +Packages: +# - CrashSight@latest + - Poco@latest + - WXPay@1.0.0 + - AliPay@0.0.1 + - ThinkingData@1.0.0 + - TalkingData@0.0.1 + - AIhelper@latest + +# 爱加密配置 +Encryption: + ApiUrl: "https://runenc.ijiami.cn/common" # 爱加密API地址 + StrategyName: "Dev加固策略" # 加密策略名称 + Username: "PHXHJG" # 爱加密用户名 + Password: "LaMYRIx0UzFgCIR" # 爱加密密码 + ToolPath: "${WORKSPACE}/Tool/build_tools/encryptionTool-v4.3.6-202409.jar" # 加密工具路径 + NeedSign: true # 是否需要签名 + SignName: "朴合辛火安卓" # 签名名称 + SignVersion: 4 # 签名版本(1-8) + RetryCount: 3 # 异常重试次数 From 054d7630eb295b4b9e3947f3bbd172d37d82a72e Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Tue, 27 Jan 2026 18:38:44 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E3=80=90=E5=8F=8D=E7=A0=B4=E8=A7=A3?= =?UTF-8?q?=E3=80=91=E5=B1=8F=E8=94=BD=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs b/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs index 9fa2b69ca1b..fa312843298 100644 --- a/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs +++ b/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs @@ -82,7 +82,7 @@ class BuildLauncher KedrExtensionMenu.GenerateAll(); // Obfuz 需要重新混淆热更后的dll而不是直接拷贝 - HotUpadeEditorHelper.CompileAndObfuscateAndCopyDllToTarget(); + // HotUpadeEditorHelper.CompileAndObfuscateAndCopyDllToTarget(); } else { From 579858dbda6e9ca786ca7c07b993f9588ba1ab41 Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Tue, 27 Jan 2026 18:44:43 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E3=80=90=E6=89=93=E5=8C=85=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/HotUpdate/Editor/HotUpadeEditorHelper.cs | 12 +++++++----- .../Assets/Editor/Common/BuildLauncherInEditor.cs | 4 +--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ProjectNLD/Assets/Code/Scripts/HotUpdate/Editor/HotUpadeEditorHelper.cs b/ProjectNLD/Assets/Code/Scripts/HotUpdate/Editor/HotUpadeEditorHelper.cs index 00bf4307e54..5ecbbac9536 100644 --- a/ProjectNLD/Assets/Code/Scripts/HotUpdate/Editor/HotUpadeEditorHelper.cs +++ b/ProjectNLD/Assets/Code/Scripts/HotUpdate/Editor/HotUpadeEditorHelper.cs @@ -22,13 +22,10 @@ public static class HotUpadeEditorHelper const string AOT_GENERIC_REFERENCES_PATH = "/HybridCLRGenerate/AOTGenericReferences.cs"; - public static void CompileAndObfuscateAndCopyDllToTarget() + private static void _CopyObfuscateDllToTarget() { BuildTarget target = EditorUserBuildSettings.activeBuildTarget; - CompileDllCommand.CompileDll(target); - string obfuscatedHotUpdateDllPath = PrebuildCommandExt.GetObfuscatedHotUpdateAssemblyOutputPath(target); - ObfuscateUtil.ObfuscateHotUpdateAssemblies(target, obfuscatedHotUpdateDllPath); Directory.CreateDirectory(Application.streamingAssetsPath); @@ -43,7 +40,7 @@ public static class HotUpadeEditorHelper if (File.Exists(srcFile)) { File.Copy(srcFile, dstFile, true); - Debug.Log($"[CompileAndObfuscate] Copy {srcFile} to {dstFile}"); + Debug.Log($"[_CopyObfuscateDllToTarget] Copy {srcFile} to {dstFile}"); } } } @@ -51,6 +48,11 @@ public static class HotUpadeEditorHelper // [MenuItem("Tools/热更新/转移热更dll")] public static void CopyHotUpdateDll() { + if (ObfuzSettings.Instance.buildPipelineSettings.enable) + { + _CopyObfuscateDllToTarget(); + return; + } // VersionControlSystem.Checkout(HOT_UPDATE_DLLS_DIR); var assemblies = SettingsUtil.HotUpdateAssemblyNamesExcludePreserved; var dir = new DirectoryInfo(Application.dataPath + HOT_UPDATE_DLL_PATH + EditorUserBuildSettings.activeBuildTarget); diff --git a/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs b/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs index fa312843298..08fb8cfd350 100644 --- a/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs +++ b/ProjectNLD/Assets/Editor/Common/BuildLauncherInEditor.cs @@ -81,17 +81,15 @@ class BuildLauncher // PrebuildCommandExt.GenerateAll(); KedrExtensionMenu.GenerateAll(); - // Obfuz 需要重新混淆热更后的dll而不是直接拷贝 - // HotUpadeEditorHelper.CompileAndObfuscateAndCopyDllToTarget(); } else { // #region 未接入Obfuz PrebuildCommand.GenerateAll(); // #endregion - HotUpadeEditorHelper.CopyHotUpdateDll(); } + HotUpadeEditorHelper.CopyHotUpdateDll(); HotUpadeEditorHelper.CopyMetaDataDll(); if (ObfuzSettings.Instance.polymorphicDllSettings.enable) From 8fdf1fddc9608e289fe165c7092397bca5a5ddc9 Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Tue, 27 Jan 2026 18:52:55 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E3=80=90=E5=8F=8D=E7=A0=B4=E8=A7=A3?= =?UTF-8?q?=E3=80=91=E5=BC=80=E5=90=AFpolymorphicDll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectNLD/ProjectSettings/Obfuz.asset | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ProjectNLD/ProjectSettings/Obfuz.asset b/ProjectNLD/ProjectSettings/Obfuz.asset index 27a0c453dcf..41c62250ee1 100644 --- a/ProjectNLD/ProjectSettings/Obfuz.asset +++ b/ProjectNLD/ProjectSettings/Obfuz.asset @@ -16,6 +16,8 @@ MonoBehaviour: enable: 1 linkXmlProcessCallbackOrder: 10000 obfuscationProcessCallbackOrder: 10000 + compatibilitySettings: + targetRuntime: 0 assemblySettings: assembliesToObfuscate: - Assembly-CSharp @@ -88,6 +90,6 @@ MonoBehaviour: text: Obfuscated by Obfuz signatureLength: 256 polymorphicDllSettings: - enable: 0 + enable: 1 codeGenerationSecretKey: obfuz-phxh-polymorphic-check-dll - disableLoadStandardDll: 0 + disableLoadStandardDll: 1 From debc921f37b8a61c2aabbd9f77435b51e4740d5e Mon Sep 17 00:00:00 2001 From: liutao <821580467@qq.com> Date: Tue, 27 Jan 2026 19:40:50 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E3=80=90=E5=8F=8D=E7=A0=B4=E8=A7=A3?= =?UTF-8?q?=E3=80=91=E6=9B=BF=E6=8D=A2dll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll b/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll index a5faa02772b..a3a0dc41e64 100644 --- a/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll +++ b/ProjectNLD/Assets/Editor/KedrExtension/ThirdParty/0Harmony.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:77e6901ecc606aec66c2a972782a3779e4f50c037d2d165eb7ececdd4d8f794d -size 2461696 +oid sha256:0e264e3746bf2fd370f32c382ccdf650815a2ea043c960499173fc8b74791ad1 +size 2478080