Closed darkSuperman closed 1 year ago
Hey!
Thanks! Me and contributors doing our best!
As far as I know, .NET 5 compiling into the native code, but the .NET 5 application should have a .dll
file with all of your managed code inside. That means in the root folder of the Demo.exe
should be a Demo.dll
- which contains the managed code, and you need to protect this instead of Demo.exe
I didn't find a file similar to Demo.dll
, is it related to the configuration in the VStudio publish?
Deployment Mode: Self-contained | Produce single file: checked.
And the Demo.exe
file is also very large, it seems that the code is all on it.
I think yes its related to the 'self-contained' publish option, try to publish it with non self contained option and the dll should appear or try to uncheck the single file option
Hi, I unchecked Produce single file
, Demo.dll
was indeed generated, except Demo.exe
andDemo.dll
I put all files under libs, but a new error appeared
***\Demo.dll
[2023-07-26 08:59:39 INF][BitMono.CLI.Modules.CLIObfuscationNeedsFactory] Dependencies (libs) directory was automatically found in: ***\libs!
[2023-07-26 08:59:39 INF][BitMono.CLI.Program] File: ***\Demo.dll
[2023-07-26 08:59:39 INF][BitMono.CLI.Program] Dependencies (libs): ***\libs
[2023-07-26 08:59:39 INF][BitMono.CLI.Program] Everything is seems to be ok, starting obfuscation..
[2023-07-26 08:59:39 INF][BitMono.CLI.Program]
___ _ __ __ ___
/ _ )(_) /_/ |/ /__ ___ ___
/ _ / / __/ /|_/ / _ \/ _ \/ _ \
/____/_/\__/_/ /_/\___/_//_/\___/
https://github.com/sunnamed434/BitMono
BitMono v0.16.2.0
[2023-07-26 08:59:40 INF][BitMono.Obfuscation.BitMonoObfuscator] Module Demo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[2023-07-26 08:59:40 INF][BitMono.Obfuscation.BitMonoObfuscator] Module Target Framework: .NETCoreApp
[2023-07-26 08:59:40 INF][BitMono.Obfuscation.BitMonoObfuscator] PE TimeDateStamp: 08/18/2071 20:05:34
[2023-07-26 08:59:40 INF][BitMono.Obfuscation.BitMonoObfuscator] Module culture: ["u", "n", "k", "n", "o", "w", "n"]
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.NullValueHandling could not be resolved. Assuming System.Int32 for custom attribu
te argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.DefaultValueHandling could not be resolved. Assuming System.Int32 for custom attr
ibute argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.NullValueHandling could not be resolved. Assuming System.Int32 for custom attribu
te argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.DefaultValueHandling could not be resolved. Assuming System.Int32 for custom attr
ibute argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.NullValueHandling could not be resolved. Assuming System.Int32 for custom attribu
te argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.DefaultValueHandling could not be resolved. Assuming System.Int32 for custom attr
ibute argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.NullValueHandling could not be resolved. Assuming System.Int32 for custom attribu
te argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.DefaultValueHandling could not be resolved. Assuming System.Int32 for custom attr
ibute argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.NullValueHandling could not be resolved. Assuming System.Int32 for custom attribu
te argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.DefaultValueHandling could not be resolved. Assuming System.Int32 for custom attr
ibute argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.NullValueHandling could not be resolved. Assuming System.Int32 for custom attribu
te argument.
[2023-07-26 08:59:41 ERR][BitMono.Obfuscation.Starter.BitMonoStarter] Registered error!
System.BadImageFormatException: Underlying enum type Newtonsoft.Json.DefaultValueHandling could not be resolved. Assuming System.Int32 for custom attr
ibute argument.
[2023-07-26 08:59:41 FTL][BitMono.Obfuscation.BitMonoObfuscator] No one protection were detected, please specify or enable them in protections.json!
[2023-07-26 08:59:41 FTL][BitMono.Obfuscation.BitMonoObfuscator] Obfuscation stopped! Something went wrong!
Enter anything to exit!
Hey, can you please send the Demo.dll
to my email: sunnamed434@proton.me
I guess the problem is more that the BitMono TargetFramework is .NET Framework 461, it would be great to add support for the .NET 5/6, etc
I have sent you an email, please check
Will check tommorow
You can ignore those exceptions, the problem can be caused due to BitMono using .NET Framework. I specified a few protections and the file is obfuscated successfully that you provided in my email, to make it work simply configure protections.json
The solution is to add a .NET 6/5 to the bitmono target frameworks, I'll figure it out when I'll have some free time, or someone can make a PR, and temp solution is just ignore it
Thank you, to be honest I'm not good at windows application development, I'm only good at Android and Rust, so sorry I can't make a PR :)
And how to use the protections.json
, is it placed in the Demo project file or as a command line parameter? What does the name
field in protections.json
refer to? Sorry I read the docs but still not quite clear using
Name
is the name of the protection
Enabled
is a state of protection (enabled or not)
Here's my best preset for obfuscation, but, since your app is forms, don't use my preset because it works only on Mono runtime, and your application won't run without specific runtime (i.e Mono)
{
"Protections": [
{
"Name": "AntiILdasm",
"Enabled": false
},
{
"Name": "AntiDe4dot",
"Enabled": false
},
{
"Name": "ObjectReturnType",
"Enabled": false
},
{
"Name": "NoNamespaces",
"Enabled": false
},
{
"Name": "FullRenamer",
"Enabled": false
},
{
"Name": "AntiDebugBreakpoints",
"Enabled": false
},
{
"Name": "StringsEncryption",
"Enabled": false
},
{
"Name": "UnmanagedString",
"Enabled": false
},
{
"Name": "DotNetHook",
"Enabled": false
},
{
"Name": "CallToCalli",
"Enabled": false
},
{
"Name": "AntiDecompiler",
"Enabled": true
},
{
"Name": "BitMethodDotnet",
"Enabled": true
},
{
"Name": "BitTimeDateStamp",
"Enabled": true
},
{
"Name": "BitDotNet",
"Enabled": true
},
{
"Name": "BitMono",
"Enabled": true
}
]
}
I recommend using this preset for you: DotNetHook
, CallToCalli
, BitTimeDateStamp
, and UnmanagedString
Where should the protections.json
file be placed?
Here: Release\net462\protections.json
Thanks, I already figured it out. Does this issues need to be closed?
For now yes, I'll create another issue
Hello, thank you for your contribution to this very meaningful project. I had a problem after using it. I checked the issue list and found no similar problem to mine. The following is the error log. There are a few Chinese characters in it. Please don’t worry about it.(My application is written on .net 5, and I choose not to rely on the external environment and simplify unused code when publishing)