home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / +Sandman / Htocrk20.txt < prev    next >
Text File  |  2000-05-25  |  30KB  |  1,026 lines

  1.                      HOW TO CRACK, by +ORC, A TUTORIAL
  2.  
  3. ---------------------------------------------------------------------------
  4.  
  5.                   Lesson 2: tools and tricks of the trade
  6.  
  7. ---------------------------------------------------------------------------
  8.  
  9.                                  [INDY.EXE]
  10.  
  11.                    --------------------------------------
  12.  
  13. LOST IN THE DARK CODEWOODS
  14.  
  15.      When you break into a program you end up in portions of code
  16.  
  17. that are unfamiliar to you. It is also not uncommon for the
  18.  
  19. breakpoints to occur outside of the confines of the program you
  20.  
  21. want to crack. Getting your bearings is, in these cases, very
  22.  
  23. important.
  24.  
  25.      One of the handiest utilities is the memory dump tool -it
  26.  
  27. tells you where all the device drivers and TSR are loaded, in
  28.  
  29. which memory locations the program you are cracking dwells, how
  30.  
  31. much memory is left and what the next program load point is. The
  32.  
  33. tools you use should report on the following:
  34.  
  35. -    the contents of interrupt vectors
  36.  
  37. -    the state of the BIOS data area, beginning at address 40:0
  38.  
  39. -    internal structures within DOS, such as the MCB chain, the
  40.  
  41.      SFT (System File Table) chain, the chain of installed
  42.  
  43.      device drivers, the PSPs and memory allocations associated
  44.  
  45.      with installed TSRs
  46.  
  47. -    memory allocation statistic from XMS and EMS drivers
  48.  
  49.      When seeking to understand a section of foreign code, you
  50.  
  51. must be especially careful to seek the real intent of the code.
  52.  
  53. Consider using a profiler prior to undertaking an analysis of an
  54.  
  55. unfamiliar program. This will help you by ensuring that you don't
  56.  
  57. waste time studying sections of the program that aren't even
  58.  
  59. involved in the protection scheme you are chasing down.
  60.  
  61.      Using a utility that charts a program's calling hierarchy
  62.  
  63. can give you an important perspective on how your babe conducts
  64.  
  65. its internal operations.
  66.  
  67. YOUR DEBUGGER: YOUR FAVOURITE TOOL
  68.  
  69.      First and foremost, your debugger must be designed for use
  70.  
  71. with resident modules (or must be itself a resident module).
  72.  
  73. Trying to crack with simplistic [debug.com] is a sure way to get
  74.  
  75. absolutely nowhere. We recommend Softice.exe from Nu-Mega
  76.  
  77. technologies (Version 2.6 [S-Ice.exe] has been cracked by MARQUIS
  78.  
  79. DE SOIREE and its vastly available on the Web). You could also
  80.  
  81. use [Periscope] or [Codeview] or Borland's Turbodebugger... all
  82.  
  83. these programs have been boldly cracked and/or distributed and
  84.  
  85. are now on the Web for free... learn how to use YAHOO and find
  86.  
  87. them. In emergency cases you could fix some quick crack using
  88.  
  89. [debug] or [symdeb], but, as said above, most of the time these
  90.  
  91. older debuggers won't do. I'll nevertheless ALWAYS give the final
  92.  
  93. crack procedure for [debug.com], in order to permit even lusers
  94.  
  95. to crack programs.
  96.  
  97.      When you first smell a protection, it can be tempting to
  98.  
  99. immediately begin your crack using invasive types of techniques.
  100.  
  101. While there is certainly nothing wrong with this approach,
  102.  
  103. provided that you are fairly familiar with the protection scheme
  104.  
  105. used, going in too deep too soon can be a problem when you don't
  106.  
  107. have a strong hunch. Most of the time you'll end up missing
  108.  
  109. important details. So first of all sit down and ponder... that's
  110.  
  111. the zen-way, the only one that really works.
  112.  
  113.      Single-stepping is expensive, not only because of the time
  114.  
  115. it requires but also because of the amount of detail with which
  116.  
  117. you must contend. Your immediate goal is to home in on the
  118.  
  119. protection scheme through a series of successively refined traps,
  120.  
  121. your broader aim is to get an overview idea of the program's
  122.  
  123. action... the wise use of breakpoints will condense these
  124.  
  125. minutiae into an understandable form.
  126.  
  127.      The first step is to try to identify the section of the
  128.  
  129. program where the protection scheme is snapping.
  130.  
  131.      Once you are able to isolate a certain section of a program,
  132.  
  133. breakpoints can be used to gather a trace history of the
  134.  
  135. program's execution. If your debugger sports a backtrace buffer,
  136.  
  137. logging window, or similar feature, by all means learn how to use
  138.  
  139. it. The debugger it's your best weapon, you must know all the
  140.  
  141. possibilities it offers and all the capabilities it possesses.
  142.  
  143. Having a debugger's display output echoed to a printer is another
  144.  
  145. possibility.
  146.  
  147.      Using breakpoints is beneficial for two basic reasons: speed
  148.  
  149. and reduction of detail. Manual single-stepping is invaluable
  150.  
  151. when you are close to the protection scheme, but too much of it
  152.  
  153. will bore you to death.
  154.  
  155.      When selecting breakpoint locations and the types of
  156.  
  157. breakpoint to use, it is important to step back once more, drink
  158.  
  159. a cool Martini-Wodka (use only Moskovskaja: non-russian Wodkas
  160.  
  161. are appalling) and ask yourself: "What is this going to tell me?"
  162.  
  163. and "What else will I need to know once the break occurs?". MOST
  164.  
  165. IMPORTANT OF ALL: "Is my current cracking approach the simplest
  166.  
  167. and most direct?", coz you do not want to waste precious cracking
  168.  
  169. time.
  170.  
  171.      When devising a set of breakpoints it is wise to consider
  172.  
  173. how "a trail of bread crumbs" can be left. Not allowing for an
  174.  
  175. execution chronicle from the start can mean having to restart a
  176.  
  177. cracking session.
  178.  
  179.      Setting breakpoints on certain software interrupt calls is
  180.  
  181. an excellent way to get an overview of a program's operations.
  182.  
  183. The INT_21 DOS services interrupt is probably the most universal
  184.  
  185. useful of these, with BIOS interrupts such as the INT_13 (BIOS
  186.  
  187. Disk services) and INT_16 (BIOS keyboard services) useful for
  188.  
  189. specific cracking.
  190.  
  191.      When working with a debugger, evaluative breakpoints are
  192.  
  193. usually your best shot. To avoid having to deal with a plethora
  194.  
  195. of calls, you would want to have a debugger capable of being told
  196.  
  197. to "break on any INT_21 call except where AH == 2C or AH == 0B".
  198.  
  199.      A real understanding of the working of a program is surely
  200.  
  201. important, but don't overdo it! To reverse-engineer even a small
  202.  
  203. program can involve many hours of analysis and documentation
  204.  
  205. work. If you'll not be able to use the zen-cracking techniques
  206.  
  207. described in this tutorial (sadly not everybody can) pace
  208.  
  209. yourself and make sure your chair is comfortable: you'll be
  210.  
  211. sitting for quite a spell.
  212.  
  213.      Much of the work involved in reverse-engineering consist of
  214.  
  215. chasing down tentacles. In order to understand the operations of
  216.  
  217. one function, you must understand what happens within each of the
  218.  
  219. functions it calls- its child functions. To understand these
  220.  
  221. child functions you must study their children; and so on down the
  222.  
  223. calling hierarchy tree. Then there is the data. Tracing tentacles
  224.  
  225. based on a program's calling hierarchy is a directed process.
  226.  
  227. Each function you encounter is basically a list of other
  228.  
  229. functions you must reckon with. When it comes to analyzing a
  230.  
  231. function's interrelationship with the program's data structure,
  232.  
  233. no such list is provided. You must have instinct, feeling and
  234.  
  235. luck.
  236.  
  237.      Data analysis requires more of a broad-based inquisition.
  238.  
  239. For each memory variable you are interested in, you must survey
  240.  
  241. all functions to determine which ones read and write that
  242.  
  243. variable. The use of memory conditional breakpoints and of a
  244.  
  245. disassembler that builds a cross-reference table can make this
  246.  
  247. task a lot easier. (Use Sourcer! It's a fairly good tool and
  248.  
  249. version 4.08 of [sr.exe] has been long ago cracked and
  250.  
  251. distributed on the Web).
  252.  
  253. ALL SYSTEM CALLS IN ONE LOCATION
  254.  
  255.      Remember that if the program you are cracking was written
  256.  
  257. in assembler in the first place (very unlikely knowing the
  258.  
  259. laziness of to_days programmers), system calls are probably made
  260.  
  261. directly from the functions which need them. But when a program
  262.  
  263. is developed in a high-level language, it is more likely that
  264.  
  265. common library functions will be used for many operations
  266.  
  267. involving system calls. When a program makes all of its INT_21
  268.  
  269. calls from the same location, you know that this is certainly the
  270.  
  271. case.
  272.  
  273.      Now, what happens sometimes is that the programmers write
  274.  
  275. the whole application in a overbloated language like C++, but are
  276.  
  277. afterwards compelled to "speed up" critical sections of the code
  278.  
  279. writing them in assembler. And loo! A section where you
  280.  
  281. repeatedly find assembler crafted patches is precisely the
  282.  
  283. protection scheme! So you could have a program with all INT_21
  284.  
  285. calls from the same location but for one or two calls which are
  286.  
  287. coming out of the section where the morons have "hidden" their
  288.  
  289. protection strategy. By just "looking" at the dead code of a
  290.  
  291. program, you should be capable to tell wich parts have been
  292.  
  293. "added on" in a later phase. They presents themselves as
  294.  
  295. unevenness and irregularities, especially if you use an utility
  296.  
  297. that represents graphicallly the code of a program. Protections
  298.  
  299. are often added on at the end of the development.
  300.  
  301.      Should you determine that the system calls relevant to your
  302.  
  303. cracking are made from common library functions, all is not lost.
  304.  
  305. The specific function from which these library calls were made,
  306.  
  307. the function you are seeking to locate, is executing at some
  308.  
  309. point in between these calls. Break in with your debugger at the
  310.  
  311. end of the first system call, just where it is returning to the
  312.  
  313. point of call. From there, trace through the remainder of the
  314.  
  315. common library routine until it returns to its caller. In short
  316.  
  317. order, you should find yourself in the function you need to see.
  318.  
  319. The trick is to be able to identify it for what it is.
  320.  
  321. ASCIIZ IN CODE
  322.  
  323.      In the interest of gaining an overall familiarity with the
  324.  
  325. program you want to crack, it can be enlightening to use a hex
  326.  
  327. dump utility to examine the message strings contained within the
  328.  
  329. program's binary modules. If the program happens to load its
  330.  
  331. message strings from separate files, your search has just been
  332.  
  333. simplified.
  334.  
  335.      Your debugger's memory-dumping feature is one tool that can
  336.  
  337. be useful for this type of exploration. You could also construct
  338.  
  339. a filtering program, which would read a binary file and output
  340.  
  341. all sequences of bytes that are comprised of displayable
  342.  
  343. characters and are over a certain minimum length (the best
  344.  
  345. cracker tools are often the ones you write yourself).
  346.  
  347.      When a protection scheme is marked by the issuance of a
  348.  
  349. specific message on the screen, you could go into the program and
  350.  
  351. locate the code that emits this message, and then determine what
  352.  
  353. triggers it. A good way to start the location process is to see
  354.  
  355. if a system call is used to display the string. Interrupt INT_21,
  356.  
  357. INT_10 or INT_29 are usually used to display text messages to the
  358.  
  359. console.
  360.  
  361.      When the message's display is not a result of one of these
  362.  
  363. system calls, direct video writing is probably being used. If you
  364.  
  365. know the screen location used, and if that part of video memory
  366.  
  367. is not used for anything else at the time (a big if), a memory
  368.  
  369. write breakpoint could be set on the video buffer address
  370.  
  371. corresponding to the first character's position. If this won't
  372.  
  373. work, use the step-over/step-around tracing technique while
  374.  
  375. watching for the message to appear.
  376.  
  377.      Now you found it: from a disassembled listing, you locate
  378.  
  379. the address of the message string and then survey the reminder
  380.  
  381. of the file for any instructions that reference this address.
  382.  
  383. [Sourcer] can generate labels for specific memory locations and
  384.  
  385. a cross-reference table showing where these labelled locations
  386.  
  387. are referenced. Otherwise, load the disassembled listing file
  388.  
  389. into your editor and use its search capabilities. Manually
  390.  
  391. searching for such things in a listing will make you old before
  392.  
  393. your time.
  394.  
  395. CODE AND DATA
  396.  
  397.      When stepping through code at the assembler level, watch out
  398.  
  399. for interrupt calls that are followed by data. Sometimes you will
  400.  
  401. find an interrupt call, typically within the range INT_34 to
  402.  
  403. INT_3F, where several bytes immediately following the interrupt
  404.  
  405. instruction will be data rather than code.
  406.  
  407.      Be especially suspicious of this type of code-and-data
  408.  
  409. mixture when your debugger's disassembly output of the
  410.  
  411. instructions immediately following an interrupt call doesn't make
  412.  
  413. sense. Sometimes you  can determine the offset of the next true
  414.  
  415. instruction by inspecting the following code and data. In other
  416.  
  417. cases, you will have to trace through the interrupt call to see
  418.  
  419. how it accesses the data following the interrupt call instruction
  420.  
  421. and how it manipulates the return address on the stack.
  422.  
  423. HOOKED VECTORS
  424.  
  425.      Seeing what interrupt intercepts already exist within a
  426.  
  427. system before running the program you want to crack, as well as
  428.  
  429. what interrupt handlers are established by the target program,
  430.  
  431. can provide useful clues. For example, if a protection
  432.  
  433. establishes an INT_09 intercept just before the snapping of a
  434.  
  435. keyboard verification routine, your range of suspects has just
  436.  
  437. been narrowed significantly.
  438.  
  439.      To study the interrupt vector activities of an application,
  440.  
  441. a vector dump map utility is useless. It can't be run while
  442.  
  443. running the application you want to crack. One solution is to run
  444.  
  445. the program under a debugger and watch for system calls to INT_21
  446.  
  447. functions 25h (set interrupt vector) and 35h (get interrupt
  448.  
  449. vector), but in the event that the program  reads and writes
  450.  
  451. interrupt vectors directly, this method will not give you a
  452.  
  453. complete picture. Normally you'll use a spy, trace or "step"
  454.  
  455. utility.
  456.  
  457.      APPLYING A MEMORY WRITE BREAKPOINT TO A SPECIFIC VECTOR OR
  458.  
  459. TO THE ENTIRE TABLE is another way to deal with this.
  460.  
  461.      Note that some sort of direct vector writing must be
  462.  
  463. occurring if a vector change is detected between system calls.
  464.  
  465.      If a vector change is detected during a system call but it
  466.  
  467. isn't function 25h of INT_21, suspect that an IRQ handler may be
  468.  
  469. effecting the change.
  470.  
  471. LITTLE TRICKS OF THE TRADE:
  472.  
  473. *    determining interrupt vector addresses ****************
  474.  
  475.      How do you determine the interrupt vector addresses? As
  476.  
  477. example let's find the address of the INT_21 interrupt vector.
  478.  
  479. Since the interrupt vector table starts at address 0000:0000
  480.  
  481. (easy to remember, isn't it?) and there are four bytes per
  482.  
  483. vector, the basic process is to multiply the interrupt number
  484.  
  485. four times and use the result at the offset (on segment zero).
  486.  
  487. 21h + 21h = 42h                         42h + 42h = 84h
  488.  
  489. The int_21 vector is located at address 0000:0084
  490.  
  491. You could also use a calculator, for instance, the address of
  492.  
  493. INT_63 is 63h*4=18ch               ->   0000:018C
  494.  
  495.  
  496.  
  497. * address conversion ***************************************
  498.  
  499.      After a painstaking cracking session, you have finally
  500.  
  501. determined that a byte of memory at address 6049:891C is the
  502.  
  503. trigger. But when you isolate the offending instruction, you find
  504.  
  505. that the address it is generating when the protection occur is
  506.  
  507. different, being 6109:7D1C instead! How can this be?
  508.  
  509.      An 80x86 type CPU, when running in real or VM86 mode, uses
  510.  
  511. what is known as segment:offset type addressing. One side effect
  512.  
  513. of this addressing method is that one physical address can be
  514.  
  515. equivalent to many different segment:offset addresses.
  516.  
  517.      To find the PHYSICAL ADDRESS for a given segment:offset do
  518.  
  519. the following:
  520.  
  521. - convert the segment portion of the address to a 1-based number
  522.  
  523. by multiplying it by 16 (x10)... it's easy: add 0 at the right
  524.  
  525. end of the number!...
  526.  
  527.      6049 -> 60490
  528.  
  529.      6109 -> 61090
  530.  
  531. now all you have to do is to add this value to the offset value
  532.  
  533.      60490+891C  -> 68DAC
  534.  
  535.      61090+7D1C  -> 68DAC          <-   Got it?
  536.  
  537. And the other way round? If you have a physical address, say
  538.  
  539. 19AC3, and you want to obtain a segment:offset address you must
  540.  
  541. first of all decide in which segment you want the address... if,
  542.  
  543. say, you choose segment 16CC, you proceed as follows:
  544.  
  545.      16CC           -> 16CC0
  546.  
  547.      19AC3-16CC0    =  2E03 (offset)
  548.  
  549.      address for 19AC3 in segment 16CC = 16CC:2E03
  550.  
  551. TOOLS OF THE TRADE
  552.  
  553. Before starting this section, for those of you that do not know
  554.  
  555. anything, here is the ARCHIE way you get all the program that do
  556.  
  557. EXIST on the planet: e-mail following
  558.  
  559. 1) (address)   archie@archie.univ-rennes1.fr
  560.  
  561. I use this french archie, but you can get a worldwide list using
  562.  
  563. the metacommand "servers"
  564.  
  565. 2) (text)      set search sub      <- anywhere in string
  566.  
  567.                set maxhits 140     <- (100-1000)
  568.  
  569.                set maxhitspm 15    <- not just 1 file all over
  570.  
  571.                find stepdos        <- search e.g. this file
  572.  
  573. Wait two hours, get your post and ftp the file you wanted (and
  574.  
  575. YES!, you 'll find also EVERYTHING else for free on the Web).
  576.  
  577. You could, instead of using archie, also learn how to use YAHOO.
  578.  
  579. [MEMSCAN.EXE]
  580.  
  581.      One of the most fascinating tools that I have ever seen is
  582.  
  583. a (very old) program: MEMSCAN.EXE.
  584.  
  585. This program was originally written in 1988 by Scott A. Mebust,
  586.  
  587. running in CGA. It's a "visual" utility: it enables you to see
  588.  
  589. graphically the 1-meg of PC memory in 8 kbyte chunks. It's a
  590.  
  591. powerful tool in order to locate quickly bit mapped graphics and
  592.  
  593. other 'objects' in memory, like program data tables, stack areas,
  594.  
  595. code areas, available RAM, etc. I used this great idea to create
  596.  
  597. (in C) my own tools: a "dead_programs scanner" and an ameliorate
  598.  
  599. version of Memscan itself. Looking at the VISUAL STRUCTURE of a
  600.  
  601. program it's a great help when you'll crack higher levels.
  602.  
  603. [TRACKMEM.COM]
  604.  
  605.      A very good tool by James W.Birdsall, tracks memory usage
  606.  
  607. of programs (EMS, XMS, conventional).
  608.  
  609. [SCANCODE.COM]
  610.  
  611.      "THE" scancode lister, by the code_masters from clockwork
  612.  
  613. software. The must utility for crackers that do not learn all
  614.  
  615. scancodes by heart.
  616.  
  617. [MAP.EXE]
  618.  
  619.      Actually "MAP2", THE memory mapper from the code_masters at
  620.  
  621. clockwork software. It's a very good tool and an interesting one
  622.  
  623. too, coz you get it with the "Nigel" nag screens. They are not
  624.  
  625. difficult to remove (a "passletter" protection scheme, you'll
  626.  
  627. learn how to find and remove it from [Map.exe] in LESSON 3.2).
  628.  
  629. [FILEDUMP.COM] [HEXDUMP.COM] [TDUMP.EXE] [DUMP.EXE]
  630.  
  631.      There are hundred of file dump utilities, coz file dumping
  632.  
  633. is one of the first exercise they learn you at C-school.
  634.  
  635. Hexdump.com is 558 bytes long, Tdump.exe 120.704, pick the one
  636.  
  637. you like better or write your own (even better). Filedump.com,
  638.  
  639. by Daniel M.O'Brien, 1046 bytes long, it's nice.
  640.  
  641. [SPRAY.COM]
  642.  
  643.      That's a good crack utility indeed! This 1989 program by
  644.  
  645. Daniel M.O'Brien gives you a "post-mortem" picture of your
  646.  
  647. memory. You redirect it to <myfile> and study it at ease. It's
  648.  
  649. difficult to say how many hours of cracking it did spare me (you
  650.  
  651. should study the program, only 252 bytes long, and will have to
  652.  
  653. modify it a bit, coz it's pretty primitive, in the original
  654.  
  655. version, for instance, the redirection to the printer works only
  656.  
  657. if there is NO SPACE between "spray" and ">").
  658.  
  659. [VEXE.EXE]
  660.  
  661.      A good EXE files analyzer, useful for windows programs too
  662.  
  663. (see --> LESSON 7). Some of its functions are present in
  664.  
  665. TDUMP.EXE too. This 1991 program by S.Krupa it's sometimes very
  666.  
  667. useful.
  668.  
  669. [SNOOP UTILITIES --> KGB.EXE INTMON.EXE INTRSPY.EXE etc...]
  670.  
  671. [TRACE UTILITIES --> TRACE.EXE STEPDOS.EXE etc...]
  672.  
  673.      A must to study the "calling hierarchy" of an unknown
  674.  
  675. program. KGB.EXE, a 1992 program by Petr Horàk could easily be
  676.  
  677. the best one, and comes with source code(!). I'll teach you how
  678.  
  679. to crack without any of them (you do not need them if you zen-
  680.  
  681. crack), but they can nevertheless be very useful in some
  682.  
  683. situations. Stepdos.exe, by Mike Parker, is a excellent program:
  684.  
  685. a pleasure to crack in order to use it for slightly different
  686.  
  687. purposes :=)
  688.  
  689.  
  690.  
  691. [SOURCERING UTILITIES]
  692.  
  693.      SR.EXE can be used for sourcering unknown programs. It's a
  694.  
  695. fairly good sourcering tool. Version 4.08 has been cracked (it's
  696.  
  697. a "ORIGINAL NUMBERCODE" protected program) and distributed on the
  698.  
  699. Web, so you should easily find it. This said, you should NEVER
  700.  
  701. use such a brute force approach, unless you are really desperate:
  702.  
  703. I'll teach you how to crack without sourcering (you don't need
  704.  
  705. to sourcer if you zen-crack).
  706.  
  707.  
  708.  
  709. [HEXEDITORS]
  710.  
  711. Every idiot has written at least one hexeditor, and you can find
  712.  
  713. very bad tools everywhere (the SIMTEL collection, on the Web,
  714.  
  715. lists at least 35 hexeditors). I suggest you write your own and
  716.  
  717. contribute to the flood, or (better) get PSEDIT.EXE, a good 1990
  718.  
  719. program by Gary C. Crider (Parity Solutions, 1903 Pavia Ct.
  720.  
  721. Arlington, TX 76006... sometimes even americans can write good
  722.  
  723. programs). If you do use it (as you should) disapt the nag screen
  724.  
  725. as small exercise in cracking.
  726.  
  727. [DEBUGGER]
  728.  
  729.      Your best friend in cracking, your weapon, your hidecloak...
  730.  
  731. I suggest [Softice.exe] from Nu-Mega technologies (Version 2.6
  732.  
  733. has been cracked by MARQUIS DE SOIREE and its vastly available
  734.  
  735. on the Web). You could also use [Periscope] or [Codeview] or
  736.  
  737. Borland's Turbodebugger... all these programs have been boldly
  738.  
  739. cracked and/or distributed and are now on the Web for free...
  740.  
  741. learn how to use ARCHIE and YAHOO in order to find them. Your
  742.  
  743. debugger is the only tool you 'll REALLY need, believe me. So
  744.  
  745. choose your weapon wisely and learn how to use backtrace ranges
  746.  
  747. and (FOREMOST!) breakpoint on user written qualifications
  748.  
  749. routines. You 'll be able to crack almost EVERYTHING using these
  750.  
  751. features in the right way.
  752.  
  753.      You should get all the programs mentioned above (all the
  754.  
  755. programs that EXIST for that matter) for free on the Web. Use
  756.  
  757. them, but also modify them recklessly! REMEMBER THAT YOU ARE
  758.  
  759. (GOING TO BE) A CRACKER! The first programs you should crack and
  760.  
  761. modify are therefore your very tools! So steal the code of the
  762.  
  763. best tools you find! Snatch the best routines and change them for
  764.  
  765. the better! That's the whole point in cracking: a mission to
  766.  
  767. IMPROVE the best accomplishments of humanity's genius :=)
  768.  
  769. HOW TO CRACK, ZEN-CRACKING
  770.  
  771.      You 'll learn, beginning with next lesson, how to crack
  772.  
  773. systematically the different protection schemes: paper & password
  774.  
  775. protections, time protections, access protections. At the end of
  776.  
  777. the "methodolocical" part, you'll be able to deprotect programs,
  778.  
  779. but you still wont be a cracker. In order to crack higher you
  780.  
  781. must use what I call (lacking a better definition) "zen-
  782.  
  783. cracking". I 'll give you right now an example of this, so that
  784.  
  785. you know what I'm talking about, but -unless you are already
  786.  
  787. capable- you'll have to finish this tutorial part for "normal"
  788.  
  789. cracking before attempting this techniques. Let's zen-crack
  790.  
  791. together a password protection scheme (aka "paper protection",
  792.  
  793. coz you need the original manual of the program in order to
  794.  
  795. answer). This protection is based on the typing, at the nag
  796.  
  797. screen, of the correct sequence of numbers. Our example is a game
  798.  
  799. for the reasons explained in lesson 1, but you 'll find the SAME
  800.  
  801. protection scheme in the access protection procedure of some old
  802.  
  803. Tapestry networks... so do not frown upon games protections.
  804.  
  805. INDIANAPOLIS 500, Papyrus software & Electronic Arts, 1989
  806.  
  807. It's a rather widespread program, you should therefore find it
  808.  
  809. pretty easily. The nag screen asks for data based on the
  810.  
  811. historical performances of race cars... that means that the
  812.  
  813. answers will consist in two to three digits.
  814.  
  815.      Now, the normal way to crack such a program (described in
  816.  
  817. -> lesson 3.1) embodyes following steps:
  818.  
  819. -    snap save program memory areas before typing your answer
  820.  
  821. -    snap compare after typing, say, "666"
  822.  
  823. -    search for the sequence 36,36,36 (i.e. 666)
  824.  
  825. -    breakpoint on memory range for reading
  826.  
  827. -    look at the program part fetching your data
  828.  
  829. -    find the snap procedure
  830.  
  831. -    disable it.
  832.  
  833.      The above crack it's relatively quick and should be most of
  834.  
  835. the time fairly effective, but there is a better way: the "zen
  836.  
  837. way", the only one that can really enable you to crack high
  838.  
  839. protection schemes.
  840.  
  841. -    Run the program and break in at the nag screen
  842.  
  843. -    Answer consist of 2-3 digits? Search for "AC" (i.e. the
  844.  
  845. instruction LODSB, load digit of answer in AL) in the area 500
  846.  
  847. bytes BEFORE and 500 bytes AFTER your position. You'll get some
  848.  
  849. locations. (In the case of INDY 500 you get 6 such locations).
  850.  
  851. -    "feel" the locations (that's the tricky part).
  852.  
  853. -    OK, you already made it! Here is the protection strategy:
  854.  
  855.   8BBF28A5     MOV  DI,[BX+A528]<-- DI points to coded data area
  856.  
  857. :compare_loop
  858.  
  859.   AC      LODSB          <-- load first digit of answer in AL
  860.  
  861.   B4FF    MOV  AH,FF     <-- load mask in AH
  862.  
  863.   2A25    SUB  AH,[DI]   <-- sub coded data from mask and get
  864.  
  865.                          real answer
  866.  
  867.   47      INC  DI        <-- ready to get next coded data
  868.  
  869.   3AC4    CMP  AL,AH     <-- user answer = real answer ?
  870.  
  871.   751A    JNZ  beggar_off_coz_false_answer
  872.  
  873.   0AC0    OR   AL,AL     <-- more numbers?
  874.  
  875.   75F2    JNZ  compare_loop
  876.  
  877.   59      POP  CX        <-- all OK, go on, nice guy
  878.  
  879.   ...
  880.  
  881. And if the protection scheme had been more far away? And if you
  882.  
  883. cannot "feel" the right one? And if my grandma had wheels? You'll
  884.  
  885. learn it, believe me.
  886.  
  887. Now let's quickly crack this crap.
  888.  
  889. ------------------------------------------------
  890.  
  891. CRACKING INDY.EXE (by +ORC, January 1996)
  892.  
  893. ren indy.exe indy.ded
  894.  
  895. symdeb indy.ded
  896.  
  897. -    s (cs+0000):0 Lffff B4 FF 2A 25 47 3A C4 75 1A
  898.  
  899. xxxx:yyyy           <-- this is the answer of the debugger
  900.  
  901. -    s (cs+1000):0 Lffff B4 FF 2A 25 47 3A C4 75 1A
  902.  
  903. (nothing, but you must be sure there isn't a mirror)
  904.  
  905. -    e xxxx:yyyy+8 00    <-- "JNZ 1A ahead" changes to "JNZ 0"
  906.  
  907. -    w
  908.  
  909. -    q
  910.  
  911. ren indy.ded indy.exe
  912.  
  913. -------------------------------------------------
  914.  
  915. Cracked: you just changed the JNZ beggar_off instruction in a JNZ
  916.  
  917. go_ahead_anyway. Nice, isnt'it?
  918.  
  919. WHY WE CRACK
  920.  
  921.      Strange as it may seem, the reasons for cracking are very
  922.  
  923. important for the success of our task. We (at least we old
  924.  
  925. crackers) crack AGAINST society, and OPPOSING laws and
  926.  
  927. conventions. We usually DO NOT crack for money or for other
  928.  
  929. "commercial" reasons (just sometimes, and we are expensive: I
  930.  
  931. have plenty of money already and my services are VERY expensive
  932.  
  933. if you need an aimed deprotection). But in general we don't care
  934.  
  935. much for money and -as you can see- I am giving away the basis
  936.  
  937. of what I know for free with this tutorial. The programs we crack
  938.  
  939. should be made free for everybody, even if we spent some of our
  940.  
  941. time deprotecting them. We could not care less of the commercial
  942.  
  943. value of a given program, not to mention the holy work of the
  944.  
  945. ethical programmers... we program ourselves, but only because we
  946.  
  947. LIKE it... if somebody does something only in order to gain
  948.  
  949. money, he does not deserve anything. It's the mind challenge that
  950.  
  951. counts, NEVER the profit! (Even if you can make good use of the
  952.  
  953. cracked programs and even if -as I said- there is at times a
  954.  
  955. personal profit).
  956.  
  957.      This is an indispensable attitude! Only a non-mercantile
  958.  
  959. mind can leap forward to the "satori" knowledge that you
  960.  
  961. desperately need if you want to crack quickly and elegantly huge
  962.  
  963. iperbloated monstruosities that somebody else wrote and
  964.  
  965. protected, or if you want to gain access to some hidden
  966.  
  967. information, data that you would like to snoop but that somebody
  968.  
  969. declared "off limits", coz a stupid government, or useless
  970.  
  971. industry sector, or money oriented programmer or dirty lobby of
  972.  
  973. interest decided it.
  974.  
  975.      If you do accept the society where we are compelled to live,
  976.  
  977. its awfully egoistic way of life and its dirty "profit" values,
  978.  
  979. you may eventually learn how to disable some simple protections,
  980.  
  981. but you'll never be able to crack in the "right" way. You must
  982.  
  983. learn to despise money, governments, televisions, trends,
  984.  
  985. opinion-makers, public opinion, newspapers and all this
  986.  
  987. preposterous, asinine shit if you want to grasp the noble art,
  988.  
  989. coz in order to be emphatic with the code you must be free from
  990.  
  991. all trivial and petty conventions, strange as it may sound. So
  992.  
  993. you better take a good look around you... you'll find plenty of
  994.  
  995. reasons to hate society and act against it, plenty of sparks to
  996.  
  997. crackle programs in the right way... Hope all this did not sound
  998.  
  999. too cretin.
  1000.  
  1001. Well, that's it for this lesson, reader. Not all lessons of my
  1002.  
  1003. tutorial are on the Web.
  1004.  
  1005.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  1006.  
  1007. me back (via anon.penet.fi) with some tricks of the trade I may
  1008.  
  1009. not know that YOU discovered. Mostly I'll actually know them
  1010.  
  1011. already, but if they are really new you'll be given full credit,
  1012.  
  1013. and even if they are not, should I judge that you "rediscovered"
  1014.  
  1015. them with your work, or that you actually did good work on them,
  1016.  
  1017. I'll send you the remaining lessons nevertheless. Your
  1018.  
  1019. suggestions and critics on the whole crap I wrote are also
  1020.  
  1021. welcomed.
  1022.  
  1023.                                 E-mail +ORC
  1024.  
  1025.                         +ORC an526164@anon.penet.fi
  1026.