Saturday, December 5, 2009

Introduction

This book is designed to help all programmers who have ever written their own software to better protect their software from illegal copying. It will also be useful to programmers creating freeware who wish to protect their source code.

The idea to write a book like this came to me some time ago when I realized how poorly the topic is covered and how difficult it is to acquire the information necessary to adequately protect software. When I was involved with game production in the Czech and Slovak Republics, I was astonished at how simple their protection was, and that very often they had no protection at all — yet it is so easy to protect software, at least at a basic level.

The problem lies in the lack of information and experience in this field. That's why I wrote this book, which will present many previously unaddressed topics concerning software protection.

Protection as a Deterrent

My experience tells me that there is no protection that cannot be easily removed and, as such, much of the work you will put into protecting your software is simply a deterrent, delaying the inevitable. It's only a matter of time, possibilities, and patience before a cracker cracks your software.

Of course, the better your deterrent, the more time you'll have to sell your software before you find it available (or crackable) for free, online. What creators of a program or game would want to find their product, whether shareware or commercial software, pirated on the Internet the very day of the release? That would definitely result in reduced sales.

Good software protection prevents the cracker from removing the protection correctly. With such protection, the program won't work, or won't work correctly, and more people will buy an original copy. Of course, a successful crack will appear in the course of time, but the time you buy is money earned. Really good protection will buy a considerable amount of time and will engender several versions of the crack, some of which will not work properly. In such a case, even many hardcore pirates will buy an original copy rather than try to crack one, just to avoid the hassle.

Working with Assembler

In later chapters you'll find many examples of applications protected from debugging, disassembling, or possible decompiling. The examples are all in assembler, but they are written as comprehensibly as possible and are accompanied by footnotes in a source code. Even a mediocre assembler programmer should be able to understand them. I chose not to use a higher-level language like C++ code because it wouldn't be understandable to programmers who work in Delphi, and vice versa. I chose not to use Visual Basic because most examples cannot be written in it. Assembler is the best choice because even code written in C++ will have some parts written in assembler.

Another advantage of assembler is that it can be directly inserted both into C++ and Delphi code, so assembler examples are universal for both languages. Visual Basic programmers can also insert the code into a library created in another programming language (assembler, C++, or Delphi) and then call the library from the application code. This is certainly not a perfect solution, but it is better than no protection at all.

Publishing Cracker Tricks

This book took considerable effort to write. I had to do a good bit of research, and most of what I present here comes from the web pages of crackers. There are plenty of them, and it is sad that there is almost

nothing comparable for developers.

Some people argue that information like that presented in this book should not be freely accessible to everyone. However, keeping it secret would be counterproductive. The fact is, crackers are very well informed, while developers have virtually no resources. When a cracker learns how to remove a certain kind of protection, it is only a matter of time before detailed information on how to do so is published on specialized web pages. On the other hand, developers who don't follow the field of cracking carefully will not be aware of how easily their protection can be cracked and will continue to use this protection, even though it may be removed in a matter of minutes.

It is no surprise that crackers create the best software protection, since they are often the best informed and have the most experience. This situation will hopefully change in the future, and I will be very glad if this book helps in this effort.

My thanks go to all the people without whom this book would never have been written.

First, my special thanks to my friend Linda and my family, who tolerated my late-night sessions and my bad mood in the mornings when I had to go to work.

Thanks to my Internet friends:

EliCZ Thanks for all the help and for your faultless source code. There is hardly a better system programmer than you, really.

Ivan Bartek Thanks for everything; I look forward to our future cooperation.

Miroslav Bambosek You helped me a lot with your keen observations and your help with C examples. I would probably be unable to manage SafeDisc without you.

Ice Thanks for everything, especially for your inspiration.

Stone Your wonderful source code helped me in many cases.

The Owl You are a real master of anti-debugging tricks and other hidden secrets of Windows 9x.

Liquid Thanks for the anti-FrogsICE tricks.

Pet'o Somora You are a wonderful mathematician and an even better friend. Thanks for your patience in explaining those problems.

Further, thanks to the following people: Hoe, Doom, HHup, Brbla, Slask, Lorian, Christopher Gabler, Nihil, Iceman, Maxx, Ender, Alfo, Sadman, Crow, Rainman, SaHo, Momo, Dugi, Ivan, Maros, Mikie, KremeH, Neuron, Daemon, SAC, Light Druid, and Vladimir Gneushev. And to everyone whose names I have forgotten to list here but who helped with this book, thank you.

No comments:

Post a Comment