Click here to Skip to main content
12,954,464 members (50,110 online)
Rate this:
Please Sign up or sign in to vote.
See more: (untagged)

i have a dll that made and im trying to hide the strings or function (like "regopenkey") that i use. hiding it from a winhex or any hex editor

basically when i put my dll into the hex editor i see some strings that i used or function

is there a possible way to hide it ???

thanks in advance
Posted 12-Sep-12 4:36am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You should look into Obfuscation[^]. Just google .NET Obfuscation and you'll find enough links to products that will help you achieve your goal.


— Manfred
Juan _dela_cruz 12-Sep-12 10:49am
yes i know about that using confuser..but it cant obfuscate my dll..runtime /MT

im thinking is there a technique to write the code safe :D
or maybe encrypt it..(dont know hot to encrypt thou)

thanks for the response
Sergey Alexandrovich Kryukov 12-Sep-12 18:34pm
Who told you cannot? Yes you can, of course.
Yes, you can encrypt it, trivially -- please see my answer.
Sergey Alexandrovich Kryukov 12-Sep-12 18:35pm
My 5. The question is: why?
Some more detail in my answer, please see.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

First of all, I would like to discourage this "hiding" activity. It would be to naive to defend your files against real reverse engineering, and most of the rest of the users won't see your strings anyway. However, I must admit that I don't know your goal, maybe you really need such thing. (It's a good idea to start questions with explaining your ultimate goals.)

So, as Manfred already advised, you can use some obfuscation product. As some products are commercial, and we should not promote them, you should find some product by yourself:[^].

Read the documentation on each product to see how you can use it. Yes, you can obfuscate the DLL (in .NET, there are no real difference between DLLs and other assemblies), but it can be done in coordination with all the assemblies using it, apparently. All obfuscators can do it.

Now, if all you want is to obfuscate only the string data, you can easily self-obfuscate it by yourself. First of all, you should not use hard-coded string data anyway, so you need to have some data structures with string values. You need to separate data from code. Just encrypt the data using any encryption method of your choice (there are enough already implemented in .NET BCL) and create the files with encrypted data. Add this files to some .resx resources. When you need a string during run-time, get its encrypted value from resource, decrypt and use it. This is really easy. Again, the question is: why?


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,539
CHill60 3,490
Maciej Los 3,143
ppolymorphe 2,030
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100