Code Clean Up
parent
f5c2fe94ea
commit
d52a9e7016
|
@ -1,6 +1,4 @@
|
|||
using System.Text;
|
||||
|
||||
namespace Obfuz.Editor
|
||||
namespace Obfuz.Editor
|
||||
{
|
||||
public static class ConstValues
|
||||
{
|
||||
|
|
|
@ -5,7 +5,6 @@ using Obfuz.Utils;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine.Assertions;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ using dnlib.DotNet.Emit;
|
|||
using Obfuz.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using UnityEngine.Assertions;
|
||||
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
using Obfuz.Settings;
|
||||
using Obfuz.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obfuz.GarbageCodeGeneration
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Obfuz.Settings;
|
||||
using Obfuz.Utils;
|
||||
using Obfuz.Utils;
|
||||
|
||||
namespace Obfuz.GarbageCodeGeneration
|
||||
{
|
||||
|
|
|
@ -52,9 +52,9 @@ namespace Obfuz.ObfusPasses.CallObfus
|
|||
switch (mode)
|
||||
{
|
||||
case ProxyMode.Dispatch:
|
||||
return new DispatchProxyObfuscator(ctx.moduleEntityManager);
|
||||
return new DispatchProxyObfuscator(ctx.moduleEntityManager);
|
||||
case ProxyMode.Delegate:
|
||||
return new DelegateProxyObfuscator(ctx.moduleEntityManager);
|
||||
return new DelegateProxyObfuscator(ctx.moduleEntityManager);
|
||||
default:
|
||||
throw new System.NotSupportedException($"Unsupported proxy mode: {mode}");
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using dnlib.DotNet.Emit;
|
||||
using Obfuz.Data;
|
||||
using Obfuz.Emit;
|
||||
using Obfuz.Settings;
|
||||
using Obfuz.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -64,7 +63,7 @@ namespace Obfuz.ObfusPasses.CallObfus
|
|||
{
|
||||
return typeName;
|
||||
}
|
||||
for (int i = 0; ;i++)
|
||||
for (int i = 0; ; i++)
|
||||
{
|
||||
typeName = $"$Obfuz$Delegate_{hashCode}_{i}";
|
||||
if (_allocatedDelegateNames.Add(typeName))
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
using dnlib.DotNet;
|
||||
using dnlib.DotNet.Emit;
|
||||
using Obfuz.Data;
|
||||
using Obfuz.Emit;
|
||||
using Obfuz.Settings;
|
||||
using Obfuz.Utils;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using dnlib.DotNet.Emit;
|
||||
using Obfuz.Data;
|
||||
using Obfuz.Emit;
|
||||
using Obfuz.Settings;
|
||||
using Obfuz.Utils;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using dnlib.DotNet;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obfuz.ObfusPasses.ControlFlowObfus
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using dnlib.DotNet;
|
||||
using Obfuz.Emit;
|
||||
|
||||
namespace Obfuz.ObfusPasses.ControlFlowObfus
|
||||
{
|
||||
|
|
|
@ -328,7 +328,7 @@ namespace Obfuz.ObfusPasses.ControlFlowObfus
|
|||
|
||||
BlockGroup group = to.group;
|
||||
group.basicBlocks.Insert(group.basicBlocks.IndexOf(to), saveLocalBasicBlock);
|
||||
group.switchMachineCases.Add(new SwitchMachineCase { index = -1, prepareBlock = saveLocalBasicBlock, targetBlock = to});
|
||||
group.switchMachineCases.Add(new SwitchMachineCase { index = -1, prepareBlock = saveLocalBasicBlock, targetBlock = to });
|
||||
saveLocalBasicBlock.instructions.Add(Instruction.Create(OpCodes.Ldsfld, (FieldDef)null));
|
||||
saveLocalBasicBlock.instructions.Add(Instruction.Create(OpCodes.Stloc, GlobalSwitchIndexLocal));
|
||||
saveLocalBasicBlock.instructions.Add(Instruction.Create(OpCodes.Br, group.switchMachineEntryInst));
|
||||
|
@ -359,7 +359,7 @@ namespace Obfuz.ObfusPasses.ControlFlowObfus
|
|||
{
|
||||
Dictionary<Instruction, BasicBlockInfo> inst2bb = BuildInstructionToBasicBlockInfoDic();
|
||||
|
||||
InsertSwitchMachineBasicBlockForGroup(rootGroup, inst2bb);
|
||||
InsertSwitchMachineBasicBlockForGroup(rootGroup, inst2bb);
|
||||
}
|
||||
|
||||
private void ShuffleBasicBlocks0(List<BasicBlockInfo> bbs)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using dnlib.DotNet;
|
||||
using Obfuz.Conf;
|
||||
using Obfuz.Utils;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
using dnlib.DotNet;
|
||||
using dnlib.DotNet.Emit;
|
||||
using Obfuz.Settings;
|
||||
using Obfuz.Utils;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obfuz.ObfusPasses.RemoveConstField
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System.Text;
|
||||
|
||||
namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers
|
||||
namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers
|
||||
{
|
||||
public class DebugNameMaker : NameMakerBase
|
||||
{
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
using dnlib.DotNet;
|
||||
using dnlib.DotNet.Emit;
|
||||
using dnlib.DotNet.PolymorphicWriter.Utilities;
|
||||
using NUnit.Framework;
|
||||
using Obfuz.Emit;
|
||||
using Obfuz.Settings;
|
||||
using Obfuz.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine;
|
||||
using FieldAttributes = dnlib.DotNet.FieldAttributes;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using dnlib.DotNet;
|
||||
using Obfuz.Data;
|
||||
using Obfuz.Emit;
|
||||
using Obfuz.Utils;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace Obfuz
|
|||
searchPaths.Add("Managed/UnityEngine");
|
||||
}
|
||||
|
||||
var resultPaths = new List<string>();
|
||||
var resultPaths = new List<string>();
|
||||
foreach (var path in searchPaths)
|
||||
{
|
||||
string candidatePath1 = Path.Combine(applicationContentsPath, path);
|
||||
|
|
Loading…
Reference in New Issue