yck1509 / ConfuserEx

An open-source, free protector for .NET applications
http://yck1509.github.io/ConfuserEx/
Other
3.55k stars 1.62k forks source link

How to use ObfuscationAttribute feature of ConfuserEx ? question #186

Open rdepke opened 9 years ago

rdepke commented 9 years ago

Hi,

I'm trying to obfuscate a simple example using the attribute feature as described here https://github.com/yck1509/ConfuserEx/wiki/Declarative-Obfuscation .

My code is as follows:

    using System;
    using System.Reflection;

    [assembly: Obfuscation(Exclude = false, Feature = "namespace 'ConfuserExTestApplication':+rename")]
    namespace ConfuserExTestApplication
    {

        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Das Testprogramm");
                Console.ReadLine();
                KlasseExclude.printToConsole();
            }
        }

        internal class KlasseExclude
        {

            public static void printToConsole()
            {
                Console.Write("Die Extra Klasse");
            }
        }
    }

After compiling I drag'n'drop the *.exe on Confuser.CLI.exe. What I get is the following output:

[INFO] ConfuserEx v0.4.0 Copyright (C) Ki 2014
[INFO] Running on Microsoft Windows NT 6.2.9200.0, .NET Framework v2.0.50727.8009, 64 bits
[ERROR] Unknown error occurred.
Exception: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:Zeile 81.
Failed at 17:26, 0:00 elapsed.
Press any key to continue...

I'm pretty sure its me tring to use it wrong, but I don't now what causes the issue.

Any help is appreciated, thx for reading.

yck1509 commented 9 years ago

Hi, you might want to try the latest builds at the CI Server and see whether the problem had been fixed.

rdepke commented 9 years ago

Hi, I tried the CI build, but the result is no different.

yck1509 commented 9 years ago

Hi, You'll need to specify a output directory in the arguments, for example:

Confuser.CLI -out=C:\Confused\ C:\App.exe
rdepke commented 9 years ago

Hi,

thank you, that solved my problem.