Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. .NET, Reflection and private members

.NET, Reflection and private members

Scheduled Pinned Locked Moved C#
csharpc++comhelptutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    J Diamond
    wrote on last edited by
    #1

    Hello, Is there any way to prevent a tool like Reflector (http://www.aisto.com/roeder/dotnet/) from reading and disassembling private members using reflection? I am aware of a suggestion posted by Microsoft, stating that using [StrongNameIdentityPermission...] may help, but I can't find any example for a successful usage of it. Using [assembly: ReflectionPermission(SecurityAction.RequestRefuse, TypeInformation=true)] (or any other flag) also proved futile. Can it be that an assembly created using C# and .NET has no secrets when challenged by a freeware tool? And say I have secrets, does it mean I have to stick with C++ (knowing that you need a capable disassembler and a more capable person to squeeze the data out of my modules)? Best J

    A S 2 Replies Last reply
    0
    • J J Diamond

      Hello, Is there any way to prevent a tool like Reflector (http://www.aisto.com/roeder/dotnet/) from reading and disassembling private members using reflection? I am aware of a suggestion posted by Microsoft, stating that using [StrongNameIdentityPermission...] may help, but I can't find any example for a successful usage of it. Using [assembly: ReflectionPermission(SecurityAction.RequestRefuse, TypeInformation=true)] (or any other flag) also proved futile. Can it be that an assembly created using C# and .NET has no secrets when challenged by a freeware tool? And say I have secrets, does it mean I have to stick with C++ (knowing that you need a capable disassembler and a more capable person to squeeze the data out of my modules)? Best J

      A Offline
      A Offline
      Alex Korchemniy
      wrote on last edited by
      #2

      There are tools out there that can help you out a little. They are called obfuscators. What they do is they modify method names and class names to make it more difficult for someone to read your code. The more advanced tools insert special code to foil tools like Reflector. Do a search for Salamander (expensive)

      J 1 Reply Last reply
      0
      • J J Diamond

        Hello, Is there any way to prevent a tool like Reflector (http://www.aisto.com/roeder/dotnet/) from reading and disassembling private members using reflection? I am aware of a suggestion posted by Microsoft, stating that using [StrongNameIdentityPermission...] may help, but I can't find any example for a successful usage of it. Using [assembly: ReflectionPermission(SecurityAction.RequestRefuse, TypeInformation=true)] (or any other flag) also proved futile. Can it be that an assembly created using C# and .NET has no secrets when challenged by a freeware tool? And say I have secrets, does it mean I have to stick with C++ (knowing that you need a capable disassembler and a more capable person to squeeze the data out of my modules)? Best J

        S Offline
        S Offline
        sreejith ss nair
        wrote on last edited by
        #3

        hi, Please check this site for obfuscation and reverse engi:. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dotfuscator/dotf49m6.asp ;) ************************** S r e e j i t h N a i r **************************

        1 Reply Last reply
        0
        • A Alex Korchemniy

          There are tools out there that can help you out a little. They are called obfuscators. What they do is they modify method names and class names to make it more difficult for someone to read your code. The more advanced tools insert special code to foil tools like Reflector. Do a search for Salamander (expensive)

          J Offline
          J Offline
          J Diamond
          wrote on last edited by
          #4

          Thanks, I am familiar with these (actually wrote one myself for Java). Unfortunately, even these tools with very advanced logic can only rename and scramble a little... this is certainly not the case with a C++ application, there you have to actually know ASM to understand the code, or use a disassembler that gets no-where close the original code. I reviewed numerous obfuscators during the last weekend. Salamander is not expensive compared to others, but it has a very mediocre UI. I understand that its most valuable (advertised) feature is its ability to convert the code to what you would have gotten, had you used C++ (or other not managed language) to begin with... It seems that Microsofties themselves are using Dotfuscator (which is bundled with DevStudio). Still, I see no way to protect your *private* (not the public interfaces) code with managed code, and hence no reason to use it for project that you want to keep as inconspicuous as possible (like encryption libraries etc).

          A 1 Reply Last reply
          0
          • J J Diamond

            Thanks, I am familiar with these (actually wrote one myself for Java). Unfortunately, even these tools with very advanced logic can only rename and scramble a little... this is certainly not the case with a C++ application, there you have to actually know ASM to understand the code, or use a disassembler that gets no-where close the original code. I reviewed numerous obfuscators during the last weekend. Salamander is not expensive compared to others, but it has a very mediocre UI. I understand that its most valuable (advertised) feature is its ability to convert the code to what you would have gotten, had you used C++ (or other not managed language) to begin with... It seems that Microsofties themselves are using Dotfuscator (which is bundled with DevStudio). Still, I see no way to protect your *private* (not the public interfaces) code with managed code, and hence no reason to use it for project that you want to keep as inconspicuous as possible (like encryption libraries etc).

            A Offline
            A Offline
            Alex Korchemniy
            wrote on last edited by
            #5

            I was going to mention that even C++ can't hide your data, but you already know that. Well, I guess you can just create an unmanaged library for your most important functions and then use interop. If you need to release this as a component then create a wrapper library.

            J 1 Reply Last reply
            0
            • A Alex Korchemniy

              I was going to mention that even C++ can't hide your data, but you already know that. Well, I guess you can just create an unmanaged library for your most important functions and then use interop. If you need to release this as a component then create a wrapper library.

              J Offline
              J Offline
              J Diamond
              wrote on last edited by
              #6

              You set the plan as it will be :-) Obfuscation for the code, unmanaged library for the encryption related code. This will (hopefully) shift the culprit's gain-loss balance towards the loss column. Thanks for your suggesions.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups