clean up codes

before-split
walon 2025-05-30 13:32:29 +08:00
parent b9061c567c
commit cad7fff2d1
99 changed files with 91 additions and 443 deletions

View File

@ -2,11 +2,7 @@
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml; using System.Xml;
using UnityEditor.VersionControl;
using UnityEngine; using UnityEngine;
namespace Obfuz.Conf namespace Obfuz.Conf
@ -17,7 +13,7 @@ namespace Obfuz.Conf
} }
public interface IMethodRule<R> where R: IRule<R> public interface IMethodRule<R> where R : IRule<R>
{ {
string Name { get; set; } string Name { get; set; }
NameMatcher NameMatcher { get; set; } NameMatcher NameMatcher { get; set; }
@ -33,7 +29,7 @@ namespace Obfuz.Conf
public R Rule { get; set; } public R Rule { get; set; }
} }
public interface ITypeRule<T, R> where T: IMethodRule<R> where R : IRule<R> public interface ITypeRule<T, R> where T : IMethodRule<R> where R : IRule<R>
{ {
string Name { get; set; } string Name { get; set; }

View File

@ -2,12 +2,7 @@
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml; using System.Xml;
using UnityEditor.VersionControl;
using UnityEngine;
namespace Obfuz.Conf namespace Obfuz.Conf
{ {

View File

@ -3,9 +3,6 @@ using Obfuz.ObfusPasses;
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml; using System.Xml;
using UnityEngine; using UnityEngine;
@ -189,7 +186,7 @@ namespace Obfuz
ObfuscationPassType passType = ObfuscationPassType.None; ObfuscationPassType passType = ObfuscationPassType.None;
foreach (var passName in obfuscationPassTypesStr.Split('|')) foreach (var passName in obfuscationPassTypesStr.Split('|'))
{ {
if (Enum.TryParse< ObfuscationPassType>(passName, out var pass)) if (Enum.TryParse<ObfuscationPassType>(passName, out var pass))
{ {
passType |= pass; passType |= pass;
} }

View File

@ -1,10 +1,4 @@
using System; namespace Obfuz.Editor
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Editor
{ {
public static class ConstValues public static class ConstValues
{ {

View File

@ -6,11 +6,6 @@ using Obfuz.Utils;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Assertions; using UnityEngine.Assertions;
namespace Obfuz.Data namespace Obfuz.Data

View File

@ -4,9 +4,7 @@ using Obfuz.Emit;
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using UnityEngine.Assertions; using UnityEngine.Assertions;
namespace Obfuz.Data namespace Obfuz.Data

View File

@ -3,9 +3,6 @@ using dnlib.DotNet.Emit;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Emit namespace Obfuz.Emit
{ {

View File

@ -1,9 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Emit namespace Obfuz.Emit
{ {
@ -45,7 +42,7 @@ namespace Obfuz.Emit
} }
} }
public List<T> GetEntities<T>() where T: IGroupByModuleEntity public List<T> GetEntities<T>() where T : IGroupByModuleEntity
{ {
var managers = new List<T>(); var managers = new List<T>();
foreach (var kv in _moduleEntityManagers) foreach (var kv in _moduleEntityManagers)

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.EncryptionVM.Instructions namespace Obfuz.EncryptionVM.Instructions
{ {

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.EncryptionVM.Instructions namespace Obfuz.EncryptionVM.Instructions
{ {

View File

@ -1,8 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.EncryptionVM.Instructions namespace Obfuz.EncryptionVM.Instructions
{ {

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.EncryptionVM.Instructions namespace Obfuz.EncryptionVM.Instructions
{ {

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.EncryptionVM.Instructions namespace Obfuz.EncryptionVM.Instructions
{ {

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.EncryptionVM.Instructions namespace Obfuz.EncryptionVM.Instructions
{ {

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.EncryptionVM.Instructions namespace Obfuz.EncryptionVM.Instructions
{ {

View File

@ -1,11 +1,8 @@
using Obfuz.Utils; using Obfuz.Utils;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Obfuz.EncryptionVM namespace Obfuz.EncryptionVM

View File

@ -1,10 +1,7 @@
using NUnit.Framework; using Obfuz.EncryptionVM.Instructions;
using Obfuz.EncryptionVM.Instructions;
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine.Assertions;
using UnityEngine.UIElements;
namespace Obfuz.EncryptionVM namespace Obfuz.EncryptionVM
{ {

View File

@ -1,12 +1,6 @@
using Obfuz.Utils; using Obfuz.Utils;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Text;
using UnityEngine;
using UnityEngine.Assertions; using UnityEngine.Assertions;
using UnityEngine.UIElements;
namespace Obfuz.EncryptionVM namespace Obfuz.EncryptionVM
{ {
@ -47,7 +41,7 @@ namespace Obfuz.EncryptionVM
byte[] strBytes = Encrypt("abcdef", ops, salt); byte[] strBytes = Encrypt("abcdef", ops, salt);
Assert.AreEqual("abcdef", DecryptString(strBytes, 0, strBytes.Length, ops, salt)); Assert.AreEqual("abcdef", DecryptString(strBytes, 0, strBytes.Length, ops, salt));
var arr = new byte[100]; var arr = new byte[100];
for (int i = 0; i < arr.Length ; i++) for (int i = 0; i < arr.Length; i++)
{ {
arr[i] = (byte)i; arr[i] = (byte)i;
} }

View File

@ -1,9 +1,4 @@
using Obfuz.ObfusPasses; using Obfuz.ObfusPasses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz namespace Obfuz
{ {

View File

@ -1,8 +1,8 @@
using dnlib.DotNet.Emit; using dnlib.DotNet;
using dnlib.DotNet; using dnlib.DotNet.Emit;
using Obfuz.Emit;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Obfuz.Emit;
namespace Obfuz.ObfusPasses namespace Obfuz.ObfusPasses
{ {

View File

@ -1,15 +1,9 @@
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.DotNet.Emit; using dnlib.DotNet.Emit;
using Obfuz.Utils;
using Obfuz.Emit; using Obfuz.Emit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using UnityEngine.Assertions;
using Obfuz.Settings; using Obfuz.Settings;
using Obfuz.Utils;
using System.Collections.Generic;
namespace Obfuz.ObfusPasses.CallObfus namespace Obfuz.ObfusPasses.CallObfus
{ {

View File

@ -7,8 +7,6 @@ using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MethodImplAttributes = dnlib.DotNet.MethodImplAttributes; using MethodImplAttributes = dnlib.DotNet.MethodImplAttributes;
using TypeAttributes = dnlib.DotNet.TypeAttributes; using TypeAttributes = dnlib.DotNet.TypeAttributes;
@ -211,7 +209,7 @@ namespace Obfuz.ObfusPasses.CallObfus
salt = salt, salt = salt,
encryptedIndex = encryptedIndex, encryptedIndex = encryptedIndex,
}; };
methodDispatcher.methods.Add(new CallInfo { method = method, callVir = callVir}); methodDispatcher.methods.Add(new CallInfo { method = method, callVir = callVir });
_methodProxys.Add(key, proxyInfo); _methodProxys.Add(key, proxyInfo);
} }
return new ProxyCallMethodData(proxyInfo.proxyMethod, proxyInfo.encryptedOps, proxyInfo.salt, proxyInfo.encryptedIndex, proxyInfo.index); return new ProxyCallMethodData(proxyInfo.proxyMethod, proxyInfo.encryptedOps, proxyInfo.salt, proxyInfo.encryptedIndex, proxyInfo.index);

View File

@ -3,11 +3,7 @@ using Obfuz.Conf;
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml; using System.Xml;
using UnityEngine;
namespace Obfuz.ObfusPasses.CallObfus namespace Obfuz.ObfusPasses.CallObfus
{ {

View File

@ -1,11 +1,10 @@
using dnlib.DotNet.Emit; using dnlib.DotNet;
using dnlib.DotNet; using dnlib.DotNet.Emit;
using System.Collections.Generic;
using Obfuz.Utils;
using Obfuz.Emit;
using Obfuz.Data; using Obfuz.Data;
using UnityEngine; using Obfuz.Emit;
using Obfuz.Settings; using Obfuz.Settings;
using Obfuz.Utils;
using System.Collections.Generic;
namespace Obfuz.ObfusPasses.CallObfus namespace Obfuz.ObfusPasses.CallObfus
{ {

View File

@ -1,9 +1,4 @@
using dnlib.DotNet; using dnlib.DotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.CallObfus namespace Obfuz.ObfusPasses.CallObfus
{ {

View File

@ -1,10 +1,6 @@
using dnlib.DotNet.Emit; using dnlib.DotNet;
using dnlib.DotNet; using dnlib.DotNet.Emit;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.CallObfus namespace Obfuz.ObfusPasses.CallObfus
{ {

View File

@ -1,10 +1,5 @@
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.DotNet.Emit; using dnlib.DotNet.Emit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.CleanUp namespace Obfuz.ObfusPasses.CleanUp
{ {

View File

@ -1,11 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.DotNet.Emit;
using Obfuz.Editor; using Obfuz.Editor;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.CleanUp namespace Obfuz.ObfusPasses.CleanUp
{ {

View File

@ -4,10 +4,7 @@ using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml; using System.Xml;
using UnityEngine;
namespace Obfuz.ObfusPasses.ConstEncrypt namespace Obfuz.ObfusPasses.ConstEncrypt
{ {

View File

@ -2,15 +2,7 @@
using dnlib.DotNet.Emit; using dnlib.DotNet.Emit;
using Obfuz.Emit; using Obfuz.Emit;
using Obfuz.Settings; using Obfuz.Settings;
using Obfuz.Utils;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Assertions;
namespace Obfuz.ObfusPasses.ConstEncrypt namespace Obfuz.ObfusPasses.ConstEncrypt
{ {

View File

@ -1,14 +1,12 @@
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.DotNet.Emit; using dnlib.DotNet.Emit;
using Obfuz.Emit;
using Obfuz.Data;
using Obfuz.Utils;
using System;
using System.Collections.Generic;
using NUnit.Framework; using NUnit.Framework;
using System.Text; using Obfuz.Data;
using Obfuz.Emit;
using Obfuz.Settings; using Obfuz.Settings;
using UnityEngine.Assertions.Must; using Obfuz.Utils;
using System.Collections.Generic;
using System.Text;
namespace Obfuz.ObfusPasses.ConstEncrypt namespace Obfuz.ObfusPasses.ConstEncrypt
{ {

View File

@ -1,6 +1,5 @@
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.DotNet.Emit; using dnlib.DotNet.Emit;
using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Obfuz.ObfusPasses.ConstEncrypt namespace Obfuz.ObfusPasses.ConstEncrypt

View File

@ -1,9 +1,4 @@
using dnlib.DotNet; using dnlib.DotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.ConstEncrypt namespace Obfuz.ObfusPasses.ConstEncrypt
{ {

View File

@ -1,10 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.DotNet.Emit; using dnlib.DotNet.Emit;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.ExprObfus namespace Obfuz.ObfusPasses.ExprObfus
{ {

View File

@ -1,7 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using Obfuz.Conf; using Obfuz.Conf;
using Obfuz.Utils; using Obfuz.Utils;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml; using System.Xml;

View File

@ -5,8 +5,6 @@ using Obfuz.Settings;
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
using UnityEngine.Assertions; using UnityEngine.Assertions;
namespace Obfuz.ObfusPasses.FieldEncrypt namespace Obfuz.ObfusPasses.FieldEncrypt

View File

@ -1,11 +1,7 @@
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.DotNet.Emit; using dnlib.DotNet.Emit;
using Obfuz;
using Obfuz.Settings; using Obfuz.Settings;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Obfuz.ObfusPasses.FieldEncrypt namespace Obfuz.ObfusPasses.FieldEncrypt
{ {

View File

@ -1,9 +1,4 @@
using dnlib.DotNet; using dnlib.DotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.FieldEncrypt namespace Obfuz.ObfusPasses.FieldEncrypt
{ {

View File

@ -1,9 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using dnlib.DotNet.Emit; using dnlib.DotNet.Emit;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.FieldEncrypt namespace Obfuz.ObfusPasses.FieldEncrypt
{ {

View File

@ -1,5 +1,5 @@
using dnlib.DotNet.Emit; using dnlib.DotNet;
using dnlib.DotNet; using dnlib.DotNet.Emit;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -1,6 +1,4 @@
using Obfuz.Emit; namespace Obfuz.ObfusPasses
namespace Obfuz.ObfusPasses
{ {
public abstract class ObfuscationPassBase : IObfuscationPass public abstract class ObfuscationPassBase : IObfuscationPass
{ {

View File

@ -1,5 +1,4 @@
using dnlib.DotNet; using System.Text;
using System.Text;
namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers
{ {

View File

@ -1,9 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine.Assertions; using UnityEngine.Assertions;
namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers

View File

@ -1,9 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers
{ {

View File

@ -1,5 +1,4 @@
using Microsoft.SqlServer.Server; using System.Collections.Generic;
using System.Collections.Generic;
using System.Text; using System.Text;
namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers

View File

@ -1,8 +1,4 @@
using dnlib.DotNet; using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers
{ {

View File

@ -1,6 +1,5 @@
using dnlib.DotNet; using dnlib.DotNet;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace Obfuz.ObfusPasses.SymbolObfus.Policies namespace Obfuz.ObfusPasses.SymbolObfus.Policies
{ {

View File

@ -1,13 +1,9 @@
using dnlib.DotNet; using dnlib.DotNet;
using Obfuz.Conf;
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml; using System.Xml;
using System.Xml.Linq;
using UnityEngine; using UnityEngine;
namespace Obfuz.ObfusPasses.SymbolObfus.Policies namespace Obfuz.ObfusPasses.SymbolObfus.Policies

View File

@ -1,9 +1,4 @@
using dnlib.DotNet; using dnlib.DotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.SymbolObfus.Policies namespace Obfuz.ObfusPasses.SymbolObfus.Policies
{ {

View File

@ -1,11 +1,7 @@
using dnlib.DotNet; using dnlib.DotNet;
using Obfuz.Utils; using Obfuz.Utils;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.SymbolObfus.Policies namespace Obfuz.ObfusPasses.SymbolObfus.Policies
{ {

View File

@ -5,10 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml; using System.Xml;
using System.Xml.Linq;
using UnityEngine; using UnityEngine;
namespace Obfuz.ObfusPasses.SymbolObfus namespace Obfuz.ObfusPasses.SymbolObfus

View File

@ -1,9 +1,4 @@
using Obfuz.Settings; using Obfuz.Settings;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.SymbolObfus namespace Obfuz.ObfusPasses.SymbolObfus
{ {

View File

@ -1,17 +1,12 @@
using dnlib.DotNet; using dnlib.DotNet;
using Obfuz.ObfusPasses.SymbolObfus;
using Obfuz.ObfusPasses.SymbolObfus.NameMakers; using Obfuz.ObfusPasses.SymbolObfus.NameMakers;
using Obfuz.ObfusPasses.SymbolObfus.Policies; using Obfuz.ObfusPasses.SymbolObfus.Policies;
using Obfuz.Settings; using Obfuz.Settings;
using Obfuz.Utils; using Obfuz.Utils;
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.OleDb;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using UnityEditor.SceneManagement;
using UnityEngine; using UnityEngine;
using UnityEngine.Assertions; using UnityEngine.Assertions;
@ -142,7 +137,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
} }
foreach (EventDef eventDef in type.Events) foreach (EventDef eventDef in type.Events)
{ {
CollectCArgumentWithTypeOf (eventDef, customAttributes); CollectCArgumentWithTypeOf(eventDef, customAttributes);
} }
} }
@ -577,7 +572,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
{ {
newVirtualMethodName = existVirtualMethodName; newVirtualMethodName = existVirtualMethodName;
} }
else if(newVirtualMethodName != existVirtualMethodName) else if (newVirtualMethodName != existVirtualMethodName)
{ {
Debug.LogWarning($"Virtual method rename conflict. {m} => {existVirtualMethodName} != {newVirtualMethodName}"); Debug.LogWarning($"Virtual method rename conflict. {m} => {existVirtualMethodName} != {newVirtualMethodName}");
conflict = true; conflict = true;

View File

@ -1,10 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using Obfuz.Utils; using Obfuz.Utils;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.SymbolObfus namespace Obfuz.ObfusPasses.SymbolObfus
{ {

View File

@ -1,11 +1,7 @@
using dnlib.DotNet; using dnlib.DotNet;
using Obfuz.Editor; using Obfuz.Editor;
using Obfuz.Utils; using Obfuz.Utils;
using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Obfuz namespace Obfuz

View File

@ -1,14 +1,8 @@
using dnlib.DotNet; using dnlib.DotNet;
using Obfuz.Data; using Obfuz.Data;
using Obfuz.Emit; using Obfuz.Emit;
using Obfuz.ObfusPasses;
using Obfuz.ObfusPasses.SymbolObfus;
using Obfuz.Utils; using Obfuz.Utils;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz namespace Obfuz
{ {

View File

@ -2,7 +2,6 @@
using Obfuz.Data; using Obfuz.Data;
using Obfuz.Emit; using Obfuz.Emit;
using Obfuz.EncryptionVM; using Obfuz.EncryptionVM;
using Obfuz.ObfusPasses;
using Obfuz.ObfusPasses.CleanUp; using Obfuz.ObfusPasses.CleanUp;
using Obfuz.ObfusPasses.SymbolObfus; using Obfuz.ObfusPasses.SymbolObfus;
using Obfuz.Unity; using Obfuz.Unity;
@ -11,10 +10,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using IAssemblyResolver = Obfuz.Utils.IAssemblyResolver;
namespace Obfuz namespace Obfuz
{ {
@ -141,7 +137,7 @@ namespace Obfuz
throw new Exception($"class Obfuz.EncryptionVM.GeneratedEncryptionVirtualMachine found in multiple assemblies! Please retain only one!"); throw new Exception($"class Obfuz.EncryptionVM.GeneratedEncryptionVirtualMachine found in multiple assemblies! Please retain only one!");
} }
var gvmInstance = (IEncryptor)Activator.CreateInstance(generatedVmTypes[0], new object[] { secretKey } ); var gvmInstance = (IEncryptor)Activator.CreateInstance(generatedVmTypes[0], new object[] { secretKey });
VerifyVm(vm, vms, gvmInstance); VerifyVm(vm, vms, gvmInstance);

View File

@ -1,5 +1,4 @@
using Obfuz.ObfusPasses; using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
namespace Obfuz namespace Obfuz

View File

@ -1,8 +1,6 @@
using NUnit.Framework;
using Obfuz.Editor; using Obfuz.Editor;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using UnityEngine; using UnityEngine;
namespace Obfuz.Settings namespace Obfuz.Settings

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Obfuz.Settings namespace Obfuz.Settings

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Obfuz.Settings namespace Obfuz.Settings

View File

@ -1,9 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Obfuz.Settings namespace Obfuz.Settings

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Obfuz.Settings namespace Obfuz.Settings

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.Remoting.Messaging;
using UnityEditor; using UnityEditor;
using UnityEditorInternal; using UnityEditorInternal;
using UnityEngine; using UnityEngine;

View File

@ -1,8 +1,4 @@
using System;
using System.Reflection;
using UnityEditor; using UnityEditor;
using UnityEditor.Presets;
using UnityEngine;
using UnityEngine.UIElements; using UnityEngine.UIElements;
namespace Obfuz.Settings namespace Obfuz.Settings
@ -74,7 +70,7 @@ namespace Obfuz.Settings
public override void OnGUI(string searchContext) public override void OnGUI(string searchContext)
{ {
if (_serializedObject == null||!_serializedObject.targetObject) if (_serializedObject == null || !_serializedObject.targetObject)
{ {
InitGUI(); InitGUI();
} }

View File

@ -1,5 +1,4 @@
using System; using System;
using System.IO;
using UnityEngine; using UnityEngine;
namespace Obfuz.Settings namespace Obfuz.Settings

View File

@ -1,10 +1,7 @@
using Obfuz.ObfusPasses.SymbolObfus; using Obfuz.Utils;
using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Obfuz.Settings namespace Obfuz.Settings

View File

@ -1,18 +1,15 @@
using Obfuz.Settings; using Obfuz.Settings;
using Obfuz.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Xml; using System.Xml;
using UnityEditor; using UnityEditor;
using UnityEditor.Build; using UnityEditor.Build;
using UnityEditor.Build.Reporting; using UnityEditor.Build.Reporting;
using UnityEditor.UnityLinker; using UnityEditor.UnityLinker;
using UnityEngine; using UnityEngine;
using static UnityEngine.GraphicsBuffer;
using FileUtil = Obfuz.Utils.FileUtil; using FileUtil = Obfuz.Utils.FileUtil;
namespace Obfuz.Unity namespace Obfuz.Unity

View File

@ -1,18 +1,14 @@
using System; using dnlib.DotNet;
using Obfuz.Settings;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEditor.Build;
using UnityEditor; using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting; using UnityEditor.Build.Reporting;
using UnityEngine; using UnityEngine;
using UnityEditor.Compilation;
using Obfuz.Utils;
using FileUtil = Obfuz.Utils.FileUtil; using FileUtil = Obfuz.Utils.FileUtil;
using Obfuz.Settings;
using dnlib.DotNet;
namespace Obfuz.Unity namespace Obfuz.Unity
{ {
@ -145,4 +141,4 @@ namespace Obfuz.Unity
} }
} }
#endif #endif
} }

View File

@ -1,10 +1,7 @@
using Obfuz.Utils; using Obfuz.Utils;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;

View File

@ -1,10 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,10 +1,4 @@
using System; namespace Obfuz.Utils
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils
{ {
public abstract class AssemblyResolverBase : IAssemblyResolver public abstract class AssemblyResolverBase : IAssemblyResolver
{ {

View File

@ -1,8 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,9 +1,5 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Configuration.Assemblies;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Obfuz.Utils namespace Obfuz.Utils

View File

@ -1,10 +1,6 @@
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -2,8 +2,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,11 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine.UIElements;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,10 +1,4 @@
using System; namespace Obfuz.Utils
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils
{ {
public interface IAssemblyResolver public interface IAssemblyResolver
{ {

View File

@ -1,10 +1,6 @@
using NUnit.Framework; using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -4,11 +4,8 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading.Tasks;
using UnityEngine.Assertions; using UnityEngine.Assertions;
using UnityEngine.UIElements;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,11 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using Obfuz.Editor; using Obfuz.Editor;
using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,10 +1,4 @@
using System; using System.IO;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {
@ -19,7 +13,7 @@ namespace Obfuz.Utils
public override string ResolveAssembly(string assemblyName) public override string ResolveAssembly(string assemblyName)
{ {
foreach(var path in _searchPaths) foreach (var path in _searchPaths)
{ {
string assPath = Path.Combine(path, assemblyName + ".dll"); string assPath = Path.Combine(path, assemblyName + ".dll");
if (File.Exists(assPath)) if (File.Exists(assPath))

View File

@ -1,9 +1,4 @@
using System; using UnityEditor;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEditor;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,11 +1,4 @@
using Obfuz.Emit; namespace Obfuz.Utils
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils
{ {
public class RandomWithKey : IRandom public class RandomWithKey : IRandom
{ {

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,9 +1,7 @@
using dnlib.DotNet; using dnlib.DotNet;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace Obfuz.Utils namespace Obfuz.Utils
{ {

View File

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz namespace Obfuz
{ {

View File

@ -1,9 +1,5 @@
using System; using System;
using System.Collections;
using System.Collections.Generic;
using System.Text; using System.Text;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Assertions; using UnityEngine.Assertions;
namespace Obfuz namespace Obfuz

View File

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz namespace Obfuz
{ {

View File

@ -21,7 +21,7 @@
} }
} }
public struct DefaultStaticEncryptionScope: IEncryptionScope public struct DefaultStaticEncryptionScope : IEncryptionScope
{ {
public void ForcePreserveAOT() public void ForcePreserveAOT()
{ {

View File

@ -1,10 +1,4 @@
using System; namespace Obfuz
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz
{ {
public static class EncryptionService<T> where T : IEncryptionScope public static class EncryptionService<T> where T : IEncryptionScope

View File

@ -1,7 +1,5 @@
using JetBrains.Annotations; using System;
using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using Unity.Collections.LowLevel.Unsafe; using Unity.Collections.LowLevel.Unsafe;
using UnityEngine.Assertions; using UnityEngine.Assertions;
@ -249,7 +247,7 @@ namespace Obfuz
public virtual unsafe void DecryptBlock(byte[] data, int ops, int salt) public virtual unsafe void DecryptBlock(byte[] data, int ops, int salt)
{ {
fixed(byte* dataPtr = &data[0]) fixed (byte* dataPtr = &data[0])
{ {
DecryptBlock(dataPtr, data.Length, ops, salt); DecryptBlock(dataPtr, data.Length, ops, salt);
} }

View File

@ -1,8 +1,4 @@
using System.Collections.Generic; namespace Obfuz
using System.Linq;
using System.Threading.Tasks;
namespace Obfuz
{ {
public interface IEncryptor public interface IEncryptor
{ {

View File

@ -1,8 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace Obfuz namespace Obfuz
{ {

View File

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz namespace Obfuz
{ {