CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Virtual Machines for Software Protection?

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Posts
    281

    Virtual Machines for Software Protection?

    I've been wondering for a long time, how are virtual machines used for software protection? I've looked into some open source VM's and I've got lost. Does anyone here have any knowledge they could shed on this subject? I've been wanting to write something of the sort for my own software protection.

    Here are some examples of software that uses a VM for protection:
    http://vmprotect.ru/
    http://oreans.com/index.php
    http://www.setisoft.com/?lang=en

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

    Re: Virtual Machines for Software Protection?

    The first step is to realize that there are two radically different types of "Virtual Machines".

    The first [which is NOT what is being talked about in any of the links] are those that provide a complete "virtual computer". These are things like VMWare, VirtualPC, VirtualServer, Hyper-V, Zen/Citrix. An example would be running XP in a controlled environment on a Vista Box [fairly common]

    The second, is a piece of software that utilizes a custom set of "byte codes" that define a unique "instruction set". These are then "interpreted" (often very highly optimized) to "run" the program. Of course, the most common VM of this type is the Java enviroment.

    The fact is that there are noti nherently any more secure than native code. The prime difference is that while there are millions of people who may understand x86 machine code, there are only a handful of people who would know a "custom" virtual machine's language. This reduces the surface area (number of attackers), but does nothing to stop a skilled and determined attack.

    Many of these products also encrypt the file to provide some additional protection, but this exact same technioque can be done with native code. So there is no real difference here anyway.

    The bottom line is that any code that is deployed to external machines is vunerable to attack, and this must be analyzed to determine the risk/benefit tradeoff on a case by case basis.
    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
    Nov 2005
    Posts
    281

    Re: Virtual Machines for Software Protection?

    Ok I understand it much better now. I can easily make my own unique instructions and what not, but I have no idea how I would make it translate them if I'm making my own software protection. Would you know anything about that? I understand how the PE Headers work and what not, but would I just make the stub simply read the native code and execute it as my bytecode? Or would I have my protector actually translate the whole binary and then have the translation in the stub so it knows how to execute it? Or is there truly no difference?

    And now I understand how a "VM" wouldn't make it much harder for it to be unpacked, but I also realize how it would make it much more difficult for a packer to be produced if the instruction set was made unique constantly, if each time I protected my application the instruction set was made different.

    Only a handful of people may understand how they work, but those people are also the extremely knowledgeable. Anything is crackable, but I'm just trying to make it more difficult. If I can take the script kiddies and people who aren't advanced in cracking out of the equation, then it reduces the risk of my application being cracked and distributed illegally.

  4. #4
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,116

    Re: Virtual Machines for Software Protection?

    Complete translation is MUCH easier to break [all the code is living in memory immediately after the translation].

    It would take way tooooo long in a forum to attempt to explain how to write your own mechanism, but there are plenety of reference implementations of interpreters that you can download and evaluate to learn the concepts.
    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

  5. #5
    Join Date
    Nov 2005
    Posts
    281

    Re: Virtual Machines for Software Protection?

    I've been searching for the references, perhaps I'm just looking in all the wrong places. Can you please show the references and what not that you have?

  6. #6
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,116

    Re: Virtual Machines for Software Protection?

    Quote Originally Posted by Rehorav View Post
    I've been searching for the references, perhaps I'm just looking in all the wrong places. Can you please show the references and what not that you have?
    Quick starting point,
    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

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)