Skip to content

Commit

Permalink
Merge pull request #61 from sunnamed434/dev
Browse files Browse the repository at this point in the history
Bump new version 0.6.0-alpha.15
  • Loading branch information
sunnamed434 authored Jan 9, 2023
2 parents d616c1c + ff68a65 commit fa884f6
Show file tree
Hide file tree
Showing 164 changed files with 2,213 additions and 2,235 deletions.
39 changes: 6 additions & 33 deletions BitMono.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "standalone", "standalone", "{76169FB9-B5F2-44B3-BF48-CCF10C3F9341}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.Standalone", "src\BitMono.Standalone\BitMono.Standalone.csproj", "{FE748DBC-2CE5-42D6-B192-D8222B103E0F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "submodules", "submodules", "{627F81D7-6C42-4AE8-9D96-A7F1BB3B2475}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D87066C4-1144-4BD8-96E9-9F4676001397}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "crackmes", "crackmes", "{2FE1199C-34CC-4AC8-AAB9-F1EF76883EE3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.Unturned-RocketMod-Crackme", "src\BitMono.Unturned-RocketMod-Crackme\BitMono.Unturned-RocketMod-Crackme.csproj", "{63224ECB-DC65-4908-87AB-8016DF7EC243}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.API", "src\BitMono.API\BitMono.API.csproj", "{AF23CAB0-659E-4444-9D31-7F4D06BDA5C4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.CLI", "src\BitMono.CLI\BitMono.CLI.csproj", "{BD0789BC-F351-44CC-B58C-F91DBE778D56}"
Expand All @@ -34,8 +24,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.GUI", "src\BitMono.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.GUI.API", "src\BitMono.GUI.API\BitMono.GUI.API.csproj", "{7C0EBB47-7DB0-4110-A39B-7659AB70649F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.GUI.Utilities", "src\BitMono.GUI.Utilities\BitMono.GUI.Utilities.csproj", "{1F964CE2-3E32-4B34-B69E-991E8E4DA01D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.Host", "src\BitMono.Host\BitMono.Host.csproj", "{41B9E388-392E-4AD3-8678-2A5AFF3A1F50}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.Obfuscation", "src\BitMono.Obfuscation\BitMono.Obfuscation.csproj", "{8D86C77B-40D5-4234-8DC0-FE129F730B7A}"
Expand All @@ -50,22 +38,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.Shared", "src\BitMo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.Utilities", "src\BitMono.Utilities\BitMono.Utilities.csproj", "{34C08A60-E141-4FAD-975F-F447317CDA79}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dnlib", "src\dnlib\src\dnlib.csproj", "{41A5C3DF-744E-47E6-84F2-671260AB651B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.GUI.Utilities", "src\BitMono.GUI.Utilities\BitMono.GUI.Utilities.csproj", "{452E19E6-E967-47BC-8F0D-04FD372BBC79}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FE748DBC-2CE5-42D6-B192-D8222B103E0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE748DBC-2CE5-42D6-B192-D8222B103E0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE748DBC-2CE5-42D6-B192-D8222B103E0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE748DBC-2CE5-42D6-B192-D8222B103E0F}.Release|Any CPU.Build.0 = Release|Any CPU
{63224ECB-DC65-4908-87AB-8016DF7EC243}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63224ECB-DC65-4908-87AB-8016DF7EC243}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63224ECB-DC65-4908-87AB-8016DF7EC243}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63224ECB-DC65-4908-87AB-8016DF7EC243}.Release|Any CPU.Build.0 = Release|Any CPU
{AF23CAB0-659E-4444-9D31-7F4D06BDA5C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF23CAB0-659E-4444-9D31-7F4D06BDA5C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF23CAB0-659E-4444-9D31-7F4D06BDA5C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -88,10 +68,6 @@ Global
{7C0EBB47-7DB0-4110-A39B-7659AB70649F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C0EBB47-7DB0-4110-A39B-7659AB70649F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C0EBB47-7DB0-4110-A39B-7659AB70649F}.Release|Any CPU.Build.0 = Release|Any CPU
{1F964CE2-3E32-4B34-B69E-991E8E4DA01D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F964CE2-3E32-4B34-B69E-991E8E4DA01D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F964CE2-3E32-4B34-B69E-991E8E4DA01D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F964CE2-3E32-4B34-B69E-991E8E4DA01D}.Release|Any CPU.Build.0 = Release|Any CPU
{41B9E388-392E-4AD3-8678-2A5AFF3A1F50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41B9E388-392E-4AD3-8678-2A5AFF3A1F50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41B9E388-392E-4AD3-8678-2A5AFF3A1F50}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -120,31 +96,28 @@ Global
{34C08A60-E141-4FAD-975F-F447317CDA79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34C08A60-E141-4FAD-975F-F447317CDA79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34C08A60-E141-4FAD-975F-F447317CDA79}.Release|Any CPU.Build.0 = Release|Any CPU
{41A5C3DF-744E-47E6-84F2-671260AB651B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41A5C3DF-744E-47E6-84F2-671260AB651B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41A5C3DF-744E-47E6-84F2-671260AB651B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41A5C3DF-744E-47E6-84F2-671260AB651B}.Release|Any CPU.Build.0 = Release|Any CPU
{452E19E6-E967-47BC-8F0D-04FD372BBC79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{452E19E6-E967-47BC-8F0D-04FD372BBC79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{452E19E6-E967-47BC-8F0D-04FD372BBC79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{452E19E6-E967-47BC-8F0D-04FD372BBC79}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FE748DBC-2CE5-42D6-B192-D8222B103E0F} = {76169FB9-B5F2-44B3-BF48-CCF10C3F9341}
{63224ECB-DC65-4908-87AB-8016DF7EC243} = {2FE1199C-34CC-4AC8-AAB9-F1EF76883EE3}
{AF23CAB0-659E-4444-9D31-7F4D06BDA5C4} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{BD0789BC-F351-44CC-B58C-F91DBE778D56} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{76B85164-08C4-4D79-B331-F220967529BD} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{BBD90469-32A2-4F72-B022-6496E9BB1800} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{7C0EBB47-7DB0-4110-A39B-7659AB70649F} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{1F964CE2-3E32-4B34-B69E-991E8E4DA01D} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{41B9E388-392E-4AD3-8678-2A5AFF3A1F50} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{8D86C77B-40D5-4234-8DC0-FE129F730B7A} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{67AC5ED0-B443-4098-B0D9-6B5F0761F599} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{5B46A891-BF1A-487F-AF68-0AF045F8EC96} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{7A7E46BE-5210-4E0B-8FF6-71B82012E51A} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{40615C80-C80C-4C95-ABC3-3291C32197D8} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{34C08A60-E141-4FAD-975F-F447317CDA79} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{41A5C3DF-744E-47E6-84F2-671260AB651B} = {627F81D7-6C42-4AE8-9D96-A7F1BB3B2475}
{452E19E6-E967-47BC-8F0D-04FD372BBC79} = {D87066C4-1144-4BD8-96E9-9F4676001397}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7DA0BB43-C1D4-4688-BE43-A9ED2D6F78EE}
Expand Down
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
| Versions: |
| - |
| [v0.5.0-alpha](#v050-alpha14) |
| [v0.6.0-alpha](#v060-alpha15) |
| [v0.4.4-alpha](#v044-alpha13) |
| [v0.4.3-alpha](#v043-alpha12) |
| [v0.4.2-alpha](#v042-alpha11) |
Expand All @@ -17,6 +17,29 @@
| [v0.1.0](#v010) |

---
### v0.6.0-alpha.15:
#### Added:
* New protection AntiDecompiler
* As more as possible errors logging

#### Changed:
* Migrate dnlib to AsmResolver or Mono.Cecil [#50](https://github.com/sunnamed434/BitMono/issues/50)

#### Fixed:
* BitMethodDotnet Protection
* StringsEncryption Protection
* CallToCalli Protection
* DotNetHook Protection
* Load Runtime Module via file instead of typeof(SomeRuntime).Module [#55](https://github.com/sunnamed434/BitMono/issues/55)
* Rewrite Custom Attributes Resolve as less as a possible reflection [#57](https://github.com/sunnamed434/BitMono/issues/57)
* System.BadImageFormatException: Invalid DOS signature [#45](https://github.com/sunnamed434/BitMono/issues/45)
* Whole Protections execution process
* Protections execution information
* Obfuscation
* Optimized file writing
* Ignoring of targets with [ObfuscationAttribute] and [MethodImpl(MethodImplOptions.NoInlining)]
* Runtime injection and even became better

### v0.5.0-alpha.14:
#### Added:
* Before obfuscation optmizes all method bodies (macros)
Expand All @@ -25,7 +48,6 @@
* BitMethodDotnet Protection
* StringsEncryption Protection


### v0.4.4-alpha.13:
#### Fixed:
* DotNetHook Protection
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Open **[wiki](https://github.com/sunnamed434/BitMono/wiki)** to read protections
* NoNamespaces
* FullRenamer
* AntiDebugBreakpoints
* AntiDecompiler
* BitDateTimeStamp

## Usage
Expand All @@ -70,4 +71,4 @@ Credits

**[ConfuserEx and their Forks](https://github.com/yck1509/ConfuserEx)** for most things that I watched for the architecture of BitMono and the obfuscator engine as an application and solving plenty of User solutions which I would be knew in the very long future after much fail usage of BitMono and reports by other Users. Day-by-day I'm looking for something interesting there to improve myself in knowledge and BitMono also.

**[Kao and his blogs](https://lifeinhex.com/) thanks a lot of these blogs.
**[Kao and his blogs](https://lifeinhex.com/)** thanks a lot of these blogs.
4 changes: 3 additions & 1 deletion src/BitMono.API/BitMono.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AsmResolver" Version="5.0.0" />
<PackageReference Include="AsmResolver.DotNet" Version="5.0.0" />
<PackageReference Include="Autofac" Version="6.4.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0-rc.2.22472.3" />
Expand All @@ -34,7 +36,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\dnlib\src\dnlib.csproj" />
<ProjectReference Include="..\BitMono.Shared\BitMono.Shared.csproj" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions src/BitMono.API/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
global using Autofac.Extensions.DependencyInjection;
global using AsmResolver.DotNet;
global using AsmResolver.DotNet.Builder;
global using AsmResolver.DotNet.Serialized;
global using AsmResolver.PE.File.Headers;
global using Autofac.Extensions.DependencyInjection;
global using BitMono.API.Protecting.Contexts;
global using BitMono.API.Protecting.Pipeline;
global using dnlib.DotNet;
global using dnlib.DotNet.Writer;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.DependencyInjection;
global using NullGuard;
global using System;
global using System.Collections.Generic;
global using System.Reflection;
global using System.Runtime.CompilerServices;
global using System.Threading;
global using System.Threading.Tasks;
global using IAssemblyResolver = AsmResolver.DotNet.IAssemblyResolver;
global using IModule = Autofac.Core.IModule;
22 changes: 13 additions & 9 deletions src/BitMono.API/Protecting/Contexts/ProtectionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

public class ProtectionContext
{
[AllowNull] public ModuleDefMD ModuleDefMD { get; set; }
[AllowNull] public ModuleCreationOptions ModuleCreationOptions { get; set; }
[AllowNull] public ModuleWriterOptions ModuleWriterOptions { get; set; }
[AllowNull] public ModuleDefMD RuntimeModuleDefMD { get; set; }
[AllowNull] public Importer Importer { get; set; }
[AllowNull] public Importer RuntimeImporter { get; set; }
[AllowNull] public ModuleDefinition Module { get; set; }
[AllowNull] public ModuleReaderParameters ModuleReaderParameters { get; set; }
[AllowNull] public IPEImageBuilder PEImageBuilder { get; set; }
[AllowNull] public ModuleDefinition RuntimeModule { get; set; }
[AllowNull] public ReferenceImporter RuntimeImporter { get; set; }
[AllowNull] public BitMonoContext BitMonoContext { get; set; }
[AllowNull] public byte[] ModuleDefMDOutput { get; set; }
[AllowNull] public CancellationToken CancellationToken { get; set; }

[AllowNull] public ModuleContext ModuleContext => ModuleCreationOptions.Context;
[AllowNull] public AssemblyResolver AssemblyResolver => (AssemblyResolver)ModuleContext.AssemblyResolver;
[AllowNull] public IAssemblyResolver AssemblyResolver => Module.MetadataResolver.AssemblyResolver;
[AllowNull] public ReferenceImporter Importer => Module.DefaultImporter;

public void ThrowIfCancellationRequested()
{
CancellationToken.ThrowIfCancellationRequested();
}
}
6 changes: 3 additions & 3 deletions src/BitMono.API/Protecting/Contexts/ProtectionParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
public class ProtectionParameters
{
public ProtectionParameters(List<IDnlibDef> targets)
public ProtectionParameters(List<IMetadataMember> members)
{
Targets = targets;
Members = members;
}

public List<IDnlibDef> Targets { get; private set; }
public List<IMetadataMember> Members { get; }
}
}
2 changes: 1 addition & 1 deletion src/BitMono.API/Protecting/IProtection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface IProtection
{
Task ExecuteAsync(ProtectionContext context, ProtectionParameters parameters, CancellationToken cancellationToken = default);
Task ExecuteAsync(ProtectionContext context, ProtectionParameters parameters);
}
5 changes: 0 additions & 5 deletions src/BitMono.API/Protecting/IStageProtection.cs

This file was deleted.

12 changes: 0 additions & 12 deletions src/BitMono.API/Protecting/Injection/IInjector.cs

This file was deleted.

10 changes: 10 additions & 0 deletions src/BitMono.API/Protecting/Pipeline/IInvokablePipeline.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace BitMono.API.Protecting.Pipeline;

public interface IInvokablePipeline
{
bool Succeed { get; }
ProtectionContext Context { get; }
Action OnFail { get; set; }

Task InvokeAsync(Func<ProtectionContext, Task<bool>> func);
}
2 changes: 1 addition & 1 deletion src/BitMono.API/Protecting/Pipeline/IPipelineProtection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface IPipelineProtection : IProtection
{
IEnumerable<(IPhaseProtection, PipelineStages)> PopulatePipeline();
IEnumerable<IPhaseProtection> PopulatePipeline();
}
6 changes: 0 additions & 6 deletions src/BitMono.API/Protecting/Pipeline/IPipelineStage.cs

This file was deleted.

7 changes: 0 additions & 7 deletions src/BitMono.API/Protecting/Pipeline/PipelineStages.cs

This file was deleted.

9 changes: 4 additions & 5 deletions src/BitMono.API/Protecting/Renaming/IRenamer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
public interface IRenamer
{
string RenameUnsafely();
void Rename(IDnlibDef dnlibDef);
void Rename(params IDnlibDef[] dnlibDefs);
void Rename(IFullName fullName);
void Rename(params IFullName[] fullNames);
void Rename(IVariable variable);
void Rename(IMetadataMember member);
void Rename(params IMetadataMember[] members);
void RemoveNamespace(IMetadataMember member);
void RemoveNamespace(params IMetadataMember[] members);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace BitMono.API.Protecting.Resolvers;

public class CustomAttributeResolve
{
public CustomAttribute CustomAttribute { get; set; }
public object Value { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

public interface IAttemptAttributeResolver
{
bool TryResolve<TAttribute>(IHasCustomAttribute from, Func<TAttribute, bool> predicate, Func<TAttribute, bool> strip, out TAttribute attribute)
where TAttribute : Attribute;
bool TryResolve(IHasCustomAttribute from, string @namespace, string name, out Dictionary<string, CustomAttributeResolve> keyValuePairs);
}
10 changes: 10 additions & 0 deletions src/BitMono.API/Protecting/Resolvers/IAttributeResolver.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace BitMono.API.Protecting.Resolvers;

public interface IAttributeResolver
{
bool Resolve(string feature, IHasCustomAttribute from, out CustomAttributeResolve attributeResolve);
bool Resolve(string feature, IHasCustomAttribute from);
bool Resolve(IHasCustomAttribute from);
bool Resolve(Type featureType, IHasCustomAttribute from);
bool Resolve<TFeature>(IHasCustomAttribute from) where TFeature : IProtection;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace BitMono.API.Protecting.Resolvers;

public interface ICustomAttributeResolver
{
Dictionary<string, CustomAttributeResolve> Resolve(IHasCustomAttribute from, string @namespace, string name);
}

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions src/BitMono.API/Protecting/Resolvers/IDnlibDefResolver.cs

This file was deleted.

Loading

0 comments on commit fa884f6

Please sign in to comment.