home *** CD-ROM | disk | FTP | other *** search
- Chapter I How to Crack
-
-
- -------------------------------------------------------------
- Let's start with a simple introduction to patching a program
- using the DOS DEBUG program. The following article will in-
- troduce you to the basic ideas and concepts of looking for a
- certain area of a program and making a patch to it.
- -------------------------------------------------------------
-
-
- By: Charles Petzold / Specular Vision
- Title: Case Study: A Colorful CLS
-
- This article originally appeared in the Oct. 14,1986 Issue
- of PC Magazine (Vol 15. Num 17.). Written by Charles Petzold.
-
- The hardest part of patching existing programs is determin-
- ing where the patch should go. You really have to make an
- intelligent guess about the functioning of the program.
-
- As an example, let's attempt to modify COMMAND.COM so that
- is colors the screen on a CLS command. As with any type of
- patch try it out on a copy and NOT the original.
-
- First, think about what we should look for. CLS is differ-
- ent from all the other DOS internal Commands, It is the only
- internal command that does something to the screen other than
- just write to it with simple teletype output. CLS blanks the
- screen and homes the cursor. Since it can't do this through
- DOS Calls (unless ANSI.SYS is loaded), it is probably calling
- the BIOS Directly. The BIOS Interrupt 10h call controls the
- video, and so the CLS command probably uses several INT 10h
- instructions. The machine code for INT 10h is CD 10.
-
- (While this same method will work under any version of
- PC-DOS, Version 2.0 and later, the addresses I'll be using
- are from PC-DOS 3.1. Other versions of PC-DOS(or MS-DOS) will
- have different addresses; you should be absolutely certain
- that you're using the correct addresses.)
-
- Load COMMAND.COM into DEBUG:
-
- DEBUG COMMAND.COM
-
- and do an R (Registers) command. The size of COMMAND.COM is
- in register CX. For DOS 3.1's COMMAND.COM, this value is
- 5AAA.
-
- Now do Search command to look for the CD 10 bytes:
-
- S 100 L 5AAA CD 10
-
- You'll get a list of six addresses, all clustered close to-
-
- 4
- gether. The first one is 261D. You can now pick an address a
- little before that (to see what the first call is doing) and
- start disassembling:
-
- U 261B
-
- The first INT 10 has AH set to 0F which is a Current Video
- State call. The code checks if the returned value of AL
- (Which is the video mode) is less than 3 or equal to 7.
- These are the text modes. If so, it branches to 262C. If
- not, it just resets the video mode with another INT 10 at ad-
- dress 2629.
-
- At 262C, the code first sets the border black (the INT 10
- at 2630), then does another Current Video State call (at
- 2634) to get the screen width in register AH. It uses infor-
- mation from this call to set DX equal to the bottom right row
- and column. It then clears the screen by scrolling the en-
- tire screen up with another INT 10 (at 2645), and then sets
- the cursor to the zeroth row and zeroth column with the final
- INT 10 (at 264D).
-
- When it scrolls the whole screen, the zero value in AL ac-
- tually means blank the screen, the value of BH is the at-
- tribute to be used on the blanked area. In an unmodified
- COMMAND.COM, BH is set to 7 (Which is white on black) by the
- following statement at address 2640:
-
- MOV BX,0700
-
- If you prefer a yellow-on-blue attribute (1E), you can
- change this line by going into Assemble mode by entering:
-
- A
-
- then entering
-
- MOV BX,1E00
-
- and exiting Assemble mode by entering a blank line.
-
- Now you can save the modified file:
-
- W
-
- and quit DEBUG:
-
- Q
-
- When you load the new version of COMMAND.COM (and you can
- do so without rebooting by just entering:
-
- COMMAND
-
-
- 5
- on the DOS command level), a CLS will turn the screen blue
- and display characters as yellow.
-
- If it doesn't or if anything you type shows up as white on
- black, that probably means you have ANSI.SYS loaded. If you
- use ANSI.SYS, you don't have to make this patch but can in-
- stead use the prompt command for coloring the screen.
-
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 6
- -------------------------------------------------------------
- That was just one section of a very large article that helped
- me to get started. Next we'll look at two other articles,
- both written by Buckaroo Banzi. These two articles CRACK-1
- and CRACK-2 give you an introduction to the different copy
- protection schemes used on IBM PC's, and how to find and by-
- pass them.
- -------------------------------------------------------------
-
-
-
- By: Buckaroo Banzai
- Title: Cracking On the IBM PC Part I
-
-
- Introduction
- ------------
- For years, I have seen cracking tutorials for the APPLE
- computers, but never have I seen one for the PC. I have de-
- cided to try to write this series to help that pirate move up
- a level to a crackest.
-
- In this part, I will cover what happens with INT 13 and how
- most copy protection schemes will use it. I strongly suggest
- a knowledge of Assembler (M/L) and how to use DEBUG. These
- will be an important figure in cracking anything.
-
-
- INT-13 - An overview
- --------------------
-
- Many copy protection schemes use the disk interrupt
- (INT-13). INT-13 is often use to either try to read in a il-
- legally formatted track/sector or to write/format a
- track/sector that has been damaged in some way.
-
- INT-13 is called like any normal interrupt with the assem-
- bler command INT 13 (CD 13). [AH] is used to select which
- command to be used, with most of the other registers used for
- data.
-
- INT-13 Cracking College
- -----------------------
- Although, INT-13 is used in almost all protection schemes,
- the easiest to crack is the DOS file. Now the protected pro-
- gram might use INT-13 to load some other data from a normal
- track/sector on a disk, so it is important to determine which
- tracks/sectors are important to the protection scheme. I
- have found the best way to do this is to use LOCKSMITH/pc
- (what, you don't have LS. Contact your local pirate for it.)
-
- Use LS to analyze the diskette. Write down any track/sector
- that seems abnormal. These track are must likely are part of
- the protection routine. Now, we must enter debug. Load in
-
- 7
- the file execute a search for CD 13. Record any address
- show.
-
- If no address are picked up, this mean 1 or 2 things, the
- program is not copy protected (right...) or that the check is
- in an other part of the program not yet loaded. The latter
- being a real hassle to find, so I'll cover it in part II.
- There is another choice. The CD 13 might be hidden in self
- changing code. Here is what a sector of hidden code might
- look like
-
- -U CS:0000
- 1B00:0000 31DB XOR BX,BX
- 1B00:0002 8EDB MOV DS,BX
- 1B00:0004 BB0D00 MOV BX,000D
- 1B00:0007 8A07 MOV AL,[BX]
- 1B00:0009 3412 XOR AL,12
- 1B00:000B 8807 MOV [BX],AL
- hip, The - WWIV............................................314-644-5777
- First Capitol Computer............................................314-928-9228
- Fishing Pond, The - WWIV..........................................314-846-4031
- Flash BBS, The (B)................................................314-275-2040
- Flo Valley LongShips - WWIV.......................................314-595-4489
- Forgotten Realm, The - WWIV.......................................314-838-5116
- Freedom Station - TAG.............................................314-677-8284
- Frog, The.........................................................314-776-0321
- Future BBS, The...................................................314-921-6867
- Games Depot (*)...................................................314-576-7686
- Gateway Area Mac Users' Group.....................................314-997-6912
- Gateway City......................................................314-647-3290
- Ghost Wheel.......................................................314-427-4119
- Glass Menagerie (?)...............................................314-423-5787
- Harris-Stowe State College - WWIV.................................314-533-3158
- Heath Users' Group................................................314-291-8653
- Hoops BBS, The - WWIV.............................................314-428-5209
- IBM PC Users' Group - Maximus.....................................314-928-9993
- Information Exchange, The ($) - WWIV..............................314-845-2780
- Java Shoppe.......................................................314-772-5073
- Junk Drawer - MTAB................................................314-434-4034
- Just Crumbs.......................................................314-595-2002
- KAYPRO Users' Group...............................................314-821-0638
- Ken's Survivalist - TBBS..........................................314-821-2815
- Kingdom of Darkness, The - WWIV...................................314-225-1721
- Kirkwood Community BBS.................................