3

In my application project in Visual stuido, I am trying to reference a DLL confused with ConfuserEx (from another project). Even if I use the "none" preset, at runtime, when the DLL is loaded, my application crashes with the following message:

Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x063b523c, on thread 0x341c. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

See a screenshot of the error here

The following is the project I use to process my DLL:

<project baseDir="path_to_input_dll_folder" outputDir="path_to_output_dll_folder" xmlns="http://confuser.codeplex.com">
    <rule preset="none" pattern="true"></rule>
    <module path="path_of_dll_to_confuse" />
</project>

Can anyone help me?

  • Does it do the same if you build for Release? Was it obfuscated with the anti-debug option? – ProgrammingLlama Aug 01 '18 at 08:26
  • 1
    First action of business would be to run `peverify` on the output. It's not uncommon for these tools to contain bugs that cause them to output invalid code that the runtime can choke on in various creative ways. – Jeroen Mostert Aug 01 '18 at 08:34
  • I noticed that if I run my application by double clicking on the exe file, it works fine. Probably, even if I am not using any preset and I'm not using the anti-debug option, Confuserex prevents my application from being debugged somehow. – Nicola Montini Aug 01 '18 at 09:22
  • Can't you just obfuscate the DLL after the compilation and debug without obfuscation ? Do you have access to the no-obfuscate DLL ? – Cesar Aug 01 '18 at 09:43
  • Clearly this obfuscator is worth what you paid for it. You'll have to stop using it and file a bug report with the project so they can get it fixed. This does require a repro project, rather the opposite of what the tool was made to do. Hehe. Do consider a commercial one that can provide you with the support you need. – Hans Passant Aug 01 '18 at 10:25
  • @Cesar, yes I have access to the non-obfuscated DLL. In fact, I will keep developing with the non-obfuscated DLL and deploy with the obfuscated version. Thanks! – Nicola Montini Aug 01 '18 at 12:15

1 Answers1

6

One reason might be that anti-debug protection is added. You can add the following into your crproj file to disable that:

<module path="path_of_dll_to_confuse">
  <rule pattern="true" inherit="false">
    <protection id="anti debug" action="remove" />
  </rule>
</module>
yakya
  • 4,559
  • 2
  • 29
  • 31