Crackproof Your Software(No Starch-2002).pdf

(7343 KB) Pobierz
Crackproof Your Software
47047162.001.png
Crackproof Your Software
47047162.002.png
Table of Contents
Crackproof Your Software—The Best Ways to Protect Your Software Against Crackers....................1
Introduction....................................................................................................................................................3
Protection as a Deterren.....................................................................................................................3
Working with Assembler......................................................................................................................3
Publishing Cracker Tricks....................................................................................................................3
Chapter 1: Basics..........................................................................................................................................5
Why Crackers Crack............................................................................................................................5
How Crackers Crack: Debuggers and Disassemblers.........................................................................5
Debuggers.....................................................................................................................................5
Disassemblers...............................................................................................................................5
Decompilers...................................................................................................................................5
The Most Frequent Protection Failures...............................................................................................6
Chapter 2: Cracking Tools............................................................................................................................7
Overview..............................................................................................................................................7
SoftICE Basics.....................................................................................................................................8
Key Commands...........................................................................................................................10
The BPX Command.....................................................................................................................10
The BPR Switch...........................................................................................................................10
The BPM Switch..........................................................................................................................10
Display Commands......................................................................................................................11
Chapter 3: The Basic Types of Software Protection................................................................................12
Registration−Number (Serial−Number) Protection............................................................................12
Registration Number Is Always the Same...................................................................................12
Registration Number Changes in Accordance with Entered Information.....................................13
Registration Number Changes in Accordance with the User's Computer...................................14
Registration−Number Protection in Visual Basic Programs.........................................................15
How VB4 Programs Are Cracked................................................................................................16
Registration Number Is Checked Online.....................................................................................18
Time−Limited Programs....................................................................................................................21
Time Limit Is Removed Once the Correct Registration Number Is Entered................................21
Time Limit Is Removed Once a Registration Key File (.REG) Is Entered....................................22
Time Limit Cannot Be Removed; User Must Buy the Full Program.............................................22
Time Limit Is Contained in a Visual Basic Program.....................................................................23
Time Limit Applies to a Certain Number of Starts........................................................................23
Registration−File (KEY File) Protection.............................................................................................24
Some Program Functions Are Blocked Without the Correct Registration File.............................24
Program Is Time−Limited Without the Correct Registration File..................................................25
Hardware−Key (Dongle) Protection...................................................................................................25
Program Cannot Be Started Without the Hardware Key..............................................................25
Some Functions Are Limited Without the Hardware Key.............................................................26
HASP Hardware Keys.................................................................................................................27
Sentinel Hardware Keys..............................................................................................................32
Chapter 4: CD Protection Tricks................................................................................................................33
Overview............................................................................................................................................33
How CD−Checkers Work...................................................................................................................33
CD Protection Software.....................................................................................................................34
CD−Cops.....................................................................................................................................34
DiscGuard....................................................................................................................................35
LaserLock....................................................................................................................................35
1
Table of Contents
Chapter 4: CD Protection Tricks
SafeCast......................................................................................................................................35
SafeDisc......................................................................................................................................35
SecuROM....................................................................................................................................37
VOB.............................................................................................................................................38
Other CD Protection Tricks................................................................................................................39
CD Contains More Than 74 Minutes of Data...............................................................................39
Damaged TOC (Table of Contents).............................................................................................40
Huge Files....................................................................................................................................40
Physical Errors.............................................................................................................................40
One or More Huge Files..............................................................................................................40
Demo with Selected Program Functions Limited.........................................................................40
Chapter 5: Program Compression and Encoding—Freeware and Shareware......................................42
Overview............................................................................................................................................42
aPLib..................................................................................................................................................42
ASPack..............................................................................................................................................42
Ding Boys PE−Crypt..........................................................................................................................44
NeoLite..............................................................................................................................................45
Advanced Compression Options.................................................................................................46
Icons............................................................................................................................................46
Preserve Data..............................................................................................................................46
Other Resources..........................................................................................................................47
Miscellaneous..............................................................................................................................47
NFO...................................................................................................................................................47
PECompac........................................................................................................................................48
PELOCKnt.........................................................................................................................................49
PE−Crypt...........................................................................................................................................50
Manual Removal..........................................................................................................................53
Creating a Loader........................................................................................................................53
PE−Crypt Options........................................................................................................................53
PE−Crypt Summary.....................................................................................................................54
PE−SHiELD.......................................................................................................................................55
Petite..................................................................................................................................................56
Shrinker.............................................................................................................................................56
UPX...................................................................................................................................................57
WWPack32........................................................................................................................................58
Chapter 6: Commercial Software Protection Programs..........................................................................60
Overview............................................................................................................................................60
ASProtec...........................................................................................................................................60
FLEXlm..............................................................................................................................................63
InstallShield.......................................................................................................................................65
ShareLock..........................................................................................................................................66
The Armadillo Software Protection System.......................................................................................67
Vbox...................................................................................................................................................68
TimeLock 3.03 Through 3.10.......................................................................................................69
TimeLock 3.13 Through 3.15.......................................................................................................69
Vbox 4.0 Through 4.03................................................................................................................69
Vbox 4.10.....................................................................................................................................70
Vbox 4.3.......................................................................................................................................70
The Slovak Protector (SVKP)......................................................................................................71
2
Table of Contents
Chapter 7: Anti−Debugging, Anti−Disassembling, and Other Tricks for Protecting Against
Softice and TRW.........................................................................................................................................74
Overview............................................................................................................................................74
Detecting SoftICE by Calling INT 68h................................................................................................75
Detecting SoftICE by Calling INT 3h..................................................................................................76
Detecting SoftICE by Searching Memory..........................................................................................78
Detecting SoftICE by Opening Its Drivers and Calling the API Function CreateFileA (SICE,
NTICE)..............................................................................................................................................79
Detecting SoftICE by Measuring the Distance Between INT 1h and INT 3h Services......................81
Detecting SoftICE by Opening Its Drivers and Calling the API Function CreateFileA (SIWVID).......82
Detecting SoftICE by Calling the NmSymIsSoftICELoaded DLL Function from the nmtrans.dll
Library...............................................................................................................................................83
Detecting SoftICE by Identifying Its INT 68h Service........................................................................85
Detecting SoftICE by Detecting a Change in the INT 41h Service....................................................85
Detecting SoftICE by Opening Its Driver and Calling the API Function CreateFileA
(SIWDEBUG)....................................................................................................................................87
Detecting SoftICE by Calling Int 2Fh and Its Function GET DEVICE API ENTRY POINT for VxD
SICE.................................................................................................................................................88
Detecting SoftICE by Calling INT 2Fh and Its Function GET DEVICE API ENTRY POINT for
VxD SIWVID.....................................................................................................................................91
Using the CMPXCHG8B Instruction with the LOCK Prefix................................................................94
Detecting SoftICE with the VxDCal...................................................................................................95
Finding an Active Debugger Through the DR7 Debug Register........................................................97
Detecting SoftICE by Calling VxDCall Through Kernel32!ORD_0001...............................................99
Using the Windows Registry to Find the Directory Where SoftICE Is Installed...............................101
TRW Detection Using the Distance Between the Int 1h and the Int 3h Services............................103
Detecting TRW by Opening Its Driver Through Calling the API of the CreateFileA (TRW).............105
Launching the BCHK Command of the SoftICE Interface...............................................................106
Detecting TRW by Calling Int 3h......................................................................................................108
Detecting SoftICE by Opening Its Driver with an API Call to the CreateFileA (SIWVIDSTART)
Function..........................................................................................................................................110
Detecting SoftICE by Opening Its Driver with an API Call to the CreateFileW (NTICE,
SIWVIDSTART) Function...............................................................................................................111
Detecting SoftICE by Opening Its Driver with an API Call to Function _lcreat (SICE, NTICE,
SIWVID, SIWDEBUG, SIWVIDSTART..........................................................................................113
Detecting SoftICE by Opening Its Driver with an API Call to Function _lopen (SICE, NTICE,
SIWVID, SIWDEBUG, SIWVIDSTART..........................................................................................114
Anti−FrogsICE Trick........................................................................................................................115
Detecting SoftICE by Searching for the Int 3h Instruction in the UnhandledExceptionFilter...........117
Detecting SoftICE Through Int 1h....................................................................................................118
Chapter 8: Protecting Against Breakpoints, Tracers, and Debuggers.................................................120
Detecting Tracers Using the Trap Flag............................................................................................120
Detecting Breakpoints by Searching for Int 3h................................................................................121
Detecting Breakpoints by CRC........................................................................................................123
Detecting Debug Breakpoints..........................................................................................................126
Detecting User Debuggers..............................................................................................................128
Detecting User Debuggers Using the API Function IsDebuggerPresen.........................................129
Chapter 9: Other Protection Tricks..........................................................................................................130
API Hook Detection.........................................................................................................................130
Anti−ProcDump Trick.......................................................................................................................132
Switching a Running Program from Ring3 to Ring0........................................................................133
Switching into Ring0 Using the LDT (Locale Descriptor Table).................................................133
3
Zgłoś jeśli naruszono regulamin