Piracy protection

Dear friends,

First all, I don't speak english, but I'll try to explain my doubts.

I need to write an application in C++ (with some free tool), but I don't want to see my software cracked...

I don't have "sponsors", so I can't use hard locks... I need to find "others tools"...

I know, we don't have tools 100% secure against piracy, but, which techniques may I use to minimize the risk of my application be cracked?

Any help is wellcome (codes in C++, links [in english, too ;-)], books etc);

Can you help me?

Paulo Cassiano
[618 byte] By [pcassiano] at [2007-11-19 7:05:06]
# 1 Re: Piracy protection
I have 3 questions for you:

* How does one register the product? (via a registration key?)

* What type of application are you programming?

* How much effort do you want to put into this?
KevinHall at 2007-11-9 0:42:13 >
# 2 Re: Piracy protection
forget about protection, it will be bypassed withing hours of the release if the soft is good.
Do a basic cpacker onto the .exe w/e other file u may have.
Get good one to...something of type of ASprotect....
Second, don't use messagbox's or dialog windows for registration.
Third, try not to use GetWindowText or such to get text out of dialog box(i assume u are under win32api).
Encrypt all strings in ur program.
ex.
instead of "Please Register"
have it be like this in declaration of the variable"asd87as98d7a98sd7as98d".
decrypt the keys only when they are used. Use DMA for variables.
Add some anti debug tricks, when i get time i will post an article on how to bypass Olly.
If u use trial for advirtisi\ng, make sure u REMOVE the function that are disabled in trial.
and do remove some of them, so it will be impossible to get a cracked registered version that is full.

Do not spend too much time on this, if the prog is usefull it will be cracked withing hours of it';s releas/ The pirated version will surface withing days.

The above tips can lead noob cracker into big problems to crack the prog,
Quell at 2007-11-9 0:43:11 >
# 3 Re: Piracy protection
I need to write an application in C++ (with some free tool), but I don't want to see my software cracked...

I don't have "sponsors", so I can't use hard locks... I need to find "others tools"...

I know, we don't have tools 100% secure against piracy, but, which techniques may I use to minimize the risk of my application be cracked?


The only possibility of your program not being cracked is that crackers will not be interested in it.Should this be the case,you'd wish they would :)
There're a couple of techniques that would make this very difficult though.You could use SMC(self modifying code) which is code that changes itself at runtime.There are numerous tutorials around,i'd suggest that you visit mammon's site(Also make a search for "smc code" in google):

http://www.eccentrix.com/members/mammon/

Some more advanced techniques would involve polymorphism which is the act of executing different pieces of code each time the program runs.Then,you should also use some techniques to kill debuggers,disassemblers and such(make a search for "daemon's cave").Combine all these techniques to possibly create your own pe encryptor or packer.Read more about pe files and import table and import table rebuilding techniques.Should you use such techniques the right way,your program would be VERY interesting for a cracker to spend LOTS of time to crack.Good luck ;)
lakis at 2007-11-9 0:44:12 >
# 4 Re: Piracy protection
not sure about the SMC, it can be bypassed by simply debuggin the app, as can other stuff.
Jsut load the app into olly, and trace through it, when u find what u want to modify, do it, and dump the file.
Better idea would be to make ur prog detect olly and SI.
If ur progr will be loaded into olly, or will not detect SI, u can kiss ur prog good bye. It will be done with few problems with teh exception of packers.

BTW, don';t make a prog to hard to crack, ppl will proly be attracted to test their skills, and there are gonna be hundreds of tuts up on the net how to do it, or at least bits and pieces :D
Quell at 2007-11-9 0:45:08 >
# 5 Re: Piracy protection
not sure about the SMC, it can be bypassed by simply debuggin the app, as can other stuff.
Jsut load the app into olly, and trace through it, when u find what u want to modify, do it, and dump the file.


Well,not really ;) If you combine smc with creating a program that allocates space and executes apis dynamically at the allocated space,you would then need to code an iat rebuilder.This would mean that just dumping the executable would result in an executable that would need rebuilding of its imports and this is always the main procedure at which all today's packers rely on.SMC,if implemented with a couple of CRC like checks and iat mangling could make the cracking procedure very time-consuming...
lakis at 2007-11-9 0:46:17 >
# 6 Re: Piracy protection
good call on CRC checks, but rebuilding IAT is fairly easy, there are huge number of programs that do it automaticaly, but if u can bypass them, then it will require much more skill to rebuild the IAT.

also, can u give more info on what kind of program u are making so we can be more specific on the defense routins.
Quell at 2007-11-9 0:47:11 >
# 7 Re: Piracy protection
good call on CRC checks, but rebuilding IAT is fairly easy, there are huge number of programs that do it automaticaly, but if u can bypass them, then it will require much more skill to rebuild the IAT.

Indeed,rebuilding the IAT of an executable can become quite easy if you use programs like ImpRec or Revirgin.However,there's a great upset.There can be many tricks to perform that will confuse such programs and will not rebuild the executable correctly.For example,a later version of asprotect would not rebuild all imports and you would have to trace to fix some of them.
Tricks would be protecting memory pages and causing exceptions and call iats dynamically,or emulating first instruction of a dll's function and call it in the middle(like asprotect does).There can be numerous adaptations so that the import table will not be easily fixed.And you can also make some anti-loader stuff so that the executable is not dumped at all(by changing imagebase,sections and stuff dynamically).
All the above techniques require that you step into the executable's code a lot.And if you do so,smc along with crcs(static and memory ones) and debug registers clearing can cause severe pain..

also, can u give more info on what kind of program u are making so we can be more specific on the defense routins.

I'm not really talking of a standard program.Such techniques can be found in packers like SVKP,or armadillo,safedisk etc..There are many defence routines,some of which are pretty intuitive,but for sure all of them can be bypassed.
lakis at 2007-11-9 0:48:12 >
# 8 Re: Piracy protection
ASprotect is no longer a good pretocetion, a new packer needs to be made, something like ASprotect, but change how it does it, there are too many tuts on how to bypass ASprotect.

also safedisk will not work, since it is uses a hardburnet key into the cd rom.
Quell at 2007-11-9 0:49:15 >
# 9 Re: Piracy protection
ASprotect is no longer a good pretocetion, a new packer needs to be made, something like ASprotect, but change how it does it, there are too many tuts on how to bypass ASprotect.

In fact,it's one of the best there is :) I think that the best one is armadillo or SVKP at the time though.ASprotector is probably the third in the hierarchy :)
The question is not what the best packer is,but how one can use certain tricks to protect an application.In general,bypassing a packer using a "how-to" tutorial can be pretty easy.However,the process is not the same in all packers,in fact it's a lot difference.
The result is that if the reverser is not aware of the techniques in general,creating your own packer that uses scarce techinques is pretty difficult to crack and there will not probably be a tutorial on unpacking a home-made packer..
lakis at 2007-11-9 0:50:19 >
# 10 Re: Piracy protection
also safedisk will not work, since it is uses a hardburnet key into the cd rom.

It in fact extracts a key from the error parts into the cd rom and decrypts sections of the executable using the TEA algorithm.Sure it can work with minor changes.How about storing a key based on user input ? ;) This could be used as a decryption key which,in combination to smc can return bogus results on the code.
lakis at 2007-11-9 0:51:19 >
# 11 Re: Piracy protection
the tut will not apear unless the program is really good., that i agree with u.
As for ASprotect and Armadillo...
if u use them, there are general ways of getting to the OEP.
It can take around 30 minutes, but u wil get there no matter what the program is, if u know the packer.

For protection, u should find out how these packer work, adn then write ur own packer that does similar functions but in a diffrent wy, that will slow the **** out of a reverse, since tracing through the code will be quite long.

Also some packer have protection inside of them, do not be lazy and write protection in ur own prog as well as the packer that has protection inside of it.
First one that comes to mind is VBOX.

Also, if u will be using a keygen algo, then have the algo NOT generate the valid key adn then compear it to the entered one, makes a prog much easier to keygen.
have it check the key that has been enterted.
Quell at 2007-11-9 0:52:15 >
# 12 Re: Piracy protection
As for ASprotect and Armadillo...
if u use them, there are general ways of getting to the OEP.
It can take around 30 minutes, but u wil get there no matter what the program is, if u know the packer.

Sure there are some generic ways of getting the OEP but new versions come out soon and more intuitive tricks are found (like stolen bytes in asprotect).Apart from that,packers like armadillo do in fact give wide choices of protection.A program can use some while some other may not.
I think that if you have unpacked a packed executable with all choices that the packer supports and you find a protected program of the SAME version it's highly likely that you unpack it easily(not sure though,there's polymorphism or virtual machines around :)).
Getting a new packer to unpack,however,requires MUCH time,even if you know all the tricks.For instance,i was recently making some analysis of SDprotector.It took me about 1 week to analyse the protection and i could in fact learn two new (to me) techniques,one of which had me wondering for days.
lakis at 2007-11-9 0:53:18 >