Skip to content

Commit

Permalink
Merge pull request #124 from sunnamed434/dev
Browse files Browse the repository at this point in the history
Bump new version 0.15.0-alpha.27
  • Loading branch information
sunnamed434 committed Apr 27, 2023
2 parents 2a6b925 + ece9fae commit 494bfed
Show file tree
Hide file tree
Showing 87 changed files with 725 additions and 452 deletions.
6 changes: 5 additions & 1 deletion BitMono.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/SuppressUninitializedWarningFix/Enabled/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/CodeEditing/SuppressUninitializedWarningFix/Enabled/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CLI/@EntryIndexedValue">CLI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JS/@EntryIndexedValue">JS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NET/@EntryIndexedValue">NET</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ldasm/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Versions: |
|---------------------------------|
| [v0.15.0-alpha](#v0150-alpha27) |
| [v0.14.0-alpha](#v0140-alpha26) |
| [v0.13.1-alpha](#v0131-alpha25) |
| [v0.13.0-alpha](#v0130-alpha24) |
Expand Down Expand Up @@ -28,6 +29,19 @@
| [v0.1.0](#v010) |

---
### v0.15.0-alpha.27:
2023-04-27
#### Added:
* UnmanagedString Protection.
* More docs.

#### Fixed:
* DotNetHook Protection.

#### Changed:
* Major improvements and changes in Engine APIs.
* Removed PreserveAll flag, now obfuscation should be more stable.

### v0.14.0-alpha.26:
2023-04-24
#### Added:
Expand Down Expand Up @@ -81,7 +95,7 @@
2023-02-016
#### Added:
* BitMono ASCII Art in CLI.
* Hiding of the pathes (file path, directory path, etc).
* Hiding of the path (file path, directory path, etc).
* Documentation.

#### Fixed:
Expand Down Expand Up @@ -162,7 +176,7 @@

### v0.5.0-alpha.14:
#### Added:
* Before obfuscation optmizes all method bodies (macros)
* Before obfuscation optimizes all method bodies (macros)

#### Fixed:
* BitMethodDotnet Protection
Expand Down
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ BitMono is a free open-source C# obfuscator that in most cases works **only** wi

<p align="center">
<img src="https://raw.githubusercontent.com/sunnamed434/BitMono/main/resources/images/preview/before-after.png"
alt="Before and after obfuscation preview by BitMono"
alt="Before and after obfuscation preview by BitMono">
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/sunnamed434/BitMono/main/resources/images/preview/before-after-2.png"
alt="Before and after obfuscation preview by BitMono 2"
alt="Before and after obfuscation preview by BitMono 2">
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/sunnamed434/BitMono/main/resources/images/preview/GUI.png"
alt="GUI"
alt="GUI">
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/sunnamed434/BitMono/main/resources/images/preview/CLI.png"
alt="CLI"
alt="CLI">
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/sunnamed434/BitMono/main/resources/images/preview/configuration.png"
alt="Configuration"
alt="Configuration">
</p>

## Usability
BitMono breaks the most popular tools using just one packer, such as:
- dnspy;
- dnSpy;
- dnlib;
- AsmResolver;
- MonoCecil;
Expand All @@ -65,8 +65,9 @@ Read the **[docs][bitmono_docs]** to read protection, functionality, and more.
* Invisible types
* No code

## Obfuscation Features
## Features
* StringsEncryption
* **[UnmanagedString][unmanagedstring_source]** (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)
Expand Down Expand Up @@ -134,10 +135,10 @@ $ BitMono.CLI -f C:\specially_created_folder_for_obfuscation/your_app.exe -l C:\
Want more? Simply read the **[docs][bitmono_docs]**.

### Detailed build status
Branch | AppVeyor
------------- | -------------
main | [![Build status][image_appveyor_main]][appveyor_main_build]
dev | [![Build status][image_appveyor_dev]][appveyor_dev_build]
| Branch | AppVeyor |
|--------|-------------------------------------------------------------|
| main | [![Build status][image_appveyor_main]][appveyor_main_build] |
| dev | [![Build status][image_appveyor_dev]][appveyor_dev_build] |

Credits
-------
Expand All @@ -149,6 +150,8 @@ Credits

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

**[MrakDev][author_mrakdev]** for the acquaintance in **[UnmanagedString][unmanagedstring_source]**.

**[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.

**[OpenMod][openmod_source]** Definitely, openmod inspired this project a lot with services and clean code, extensive similar things to openmod.
Expand All @@ -173,10 +176,12 @@ Credits
[openmod_source]: https://github.com/openmod/openmod
[confuserex_source]: https://github.com/yck1509/ConfuserEx
[simple_costura_decompressor_source]: https://github.com/dr4k0nia/Simple-Costura-Decompressor
[unmanagedstring_source]: https://github.com/MrakDev/UnmanagedString
[author_0x59r11]: https://github.com/0x59R11
[author_gazzi]: https://github.com/GazziFX
[author_ellisaur]: https://github.com/Elliesaur
[author_naweka]: https://github.com/naweka
[author_mrakdev]: https://github.com/MrakDev
[author_kao_blog]: https://lifeinhex.com/
[author_drakonia]: https://github.com/dr4k0nia
[author_sunnamed434]: https://github.com/sunnamed434
Expand Down
30 changes: 17 additions & 13 deletions docs/developers/do-not-resolve-members.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Do Not Resolve Members
======================


.. warning::

Be careful, because ``Context.Module`` (ModuleDefinition) doesn't affected by ``DoNotResolveAttribute``.


For comfort BitMono provides an API which able to do not pass specfic members inside of the protection for easier understanding and abstraction let's call ``members`` as - types/methods/fields/properties, etc.


Expand Down Expand Up @@ -32,18 +38,14 @@ Add attribute ``[DoNotResolve(MemberInclusionFlags.Reflection)]`` with ``MemberI
You can specify multiple inclusion flags:
.. code-block:: csharp
[UsedImplicitly]
[DoNotResolve(MemberInclusionFlags.SpecialRuntime | MemberInclusionFlags.Reflection)]
public class MagicProtection : Protection
You can specify multiple inclusion flags.
.. warning::
.. code-block:: csharp
Be careful, because ``Module`` doesn't affected by ``DoNotResolveAttribute``.
[UsedImplicitly]
[DoNotResolve(MemberInclusionFlags.SpecialRuntime | MemberInclusionFlags.Reflection)]
public class MagicProtection : Protection
THIS IS TOTALLY BAD AND WRONG! Sorting doesn't affects to the actual Module.
Expand All @@ -61,7 +63,7 @@ THIS IS TOTALLY BAD AND WRONG! Sorting doesn't affects to the actual Module.
Instead highly recommend to use this:
Instead highly recommend to use this.


.. code-block:: csharp
Expand All @@ -75,8 +77,10 @@ Instead highly recommend to use this:
}
This is also was wrong because if you will try to get access to the ``type.Methods``, etc, methods are not sorted, use specificly what you need, for example:
- Need access to the types and methods? Then do this:
This is also was wrong because if you will try to get access to the ``type.Methods``, etc, methods are not sorted, use specificly what you need, for example.


Need access to the types and methods? Then do this.


.. code-block:: csharp
Expand All @@ -94,7 +98,7 @@ This is also was wrong because if you will try to get access to the ``type.Metho
}
Need access to the methods? Then just iterrate through the methods:
Need access to the methods? Then just iterrate through the methods.


.. code-block:: csharp
Expand Down
28 changes: 15 additions & 13 deletions docs/developers/obfuscation-execution-order.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ Obfuscation Engine Execution Order

BitMono uses its own obfuscation execution order which is good to be known, and it reminds ConfuserEx a lot, if you're familiar with it you can be easier with it.

1. Basic output information about Protections
2. Elapsed time counter
3. Output Information of Running Framework
4. Resolve References
5. Expand Macros
6. Run Protection, PipelineProtection and child pipeline protections
1. Output Loaded Module Info
2. Sort Protections
3. Basic output information about Protections
4. Elapsed time counter
5. Output Information of Running Framework
6. Resolve References
7. Expand Macros
8. Run Protection, PipelineProtection and child pipeline protections


.. code-block:: csharp
Expand All @@ -18,17 +20,17 @@ BitMono uses its own obfuscation execution order which is good to be known, and
public class Pipeline : PipelineProtection
5. Optimize Macros
6. [ObfuscationAttribute] cleanup
7. Create PE Image
8. Output PE Image Build Errors
9. Write Module
10. Run Packers
9. Optimize Macros
10. [ObfuscationAttribute] cleanup
11. Create PE Image
12. Output PE Image Build Errors
13. Write Module
14. Run Packers
.. code-block:: csharp
public class Packer : PackerProtection
11. Output Elapsed Time since obfuscation
15. Output Elapsed Time since obfuscation
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Table of Contents:
protections/fullrenamer
protections/objectreturntype
protections/stringsencryption
protections/unmanagedstring
protections/nonamespaces


Expand Down
7 changes: 5 additions & 2 deletions docs/protections/stringsencryption.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ StringsEncryption

How it works?
-------------
Protection encrypts strings using basic AES encryption, but not everyone like it because it makes the worse performance of application.
Protection encrypts strings using basic AES encryption, but not everyone like it because it makes the worse performance of application, but can be used with AntiDecompiler to crash dnSpy while analyzing the used class, also makes the RVA of the byte[] 0

Had big thoughts about `Unmanaged String <https://github.com/MrakDev/UnmanagedString>`_, but, as I tested in Mono it causes problems.

.. warning::

This protection slows down the application a lot.
11 changes: 11 additions & 0 deletions docs/protections/unmanagedstring.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UnmanagedString
===============

How it works?
-------------
Protection creates native method with assembly code and protects strings only that can be encoded with `Windows-1252` encoding.


.. warning::

This protection is only compatible with .NET Framework and .NET Core, and doens't work with Mono.
6 changes: 3 additions & 3 deletions props/SharedProjectProps.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/sunnamed434/BitMono</PackageProjectUrl>
<PackageOwners>sunnamed434</PackageOwners>
<PackageVersion>0.14.0-alpha.26</PackageVersion>
<PackageVersion>0.15.0-alpha.27</PackageVersion>
<RepositoryUrl>https://github.com/sunnamed434/BitMono</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Authors>sunnamed434</Authors>
<Version>0.14.0-alpha.26</Version>
<InformationalVersion>0.14.0-alpha.26</InformationalVersion>
<Version>0.15.0-alpha.27</Version>
<InformationalVersion>0.15.0-alpha.27</InformationalVersion>
<Company>BitMono</Company>
<Copyright>sunnamed434</Copyright>
<LangVersion>10</LangVersion>
Expand Down
1 change: 1 addition & 0 deletions src/BitMono.API/Contexts/ProtectionParameters.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace BitMono.API.Contexts;

[SuppressMessage("ReSharper", "UnusedType.Global")]
public class ProtectionParameters
{
public ProtectionParameters(List<IMetadataMember> members)
Expand Down
1 change: 1 addition & 0 deletions src/BitMono.API/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
global using NullGuard;
global using System;
global using System.Collections.Generic;
global using System.Diagnostics.CodeAnalysis;
global using System.Threading.Tasks;
global using IModule = Autofac.Core.IModule;
10 changes: 0 additions & 10 deletions src/BitMono.API/Pipeline/IInvokablePipeline.cs

This file was deleted.

3 changes: 1 addition & 2 deletions src/BitMono.CLI/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
global using System.Threading;
global using System.Threading.Tasks;
global using BitMono.Host.Extensions;
global using BitMono.Obfuscation.Abstractions;
global using BitMono.Obfuscation.Interfaces;
global using BitMono.Obfuscation.Files;
global using BitMono.Shared.Models;
global using BitMono.Utilities.Paths;
global using CommandLine;
Expand Down
1 change: 1 addition & 0 deletions src/BitMono.CLI/KnownReturnStatuses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ internal static class KnownReturnStatuses
{
public const int Success = 0;
public const int Failure = 1;
public const int Cancel = 2;
}
2 changes: 1 addition & 1 deletion src/BitMono.CLI/Modules/CLIBitMonoModuleFileResolver.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace BitMono.CLI.Modules;

internal class CLIBitMonoModuleFileResolver
internal static class CLIBitMonoModuleFileResolver
{
public static string? Resolve(string[] args)
{
Expand Down

0 comments on commit 494bfed

Please sign in to comment.