ConfuserEx icon indicating copy to clipboard operation
ConfuserEx copied to clipboard

Error whith Costura.Fody

Open Mrgaton opened this issue 3 years ago • 9 comments

  • ConfuserEx Version:
  • Target Framework:
  • Operating System:

Steps to Reproduce:

  1. intall the package costura foody to an proyect
  2. install another package like Newsoft.josn
  3. try to obsfucate it and

image

Mrgaton avatar Aug 10 '21 15:08 Mrgaton

ConfuserEx Version: image

Target Framework: 4.8 Operating System: windows 11

Mrgaton avatar Aug 10 '21 15:08 Mrgaton

@mkaring

Mrgaton avatar Aug 10 '21 16:08 Mrgaton

ConfuserEx needs all the dependencies to function properly. Costura.Fody embeds these dependencies into the module and ConfuserEx is unable to resolve them as it expects them to be present next to the file or in other locations such as GAC.

Solutions:

  1. If your file is a executable you can remove Costura.Fody and instead of the compressor packer which has the option to embed dependency dlls. This is a superior option as the dependencies are also encrypted.
  2. Disable cleanup in Costura.Fody and prevent it from deleting the dlls from the output folder (note: they will still be embedded.
    • Navigate and open FodyWeavers.xml in a text editor of your choice.
    • Modiy the contents to set the right costura option somewhat like this:
    <Weavers>
    	<Costura DisableCleanup='true'/>
    </Weavers>
    

ElektroKill avatar Aug 10 '21 16:08 ElektroKill

I'm too slow. Thanks @ElektroKill

mkaring avatar Aug 10 '21 16:08 mkaring

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

github-actions[bot] avatar Aug 28 '21 04:08 github-actions[bot]

@mkaring

I got 2 ideas :

  • What if we extract all embedded dll files during the analysis phase ?
  • What if then we remove any Fody code and select Compressor packer automaticaly ?

Would you accept a PR ?

XenocodeRCE avatar Sep 01 '21 19:09 XenocodeRCE

I Just installed this nuggets image image image

then i copiled and try it to obfuscate

Mrgaton avatar Sep 11 '21 09:09 Mrgaton

The workaround provided by @ElektroKill is the only thing that currently works. In that case the embedded assembly will still work, but is not subject to any protection.

The proper support for Costura will be part of the 2.0 release.

mkaring avatar Sep 24 '21 08:09 mkaring

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Mar 22 '23 04:03 github-actions[bot]