Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++/CLI
hi,
 
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
good
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.
 
Regards,
 
— Manfred
  Permalink  
Comments
Juan _dela_cruz at 12-Sep-12 10:49am
   
yes i know about that ..im 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 at 12-Sep-12 18:34pm
   
Who told you cannot? Yes you can, of course.
Yes, you can encrypt it, trivially -- please see my answer.
--SA
Sergey Alexandrovich Kryukov at 12-Sep-12 18:35pm
   
My 5. The question is: why?
Some more detail in my answer, please see.
--SA
Rate this: bad
good
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:
http://bit.ly/SdjrxZ[^].
 
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?
 
—SA
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 741
1 OriginalGriff 255
2 Volynsky Alex 205
3 Kishore Pogaru 130
4 Magic Wonder 129
0 OriginalGriff 5,705
1 Sergey Alexandrovich Kryukov 4,763
2 CPallini 4,570
3 George Jonsson 3,142
4 Gihan Liyanage 2,450


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2014
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