Skip to content

Commit

Permalink
Merge pull request #77 from sunnamed434/dev
Browse files Browse the repository at this point in the history
Bump new version 0.7.0-alpha.16
  • Loading branch information
sunnamed434 authored Jan 19, 2023
2 parents 3445c36 + ffcfbbc commit 6999463
Show file tree
Hide file tree
Showing 129 changed files with 2,000 additions and 620 deletions.
13 changes: 13 additions & 0 deletions .idea/.idea.BitMono/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/.idea.BitMono/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.BitMono/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/.idea.BitMono/.idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.BitMono/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions BitMono.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.Utilities", "src\Bi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMono.GUI.Utilities", "src\BitMono.GUI.Utilities\BitMono.GUI.Utilities.csproj", "{452E19E6-E967-47BC-8F0D-04FD372BBC79}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1EF50257-AFD3-48A3-9E22-03BDC25550A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Core.Tests", "test\BitMono.Core.Tests\BitMono.Core.Tests.csproj", "{A48CF019-9079-4CC1-8DC6-8EB6252B2071}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Benchmarks", "test\BitMono.Benchmarks\BitMono.Benchmarks.csproj", "{3BF83671-AB38-4B91-82F2-40EA193E10DA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestBinaries", "TestBinaries", "{EB40D287-0103-4693-8C26-7C3BC7C203B5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DotNet", "DotNet", "{A431DCB4-6EF9-4BEF-8902-FA704D62624E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Core.TestCases.CustomAttributes", "test\TestBinaries\DotNet\BitMono.Core.TestCases.CustomAttributes\BitMono.Core.TestCases.CustomAttributes.csproj", "{1D6B1BA7-496F-4F91-A115-EF5E5DC6E6C2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Core.TestCases.Methods", "test\TestBinaries\DotNet\BitMono.Core.TestCases.Methods\BitMono.Core.TestCases.Methods.csproj", "{4166AC73-6969-406A-ADD0-67CB70A76D9C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Core.TestCases.Types", "test\TestBinaries\DotNet\BitMono.Core.TestCases.Types\BitMono.Core.TestCases.Types.csproj", "{5DC793B1-F82B-4BC7-99C9-FE8C1545E1F7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -101,6 +117,26 @@ Global
{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
{A48CF019-9079-4CC1-8DC6-8EB6252B2071}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A48CF019-9079-4CC1-8DC6-8EB6252B2071}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A48CF019-9079-4CC1-8DC6-8EB6252B2071}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A48CF019-9079-4CC1-8DC6-8EB6252B2071}.Release|Any CPU.Build.0 = Release|Any CPU
{3BF83671-AB38-4B91-82F2-40EA193E10DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BF83671-AB38-4B91-82F2-40EA193E10DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BF83671-AB38-4B91-82F2-40EA193E10DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BF83671-AB38-4B91-82F2-40EA193E10DA}.Release|Any CPU.Build.0 = Release|Any CPU
{1D6B1BA7-496F-4F91-A115-EF5E5DC6E6C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D6B1BA7-496F-4F91-A115-EF5E5DC6E6C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D6B1BA7-496F-4F91-A115-EF5E5DC6E6C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D6B1BA7-496F-4F91-A115-EF5E5DC6E6C2}.Release|Any CPU.Build.0 = Release|Any CPU
{4166AC73-6969-406A-ADD0-67CB70A76D9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4166AC73-6969-406A-ADD0-67CB70A76D9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4166AC73-6969-406A-ADD0-67CB70A76D9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4166AC73-6969-406A-ADD0-67CB70A76D9C}.Release|Any CPU.Build.0 = Release|Any CPU
{5DC793B1-F82B-4BC7-99C9-FE8C1545E1F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DC793B1-F82B-4BC7-99C9-FE8C1545E1F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DC793B1-F82B-4BC7-99C9-FE8C1545E1F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DC793B1-F82B-4BC7-99C9-FE8C1545E1F7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -119,6 +155,13 @@ Global
{40615C80-C80C-4C95-ABC3-3291C32197D8} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{34C08A60-E141-4FAD-975F-F447317CDA79} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{452E19E6-E967-47BC-8F0D-04FD372BBC79} = {D87066C4-1144-4BD8-96E9-9F4676001397}
{A48CF019-9079-4CC1-8DC6-8EB6252B2071} = {1EF50257-AFD3-48A3-9E22-03BDC25550A7}
{3BF83671-AB38-4B91-82F2-40EA193E10DA} = {1EF50257-AFD3-48A3-9E22-03BDC25550A7}
{EB40D287-0103-4693-8C26-7C3BC7C203B5} = {1EF50257-AFD3-48A3-9E22-03BDC25550A7}
{A431DCB4-6EF9-4BEF-8902-FA704D62624E} = {EB40D287-0103-4693-8C26-7C3BC7C203B5}
{1D6B1BA7-496F-4F91-A115-EF5E5DC6E6C2} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
{4166AC73-6969-406A-ADD0-67CB70A76D9C} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
{5DC793B1-F82B-4BC7-99C9-FE8C1545E1F7} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7DA0BB43-C1D4-4688-BE43-A9ED2D6F78EE}
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Versions: |
| - |
| [v0.7.0-alpha](#v070-alpha16) |
| [v0.6.0-alpha](#v060-alpha15) |
| [v0.4.4-alpha](#v044-alpha13) |
| [v0.4.3-alpha](#v043-alpha12) |
Expand All @@ -17,6 +18,23 @@
| [v0.1.0](#v010) |

---
### v0.7.0-alpha-16:
#### Added:
* Unit Tests
* Benchmarks
* Support of ObfuscateAssemblyAttribute
* New properties in obfuscation.json
* Ignore members with specific attribute, eg, [SerializeField], it can be edited in criticals.json

#### Changed:
* Obfuscation process
* ObfuscationAttribute support
* Moved from .NET Framework 461 to .NET Framework 462

#### Fixed:
* [SerializableAttribute] support
* [MethodImpl(MethodImplOptions.NoInlining)] support

### v0.6.0-alpha.15:
#### Added:
* New protection AntiDecompiler
Expand Down
83 changes: 61 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
</p>

## BitMono
[![Build status](https://ci.appveyor.com/api/projects/status/8jh35hfno6riq25j?svg=true)](https://ci.appveyor.com/project/sunnamed434/bitmono)
[![Join the chat at https://gitter.im/BitMonoSpeech/community](https://badges.gitter.im/BitMonoSpeech/community.svg)](https://gitter.im/BitMonoSpeech/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build status][image_build]][build]
[![Test status][image_test]][test]
[![Codefactor][image_codefactor]][codefactor]
[![Gitter Chat][image_gitter]][gitter]
[![MIT License][image_license]][license]

BitMono is an free open-source C# obfuscator which in mostly cases works **only** with Mono - well known as fork of .NET Framework but with custom bugs or Unity. Which uses its own fork of **[dnlib](https://github.com/sunnamed434/dnlib)** for assembly manipulation. If you have any questions/issues please let me know **[there](https://github.com/sunnamed434/BitMono/issues)**. You can install lastest version of BitMono **[here](https://github.com/sunnamed434/BitMono/releases)**.
BitMono is an free open-source C# obfuscator that in most cases works **only** with Mono - well known as a fork of .NET framework but for Unity, you can still use this for a whole .NET, but be careful that something working not as intentional, etc. Which uses **[AsmResolver][asmresolver]** for assembly manipulation. If you have any questions/issues please let me know **[there][bitmono_issues]**. You can install the latest version of BitMono **[here][bitmono_releases]**.

<p align="center">
<img src="https://raw.githubusercontent.com/sunnamed434/BitMono/main/resources/images/preview/before-after.png"
Expand All @@ -30,10 +33,10 @@ BitMono is an free open-source C# obfuscator which in mostly cases works **only*
</p>

## Documentation
Open **[wiki](https://github.com/sunnamed434/BitMono/wiki)** to read protections functionnality and more.
Open the **[wiki][bitmono_wiki]** to read protection, functionality and more.

## How your app will look since BitMono obfuscation - just in a few-words
* Seems to C++ application but this is actual C# application
## How your app will look since BitMono obfuscation - just in a few words
* Looks like C++ application but is an actual C# application
* Crash of decompilers when analyzing types
* Broken decompilers
* Broken IL Code
Expand All @@ -42,11 +45,10 @@ Open **[wiki](https://github.com/sunnamed434/BitMono/wiki)** to read protections

## Obfuscation Features
* StringsEncryption
* **[BitDotNet](https://github.com/0x59R11/BitDotNet)** (based and improved on existing protection)
* **[BitMethodDotnet](https://github.com/sunnamed434/BitMethodDotnet)** (based and improved on existing protection)
* **[DotNetHook](https://github.com/Elliesaur/DotNetHook)** (based on existing protection)
* **[BitDotNet][bitdotnet_source]** (based and improved on existing protection)
* **[BitMethodDotnet][bitmethoddotnet_source]** (based and improved on existing protection)
* **[DotNetHook][dotnethook_source]** (based on existing protection)
* Call to calli
* FieldsHiding (Deprecated)
* ObjectReturnType
* NoNamespaces
* FullRenamer
Expand All @@ -57,18 +59,55 @@ Open **[wiki](https://github.com/sunnamed434/BitMono/wiki)** to read protections
## Usage
`BitMono.CLI <path to file>/drag-and-drop or use BitMono.GUI (GUI Windows only)`

Always drop dependencies in `libs` directory in the same path where is obfuscation `file` located
Always drop dependencies in `libs` directory in the same path where `file` for obfuscation is located

Credits
-------
**[0x59R11](https://github.com/0x59R11)** for his acquaintance in big part of **[BitDotNet](https://github.com/0x59R11/BitDotNet)** that breaks files for mono executables!

**[Gazzi](https://github.com/GazziFX)** for his help that [me](https://github.com/sunnamed434) asked a lot!

**[Elliesaur](https://github.com/Elliesaur)** for his acquaintance in **[DotNetHook](https://github.com/Elliesaur/DotNetHook)** that hooks methods.

**[Weka](https://github.com/sasharumega)** for his advices, help and motivation.
### Detailed build status
Branch | AppVeyor
------------- | -------------
main | [![Build status][image_appveyor_main_badge]][appveyor_main_build]
dev | [![Build status][image_appveyor_dev_badge]][appveyor_dev_build]

**[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.
Credits
-------
**[0x59R11][author_0x59r11]** for his acquaintance in big part of **[BitDotNet][bitdotnet_source]** that breaks files for mono executables!

**[Gazzi][author_gazzi]** for his help that [me][author_sunnamed434] asked a lot!

**[Elliesaur][author_ellisaur]** for his acquaintance in **[DotNetHook][dotnethook_source]** that hooks methods.

**[Weka][author_weka]** for his advices, help and motivation.

**[ConfuserEx and their Forks][confuserex_source]** 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][author_kao_blog]** thanks a lot of these blogs.

[build]: https://ci.appveyor.com/project/sunnamed434/bitmono
[test]: https://ci.appveyor.com/project/sunnamed434/bitmono/branch/main/tests
[codefactor]: https://www.codefactor.io/repository/github/sunnamed434/bitmono/overview/main
[gitter]: https://gitter.im/BitMonoSpeech/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[license]: https://github.com/sunnamed434/BitMono/blob/main/LICENSE
[asmresolver]: https://github.com/Washi1337/AsmResolver
[bitmono_issues]: https://github.com/sunnamed434/BitMono/issues
[bitmono_releases]: https://github.com/sunnamed434/BitMono/releases
[bitmono_wiki]: https://github.com/sunnamed434/BitMono/wiki
[bitdotnet_source]: https://github.com/0x59R11/BitDotNet
[bitmethoddotnet_source]: https://github.com/sunnamed434/BitMethodDotnet
[dotnethook_source]: https://github.com/Elliesaur/DotNetHook
[confuserex_source]: https://github.com/yck1509/ConfuserEx
[author_0x59r11]: https://github.com/0x59R11
[author_gazzi]: https://github.com/GazziFX
[author_ellisaur]: https://github.com/Elliesaur
[author_weka]: https://github.com/sasharumega
[author_kao_blog]: https://lifeinhex.com/
[author_sunnamed434]: https://github.com/sunnamed434
[appveyor_main_build]: https://ci.appveyor.com/project/sunnamed434/bitmono/branch/main
[appveyor_dev_build]: https://ci.appveyor.com/project/sunnamed434/bitmono/branch/dev

[image_build]: https://ci.appveyor.com/api/projects/status/8jh35hfno6riq25j?svg=true&style=plastic
[image_test]: https://img.shields.io/appveyor/tests/sunnamed434/bitmono/main?style=plastic
[image_codefactor]: https://www.codefactor.io/repository/github/sunnamed434/bitmono/badge/main
[image_gitter]: https://badges.gitter.im/BitMonoSpeech/community.svg?style=plastic
[image_license]: https://img.shields.io/github/license/sunnamed434/bitmono
[image_appveyor_main_badge]: https://ci.appveyor.com/api/projects/status/8jh35hfno6riq25j/branch/main?svg=true
[image_appveyor_dev_badge]: https://ci.appveyor.com/api/projects/status/b9rm3l7kduryjgcj/branch/dev?svg=true
13 changes: 11 additions & 2 deletions src/BitMono.API/BitMono.API.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

Expand All @@ -21,6 +21,15 @@
<DebugType>none</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AsmResolver" Version="5.0.0" />
<PackageReference Include="AsmResolver.DotNet" Version="5.0.0" />
Expand All @@ -32,7 +41,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0-rc.2.22472.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0-rc.2.22472.3" />
<PackageReference Include="morelinq" Version="3.3.2" />
<PackageReference Include="NullGuard.Fody" Version="3.1.0" />
<PackageReference Include="NullGuard.Fody" Version="3.1.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/BitMono.API/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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 Microsoft.Extensions.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

public class CustomAttributeResolve
{
public CustomAttribute CustomAttribute { get; set; }
public object Value { get; set; }
[AllowNull]
public Dictionary<string, object> NamedValues { get; set; }
[AllowNull]
public List<object> FixedValues { get; set; }
public CustomAttribute Attribute { get; set; }
}

This file was deleted.

7 changes: 4 additions & 3 deletions src/BitMono.API/Protecting/Resolvers/IAttributeResolver.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
namespace BitMono.API.Protecting.Resolvers;

public interface IAttributeResolver
public interface IAttributeResolver<TModel>
where TModel : class
{
bool Resolve(string feature, IHasCustomAttribute from, out CustomAttributeResolve attributeResolve);
bool Resolve(string feature, IHasCustomAttribute from);
bool Resolve(string featureName, IHasCustomAttribute from, out TModel model);
bool Resolve(string featureName, IHasCustomAttribute from);
bool Resolve(IHasCustomAttribute from);
bool Resolve(Type featureType, IHasCustomAttribute from);
bool Resolve<TFeature>(IHasCustomAttribute from) where TFeature : IProtection;
Expand Down

This file was deleted.

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

This file was deleted.

Loading

0 comments on commit 6999463

Please sign in to comment.