0

I decompiled the dll that my app creates for publishing it and found out, that everything is easy to read. The app is not rocket science but I'd like to hide some things, e. g. there are constants that are called productionHourlyRate what no one should know. I know, there are obfuscation softwares but they are expensive. An easy way would be to rename all variables and methods before publication, e. g. productionHourlyRate -> v1. Is there a built in possibility to do (and undo) this in Visual Studio 2022. Of course, I could rename them one by one but this is not very comfortable.

Or: Is there a free obfuscator that makes dlls undecompilable? No matter which tool I read about, I always find comments like "I decompiled the obfuscated dll with xyz and received the whole source code.".

Many thanks, Philipp

Edit: It is a C#/.Net app (Blazor WebAssembly)

Flippowitsch
  • 315
  • 3
  • 15
  • It's not possible to make it "undecomplieable"! How would the CLR be able to run it? The best you can do is obfuscating the code. – phuzi Dec 02 '21 at 15:52
  • This question lacks details. If .dll is written with C/C++ it is impossible to restore original source code. – user7860670 Dec 02 '21 at 15:52
  • @user7860670 Hmm, I made an assumption, perhaps incorrectly, that OP was talking about C#/.Net. More details needed – phuzi Dec 02 '21 at 15:53
  • @phuzi Well, that's a reasonable assumption to do. – user7860670 Dec 02 '21 at 15:57
  • Recommendations for tools are off-topic for SO, but note that even the world's greatest obfuscator is no match for a sufficiently motivated person. The best you can hope for is that there's nobody sufficiently motivated after the obfuscation. – Jeroen Mostert Dec 02 '21 at 16:10
  • OK, "undecompilable" was a too strong term. As mentioned before, the app is not top secret and it is probably enough to rename variable and method names. I just stepped over [obfuscar](https://www.obfuscar.com/) and think this could be enough for me because on the website it says that renaming "is irreversible". I'll check tomorrow... – Flippowitsch Dec 02 '21 at 16:23
  • Obfuscar works well but when I replace the not obfuscated dll with the obfuscated one, the website cannot be loaded even when I set all obfuscation attributes to false, e. g. ``. I created a new issue [here](https://stackoverflow.com/questions/70213492/can-obfuscar-be-used-with-blazor-webassembly), since it is a new question. – Flippowitsch Dec 03 '21 at 11:21

1 Answers1

0

Since there was no answer to this question, there is probably no Visual Studio built in solution.

So, I created an Excel tool that renames alle class, method and variable names in the specified files. Please find it here.

Important: Make sure, you run this obuscator only when using a version control tool. You CANNOT undo the obfuscation with this Excel tool.

Usage

  1. Add file paths in worksheet "files".
  2. Run macro "Obfuscate" to obfuscate class, method and variable names with "v1", "v2"…
  3. Publish your app.
  4. Undo the changes with your version control tool.

Once all files are manually listed, the obfuscation should only take a few seconds.

Flippowitsch
  • 315
  • 3
  • 15