yck1509 / ConfuserEx

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

Entrypoint not callable #23

Closed bajak closed 10 years ago

bajak commented 10 years ago

I've used confuser. Using Assembly.Load and entrypoint invoke throws a strange error message. Can i disable some plugin over the xml file ? After deleting a line like protection id="anti tamper" it's still use these protection.

yck1509 commented 10 years ago

What error you get? What protections you used? Please post the project XML you used.

bajak commented 10 years ago

Hallo yck1509, Can not choose protection. Confuser.CLI always runs all protections. I can add or remove protection inside the xml does not change anything.

Error Message Accessviolationexception: attempted to read or write protected memory. this is often an indication that other memory is corrupt.

Did you tried Assembly.Load with an obfuscated assembly. Is it working for you ? (Using CSharpCodeProvider to compile the assembly but its working perfectly without protection)

var assembly = Assembly.Load(assemblyBytes); assembly.EntryPoint.Invoke(null, new object[]{new []{""}});

yck1509 commented 10 years ago

Can you post the XML here? Reflection should work fine with obfuscated assemblies.

bajak commented 10 years ago
<project baseDir="C:\Users\Username\AppData\Local\Temp" outputDir="Output" xmlns="http://confuser.codeplex.com">
    <rule preset="none" pattern="true">
        <protection id="anti debug" />
        <protection id="anti dump" />
        <protection id="anti ildasm" />
        <protection id="anti tamper" />
        <protection id="constants" />
        <protection id="ctrl flow" />
        <protection id="invalid metadata" />
        <protection id="ref proxy" />
        <protection id="rename" />
        <protection id="resources" />
    </rule>
    <module path="assembly.dll" />
</project>

or

<project baseDir="C:\Users\Username\AppData\Local\Temp" outputDir="Output" xmlns="http://confuser.codeplex.com">
    <rule preset="none" pattern="true">
    </rule>
    <module path="assembly.dll" />
</project>

Same result.

yck1509 commented 10 years ago

Can you also post the output of Confuser.CLI?

bajak commented 10 years ago

unbenannt-2xxx

yck1509 commented 10 years ago

The output log seems no protections are applied. Are you sure you're checking the correct output assembly?

bajak commented 10 years ago

Console was just always faster than print key. Append this: ConfuserEx - Success "Finished " + timeString

yck1509 commented 10 years ago

The log shows no protections are used. What command line you used to run Confuser.CLI?

bajak commented 10 years ago

I had commented the lines out. For some reason they was still there.

I've removed

Now its working. Thanks