Skip to content

Commit da6269d

Browse files
authored
Merge pull request #107 from sunnamed434/dev
Bump new version v0.12.1-alpha.22
2 parents dfed93d + 17c80af commit da6269d

File tree

18 files changed

+201
-30
lines changed

18 files changed

+201
-30
lines changed

BitMono.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Core.TestCases.Type
5959
EndProject
6060
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Core.TestCases.Reflection", "test\TestBinaries\DotNet\BitMono.Core.TestCases.Reflection\BitMono.Core.TestCases.Reflection.csproj", "{1683308C-36D4-49B1-8CCE-9DDE09336856}"
6161
EndProject
62+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Obfuscation.Tests", "test\BitMono.Obfuscation.Tests\BitMono.Obfuscation.Tests.csproj", "{49E6076C-FEC8-4411-B7AE-4DB6112370C1}"
63+
EndProject
64+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitMono.Obfuscation.TestCases.CosturaDecompressor", "test\TestBinaries\BitMono.Obfuscation.TestCases.CosturaDecompressor\BitMono.Obfuscation.TestCases.CosturaDecompressor.csproj", "{E73C9803-971F-4F7D-A21B-9097C2EC1A80}"
65+
EndProject
6266
Global
6367
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6468
Debug|Any CPU = Debug|Any CPU
@@ -139,6 +143,14 @@ Global
139143
{1683308C-36D4-49B1-8CCE-9DDE09336856}.Debug|Any CPU.Build.0 = Debug|Any CPU
140144
{1683308C-36D4-49B1-8CCE-9DDE09336856}.Release|Any CPU.ActiveCfg = Release|Any CPU
141145
{1683308C-36D4-49B1-8CCE-9DDE09336856}.Release|Any CPU.Build.0 = Release|Any CPU
146+
{49E6076C-FEC8-4411-B7AE-4DB6112370C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
147+
{49E6076C-FEC8-4411-B7AE-4DB6112370C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
148+
{49E6076C-FEC8-4411-B7AE-4DB6112370C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
149+
{49E6076C-FEC8-4411-B7AE-4DB6112370C1}.Release|Any CPU.Build.0 = Release|Any CPU
150+
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
151+
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Debug|Any CPU.Build.0 = Debug|Any CPU
152+
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Release|Any CPU.ActiveCfg = Release|Any CPU
153+
{E73C9803-971F-4F7D-A21B-9097C2EC1A80}.Release|Any CPU.Build.0 = Release|Any CPU
142154
EndGlobalSection
143155
GlobalSection(SolutionProperties) = preSolution
144156
HideSolutionNode = FALSE
@@ -164,6 +176,8 @@ Global
164176
{4166AC73-6969-406A-ADD0-67CB70A76D9C} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
165177
{5DC793B1-F82B-4BC7-99C9-FE8C1545E1F7} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
166178
{1683308C-36D4-49B1-8CCE-9DDE09336856} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
179+
{49E6076C-FEC8-4411-B7AE-4DB6112370C1} = {1EF50257-AFD3-48A3-9E22-03BDC25550A7}
180+
{E73C9803-971F-4F7D-A21B-9097C2EC1A80} = {A431DCB4-6EF9-4BEF-8902-FA704D62624E}
167181
EndGlobalSection
168182
GlobalSection(ExtensibilityGlobals) = postSolution
169183
SolutionGuid = {7DA0BB43-C1D4-4688-BE43-A9ED2D6F78EE}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| Versions: |
22
| - |
3+
| [v0.12.1-alpha](#v0121-alpha22) |
34
| [v0.12.0-alpha](#v0120-alpha21) |
45
| [v0.11.0-alpha](#v0110-alpha20) |
56
| [v0.10.0-alpha](#v0100-alpha19) |
@@ -23,6 +24,14 @@
2324
| [v0.1.0](#v010) |
2425

2526
---
27+
### v0.12.1-alpha.22:
28+
2023-03-06
29+
#### Added:
30+
* Test cases for costura decompressor.
31+
32+
#### Fixed:
33+
* Costura decompressor.
34+
2635
### v0.12.0-alpha.21:
2736
2023-03-05
2837
#### Added:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![Gitter Chat][image_gitter]][gitter]
1212
[![MIT License][image_license]][license]
1313

14-
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]**.
14+
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, because the main target of the this project is Mono. Which uses **[AsmResolver][asmresolver]** for assembly manipulation (not a dnlib as you might already think). If you have any questions/issues please let me know **[there][bitmono_issues]**. You can install the latest version of BitMono **[here][bitmono_releases]**.
1515

1616
<p align="center">
1717
<img src="https://raw.githubusercontent.com/sunnamed434/BitMono/main/resources/images/preview/before-after.png"
@@ -112,7 +112,7 @@ Specify file, libs and output. If output directory doesn't exist BitMono will cr
112112
$ BitMono.CLI -f C:\specially_created_folder_for_obfuscation/your_app.exe -l C:\mythings\obfuscation\superLibsDirectory -o C:\specially_created_folder_for_obfuscation/output
113113
```
114114

115-
Want more? Read the **[docs][bitmono_docs]**.
115+
Want more? Simply read the **[docs][bitmono_docs]**.
116116

117117
### Detailed build status
118118
Branch | AppVeyor
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
When and why use BitMono?
2+
=========================
3+
4+
You know the answer, but let me open your eyes.
5+
6+
There are a lot of obfuscators/protectors, paid and free but most of them are out of support, more and more often I see new issues/pull-request, but it's just being ignored by the open-source maintainers, this is sad. I have no doubt that BitMono could have such a future too, but, at any moment BitMono can be easily forked and supported by anyone, because of its clean code, architecture, and AsmResolver as an assembly manipulator.
7+
8+
- Write your own protection, but you don't want to use ConfuserEx engine or writing your own.
9+
- Protect your intelictual property against reversers, at least, let them spend more time on it.
10+
- Protect yourself against skids.
11+
- Protect game cheat against anti-cheats.
12+
- Contribute to the BitMono.

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ Table of Contents:
5151
:name: sec-faq
5252

5353
faq/costura-support
54-
faq/disable-path-masking
54+
faq/disable-path-masking
55+
faq/when-and-why-use-bitmono

props/SharedProjectProps.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<PackageLicenseExpression>MIT</PackageLicenseExpression>
77
<PackageProjectUrl>https://github.com/sunnamed434/BitMono</PackageProjectUrl>
88
<PackageOwners>sunnamed434</PackageOwners>
9-
<PackageVersion>0.12.0-alpha.21</PackageVersion>
9+
<PackageVersion>0.12.1-alpha.22</PackageVersion>
1010
<RepositoryUrl>https://github.com/sunnamed434/BitMono</RepositoryUrl>
1111
<RepositoryType>git</RepositoryType>
1212
<Authors>sunnamed434</Authors>
13-
<Version>0.12.0-alpha.21</Version>
14-
<InformationalVersion>0.12.0-alpha.21</InformationalVersion>
13+
<Version>0.12.1-alpha.22</Version>
14+
<InformationalVersion>0.12.1-alpha.22</InformationalVersion>
1515
<Company>BitMono</Company>
1616
<Copyright>sunnamed434</Copyright>
1717
<LangVersion>10</LangVersion>

src/BitMono.Obfuscation/Abstractions/CosturaReferencesDataResolver.cs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,21 @@ namespace BitMono.Obfuscation.Abstractions;
22

33
public class CosturaReferencesDataResolver : IReferencesDataResolver
44
{
5-
private const string CosturaResourceNameStart = "costura.";
6-
private const string CosturaResourceNameEnd = ".dll.compressed";
7-
private const int MinCosturaResourceNameCharactersLenght = 19;
8-
95
[SuppressMessage("ReSharper", "ForCanBeConvertedToForeach")]
106
[SuppressMessage("ReSharper", "LoopCanBeConvertedToQuery")]
117
[SuppressMessage("ReSharper", "InvertIf")]
128
public IEnumerable<byte[]> Resolve(ModuleDefinition module)
139
{
14-
for (var i = 0; i < module.Resources.Count; i++)
10+
var resources = module.Resources;
11+
for (var i = 0; i < resources.Count; i++)
1512
{
16-
var resource = module.Resources[i];
17-
if (resource.IsEmbedded)
13+
var resource = resources[i];
14+
if (resource.IsEmbeddedCosturaResource())
1815
{
19-
if (Utf8String.IsNullOrEmpty(resource.Name) == false)
16+
var rawData = resource.GetData();
17+
if (rawData != null)
2018
{
21-
var name = resource.Name.Value;
22-
if (name.Length > MinCosturaResourceNameCharactersLenght)
23-
{
24-
if (name.StartsWith(CosturaResourceNameStart) && name.EndsWith(CosturaResourceNameEnd))
25-
{
26-
var data = resource.GetData();
27-
if (data != null)
28-
{
29-
data = Decompress(data);
30-
yield return data;
31-
}
32-
}
33-
}
19+
yield return Decompress(rawData);
3420
}
3521
}
3622
}

src/BitMono.Obfuscation/BitMonoEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public BitMonoEngine(ILifetimeScope lifetimeScope)
2121
_obfuscationAttributeResolver = _lifetimeScope.Resolve<ObfuscationAttributeResolver>();
2222
_obfuscateAssemblyAttributeResolver = _lifetimeScope.Resolve<ObfuscateAssemblyAttributeResolver>();
2323
_obfuscation = _lifetimeScope.Resolve<IOptions<Shared.Models.Obfuscation>>().Value;
24-
_protectionSettings = _lifetimeScope.Resolve<IOptions<ProtectionSettings>>().Value.Protections;
24+
_protectionSettings = _lifetimeScope.Resolve<IOptions<ProtectionSettings>>().Value.Protections!;
2525
_memberResolvers = _lifetimeScope
2626
.Resolve<ICollection<IMemberResolver>>()
2727
.ToList();;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace BitMono.Utilities.AsmResolver;
2+
3+
[SuppressMessage("ReSharper", "InvertIf")]
4+
public static class ManifestResourceExtensions
5+
{
6+
private const string CosturaResourceNameStart = "costura.";
7+
private const string CosturaResourceNameEnd = ".dll.compressed";
8+
private const int MinCosturaResourceNameCharactersLenght = 19;
9+
10+
public static bool IsEmbeddedCosturaResource(this ManifestResource source)
11+
{
12+
if (Utf8String.IsNullOrEmpty(source.Name) == false)
13+
{
14+
if (source.IsEmbedded)
15+
{
16+
var name = source.Name.Value;
17+
if (name.StartsWith(CosturaResourceNameStart)
18+
&& name.EndsWith(CosturaResourceNameEnd))
19+
{
20+
return true;
21+
}
22+
}
23+
}
24+
return false;
25+
}
26+
}

test/BitMono.Core.Tests/BitMono.Core.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
<ProjectReference Include="..\TestBinaries\DotNet\BitMono.Core.TestCases.Types\BitMono.Core.TestCases.Types.csproj" />
4040
</ItemGroup>
4141

42-
</Project>
42+
</Project>

0 commit comments

Comments
 (0)