home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / HTOCRK51.ZIP / HTOCRK51.TXT < prev    next >
Text File  |  1996-05-20  |  25KB  |  918 lines

  1.                      HOW TO CRACK, by +ORC, A TUTORIAL
  2.  
  3. ---------------------------------------------------------------------------
  4.  
  5.                  Lesson 5.1: Disk & CD-Rom access (basics)
  6.  
  7. ---------------------------------------------------------------------------
  8.  
  9.               [MARIO ANDRETTI] [REACH FOR THE SKY] [FS v.2.12]
  10.  
  11.                    --------------------------------------
  12.  
  13. LESSON 5 (1) - HOW TO CRACK, HANDS ON - Disk/CDROM access (plus
  14.  
  15. bypasses "on the fly")
  16.  
  17. Somewhere I have to put the bypasses (loader programs) in this
  18.  
  19. tutorial, allow me to put them here:
  20.  
  21. Preparing a loader to bypass a protection [MARIO ANDRETTI]
  22.  
  23.      At time the protectionists hook vectors in order to impose
  24.  
  25. a particular protection. In this (and similar) cases a good
  26.  
  27. crack-way is to prepare a "loader" program, that "de-hooks" the
  28.  
  29. vector used for the protection. This kind of crack can be used
  30.  
  31. also for internet cracking (on some firewall configurations, see
  32.  
  33. lesson A.2).
  34.  
  35.      As example let's take "Mario andretti racing challenge", a
  36.  
  37. stupid game that uses the SAME (!) protection scheme you'll still
  38.  
  39. find to day on some access routines of military servers around
  40.  
  41. the witlessly called "free" world.
  42.  
  43. In order to crack this cram you would prepare a loader on the
  44.  
  45. following lines:
  46.  
  47. loc   code           instruction        what's going on
  48.  
  49. -------------------------------------------------------
  50.  
  51. :0100 EB44           JMP 0146
  52.  
  53. ...
  54.  
  55. :0142 0000           <- storing for offset of INT_21
  56.  
  57. :0144 5887           <- storing for segment of INT_21
  58.  
  59. :0146 FA             CLI
  60.  
  61. :0147 0E             PUSH CS
  62.  
  63. :0148 1F             POP DS
  64.  
  65. :0149 BCB403         MOV SP,03B4
  66.  
  67. :014C FB             STI
  68.  
  69. :014D 8C1EA901       MOV [01A9],DS      <- save DS
  70.  
  71. :0151 8C1EAD01       MOV [01AD],DS         three
  72.  
  73. :0155 8C1EB101       MOV [01B1],DS         times
  74.  
  75. :0159 B82135         MOV AX,3521        <- get INT_21
  76.  
  77. :015C CD21           INT 21                in ES:BX
  78.  
  79. :015E 891E4201       MOV [0142],BX      <- store offset
  80.  
  81. :0162 8C064401       MOV [0144],ES      <- store segment
  82.  
  83. :0166 BA0201         MOV DX,0102
  84.  
  85. :0169 B82125         MOV AX,2521        <- set INT_21 to
  86.  
  87. :016C CD21           INT 21                DS:0102
  88.  
  89. :016E 0E             PUSH CS
  90.  
  91. :016F 07             POP ES             <- ES= current CS
  92.  
  93. :0170 BBB403         MOV BX,03B4
  94.  
  95. :0173 83C30F         ADD BX,+0F
  96.  
  97. :0176 B104           MOV CL,04
  98.  
  99. :0178 D3EB           SHR BX,CL          <- BX= 3C
  100.  
  101. :017A B8004A         MOV AX,4A00        <- Modify memory block
  102.  
  103. :017D CD21           INT 21                to 3C paragraphs
  104.  
  105. :017F BA9E01         MOV DX,019E        <- ds:dx=program name
  106.  
  107. :0182 BBA501         MOV BX,01A5        <- es:bx = param. block
  108.  
  109. :0185 B8004B         MOV AX,4B00        <- load ma.com
  110.  
  111. :0188 CD21           INT 21
  112.  
  113. :018A 2E8B164201     MOV DX,CS:[0142]   <- reset old int_21
  114.  
  115. :018F 2E8E1E4401     MOV DS,CS:[0144]
  116.  
  117. :0194 B82125         MOV AX,2521
  118.  
  119. :0197 CD21           INT 21
  120.  
  121. :0199 B8004C         MOV AX,4C00        <- terminate with return
  122.  
  123. :019C CD21           INT 21                code
  124.  
  125. :019E 6D612E636F6D00 "ma.com"
  126.  
  127.       0000           fence
  128.  
  129. :01A7 B2015887
  130.  
  131. :01AB B2015887
  132.  
  133. :O1AF B2015887
  134.  
  135.       0000           fence
  136.  
  137. let's now prepare a routine that hooks INT_21:
  138.  
  139. push all
  140.  
  141. CMP AX,2500    <- go on if INT_21 service 25
  142.  
  143. JNZ ret
  144.  
  145. CMP Word Ptr [0065], C00B <- go on if location 65 = C00B
  146.  
  147. JNZ ret
  148.  
  149. MOV  Byte Ptr [0060], EB  <- crack instructions
  150.  
  151. MOV  Byte Ptr [0061], 3C
  152.  
  153. MOV  Byte Ptr [0062], 40  <- INC AX
  154.  
  155. MOV  Byte Ptr [0063], 90  <- NOP
  156.  
  157. MOV  Byte Ptr [0064], 48  <- DEC AX
  158.  
  159. pop all
  160.  
  161. JMP  FAR CS:[0142]  <- JMP previous INT_21
  162.  
  163.      From now on this loader will work every time that a program
  164.  
  165. with location [0065] containing an 0R AX,AX instruction (0BC0:
  166.  
  167. it's the case of ma.com) calls INT_21 service 25 (hook a vector),
  168.  
  169. the target program will be modified on the fly and will get, at
  170.  
  171. location [0060], the instruction JMP 3C locations ahead, despite
  172.  
  173. the fact that it has routines capable of self checking in order
  174.  
  175. to make sure it has not been modified.
  176.  
  177.      The most important thing is the routine that YOU write that
  178.  
  179. will precede the call to INT_21 (or any other INT) service 25 (or
  180.  
  181. any other service) in order to crack on the fly the offending
  182.  
  183. program. I'll show you another one, this one for [Reach for the
  184.  
  185. skies] (reach.com):
  186.  
  187. push all
  188.  
  189. CMP  AH,3D      <- is it service 3D? (open file)
  190.  
  191. JNZ  ret        <- no, so ret
  192.  
  193. CMP  DX,13CE    <- you wanna open file at 13CE?
  194.  
  195. JNZ  ret        <- no, so ret
  196.  
  197. MOV  AX,[BP+04] <- in this case
  198.  
  199. MOV  DS,AX
  200.  
  201. CMP  Byte Ptr [B6DA],74 <- old instructions
  202.  
  203. JNZ  015B
  204.  
  205. CMP  Byte Ptr [B6DB],0F <- ditto
  206.  
  207. JNZ  015B
  208.  
  209. CMP  Byte Ptr [B6DC],80 <- ditto, now we now where we are
  210.  
  211. JNZ  015B
  212.  
  213. MOV  Byte Ptr [B6DA],EB <- crack
  214.  
  215. MOV  Byte Ptr [B697],40 <- camouflaged  no-opping
  216.  
  217. MOV  Byte Ptr [B698],48 <- cam          nop
  218.  
  219. MOV  Byte Ptr [B699],90 <- cam          nop
  220.  
  221. MOV  Byte Ptr [B69A],40 <- cam          nop
  222.  
  223. MOV  Byte Ptr [B69B],48 <- cam          nop
  224.  
  225. MOV  DX,CS:[0165]
  226.  
  227. MOV  DS,CS:[0167]
  228.  
  229. MOV  AX,2521  <- set hook
  230.  
  231. INT  21
  232.  
  233. POP  all
  234.  
  235. JMP  FAR CS:[0165]
  236.  
  237. Here you did change the instruction 740F in the instruction EB0F,
  238.  
  239. and you did "noop" the instructions at B697-B69B. (Well, more
  240.  
  241. elegantly than "noop" them with "90" bytes, you choose a INC AX,
  242.  
  243. DEC AX, NOP, INC AX, DEC AX sequence instead! There are sound
  244.  
  245. reasons to use a sequence of "working" instructions instead of
  246.  
  247. NOPs: recent protection schemes "smell" patched nops inside the
  248.  
  249. program and trash everything if they find more than -say- three
  250.  
  251. consecutive NOPs! You should always try to choose THE LESS
  252.  
  253. INTRUSIVE and MORE "CAMOUFLAGED" solution when you crack!)
  254.  
  255.      You can apply this kind of crack, on the same lines, to many
  256.  
  257. programs that perform self checking of the code and hook the
  258.  
  259. vectors.
  260.  
  261. REAL DISK ACCESS STUFF
  262.  
  263.      Now we may come to the subject of this lesson:
  264.  
  265.      As usual, let's begin from the beginning: history is always
  266.  
  267. the key that allows an understanding of present and future, in
  268.  
  269. cracking matters too. As the older 5 1/4 inch big black floppy
  270.  
  271. disks were still used (the 320K/8 tracks or 360K/9 tracks ones,
  272.  
  273. that were really "floppy" and have nowadays almost disappeared)
  274.  
  275. one of the more common methods to protect a program, was to
  276.  
  277. format the "master" (key) disk in a weird way. Old floppy disk
  278.  
  279. for the PC did usually store 360K at 9 sectors per track.
  280.  
  281.      Some basics for those of you that do not know anything: in
  282.  
  283. order to defeat this kind of cracks you need to know two things:
  284.  
  285. the floppy disk parameter block (FDPB) and the interrupt routines
  286.  
  287. dealing with format/read disk (basically INT_13).
  288.  
  289.      Most often, the protection scheme is to either format one
  290.  
  291. or more sectors or tracks with sector sizes other than the
  292.  
  293. standard 512 bytes, or to either give one of the sectors a wild
  294.  
  295. sector number like 211 or just not format a whole track of
  296.  
  297. eight/nine/15 sectors. If you, for instance, have got the same
  298.  
  299. (very old) copy of VisiCalc master I do, you'll find that sector
  300.  
  301. 8 on track 39 is missing entirely. The interrogation with
  302.  
  303. assembly or with an "ad hoc" utility (I use the tools I wrote
  304.  
  305. myself, but you 'll be able to find many such utilities in public
  306.  
  307. domain, the oldest one, from 1984 (!) being the seasoned [U-ZAP]
  308.  
  309. an "Ultra utility" from the "Freesoft company") will tell you
  310.  
  311. which sector numbers were altered, their size in bytes, and if
  312.  
  313. they were formatted with a CRC error (another not so fancy
  314.  
  315. trick).
  316.  
  317.      The floppy disk parameters are stored in the BIOS: interrupt
  318.  
  319. vector 1E contains the address of the floppy disk parameter
  320.  
  321. block. The FDPB's contents are the following:
  322.  
  323. Offset    Function                 crackworthy?        Example
  324.  
  325. 0    Step rate & head unload            no                  DF
  326.  
  327. 1    head load time                     no                  02
  328.  
  329. 2    Motor on delay                     no                  25
  330.  
  331. 3    Number of bytes per sector         yes                 02
  332.  
  333. 4    Last sector number                 yes                 12
  334.  
  335. 5    Gap length                         yes                 1B
  336.  
  337. 6    Data track length                  yes                 FF
  338.  
  339. 7    Format gap length                  yes                 54
  340.  
  341. 8    Format byte                        no                  F6
  342.  
  343. 9    Head settle time                   no                  0F
  344.  
  345. A    Motor start time                   no                  02
  346.  
  347. 0)   Offset #0: the left "nybble" (single digit) of this value
  348.  
  349.      is the step rate time for the disk drive head. The right
  350.  
  351.      nybble is the disk head unload time. These values are best
  352.  
  353.      left alone.
  354.  
  355. 1)   Offset #1: again, don't fool around with these values. The
  356.  
  357.      left nybble is the disk head load time, and the right
  358.  
  359.      nybble is the direct memory access mode select.
  360.  
  361. 2)   Wait time until motor is turned off. Not normally of use.
  362.  
  363. 3)   Bytes-per-sector value: AH-HAH! If you place a "0" in this
  364.  
  365.      value, the PC expects all sectors to be 128 bytes long. A
  366.  
  367.      "1" means a  sector size of 256 bytes, a "2" means 512
  368.  
  369.      bytes (this is the standard DOS value), and a "3" means
  370.  
  371.      1024 bytes per sector.
  372.  
  373. 4)   Highest sector number on a track: this is used for
  374.  
  375.      formatting and tells DOS how many sectors there are on each
  376.  
  377.      track.
  378.  
  379. 5)   Gap length for diskette reads: this is what you fool around
  380.  
  381.      with if you keep getting CRC errors when you try to read a
  382.  
  383.      non-standard size sector. Normally, you can just leave this
  384.  
  385.      alone except when formatting with a U-Format tool.
  386.  
  387. 6)   Data length: This contains the number of bytes in a sector
  388.  
  389.      when the value in table byte #4 doesn't contain a 0, 1, 2,
  390.  
  391.      or 3.
  392.  
  393. 7)   Number of bytes in the gap between sectors: this is also
  394.  
  395.      only used when formatting special tracks.
  396.  
  397. 8)   Format fill byte: When formatting, this is the
  398.  
  399.      initialization byte that will be placed in all new sectors.
  400.  
  401. 9)   Head settle time: leave this alone.
  402.  
  403. A)   Motor start time: don't fool with this either.
  404.  
  405. In order to modify globally the number of tracks on a given disk
  406.  
  407. and the number of sectors per track you can always format with
  408.  
  409. the DOS command switches "/t:" and "/n:"
  410.  
  411.                   FORMAT /t:tracks /n:sectors
  412.  
  413.      If you want to find out what the existing parameters are,
  414.  
  415. run [Debug.exe] or [Symdeb.exe] and enter the following commands:
  416.  
  417. -    d 0:78    l 4                 <- get FDPB address
  418.  
  419.  0000:0070     22 05 00       <- debugger's likely response
  420.  
  421. -    d 0:522   l a                 <- get 10 FDPB values
  422.  
  423.  0000:520 DF 02 25 02 12 1B FF...  <- see preceding table
  424.  
  425.      Remember that all standard disk formats under DOS support
  426.  
  427. a sector size of 512 bytes, therefore, for one-sided 5.25 inch
  428.  
  429. floppies:
  430.  
  431.                40t*8s*512b=163.840 bytes (160Kb)
  432.  
  433.                40t*9s*512b=184.320 bytes (180Kb)
  434.  
  435. and for two-sided 5.25 inch floppies:
  436.  
  437.            40t*8s*512b*2sides=327.680 bytes (320Kb)
  438.  
  439.            40t*9s*512b*2sides=368.640 bytes (360Kb)
  440.  
  441.      Beginning with DOS version 3.0 (Yeah, more and more
  442.  
  443. history!) a new floppy disk format has been supported: The IBM
  444.  
  445. AT (80286 CPU) introduced the so called "high capacity" 5.25 u-
  446.  
  447. inch floppy, capable of storing 1.2M at 15 sectors per track:
  448.  
  449.           80t*15s*512b*2sides=1.228.800 bytes (1.2Mb)
  450.  
  451.      Later on were introduced the to-day universally used 3.5
  452.  
  453. inch floppies, the ones inside a rigid small plastic cartridge,
  454.  
  455. and we have, similarly:
  456.  
  457.              3.5-inch double sided/double density      720K
  458.  
  459.             3.5-inch double sided/quad density (HD)    1440K
  460.  
  461.               3.5-inch double sided/high density       2880K
  462.  
  463. [INT_13, AH=18, Set media type for format]
  464.  
  465.      In order to create weird layouts, the protectionists use
  466.  
  467. interrupt 13h, service 18h, that specifies to the formatting
  468.  
  469. routines the number of tracks and sectors per track to be placed
  470.  
  471. on the media:
  472.  
  473. *    Registers on entry: AH=18h; CH=N° of tracks; CL= Sectors
  474.  
  475.      per track; DL= Drive number (A=0; B=1;C=2... bit 7 is set
  476.  
  477.      if the drive is an hard disk)
  478.  
  479. *    Registers on Return: DI: Offset address of 11-byte
  480.  
  481.      parameter table; ES: Segment address of 11-byte parameter
  482.  
  483.      table.
  484.  
  485. [INT_13, AH=2, Read disk sectors]
  486.  
  487. In order to read them, they have to use INT_13, service 2, read
  488.  
  489. disk sectors, with following layout:
  490.  
  491. *    Registers on entry: AH=2h; AL= N° of sectors; BX= Offset
  492.  
  493.      address of data buffer; CH=track; CL= Sector; DH= Head
  494.  
  495.      (side) number; DL= Drive number; ES: Segment address of
  496.  
  497.      data buffer.
  498.  
  499. *    Registers on Return: AH= return code. If the carry flag is
  500.  
  501.      not set, AH=0, therefore the weird sector has been read, if
  502.  
  503.      on the contrary the carry flag is set, AH reports the
  504.  
  505.      status byte as follows:
  506.  
  507. 76543210  HEX  DEC       Meaning
  508.  
  509. 1         80h  128       Time out - drive crazy
  510.  
  511.  1        40h  064       Seek failure, could not move to track
  512.  
  513.   1       20h  032       Controller kaputt
  514.  
  515.    1      10h  016       Bad CRC on disk read
  516.  
  517.     1     09h  009       DMA error - 64K boundary crossed
  518.  
  519.     1     08h  008       DMA overrun
  520.  
  521.      1    04h  004       Bad sector - sector not found
  522.  
  523.       11  03h  003       Write protect!
  524.  
  525.       1   02h  002       Bad sector ID (address mark
  526.  
  527.        1  01h  001       Bad command
  528.  
  529. [Return code AH=9: DMA boundary error]
  530.  
  531.      One of the possible errors should be explained, coz it is
  532.  
  533. used in some protection schemes: AH=9 DMA boundary error, means
  534.  
  535. that an illegal boundary was crossed when the in formation was
  536.  
  537. placed into RAM. DMA (Direct memory access) is used by the disk
  538.  
  539. service routines to place information into RAM. If a memory
  540.  
  541. offset address ending in three zeros (ES:1000, ES: 2000...) falls
  542.  
  543. in the middle of the area being overlaid by a sector, this error
  544.  
  545. will occur.
  546.  
  547. [INT_13, AH=4 Verify disk sectors]
  548.  
  549.      Another possible protection interrupt is interrupt 13H,
  550.  
  551. service 4, Verify disk sectors. Disk verification takes place on
  552.  
  553. the disk and DOES NOT involve verification of the data on the
  554.  
  555. disk against data in memory! This function has no buffer
  556.  
  557. specification, does not read or write a disk: it causes the
  558.  
  559. system to read the data in the designated sector or sectors and
  560.  
  561. to check its computed cyclic redundancy check (CRC) against data
  562.  
  563. stored on the disk. See INT_13, AH=2 registers and error report.
  564.  
  565. [CRC]
  566.  
  567.      The CRC is a checksum, that detects general errors. When a
  568.  
  569. sector is written to disk, an original CRC is calculated AND
  570.  
  571. WRITTEN ALONG with the sector data. The verification service
  572.  
  573. reads the sector, recalculates the CRC, and compares the
  574.  
  575. recalculated CRC with the original CRC.
  576.  
  577.      We saw that some protection schemes attempt to disguise
  578.  
  579. interrupt calls. This is particularly frequent in the disk access
  580.  
  581. protection schemes that utilize INT_13 (the "disk" interrupt).
  582.  
  583.      If you are attempting to crack such programs, the usual
  584.  
  585. course of action is to search for occurrences of "CD13", which
  586.  
  587. is machine language for interrupt 13. One way or another, the
  588.  
  589. protection scheme has to use this interrupt to check for the
  590.  
  591. special sectors of the disk. If you examine a cross section of
  592.  
  593. the program, however, you'll find programs which do not have
  594.  
  595. "CD13" in their machine code, but which clearly are checking the
  596.  
  597. key disk for weird sectors. How comez?
  598.  
  599.      There are several techniques which can be used to camouflage
  600.  
  601. the protection scheme from our nice prying eyes. I'll describe
  602.  
  603. here the three such techniques that are more frequent:
  604.  
  605. 1)   The following section of code is equivalent to issuing an
  606.  
  607. INT 13 command to read one sector from drive A, side 0, track
  608.  
  609. 29h, sector ffh, and then checking for a status code of 10h:
  610.  
  611.      cs:1000   MOV  AH,02     ;read operation
  612.  
  613.      cs:1002   MOV  AL,01     ;1 sector to read
  614.  
  615.      cs:1004   MOV  CH,29     ;track 29h
  616.  
  617.      cs:1006   MOV  CL,FF     ;sector ffh
  618.  
  619.      cs:1008   MOV  DX,0000   ;side 0, drive A
  620.  
  621.      cs:100B   XOR  BX,BX     ;move 0...
  622.  
  623.      cs:100D   MOV  DS,BX     ;...to DS register
  624.  
  625.      cs:100F   PUSHF          ;pusha flags
  626.  
  627.      cs:1010   PUSH CS        ;pusha CX
  628.  
  629.      cs:1011   CALL 1100      ;push address for next
  630.  
  631.                               instruction onto stack and branch
  632.  
  633.      cs:1014   COMP AH,10     ;check CRC error
  634.  
  635.      cs:1017   ... rest of verification code
  636.  
  637.      ...
  638.  
  639.      ...
  640.  
  641.      cs:1100   PUSHF          ;pusha flags
  642.  
  643.      cs:1101   MOV  BX,004C   ;address of INT_13 vector
  644.  
  645.      cs:1104   PUSH [BX+02]   ;push CS of INT_13 routine
  646.  
  647.      cs:1107   PUSH [BX]      ;push IP of INT_13 routine
  648.  
  649.      cs:1109   IRET           ;pop IP,CS and flags
  650.  
  651. Notice that there is no INT 13 command in the source code, so if
  652.  
  653. you had simply used a debugger to search for "CD13" in the
  654.  
  655. machine code, you would never have found the protection routine.
  656.  
  657. 2)   Another technique is to put in a substitute interrupt
  658.  
  659. instruction, such as INT 10, which looks harmless enough, and
  660.  
  661. have the program change the "10" to "13 (and then back to "10")
  662.  
  663. on the fly. A search for "CD13" would turn up nothing.
  664.  
  665. 3)   The best camouflage method for interrupts I have ever
  666.  
  667. cracked (albeit not on a INT 13) was a jump to a section of the
  668.  
  669. PROGRAM code that reproduces in extenso the interrupt code. This
  670.  
  671. elegant (if a little overbloated) disguise mocks every call to
  672.  
  673. the replicated interrupt.
  674.  
  675. LOADING ABSOLUTE DISK SECTORS
  676.  
  677. Old good [debug.com] has been called the "swiss army knife" of
  678.  
  679. the cracker. It allows a lot of nice things, inter alia the
  680.  
  681. loading, reading, modifying and writing of absolute sectors of
  682.  
  683. the disks. The sector count starts with the first sector of track
  684.  
  685. 0, next sector is track 0, second side (if double sided), then,
  686.  
  687. back to the first side, track 1, and so on, until the end of the
  688.  
  689. disk. Up to 80h (128) sectors can be loaded at one time. To use
  690.  
  691. you must specify starting address, drive (0=A, 1=B, etc...),
  692.  
  693. starting sector and number of sectors to load.
  694.  
  695.                                -   l 100 0 10 20
  696.  
  697. This instruction tells DEBUG to load, starting at DS:0100, from
  698.  
  699. drive A, sector 10h for 20h sectors. This allows at times the
  700.  
  701. retrieval of hidden and/or weird formatted data. If you get an
  702.  
  703. error, check the memory location for that data. Often times, part
  704.  
  705. of the data has been transferred before the error occurs, and the
  706.  
  707. remainder can be manually entered or gathered through repetitive
  708.  
  709. retries.
  710.  
  711. Bear all this in mind learning the following cracks.
  712.  
  713. Let's now crack an "oldie" primitive:
  714.  
  715. MS Flight simulator (old version 2.12, from 1985!)
  716.  
  717. This old program used -in 1985!- following beautiful protection
  718.  
  719. scheme: on the disk you had only a "stub", called FS.COM with few
  720.  
  721. bytes, which had following instructions:
  722.  
  723. loc   code           instruction        what's going on
  724.  
  725. -------------------------------------------------------
  726.  
  727. :0100 FA             CLI                ;why not?
  728.  
  729. :0101 33C0           XOR AX,AX          ;ax=0
  730.  
  731. :0103 8ED0           MOV SS,AX          ;ss=0
  732.  
  733. :0105 BCB0C0         MOV SP,C0B0        ;SP=C0B0
  734.  
  735. :0108 8EC0           MOV ES,AX          ;ES=0
  736.  
  737. :010A 26C70678003001 MOV Wptr ES:[0078],0130 ;Wp 0:78=130
  738.  
  739. :0111 268C0E7A00     MOV ES:[007A],CS   ;0:7A=Segment
  740.  
  741. :0116 BB0010         MOV BX,1000        ;BX=1000
  742.  
  743. :0119 8EC3           MOV ES,BX          ;ES=1000
  744.  
  745. :011B 33DB           XOR BX,BX          ;BX=0
  746.  
  747. :011D B80102         MOV AX,0201        ;AH=2 AL=1 sector
  748.  
  749. :0120 BA0000         MOV DX,0000        ;head=0 drive=0
  750.  
  751. :0123 B96501         MOV CX,0165        ;track=1 sector=65 (!)
  752.  
  753. :0126 CD13           INT 13             ;INT 13/AH=2
  754.  
  755. :0128 B83412         MOV AX,1234        ;AX=1234
  756.  
  757. :012B EA00000010     JMP 1000:0000      ;JMP to data we just read
  758.  
  759. :0130 CF             IRET               ;Pavlovian, useless ret
  760.  
  761.      You see what's happening in this old protection scheme,
  762.  
  763. don't you? Herein you can watch the same snap that happens in
  764.  
  765. more recent (much more recent) protection schemes (as you'll see
  766.  
  767. in the next lesson): the protection searches for a weird
  768.  
  769. formatted sector and/or for particular data.
  770.  
  771.      That should be no problem for you any more: you should just
  772.  
  773. reverse engineer everything (and that goes on pretty quickly:
  774.  
  775. just watch and break on the INT_13 calls), fetch the "weird"
  776.  
  777. data, tamper the whole crap and have your soup as you like it.
  778.  
  779.      One more word about "old" protection schemes. Be careful not
  780.  
  781. to spurn them! Some of them are
  782.  
  783.      -- CLEVER
  784.  
  785.      -- STILL USED
  786.  
  787.      -- DIFFICULT TO CRACK... I mean, this older DOS programs had
  788.  
  789. nice protections... it's pretty annoying to crack windows
  790.  
  791. programs that require a registration number: as you saw in Lesson
  792.  
  793. 3, you just type your name and a serial number of your choice in,
  794.  
  795. say "666666666", break into the program with WINICE, search the
  796.  
  797. "666666666" and search too, for good measure, your own name, set
  798.  
  799. a memory read breakpoint where the number dwells and look at the
  800.  
  801. code that manipulates your input. As [Chris] rightly pointed out,
  802.  
  803. you can even rip the code straight out of the program and create
  804.  
  805. a key generator which will produce a valid code. This code will
  806.  
  807. work for any name you typed in only in the "pure maths
  808.  
  809. manipulation" protection schemes, and will on the contrary be
  810.  
  811. specific, following the name you typed in, the "alpha-maths
  812.  
  813. manipulation" protection schemes (like MOD4WIN, see the Windows
  814.  
  815. lessons), watch in this case the "pseudo-random xoring" of the
  816.  
  817. letters that compose your name.
  818.  
  819.      -- STUNNING, coz new ideas have always been infrequent, and
  820.  
  821. they are getting more and more rare in this objectionable world
  822.  
  823. of lazy, incapable programmers patronizing us with ill-cooked
  824.  
  825. outrages like Windows'95... yeah, as usual there is no
  826.  
  827. "development" at all, quite the contrary, I would say. Take a
  828.  
  829. step backward, sip a good Martini-Wodka (please remember that
  830.  
  831. only Ice cubes, Dry Martini, Wodka Moskovskaja, Schweppes'
  832.  
  833. "Indian tonic" a green olive from Tuskany and a maltese lemon
  834.  
  835. zest will really be perfect) and watch from your balcony, with
  836.  
  837. unsullied eyes, your town and the people around you: slaves
  838.  
  839. everywhere, leaving home at 7.30 in the morning, stinking in a
  840.  
  841. progression of identical cars, forced to interminably watch
  842.  
  843. advertisement panels and endlessly listen to boorish publicity,
  844.  
  845. happy to go to work (if they happen to have the "luck" to work,
  846.  
  847. in this inequitable society) the whole day long in order to
  848.  
  849. produce other cars in order to buy, one day, a new car with a
  850.  
  851. different colour...
  852.  
  853.      Why people don't look at the stars, love each other, feel
  854.  
  855. the winds, ban the stinking cars from the places where they live
  856.  
  857. and eat, study colours... name yourself a not-consumistic
  858.  
  859. activity? Why don't they read any poems any more? No poetry any
  860.  
  861. more, in the grey society of the publicity-spots slaves...poetry
  862.  
  863. will soon be forbidden, coz you cannot CONSUME as you read poems,
  864.  
  865. and in this farce of a society you are BOUND to consume, that's
  866.  
  867. the only thing they want you to do... you are CULTIVATED to
  868.  
  869. consume... no books worth to read any more... stupid american
  870.  
  871. conventional cram everywhere... boy, at times I'm missing some
  872.  
  873. well placed neutron bombs, the ones that would kill all these
  874.  
  875. useless zombies and leave noble books and good Wodka untouched.
  876.  
  877. It's difficult to believe in democracy any more... if I ever
  878.  
  879. did... all the useless zombie do -unfortunately- vote, and they
  880.  
  881. do vote for "smiling semblances", for "conventionally minded
  882.  
  883. idiots" that so act as if they would "really" be like what they
  884.  
  885. "look" like and could not care less about anything else than
  886.  
  887. making bucks and defend intolerant and petty patterns. The slaves
  888.  
  889. choose the people they have "seen" on TV... as if the egyptians
  890.  
  891. would VOTE for their pharaohs, exhilarated under the whips of
  892.  
  893. publicity... sorry, at times I forget that you are here for the
  894.  
  895. cracks, and could not care less about what I think...
  896.  
  897.      You 'll obtain the OTHER missing lessons IF AND ONLY IF you
  898.  
  899. mail me back (via anon.penet.fi) with some tricks of the trade
  900.  
  901. I may not know that YOU discovered. Mostly I'll actually know
  902.  
  903. them already, but if they are really new you'll be given full
  904.  
  905. credit, and even if they are not, should I judge that you
  906.  
  907. "rediscovered" them with your work, or that you actually did good
  908.  
  909. work on them, I'll send you the remaining lessons nevertheless.
  910.  
  911. Your suggestions and critics on the whole crap I wrote are also
  912.  
  913. welcomed.
  914.  
  915.                                 E-mail +ORC
  916.  
  917.                         +ORC an526164@anon.penet.fi
  918.