Skip to content

Commit 6554a10

Browse files
authored
Merge pull request #22 from sunnamed434/dev
Bug fixes, code refactoring
2 parents 1b0d3d6 + 5d85a14 commit 6554a10

44 files changed

Lines changed: 388 additions & 349 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BitMono/BitMono.API/Protecting/Analyzing/ICriticalAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using BitMono.API.Protecting.Contexts;
1+
using BitMono.API.Protecting.Context;
22

33
namespace BitMono.API.Protecting.Analyzing
44
{

BitMono/BitMono.API/Protecting/Context/BitMonoContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace BitMono.API.Protecting.Contexts
1+
namespace BitMono.API.Protecting.Context
22
{
33
public class BitMonoContext
44
{

BitMono/BitMono.API/Protecting/Context/ProtectionContext.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
using dnlib.DotNet;
22
using dnlib.DotNet.Writer;
33
using NullGuard;
4-
using System.Reflection;
54

6-
namespace BitMono.API.Protecting.Contexts
5+
namespace BitMono.API.Protecting.Context
76
{
87
public class ProtectionContext
98
{
@@ -14,7 +13,6 @@ public class ProtectionContext
1413
[AllowNull] public ModuleDefMD ExternalComponentsModuleDefMD { get; set; }
1514
[AllowNull] public Importer Importer { get; set; }
1615
[AllowNull] public Importer ExternalComponentsImporter { get; set; }
17-
[AllowNull] public Assembly Assembly { get; set; }
1816
[AllowNull] public BitMonoContext BitMonoContext { get; set; }
1917

2018
[AllowNull] public ModuleContext ModuleContext => ModuleCreationOptions.Context;

BitMono/BitMono.API/Protecting/IProtection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using BitMono.API.Protecting.Contexts;
1+
using BitMono.API.Protecting.Context;
22
using System.Threading;
33
using System.Threading.Tasks;
44

BitMono/BitMono.API/Protecting/Renaming/IRenamer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using BitMono.API.Protecting.Contexts;
1+
using BitMono.API.Protecting.Context;
22
using dnlib.DotNet;
33

44
namespace BitMono.API.Protecting.Renaming
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
using BitMono.API.Protecting.Contexts;
2-
using dnlib.DotNet;
1+
using dnlib.DotNet;
32
using System;
43

54
namespace BitMono.API.Protecting.Resolvers
65
{
76
public interface IAttemptAttributeResolver
87
{
9-
bool TryResolve<TAttribute>(ProtectionContext context, IDnlibDef dnlibDef, Predicate<TAttribute> review, Func<TAttribute, bool> predicate, out TAttribute attribute, bool inherit = false)
8+
bool TryResolve<TAttribute>(IHasCustomAttribute from, Predicate<TAttribute> review, Func<TAttribute, bool> predicate, Func<TAttribute, bool> strip, out TAttribute attribute)
109
where TAttribute : Attribute;
1110
}
1211
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using dnlib.DotNet;
2+
using System;
3+
using System.Collections.Generic;
4+
5+
namespace BitMono.API.Protecting.Resolvers
6+
{
7+
public interface ICustomAttributesResolver
8+
{
9+
IEnumerable<TAttribute> Resolve<TAttribute>(IHasCustomAttribute from, Func<TAttribute, bool> strip) where TAttribute : Attribute;
10+
}
11+
}

BitMono/BitMono.API/Protecting/Resolvers/IDnlibDefAttributeResolver.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using BitMono.API.Protecting.Contexts;
2-
using dnlib.DotNet;
1+
using dnlib.DotNet;
32
using System.Runtime.CompilerServices;
43

54
namespace BitMono.API.Protecting.Resolvers
65
{
76
public interface IMethodImplAttributeExcludingResolver
87
{
9-
bool TryResolve(ProtectionContext context, IDnlibDef dnlibDef, out MethodImplAttribute obfuscationAttribute, bool inherit = false);
8+
bool TryResolve(IHasCustomAttribute from, out MethodImplAttribute obfuscationAttribute);
109
}
1110
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using BitMono.API.Protecting.Contexts;
2-
using dnlib.DotNet;
1+
using dnlib.DotNet;
32
using System.Reflection;
43

54
namespace BitMono.API.Protecting.Resolvers
65
{
76
public interface IObfuscationAttributeExcludingResolver
87
{
9-
bool TryResolve(ProtectionContext context, IDnlibDef dnlibDef, string feature, out ObfuscationAttribute obfuscationAttribute, bool inherit = false);
8+
bool TryResolve(IHasCustomAttribute from, string feature, out ObfuscationAttribute obfuscationAttribute);
109
}
1110
}

0 commit comments

Comments
 (0)