CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2005
    Location
    Spain!
    Posts
    149

    Angry Protect component library

    Hi all!, i've some code to protect .net applications but now i'm in need to protect a component library.

    I've seen some components in demo version that allows the user to work normal in design mode, but when deployed in release version, it show annoying messages telling that the app was compiled using some demo version of that control.

    There's any way to implement this on vb.net 2005 || 2008?

    Any better ideas? i'm open to you.

    Thanks in advance, and merry christmas

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Protect component library

    It is a simple matter of detecting the environment, and poping up a message box. This has been covered a number of times here on CodeGuru - so you can search for existing solutions.

    Realize that this is not really "protection". ANY code that is deployed to a machine where you do not have 100% control over can be broken (and will be broken if there is sufficient motivation).

    Many of the ".EXE protectors" are easily succeptable to "in-memory attacks".

    Simple obsfucation makes it no more difficult than if the program had been writen by womeone who spoke a different language (and I have had do reverse engineer progrrams written in Polish, German, Hungarian, French - and I only speak English)

    There are other "advanced" techniques that commercial programs like DotFuscator Professional (NOT the community edition that ships with Visual Strudio) provide.

    But in the end, you need to strike a balance between protecting your intellectual property and usability of the code. Realize that almost every vendor does NOT bother to take steps with their applications. The *only* group at Microsoft to have done it for .NET code was the SharePoint group; and they reversed the practice very quickly.

    The best way to protect your software is to make sure that the customer get a significant "value add" by having a legal copy. This typically means things like world-class support policies.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Aug 2005
    Location
    Spain!
    Posts
    149

    Red face Re: Protect component library

    I'm the first i know that this code is not a hardcore protection, but i only need a minimal protection, so my code is not everywhere so easy, i think about it like a "filter" for begginers.

    Regarding the "search" you mentioned, before i open this thread i was searching on the net and on this site, but with wrong words, i know that maybe you are tired of answering same questions again and again, but your message will be more useful if you put the words to be used to locate the information (i've tried some like 'component protection', 'controls protection' , 'control library security' and a lot of similar without any luck).


    About the question itself, i've found the property DesignMode of the component class, but it's not working in my scenario, i think is because the dll is running (and its DesignMode maybe False), and the form is in design mode( so True for form).

    Any suggestions at this point?

    I can't access the parent DesignMode property, because the readonly property is protected and i'm only a separate control.

    "The best way to protect your software is to make sure that the customer get a significant "value add" by having a legal copy"

    I take note about this, if the program have been copied or is present en p2p, then i'll think about this! thanks!

  4. #4
    Join Date
    Dec 2003
    Location
    Northern Ireland
    Posts
    1,362

    Re: Protect component library

    Have you tried this?

    Code:
    if debugger.IsAttached then
      ' An IDE is attached (may be on remote machine)
    end if
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook


    0100 1101 0110 1001 0110 0011 0110 1000 0110 0001 0110 0101 0110 1100 0010 0000 0100 0101 0110 1100 0110 1100 0110 0101 0111 0010

  5. #5
    Join Date
    Aug 2005
    Location
    Spain!
    Posts
    149

    Wink Re: Protect component library

    Thanks HairyMonkeyMan, as i've readed about, it seems to work like this other piece of code.

    Code:
        Private Function GetMode() As Boolean
            Return (System.Diagnostics.Process.GetCurrentProcess().ProcessName = "devenv")
        End Function

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Protect component library

    So, what happens if the client has a fake 'devenv' running?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured