From 87dd8a39c1713fc42b5f396c28528adeb93a357a Mon Sep 17 00:00:00 2001 From: walon Date: Sat, 3 May 2025 20:42:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=B0=8F=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/CleanUpInstructionPass.cs | 18 +++++++++--------- Editor/Emit/RandomDataNodeCreator.cs | 2 +- Editor/MemEncrypt/MemoryEncryptionPass.cs | 2 +- Editor/Obfuscator.cs | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Editor/CleanUpInstructionPass.cs b/Editor/CleanUpInstructionPass.cs index af95f9f..7f7dda7 100644 --- a/Editor/CleanUpInstructionPass.cs +++ b/Editor/CleanUpInstructionPass.cs @@ -10,6 +10,15 @@ namespace Obfuz { public class CleanUpInstructionPass : ObfuscationPassBase { + public override void Start(ObfuscatorContext ctx) + { + } + + public override void Stop(ObfuscatorContext ctx) + { + + } + public override void Process(ObfuscatorContext ctx) { foreach (var ass in ctx.assemblies) @@ -30,14 +39,5 @@ namespace Obfuz } } } - - public override void Start(ObfuscatorContext ctx) - { - } - - public override void Stop(ObfuscatorContext ctx) - { - - } } } diff --git a/Editor/Emit/RandomDataNodeCreator.cs b/Editor/Emit/RandomDataNodeCreator.cs index 1aaa791..2ed55f7 100644 --- a/Editor/Emit/RandomDataNodeCreator.cs +++ b/Editor/Emit/RandomDataNodeCreator.cs @@ -51,7 +51,7 @@ namespace Obfuz.Emit { throw new System.Exception($"No functions available for type {type}"); } - if (options.depth >= 4) + if (options.depth >= 2) { //return new ConstDataNode() { Type = type, Value = value }; return _random.NextInt(100) < 50 ? diff --git a/Editor/MemEncrypt/MemoryEncryptionPass.cs b/Editor/MemEncrypt/MemoryEncryptionPass.cs index 164948e..be15fd2 100644 --- a/Editor/MemEncrypt/MemoryEncryptionPass.cs +++ b/Editor/MemEncrypt/MemoryEncryptionPass.cs @@ -92,7 +92,7 @@ namespace Obfuz.MemEncrypt } default: return false; } - Debug.Log($"memory encrypt field: {field}"); + //Debug.Log($"memory encrypt field: {field}"); return true; } } diff --git a/Editor/Obfuscator.cs b/Editor/Obfuscator.cs index 17b0a0d..26ed048 100644 --- a/Editor/Obfuscator.cs +++ b/Editor/Obfuscator.cs @@ -51,8 +51,8 @@ namespace Obfuz _pipeline.AddPass(new MemoryEncryptionPass()); //_pipeline.AddPass(new ProxyCallPass()); - //_pipeline.AddPass(new ExprObfuscationPass()); - //_pipeline.AddPass(new DataVirtualizationPass()); + _pipeline.AddPass(new ExprObfuscationPass()); + _pipeline.AddPass(new DataVirtualizationPass()); _pipeline.AddPass(new RenameSymbolPass()); _pipeline.AddPass(new CleanUpInstructionPass()); @@ -105,7 +105,7 @@ namespace Obfuz string refAssName = refAss.Name.ToString(); if (assByName.TryGetValue(refAssName, out var refAssembly)) { - UnityEngine.Debug.Log($"assembly:{ass.name} reference to {refAssName}"); + //UnityEngine.Debug.Log($"assembly:{ass.name} reference to {refAssName}"); refAssembly.referenceMeAssemblies.Add(ass); } }