Home - Forums-.NET - Spices.Net - Obfuscator support for C# Features

Spices.Net

NET code security, tools to protect, obfuscate, tamper defense, code and data safety, recover, convert, optimize, explore, browse and analyze .Net software.

This forum related to following products: Spices.Net Suite, Spices.Net Obfuscator, Spices.Net Decompiler

Obfuscator support for C# Features
Link Posted: 16-Jul-2021 02:46
Hi,

It seems that the obfuscator does not like https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#default-interface-methods nor the ability to specify modifiers on interface methods (e.g. https://jeremybytes.blogspot.com/2019/11/c-8-interfaces-public-private-and.html). Both of these features where implemented for C# 8.

Resulting in errors:
[MD] Error: Non-public method in interface (token=0x02000034),
[MD] Error: Neither static nor abstract method in interface (token=0x02000070).
And
[MD] Error: Type:.class [XXX]YYY, token:0x020001ab, implemented interface:.class [XXX]ZZZ, token:0x01000088 but has no implemented method: [SomeMethod], token:0x06000150

Any way to exclude these interfaces from the obfuscation / validation process?
Kind Regards
Link Posted: 21-Jul-2021 01:51
Sorry for delayed response - vacation time :(
Thanks for the information and don't worry, this problem is currently on the way to be fixed.
PS: I'm not sure it would help to solve this situation if you exclude interfaces from obfuscation.
Link Posted: 21-Jul-2021 02:11
Awesome, thanks :)
Link Posted: 16-Sep-2021 02:10
Hi, any idea when?
Kind Regards.
Link Posted: 13-Jan-2022 04:28
I've good news, this problem fixed in the latest cumulative update v.5.22.01.00
Sorry for delays.
Link Posted: 14-Jan-2022 05:54
Thanks for the good news.

P.S. Am I right to assume that .NET 6 (and by extension, .NET Core) is not supported for obfuscation?
Link Posted: 14-Jan-2022 06:09
Spices.Net will provide full support of.Net6 and integration with VS2022 to the end of January.
Link Posted: 14-Jan-2022 08:31
That is great news indeed.

All of a sudden any interface implementation breaks during the obfuscation verification step, even for NetStandard2.0 assemblies :(

Consider for example a simple C# Project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <LangVersion>preview</LangVersion>
  </PropertyGroup>
</Project>

With a single CS file:

namespace ClassLibrary;
public interface IThing
{
  void DoThis();
  void DoThat();
}
public sealed class Thing : IThing
{
  public void DoThis() { }
  void IThing.DoThat() { }
}

NRObfuscator.exe /RESOLVEORSKIP /SRC=ClassLibrary.dll /OUT=ClassLibrary.Obfuscated.dll

Results in 2 verification errors:
[MD] Error: Static method in interface (token=0x02000002).
[MD] Error: Static method in interface (token=0x02000002).

Unable to use the new release to obfuscate my code :(
Link Posted: 10-Feb-2022 13:22
Sorry for delays with news about fixes of this problem. But let you know, now this problem is solved, please downlaod the latest update.
Link Posted: 12-Feb-2022 02:45
Hi,

I can confirm that the latest release resolves my (and the other user on this thread, which is also me:)'s) issues.

Thank you very much!