Skip to content

Commit

Permalink
Merge pull request #106 from sunnamed434/dev
Browse files Browse the repository at this point in the history
Bump new version 0.12.0-alpha.21
  • Loading branch information
sunnamed434 authored Mar 5, 2023
2 parents 3e97dd2 + bb9b70b commit dfed93d
Show file tree
Hide file tree
Showing 62 changed files with 483 additions and 290 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Versions: |
| - |
| [v0.12.0-alpha](#v0120-alpha21) |
| [v0.11.0-alpha](#v0110-alpha20) |
| [v0.10.0-alpha](#v0100-alpha19) |
| [v0.9.0-alpha](#v090-alpha18) |
Expand All @@ -22,11 +23,21 @@
| [v0.1.0](#v010) |

---
### v0.12.0-alpha.21:
2023-03-05
#### Added:
* [Costura-Fody](https://github.com/Fody/Costura) support, now references are resolved automatically, [#102](https://github.com/sunnamed434/BitMono/issues/102)
* Support when path contains quotes (for example: "path..."), [#104](https://github.com/sunnamed434/BitMono/issues/104)

#### Fixed:
* Hiding of the paths (before paths with .exe may cause an ignore)
* Now output directory path message shows normally (before ***\folder_before_output, now ***\output)

### v0.11.0-alpha.20:
2023-02-016
#### Added:
* BitMono ASCII Art in CLI
* Hiding of the pathes (file path, directory path, etc)
* BitMono ASCII Art in CLI.
* Hiding of the pathes (file path, directory path, etc).
* Documentation.

#### Fixed:
Expand Down
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[![Gitter Chat][image_gitter]][gitter]
[![MIT License][image_license]][license]

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]**.
BitMono is a free open-source C# obfuscator that in most cases works **only** with Mono - well known as a fork of .NET framework (which runs popular platforms such as Unity, etc), 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 @@ -35,7 +35,7 @@ BitMono is an free open-source C# obfuscator that in most cases works **only** w

Want more previews? Click **[here][previews]**.

## Documentation
## Documentation
Read the **[docs][bitmono_docs]** to read protection, functionality, and more.

## How your app will look since BitMono obfuscation - just in a few words
Expand All @@ -44,7 +44,7 @@ Read the **[docs][bitmono_docs]** to read protection, functionality, and more.
* Broken decompilers
* Broken IL Code
* Invisible types
* No code
* No code

## Obfuscation Features
* StringsEncryption
Expand Down Expand Up @@ -80,12 +80,6 @@ specially_created_folder_for_obfuscation/
Copy all libraries (.dll) from the building application folder and paste them into the `libs` directory (if it doesn't exist yet create it), or even create the libs directory yourself with a custom name for example - `myLibs`, and then specify it in BitMono, however, if you will use `libs` then by default BitMono looking for a `libs` directory, so it will save your time.

### Using CLI Commands
Outputs available commands
```console
$ BitMono.CLI --help
```

Upper command output:
```console
-f, --file Required. Set file path.

Expand All @@ -98,7 +92,7 @@ Upper command output:
--version Display version information.
```

Basic examples
Basic example
```console
$ BitMono.CLI -f C:\specially_created_folder_for_obfuscation/your_app.exe -l specially_created_folder_for_obfuscation/libs
```
Expand All @@ -122,8 +116,8 @@ Want more? Read the **[docs][bitmono_docs]**.

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

Credits
Expand All @@ -134,12 +128,14 @@ Credits

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

**[Weka][author_naweka]** for his advices, help and motivation.
**[Weka][author_naweka]** 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.

**[drakonia][author_drakonia]** for her **[costura decompressor][simple_costura_decompressor_source]**.

[test]: https://ci.appveyor.com/project/sunnamed434/bitmono/branch/main/tests
[codefactor]: https://www.codefactor.io/repository/github/sunnamed434/bitmono/overview/main
[deepsource]: https://deepsource.io/gh/sunnamed434/BitMono/?ref=repository-badge
Expand All @@ -154,11 +150,13 @@ Credits
[bitmethoddotnet_source]: https://github.com/sunnamed434/BitMethodDotnet
[dotnethook_source]: https://github.com/Elliesaur/DotNetHook
[confuserex_source]: https://github.com/yck1509/ConfuserEx
[simple_costura_decompressor_source]: https://github.com/dr4k0nia/Simple-Costura-Decompressor
[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_kao_blog]: https://lifeinhex.com/
[author_drakonia]: https://github.com/dr4k0nia
[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
Expand Down
4 changes: 4 additions & 0 deletions docs/faq/costura-support.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Does BitMono provide Costura-Fody Support by default?
=====================================================

Indeed, by default BitMono provides support for the Costura-Fody, resources will be resolved automatically, in this case, you don't need to have copies of your .DLLs or even set ``DisableCleanup`` to ``true`` in ``FodyWeavers.xml``.
58 changes: 58 additions & 0 deletions docs/faq/disable-path-masking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
How to disable path masking?
============================

You're probably getting a message with the file/directory or just a path ``(***\things)``, and you might have the same folder twice somewhere, and you need to see the full path without masking if this is what you're looking for, all instructions how to do that are provided here.

Open-up ``logging.json`` in the root of the downloaded BitMono, edit this file, and remove this:

.. code-block:: json
"Enrich": [
{
"Name": "WithSensitiveDataMasking",
"Args": {
"options": {
"MaskValue": "***\\",
"MaskProperties": [ "path", "directory", "file" ],
"MaskingOperators": [ "BitMono.Host.Extensions.PathMaskingOperator, BitMono.Host" ]
}
}
},
],
So, after edit ``logging.json`` looks like this:

.. code-block:: json
{
"Serilog": {
"Using": [
"Serilog",
"Serilog.Sinks.Console",
"Serilog.Sinks.File",
"Serilog.Sinks.Async",
"Serilog.Enrichers.Sensitive"
],
"WriteTo": [
{
"Name": "Async",
"Args": {
"configure": [
{
"Name": "File",
"Args": {
"path": "logs/bitmono-{{date}}.log",
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}][{SourceContext}] {Message:lj}{NewLine}{Exception}"
}
}
]
}
}
],
"Enrich": [
"FromLogContext"
],
"MinimumLevel": "Debug"
}
}
11 changes: 10 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@ Table of Contents:

configuration/exclude-obfuscation
configuration/third-party-issues
configuration/protections
configuration/protections


.. toctree::
:maxdepth: 1
:caption: Frequently Asked Questions
:name: sec-faq

faq/costura-support
faq/disable-path-masking
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.11.0-alpha.20</PackageVersion>
<PackageVersion>0.12.0-alpha.21</PackageVersion>
<RepositoryUrl>https://github.com/sunnamed434/BitMono</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Authors>sunnamed434</Authors>
<Version>0.11.0-alpha.20</Version>
<InformationalVersion>0.11.0-alpha.20</InformationalVersion>
<Version>0.12.0-alpha.21</Version>
<InformationalVersion>0.12.0-alpha.21</InformationalVersion>
<Company>BitMono</Company>
<Copyright>sunnamed434</Copyright>
<LangVersion>10</LangVersion>
Expand Down
15 changes: 7 additions & 8 deletions src/BitMono.API/Contexts/ProtectionParameters.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
namespace BitMono.API.Contexts
namespace BitMono.API.Contexts;

public class ProtectionParameters
{
public class ProtectionParameters
public ProtectionParameters(List<IMetadataMember> members)
{
public ProtectionParameters(List<IMetadataMember> members)
{
Members = members;
}

public List<IMetadataMember> Members { get; }
Members = members;
}

public List<IMetadataMember> Members { get; }
}
1 change: 1 addition & 0 deletions src/BitMono.CLI/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
global using BitMono.Host.Extensions;
global using BitMono.Obfuscation.Abstractions;
global using BitMono.Obfuscation.Interfaces;
global using BitMono.Utilities.Paths;
global using CommandLine;
global using Microsoft.Extensions.Options;
global using Pocket.Extensions;
Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.CLI/Modules/CLIBitMonoModuleFileResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal class CLIBitMonoModuleFileResolver
string? file = null;
if (args.IsEmpty() == false)
{
file = args[0];
file = PathFormatterUtility.Format(args[0]);
}
return file;
}
Expand Down
6 changes: 3 additions & 3 deletions src/BitMono.CLI/Modules/CLIObfuscationNeedsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public ObfuscationNeeds Create()
try
{
m_Logger.Information("Please, specify file or drag-and-drop in BitMono CLI");
fileName = Console.ReadLine();
fileName = PathFormatterUtility.Format(Console.ReadLine());
if (string.IsNullOrWhiteSpace(fileName) == false)
{
if (File.Exists(fileName))
Expand Down Expand Up @@ -62,7 +62,7 @@ public ObfuscationNeeds Create()
}

m_Logger.Information("Please, specify dependencies (libs) path: ");
var newDependenciesDirectoryName = Console.ReadLine();
var newDependenciesDirectoryName = PathFormatterUtility.Format(Console.ReadLine());
if (string.IsNullOrWhiteSpace(newDependenciesDirectoryName) == false)
{
if (Directory.Exists(newDependenciesDirectoryName))
Expand Down Expand Up @@ -99,7 +99,7 @@ public ObfuscationNeeds Create()
{
FileName = fileName,
FileBaseDirectory = fileBaseDirectory,
DependenciesDirectoryName = dependenciesDirectoryName,
ReferencesDirectoryName = dependenciesDirectoryName,
OutputDirectoryName = outputDirectoryName
};
}
Expand Down
1 change: 1 addition & 0 deletions src/BitMono.CLI/Modules/CLIOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace BitMono.CLI.Modules;

[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
[SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")]
public class CLIOptions
{
[Option('f', "file", Required = true, HelpText = "Set file path.")]
Expand Down
4 changes: 2 additions & 2 deletions src/BitMono.CLI/Modules/CLIOptionsObfuscationNeedsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public CLIOptionsObfuscationNeedsFactory(string[] args, ILogger logger)
{
FileName = options.File,
FileBaseDirectory = fileBaseDirectory,
DependenciesDirectoryName = options.Libraries.IsNullOrEmpty() == false
ReferencesDirectoryName = options.Libraries.IsNullOrEmpty() == false
? options.Libraries
: Path.Combine(fileBaseDirectory, "libs"),
OutputDirectoryName = options.Output.IsNullOrEmpty() == false
Expand All @@ -46,7 +46,7 @@ public CLIOptionsObfuscationNeedsFactory(string[] args, ILogger logger)
};

Directory.CreateDirectory(needs.OutputDirectoryName);
Directory.CreateDirectory(needs.DependenciesDirectoryName);
Directory.CreateDirectory(needs.ReferencesDirectoryName);
return needs;
}
}
2 changes: 1 addition & 1 deletion src/BitMono.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private static async Task Main(string[] args)

Console.Clear();
logger.Information("File: {0}", needs.FileName);
logger.Information("Dependencies (libs): {0}", needs.DependenciesDirectoryName);
logger.Information("Dependencies (libs): {0}", needs.ReferencesDirectoryName);
logger.Information("Everything is seems to be ok, starting obfuscation..");
logger.Information(AsciiArt);

Expand Down
2 changes: 1 addition & 1 deletion src/BitMono.Core/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
global using BitMono.API.Pipeline;
global using BitMono.Core.Analyzing;
global using BitMono.Core.Contexts;
global using BitMono.Core.Injection;
global using BitMono.Core.Renaming;
global using BitMono.Core.Services;
global using BitMono.Utilities.AsmResolver;
global using Echo.DataFlow.Analysis;
global using Echo.Platforms.AsmResolver;
Expand Down
4 changes: 2 additions & 2 deletions src/BitMono.Core/Injection/CustomInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class CustomInjector
{
public CustomAttribute InjectAttribute(ModuleDefinition module, string @namespace, string name)
public static CustomAttribute InjectAttribute(ModuleDefinition module, string @namespace, string name)
{
var factory = module.CorLibTypeFactory;
var attributeReference = new TypeReference(module, module, @namespace, name);
Expand All @@ -12,7 +12,7 @@ public CustomAttribute InjectAttribute(ModuleDefinition module, string @namespac
module.CustomAttributes.Add(attribute);
return attribute;
}
public CustomAttribute InjectAttribute(ModuleDefinition module, string @namespace, string name, string content)
public static CustomAttribute InjectAttribute(ModuleDefinition module, string @namespace, string name, string content)
{
var factory = module.CorLibTypeFactory;
var attributeReference = new TypeReference(module, module, @namespace, name);
Expand Down
Loading

0 comments on commit dfed93d

Please sign in to comment.