Open alexguerin4 opened 3 years ago
Not at all. The support for the core-like versions of .NET is broken with .NET Core 3 onwards.
Is any work in progress with this
What is broken from .NET Core 3 onwards? If the project was targeting .NET Standard 2.1 (or earlier versions) would that still be the case? Would really like to use Confuser.Core.dll within a project, that is written in .NET 5, I suppose I can just go the subprocess route; however, that is not necessarily ideal.
The problem is the assembly resolving.
The releases/2.0
is the furthest when it comes to preparing for the new versions of .NET, because that one has at least a proper handling for the runtime assemblies that would allow supporting the runtime up to .NET 5.
That does not change that resolving the assembly references currently always snaps back to the .NET Framework that that is something that needs to be adressed.
Everything up to .NET Core 2.x and .NET Standard 2.0 can work when explicitly referencing all the required assemblies in the project file. .NET Core 3.x, .NET Standard 2.1 and .NET 5.0 I was not able to get working to this day without changes to the current version of ConfuserEx.
@NotoriousRebel: I am unsure if I understand correctly what you are trying to say here. But if you want to use the Confuser.Core.dll
in your project, that is an entirely different topic.
The runtimes ConfuserEx is able to obfuscate and the version of .NET ConfuserEx itself uses to run, are two different things.
Now regarding the plan moving forward:
So I need to wait some time for v2 release? I have an app with .NET 4 and it won't launch after confusing.
The release/2.0 branch has not been updated for months. Any news?
Great work @mkaring ! Would you be comfortable sharing some progress update on this issue for those of us waiting? Perhaps you even have some tentative idea about when it could be done?
I got a concept on how to approach the problem and a first rough version that works for all the .NET Framework, .NET 5/6, .NET Core and .NET Standard versions. There are still some problems when mixing different versions inside one ConfuserEx project and the performance is⦠problematic. Also it's not always injecting the correct runtime versions, leading the assemblies that target .NET Standard and .NET Framework at the same time and things like that. I'm getting there, but there are still some things to smooth out.
I'm expecting a first version that is ready for testing in October.
Hi, Is there any update on when the first version that works for .net5 will be available? The Aug 19th comment mentions a first version ready for testing this October.
Hello, Any news?
.net 5 support would be much appreciated. Bought you some coffee, perhaps that helps ^_^
Please consider focusing on .NET6 as this is LTS edition from MS
I don't think there is a big difference between .NET6, .NET5, and even net core 3.1 in terms of ConfuserEx support.
do you have any plan to test how compatible with .Net6?
Hi, Is there any news or planned release date for .net5? I would like to use this confuser in my .net5 project...
Same here, just waiting :)
mkaring, any update on this? I tried getting the latest release (1.6.0) to work with my .NET Core 6.0 project, w/o success. The same project was able to be obfuscated when it still targeted .NET Framework 4.8. I also tried https://github.com/obfuscar/obfuscar which worked w/ my .NET Core project, but didn't obfuscate private method contents which is key IMHO. Thank you in advance - ConfuserEx is amazing!
Same here, just waiting :)......
May be another new ConfuseEx project target only .net core?
.Net 5 Support is exactly what I need :)
If you want to make it work with the latest .net versions, you will maybe have to resolve some dependencies issues. In order to resolve them, don't forget to add, after the modules in your .crproj, the path to the missing dependencies using the probePath element like this (i.e) :
<probePath>C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0</probePath>
<probePath>C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0</probePath>
If you want to make it work with the latest .net versions, you will maybe have to resolve some dependencies issues. In order to resolve them, don't forget to add, after the modules in your .crproj, the path to the missing dependencies using the probePath element like this (i.e) :
<probePath>C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0</probePath> <probePath>C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0</probePath>
@Kratheon is possible to migrate a Net 4.7.2 WPF app to Net 5 or Net 6 and use ConfuserEx this way? Or it is not supported yet. If some one share an history it will be welcome.
If you want to make it work with the latest .net versions, you will maybe have to resolve some dependencies issues. In order to resolve them, don't forget to add, after the modules in your .crproj, the path to the missing dependencies using the probePath element like this (i.e) :
<probePath>C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0</probePath> <probePath>C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0</probePath>
@Kratheon is possible to migrate a Net 4.7.2 WPF app to Net 5 or Net 6 and use ConfuserEx this way? Or it is not supported yet. If some one share an history it will be welcome.
Doesn't work for me. With 1.6.0 I get the Error:
error MSB4018: System.AggregateException: One or more errors occurred. (Could not load file or assembly 'dnlib, Version=3.4.0.0, Culture=neutral, PublicKeyToken=50e96378b6e77999'. The system cannot find the file specified.)
Seems it fails to copy the needed lib.
With 2.0.0-alpha-0191 I get:
COnfuser.MSBuild.targets: [MSB4181] Confuser.MSBuild.Tasks.ConfuseTask returned FALSE
no error in protocol.
But didn't invest much time TBH
Was hoping to get this working with Blazor WASM on .NET 6.0, but keep getting this in browser console:
blazor.webassembly.js:1 RuntimeError: memory access out of bounds
at dotnet.wasm:0x5cedc
at dotnet.wasm:0x5b576
at dotnet.wasm:0x5b48c
at dotnet.wasm:0x6da89
at dotnet.wasm:0x6d751
at dotnet.wasm:0x327e4
at dotnet.wasm:0x33233
at dotnet.wasm:0x34287
at dotnet.wasm:0x322e6
at dotnet.wasm:0x31ed5
The obfuscated DLL is being generated, but I guess the "blazor.webassembly.js" WASM runtime has a problem with it.
The whole thing to support .NET Standard 1.0 - 2.1, .NET Core 1.0 - 3.1 and .NET 5/6 really is a hassle to get working. The main issues are that the injected code messes a lot of things up and causes the assemblies to link to the wrong target assemblies. This is especially true, when mixing assemblies targeting different frameworks in one obfuscation run. For example one .NET 5 executable and one .NET Standard 2.1 class library.
The current state is:
The main issue is matching the target assembly references correctly in each obfuscation unit.
I'm still on it and I know it's taking too long π
We appreciate your hard work and continued effort! I'm guessing it's the same amount of work, but for me, even if we got it working for .net standard prior to .net latest, it would be of great help.
P.S. to everyone who wants that .net latest support, I'm sure @mkaring would appreciate any donations (sponsor button below).
The whole thing to support .NET Standard 1.0 - 2.1, .NET Core 1.0 - 3.1 and .NET 5/6 really is a hassle to get working. The main issues are that the injected code messes a lot of things up and causes the assemblies to link to the wrong target assemblies. This is especially true, when mixing assemblies targeting different frameworks in one obfuscation run. For example one .NET 5 executable and one .NET Standard 2.1 class library.
The current state is:
- Anti Debug - Works for assemblies clearly targeting windows
- Anti Dump - Works for assemblies clearly targeting windows
- Anti IL Dasm - Works
- Anti Tamper - Completely broken
- Constants - Mostly broken
- Control Flow - Works
- Invalid Metadata - Breaks everything
- Name - Works
- Hardening - Works kind of, depending on what else is active
- Reference Proxy - Works
- Resources - Broken
- Type Scramble - Very broken
- Watermark - Works π
- Compile Regex - Only works for .NET 5 (even .NET Framework versions are broken)
- Tail Call - Works
- Compressor - I don't even want to think about it
The main issue is matching the target assembly references correctly in each obfuscation unit.
I'm still on it and I know it's taking too long π
That's very good progress, actually.
Which branch has the commits? I cannot find it under master/2.0
Now, this could be a stupid question but, would it be possible to skip the "mixed assemblies problem" for now and release a version that would simply confuse Net6 assemblies?
Thanks again, man, you rock.
Hello! Thanks a lot @mkaring for the hard work you put into this project!
With @Kratheon, we are able to obfuscate .NET Standard 2.0 libraries and some simple .NET 6 projects, using ConfuserEx 1.6 and the probePath workaround.
I just have a small question for you, @mkaring... In a more complex .NET 6 project, I'm facing this error:
[ERROR] Failed to resolve a member, check if all dependencies are present in the correct version.
Exception: dnlib.DotNet.MemberRefResolveException: Could not resolve method: System.Drawing.Rectangle DevExpress.XtraSpreadsheet.ISpreadsheetControl::get_ViewBounds() (DevExpress.Spreadsheet.v22.1.Core, Version=22.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a)
I suspect the "mixed assemblies" problem. Can you please confirm (or not) this assumption?
The full log:
[INFO] Confuser.Core 1.6.0+447341964f Copyright Β© 2014 Ki, 2018 - 2022 Martin Karing
[INFO] Running on Microsoft Windows NT 6.2.9200.0, .NET Framework v4.0.30319.42000, 64 bits
[DEBUG] Discovering plugins...
[INFO] Discovered 13 protections, 1 packers.
[DEBUG] Resolving component dependency...
[INFO] Loading input modules...
[INFO] Loading 'TestConfuserEx.dll'...
[INFO] Initializing...
[DEBUG] Building pipeline...
[DEBUG] Executing 'Type scanner' phase...
[INFO] Resolving dependencies...
[DEBUG] Checking Strong Name...
[DEBUG] Creating global .cctors...
[DEBUG] Executing 'Name analysis' phase...
[DEBUG] Building VTables & identifier list...
[ERROR] Failed to resolve a member, check if all dependencies are present in the correct version.
Exception: dnlib.DotNet.MemberRefResolveException: Could not resolve method: System.Drawing.Rectangle DevExpress.XtraSpreadsheet.ISpreadsheetControl::get_ViewBounds() (DevExpress.Spreadsheet.v22.1.Core, Version=22.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a)
at dnlib.DotNet.MemberRef.ResolveMethodThrow()
at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage)
at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type)
at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage)
at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type)
at Confuser.Renamer.AnalyzePhase.Execute(ConfuserContext context, ProtectionParameters parameters)
at Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action`1 func, Func`1 targets, ConfuserContext context)
at Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context)
at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token)
Hi All, What is the status for .NET 5 and 6 please ? I'm using since years on this awesome ConfuserEx for .Net Framework, but I really need to know asap if I can use it for my news projects on .NET 5 and 6 ? I'm kind of stuck right now with some issues, and I would like to be sure that I'm not trying to resolve the impossible :) Thx for your hard work, in any case I will continue to support you !
Is not working with .Net 6? :(
I do not think @mkaring has made a commit to any of his repos in almost a year, whatever the reason.
So, a big thanks to him for taking up the project but we are royally screwed moving forward, it would seem, unless someone with the know-how picks it up again.
We've found it to be working with ConfuserEx 1.6 within the limits that mkaring described in his answer above while adding the required probe paths as described in an earlier post.
It has been applied to a reasonably complex .NET 6 project and was working with the following protections:
It is clearly a reduced scope of protections but probably what you can expect to work at this point in time until someone picks up the incredible work that has been done on ConfuserEx.
Is not working with .Net 6? :(
Inserting probe paths like below made it work with .net 6.
Please I would like to know the status of this project on dotnet 6 support What level of dotnet core can ConfuserEx support as at now
wait for v2.0 support all .net
Any fresh & exciting news for .NET 7 (seven) support please?...
wait
OK, 2023 is in the air! how about this:
.NET 8 is the successor to .NET 7. It will be supported for three years as a long-term support (LTS) release. You can download .NET 8 here.
Microsoft suggests we focus only on 6/7/8, these are considered obsoleted...
@greenozon Im using ConfuserEX to obfuscate NET 6 [WPF] project. Not working out of the box, i needed to add probe paths of the installed NET manually:
C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.15\ref\net6.0
C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\6.0.15\ref\net6.0
C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\6.0.15\ref\net6.0
and 6.0.15
depends on the installed version, so i just ended up with a script determining the latest available version and inserting it as a probe path
into confuser's crproj
. Maybe the same will do for NET 7/8?
Or you mean retargeting Confuser itself for NET 6/8?
I want to use ConfuseEx for dotnet 7 asp.net core web app but it is not working. How should it be done.
@aboah find your dotnet installed directory (might be C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\7.0.4\ref\net7.0
) and add it as a probe path into your obfuscation project
@aboah add those directory paths here in ConfuserEx:
You can find your .NET directories here: C:\Program Files\dotnet\shared
Since you're using .NET 7, you'll want to add the following directories:
That's assuming you have the current version of .NET 7 installed (7.0.5 as of today). Browse to each of the above directories on your computer to find the latest version you have installed.
For example, when I browse to the "Microsoft.AspNetCore.App" directory on my computer, I found 7.0.5 is the latest version I have installed. That's why I'm using "7.0.5" in the directory path above.
Note: Your installed .NET version could be different for each of those directories.
Does anybody try arleady this approach on .NET 8?
@greenozon I haven't tried .NET 8 yet, but the instructions I shared above should work.
Instructions above works for me for .NET6 for both WPF and ASP.NET will try NET8 shortly
UPD: Works on NET 8 for both ASP.NET and WPF projects. Added the following probe paths:
C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.0-preview.3.23174.8\ref\net8.0\
C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\8.0.0-preview.3.23177.8\ref\net8.0\
C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\8.0.0-preview.3.23178.1\ref\net8.0\
To make it work out of the box - maybe at some spare time ill try creating a PR (within my fork) which would add those paths automatically if dll to obfuscate targeting NET 6/7/8.
Exciting update!
the new era has come
@tshcherban Thank you for your reply
Not really an issue, just wondering how compatible this project is with .Net 5 apps?