9

My company uses Dotfuscator for our .NET application obfuscation. It works great, however I noticed it's a single threaded operation during our build process. Dotfuscator.exe is always running on a single core of our 8 core build machine and it makes me cry a little inside.

Is there some magic to make it run a little more paralleled? Magic /MPgogogo flag? Bueller?

Jippers
  • 2,635
  • 5
  • 37
  • 58

2 Answers2

10

It's sad, but it's almost all single threaded (I'm a developer on it). It also isn't supported to run multiple instances of Dotfuscator in parallel.. mostly.

If you have multiple separate assemblies/executables that need obfuscated, you can run multiple instances of Dotfuscator(using separate command lines or configuration files of course) though by using a bit of an undocumented trick.

If you go to C:\Program Files(x86)\PreEmptive Solutions you'll see your Dotfuscator directory. (Mine is Dotfuscator Professional 4.9) You can make a copy of that directory to some other directory. So, for example, if you made 2 copies of that directory into C:\Dotfuscator1 and C:\Dotfuscator2, then you can run each of those two dotfuscator.exe executables in each directory in parallel without them stepping on each other's feet. I won't say it's "supported", but it should work flawlessly.

Also, you'll need to copy two files into the two folders you copied from Program Files. The first file is located around C:\Users\YourName\AppData\Local\PreEmptive Solutions\Dotfuscator Professional Edition\4.0. The file is named dfusrprf.xml. Just copy it to be in the same folder as each dotfuscator.exe. The next file is in C:\ProgramData\PreEmptive Solutions\Dotfuscator Professional Edition\4.0 and should be called dotfuscator.dat. This should be copied to the same location asdfusrprf.xml`

With all of this in place, the two instances of Dotfuscator should run fine in parallel. Note that doing this with more than a few instances will cause you to need a lot of memory. On big programs Dotfuscator can take a large amount of memory(as in more than a gig)

Earlz
  • 62,085
  • 98
  • 303
  • 499
  • Before I try this out, does this affect the Map xml file output? Will I get two sets of files now? – Jippers Apr 08 '13 at 23:56
  • 1
    @Jippers Note this only helps if you have two separate project/config files. So, if you have say Foo.dll and Bar.dll, they must not rely on each other, otherwise they'll need to run as one project together. But yes, if you split it into two projects then you'll get two different XML map files. This shouldn't affect your ability to decrypt stack traces though, assuming your inputs don't rely on each other – Earlz Apr 09 '13 at 01:59
  • My God! ... fortunately, it could probably help me! I hope it works with 4.10 too ;-) By the way, are 1Gig a "large amount of memory" by these days (end of summer 2013)? ;-) – dom_beau Sep 18 '13 at 14:57
  • @dom_beau It depends on what you are obfuscating, but a moderately sized project will probably require at least 2G, and would probably be made faster by 4G. For reference, the build machine we use to obfuscate Dotfuscator with itself has 4 gigs of memory – Earlz Sep 18 '13 at 17:58
  • @Earlz I have a solution with ~200 assemblies/executables to obfuscate. My computer has 10Gig, 4 dual cores and it takes probably twice the time to obfuscate than it takes to build. And it is a mess of cross-dependencies so I cannot easily split into two parts to start two dotfuscators... :-( – dom_beau Sep 23 '13 at 17:32
  • @dom_beau heh. I'm sorry, but I don't think there is much we can do there. 200 assemblies is a huge amount of code to analyze. Analyzing IL and trying to figure out what can be obfuscated and how is a tough problem and will usually be slower than compiling from C# source code. There is nothing we can do to make it significantly faster I expect – Earlz Sep 23 '13 at 18:30
  • @Earlz Why would starting simply two instances of dotfusc...exe would not work? Or by just copying the .xml/.dat files? In other words, why should we copy the executable folder? – dom_beau Oct 10 '13 at 12:55
  • 1
    @dom_beau it might work, but it can run into problems. Dotfuscator assumes it is the only one to access the files around it like dotfuscator.dat.. so, when there are two instances sometimes it can lead to strange problems. You can try it, but you might run into problems – Earlz Oct 10 '13 at 14:08
0

Nope. Single threaded all the way.

Jippers
  • 2,635
  • 5
  • 37
  • 58