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
{ {
@ -141,7 +138,7 @@ namespace Obfuz.Emit
} }
return splitPoints; return splitPoints;
} }
private void BuildBasicBlocks(MethodDef method, HashSet<Instruction> splitPoints) private void BuildBasicBlocks(MethodDef method, HashSet<Instruction> splitPoints)
{ {

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

@ -2,7 +2,7 @@
namespace Obfuz.EncryptionVM.Instructions namespace Obfuz.EncryptionVM.Instructions
{ {
public class XorInstruction : EncryptionInstructionBase public class XorInstruction : EncryptionInstructionBase
{ {
private readonly int _xorValue; private readonly int _xorValue;
private readonly int _opKeyIndex; private readonly int _opKeyIndex;

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
{ {
@ -200,7 +197,7 @@ namespace Obfuz.ObfusPasses.ConstEncrypt
} }
return rule; return rule;
} }
private void ParseWhitelist(string configFile, XmlElement childEle) private void ParseWhitelist(string configFile, XmlElement childEle)
{ {
string type = childEle.GetAttribute("type"); string type = childEle.GetAttribute("type");

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
@ -29,7 +27,7 @@ namespace Obfuz.ObfusPasses.FieldEncrypt
return _moduleEntityManager.GetDefaultModuleMetadataImporter(method.Module, _encryptionScopeProvider); return _moduleEntityManager.GetDefaultModuleMetadataImporter(method.Module, _encryptionScopeProvider);
} }
class FieldEncryptInfo class FieldEncryptInfo
{ {
public int encryptOps; public int encryptOps;
public int salt; public int salt;
@ -47,7 +45,7 @@ namespace Obfuz.ObfusPasses.FieldEncrypt
case ElementType.I4: case ElementType.I4:
case ElementType.U4: case ElementType.U4:
case ElementType.R4: case ElementType.R4:
return encryptor.Encrypt(0, encryptOps, salt); return encryptor.Encrypt(0, encryptOps, salt);
case ElementType.I8: case ElementType.I8:
case ElementType.U8: case ElementType.U8:
case ElementType.R8: case ElementType.R8:

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
@ -59,7 +56,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers
public bool IsNamePreserved(VirtualMethodGroup virtualMethodGroup, string name) public bool IsNamePreserved(VirtualMethodGroup virtualMethodGroup, string name)
{ {
return virtualMethodGroup.GetNameConflictTypeScopes().Any(m => GetNameScope(m).IsNamePreserved(name)); return virtualMethodGroup.GetNameConflictTypeScopes().Any(m => GetNameScope(m).IsNamePreserved(name));
} }
private string GetDefaultNewName(object scope, string originName) private string GetDefaultNewName(object scope, string originName)

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
@ -127,7 +123,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies
{ {
return null; return null;
} }
ClassType type = ClassType.None; ClassType type = ClassType.None;
foreach (var s in classType.Split(',')) foreach (var s in classType.Split(','))
{ {
@ -520,7 +516,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies
private void BuildTypeRuleResult(TypeRuleSpec typeSpec, TypeDef typeDef, RuleResult typeRuleResult) private void BuildTypeRuleResult(TypeRuleSpec typeSpec, TypeDef typeDef, RuleResult typeRuleResult)
{ {
string typeName = typeDef.FullName; string typeName = typeDef.FullName;
if (typeSpec.obfuscateName != null) if (typeSpec.obfuscateName != null)
{ {
typeRuleResult.obfuscateName = typeSpec.obfuscateName; typeRuleResult.obfuscateName = typeSpec.obfuscateName;

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;
@ -50,7 +45,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
_obfuscationRuleFiles = settings.ruleFiles.ToList(); _obfuscationRuleFiles = settings.ruleFiles.ToList();
_renameRecordMap = new RenameRecordMap(settings.symbolMappingFile, settings.debug); _renameRecordMap = new RenameRecordMap(settings.symbolMappingFile, settings.debug);
_virtualMethodGroupCalculator = new VirtualMethodGroupCalculator(); _virtualMethodGroupCalculator = new VirtualMethodGroupCalculator();
_nameMaker = settings.debug ? NameMakerFactory.CreateDebugNameMaker() : NameMakerFactory.CreateNameMakerBaseASCIICharSet(settings.obfuscatedNamePrefix); _nameMaker = settings.debug ? NameMakerFactory.CreateDebugNameMaker() : NameMakerFactory.CreateNameMakerBaseASCIICharSet(settings.obfuscatedNamePrefix);
foreach (var customPolicyType in settings.customRenamePolicyTypes) foreach (var customPolicyType in settings.customRenamePolicyTypes)
{ {
@ -73,7 +68,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
_obfuscatedAndNotObfuscatedModules = ctx.allObfuscationRelativeModules; _obfuscatedAndNotObfuscatedModules = ctx.allObfuscationRelativeModules;
_toObfuscatedModuleSet = new HashSet<ModuleDef>(ctx.modulesToObfuscate); _toObfuscatedModuleSet = new HashSet<ModuleDef>(ctx.modulesToObfuscate);
var obfuscateRuleConfig = new ConfigurableRenamePolicy(ctx.coreSettings.assembliesToObfuscate, ctx.modulesToObfuscate, _obfuscationRuleFiles); var obfuscateRuleConfig = new ConfigurableRenamePolicy(ctx.coreSettings.assembliesToObfuscate, ctx.modulesToObfuscate, _obfuscationRuleFiles);
var totalRenamePolicies = new List<IObfuscationPolicy> var totalRenamePolicies = new List<IObfuscationPolicy>
{ {
new SupportPassPolicy(ctx.passPolicy), new SupportPassPolicy(ctx.passPolicy),
@ -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);
} }
} }
@ -445,7 +440,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
} }
} }
private void RenameMethodRefOrMethodSpec(IMethod method, Dictionary<MethodDef, RefMethodMetas> refMethodMetasMap) private void RenameMethodRefOrMethodSpec(IMethod method, Dictionary<MethodDef, RefMethodMetas> refMethodMetasMap)
{ {
if (method is MemberRef memberRef) if (method is MemberRef memberRef)
@ -469,7 +464,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
{ {
RenameMethodRefOrMethodSpec(method, refMethodMetasMap); RenameMethodRefOrMethodSpec(method, refMethodMetasMap);
} }
foreach (var type in mod.GetTypes()) foreach (var type in mod.GetTypes())
{ {
foreach (MethodDef method in type.Methods) foreach (MethodDef method in type.Methods)
@ -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
{ {
@ -18,7 +14,7 @@ namespace Obfuz.Utils
public static V GetValueOrDefault<K, V>(this Dictionary<K, V> dic, K key) public static V GetValueOrDefault<K, V>(this Dictionary<K, V> dic, K key)
{ {
return dic.TryGetValue(key, out V v) ? v : default(V); return dic.TryGetValue(key, out V v) ? v : default(V);
} }
} }
} }

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
{ {
@ -20,24 +18,24 @@ namespace Obfuz.Utils
public TypeSig Resolve(TypeSig typeSig) public TypeSig Resolve(TypeSig typeSig)
{ {
if (!typeSig.ContainsGenericParameter) if (!typeSig.ContainsGenericParameter)
{ {
return typeSig; return typeSig;
} }
typeSig = typeSig.RemovePinnedAndModifiers(); typeSig = typeSig.RemovePinnedAndModifiers();
switch (typeSig.ElementType) switch (typeSig.ElementType)
{ {
case ElementType.Ptr: return new PtrSig(Resolve(typeSig.Next)); case ElementType.Ptr: return new PtrSig(Resolve(typeSig.Next));
case ElementType.ByRef: return new ByRefSig(Resolve(typeSig.Next)); case ElementType.ByRef: return new ByRefSig(Resolve(typeSig.Next));
case ElementType.SZArray: return new SZArraySig(Resolve(typeSig.Next)); case ElementType.SZArray: return new SZArraySig(Resolve(typeSig.Next));
case ElementType.Array: case ElementType.Array:
{ {
var ara = (ArraySig)typeSig; var ara = (ArraySig)typeSig;
return new ArraySig(Resolve(typeSig.Next), ara.Rank, ara.Sizes, ara.LowerBounds); return new ArraySig(Resolve(typeSig.Next), ara.Rank, ara.Sizes, ara.LowerBounds);
} }
case ElementType.Var: case ElementType.Var:
{ {
GenericVar genericVar = (GenericVar)typeSig; GenericVar genericVar = (GenericVar)typeSig;
var newSig = Resolve(typeArgsStack, genericVar.Number); var newSig = Resolve(typeArgsStack, genericVar.Number);
@ -48,7 +46,7 @@ namespace Obfuz.Utils
return newSig; return newSig;
} }
case ElementType.MVar: case ElementType.MVar:
{ {
GenericMVar genericVar = (GenericMVar)typeSig; GenericMVar genericVar = (GenericMVar)typeSig;
var newSig = Resolve(methodArgsStack, genericVar.Number); var newSig = Resolve(methodArgsStack, genericVar.Number);
@ -58,13 +56,13 @@ namespace Obfuz.Utils
} }
return newSig; return newSig;
} }
case ElementType.GenericInst: case ElementType.GenericInst:
{ {
var gia = (GenericInstSig)typeSig; var gia = (GenericInstSig)typeSig;
return new GenericInstSig(gia.GenericType, gia.GenericArguments.Select(ga => Resolve(ga)).ToList()); return new GenericInstSig(gia.GenericType, gia.GenericArguments.Select(ga => Resolve(ga)).ToList());
} }
case ElementType.FnPtr: case ElementType.FnPtr:
{ {
var fptr = (FnPtrSig)typeSig; var fptr = (FnPtrSig)typeSig;
var cs = fptr.Signature; var cs = fptr.Signature;
@ -91,13 +89,13 @@ namespace Obfuz.Utils
return new FnPtrSig(ccs); return new FnPtrSig(ccs);
} }
case ElementType.ValueArray: case ElementType.ValueArray:
{ {
var vas = (ValueArraySig)typeSig; var vas = (ValueArraySig)typeSig;
return new ValueArraySig(Resolve(vas.Next), vas.Size); return new ValueArraySig(Resolve(vas.Next), vas.Size);
} }
default: return typeSig; default: return typeSig;
} }
} }
private TypeSig Resolve(List<TypeSig> args, uint number) private TypeSig Resolve(List<TypeSig> args, uint number)

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
{ {
@ -714,7 +711,7 @@ namespace Obfuz.Utils
public static void AppendIl2CppStackTraceNameOfTypeSig(StringBuilder sb, TypeSig typeSig) public static void AppendIl2CppStackTraceNameOfTypeSig(StringBuilder sb, TypeSig typeSig)
{ {
typeSig = typeSig.RemovePinnedAndModifiers(); typeSig = typeSig.RemovePinnedAndModifiers();
switch (typeSig.ElementType) switch (typeSig.ElementType)
{ {
case ElementType.Void: sb.Append("Void"); break; case ElementType.Void: sb.Append("Void"); break;

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
{ {
@ -72,7 +70,7 @@ namespace Obfuz.Utils
} }
result.Append(")"); result.Append(")");
} }
return result.ToString(); return result.ToString();
} }

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
{ {