home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersclub / km / library / hack / howtocrk.txt < prev    next >
Text File  |  1998-03-25  |  290KB  |  9,217 lines

  1. HOW TO CRACK, by +ORC, A TUTORIAL
  2.  
  3. --------------------------------------------------------------
  4.  
  5. (Htocrk10.txt) Lesson 1: an approach
  6.  
  7. (Htocrk20.txt) Lesson 2: tools and tricks of the trade
  8.  
  9. (Htocrk31.txt) Lesson 3.1: hands on, paper protections (1)
  10.  
  11. (Htocrk32.txt) Lesson 3.2: hands on, paper protections (2)
  12.  
  13. (Htocrk51.txt) Lesson 5.1: disk & CD-Rom access (basics)
  14.  
  15. (Htocrk61.txt) Lesson 6.1: funny tricks
  16.  
  17. (Htocrk81.txt) Lesson 8.1: how to crack Windows, an approach
  18.  
  19. (Htocrk82.txt) Lesson 8.2: how to crack Windows, a deeper approach
  20.  
  21. (Htocrk91.txt) Lesson 9.1: how to crack Windows, hands on
  22.  
  23. (Htocrka1.txt) Lesson A.1: advanced cracking: internet cracking (Unix)
  24.  
  25. (Htocrkc1.txt) Lesson C.1: how to crack, cracking as an art
  26.  
  27. (Htocrkc2.txt) Lesson C.2: how to crack, cracking as an art                     HOW TO CRACK, by +ORC, A TUTORIAL
  28.  
  29. ---------------------------------------------------------------------------
  30.  
  31.                            Lesson 1: an approach
  32.  
  33. ---------------------------------------------------------------------------
  34.  
  35.                                [Pooldemo.exe]
  36.  
  37.                    --------------------------------------
  38.  
  39.      The best way to learn cracking (i.e. understanding, broadly
  40.  
  41. individuating, locating exactly and eliminating or suspending or
  42.  
  43. deferring one or more protection schemes inside a software
  44.  
  45. application you do not possess the source code of) is to begin
  46.  
  47. your tampering experiments using OLDER applications which have
  48.  
  49. OLDER protection schemes.
  50.  
  51.      In this way you 'll quickly grasp the base techniques of the
  52.  
  53. trade. Do not forget that the evolution of the protection schemes
  54.  
  55. has not been a one way road... strictly speaking it's not even
  56.  
  57. an evolution: you'll eventually find some very clever new tricks,
  58.  
  59. but most of the time you 'll unearth only various trite
  60.  
  61. repetitions of past (and well known) tricks. This is no wonder:
  62.  
  63. the REAL knowledge of the "commercial" programmers themselves
  64.  
  65. (the "protectionists") is often very limited indeed: they are
  66.  
  67. inclined to use the old methods (albeit somehow changed,
  68.  
  69. sometimes even improved) instead of conceiving new methods. This
  70.  
  71. typical "commercial" degeneration happens every time people act
  72.  
  73. for money instead of doing things for the sake of it or for
  74.  
  75. pleasure. This "commercial" trend is blindly encouraged by the
  76.  
  77. stupid, money-oriented society we are coerced to live in.
  78.  
  79.      So I'll begin the "hands on" part (-> starting from lesson
  80.  
  81. 3), using as examples, some "old" applications and some "old"
  82.  
  83. tricks. We'll be able to come later over to the newest protection
  84.  
  85. schemes in order to understand them, and you 'll learn how to
  86.  
  87. defeat this kind of junk too. I'll also explain WHERE you can
  88.  
  89. find a lot of programs to crack for next to no money at all, and
  90.  
  91. HOW 'grossomodo', you should proceed in your work.
  92.  
  93.      This tutorial is for people who are getting started with
  94.  
  95. cracking. Maybe you are just contemplating doing some cracking,
  96.  
  97. maybe you have tried it with mixed success. If you are here to
  98.  
  99. get aimed in the right direction, to get off to a good start with
  100.  
  101. the cracking tricks and procedures, then you have come for the
  102.  
  103. right reason. I can't promise you'll get what you want, but I'll
  104.  
  105. do my best. On the other hand, if you have already turned out
  106.  
  107. some working cracking code in assembler and already cracked many
  108.  
  109. different protection schemes, then this tutorial is likely to be
  110.  
  111. on the elementary side for you. (If you want to review a few
  112.  
  113. basics and have no where else pressing to go, then by all means
  114.  
  115. stay).
  116.  
  117.      In order to crack successfully you need four basic things:
  118.  
  119. *    A passing knowledge of assembler language (the more you
  120.  
  121.      know, the better and quicker you crack)
  122.  
  123. *    Some intuition
  124.  
  125. *    Some help from more experienced cracker
  126.  
  127. *    A non mercantile mind (more about this later)
  128.  
  129. The applications you'll use to learn with can be divided into:
  130.  
  131. 1    - Password crippled applications (the easiest to crack)
  132.  
  133. 2    - applications crippled on how many times, or how many
  134.  
  135.      days, you use them (fairly easy to crack)
  136.  
  137. 3    - applications crippled on which date you use them before
  138.  
  139.      (easy to crack)
  140.  
  141. 4    - applications that have some functions present but
  142.  
  143.      disabled (sometimes easy, sometimes difficult)
  144.  
  145. 5    - applications crippled on Disk access (protections schemes
  146.  
  147.      that are now defined as "obsolete") and applications
  148.  
  149. crippled on
  150.  
  151.      CD-ROM presence (more or less the same methods, but -
  152.  
  153.      somehow- not defined as "obsolete") (very easy to crack)
  154.  
  155. 6    - CRYPTOGRAFED ADDS ON (i.e. one of the previous protection
  156.  
  157.      schemes, but with some scrambled or self modifying code
  158.  
  159.      (XORring and SHRLing codes) (fairly easy to crack)
  160.  
  161. 7    - None of the above (sometimes difficult to crack)
  162.  
  163. WHERE TO GET THE STUFF
  164.  
  165.      The recent widespread appearance of "Demo"-CDROM on magazine
  166.  
  167. covers is a treasure for all crackers! A short time after their
  168.  
  169. release you 'll get all the copies that remain unsold for next
  170.  
  171. to free. The demos on CD-ROMs will permit you to gather quickly
  172.  
  173. a lot of applications -old and new- that have somehow been
  174.  
  175. crippled (at times with interesting schemes). Truly a wonderful
  176.  
  177. world of cracking possibilities! Gee! For next to no money you
  178.  
  179. can secure on one CDROM the whole of LOTUS applications (or
  180.  
  181. Microsoft or Wordperfect, or you name them) on "trial for 30
  182.  
  183. days" or "try it 20 times" editions. You'll really enjoy to crack
  184.  
  185. them, to use them for ever and ever and/or graciously donate them
  186.  
  187. on the Web to the poor lamers that have no money and no brain.
  188.  
  189.      GAMES are definitely not to be frowned upon! They are
  190.  
  191. very interesting from a cracker prospective coz they are often
  192.  
  193. "overprotected". With this I mean that they possess protection
  194.  
  195. schemes of a relatively HIGH level hidden inside files that are
  196.  
  197. relatively small. Now, see, it is much more easy, and simple, to
  198.  
  199. track down and eliminate protection schemes inside a single
  200.  
  201. 35.000 bytes long executable file than to locate them inside a
  202.  
  203. collection of many lengthy DLLs and overlaids that could have
  204.  
  205. swollen as long as 2.000.000 bytes each. The lazy bunch of
  206.  
  207. "modern" programmers relies systematically for protection schemes
  208.  
  209. on this "hide the sting in the wide desert" logic. As a matter
  210.  
  211. of fact they are no longer able to program in assembler: they
  212.  
  213. bank more and more on overbloated "fatty" atrocities like Visual
  214.  
  215. Basic, Delphy or Visual C++. (Don't worry... I'll nevertheless
  216.  
  217. teach you how to crack -and quickly- those huge applications
  218.  
  219. too).
  220.  
  221.      There is another reason for employing games instead of
  222.  
  223. applications as study material: often EXACTLY THE SAME protection
  224.  
  225. schemes that you find in a simple (and short) shareware game will
  226.  
  227. be used -without much improving- a little later in order to
  228.  
  229. "protect" some huge and extremely expensive graphic application.
  230.  
  231.      For this reason in my tutorial we'll often crack games
  232.  
  233. protection schemes, even if we'll later apply what we learn
  234.  
  235. mainly in order to crack the protection schemes of commercial
  236.  
  237. applications, or to crack the access protection routines to
  238.  
  239. remote servers, or BBS, or even ATM (cash dispensers).
  240.  
  241.      Here follows an example cracking session, that will show you
  242.  
  243. -I hope- the dos and donts of our art: let's crack together as
  244.  
  245. introductory example a time crippled application. We'll learn
  246.  
  247. later (-> LESSON 4) that all applications that are crippled on
  248.  
  249. time (i.e. "how many times" you use them or "how long" you use
  250.  
  251. them) rely on analogous protection schemes (albeit with a huge
  252.  
  253. palette of small variations):
  254.  
  255. 1-   they may have a counter which "clicks" every so often: FIND
  256.  
  257.      IT AND DISABLE IT!
  258.  
  259. 2-   they may fetch the time_clock interrupts in your machine:
  260.  
  261.      INTERCEPT THEM YOURSELF!
  262.  
  263. 3-   they may compare a random_seed with a variable: NOOP IT!
  264.  
  265. 4-   they may check randomly the date of your other, unrelated,
  266.  
  267.      files on the hard disk: find this verification routine and
  268.  
  269.      INVERT the JUMPS!
  270.  
  271. I wanted to start with a modern example of this "counter clicks"
  272.  
  273. protection type, just to give you a feeling for cracking, and I
  274.  
  275. have chosen a widely published demo: you should be able to find
  276.  
  277. it pretty easily. In order to show you some of the problems you
  278.  
  279. may encounter we'll crack this example "wrongly" (you'll learn
  280.  
  281. how to crack effectively in the "HANDS ON" lessons).
  282.  
  283.      EXAMPLE: ARCADE POOL, Demonstration version, PC Conversion
  284.  
  285. by East Point Software Ltd, (c) Team 17 Software Ltd 1994. This
  286.  
  287. demo has been published by many magazines on their CDRom covers
  288.  
  289. throughout 1995.
  290.  
  291.      What follows will be useful even if you do not have our
  292.  
  293. example; nevertheless you should get a copy of this widespread
  294.  
  295. demo in order to better grasp some of the following points.
  296.  
  297.      This nice demo of a billiard game is time-crippled. It is
  298.  
  299. crippled on how long you use it: i.e., you can only play 2
  300.  
  301. minutes, afterwards a "nag" reminder of where and how you can buy
  302.  
  303. the real version snaps: protectionist squalor at its best.
  304.  
  305.      So, how do you proceed? Where does the beginning begin?
  306.  
  307. Here is what you could (but not necessarily should) do:
  308.  
  309.      Get [Soft-ice] and load it in your config.sys. See the TOOLS
  310.  
  311. OF THE TRADE lesson (-> LESSON 2) about this debugger. Version
  312.  
  313. 2.6 of [Soft-Ice] has been cracked by MARQUIS DE SOIREE and can
  314.  
  315. be found on the Web for free.
  316.  
  317. -    vecs s (save all the vectors before loading the babe)
  318.  
  319. -    start [pooldemo.exe]
  320.  
  321. -    vecs c (vector compare, save a printing of all hooked
  322.  
  323.      vectors)
  324.  
  325. -    enter and leave Soft-ice a few times to understand what's
  326.  
  327.      going on and where in [pooldemo.exe] are we roaming around
  328.  
  329.      (you should always check MORE THAN ONCE your findings when
  330.  
  331.      you snoop around: nothing moves and confuses pointers in a
  332.  
  333.      more frenzied way than good old "inactive" DOS).
  334.  
  335. -    have a good look at the map of memory usage ("map")
  336.  
  337. -    now "snap_save" the main memory regions where
  338.  
  339.      [pooldemo.exe] dwells... snapping saves "photographs" of
  340.  
  341.      memory areas.
  342.  
  343. -    do not do anything, let just the seconds go by.
  344.  
  345. -    "snap_compare" every two or three seconds without moving
  346.  
  347.      anything at all on the game board (no mouse_clicking,
  348.  
  349.      NOTHING), so that the only changes are (hopefully) the
  350.  
  351.      changes caused by the time counters.
  352.  
  353. -    snap_compare twice in a second.
  354.  
  355. -    snap_compare at second 00:59 and at second 1:01.
  356.  
  357. -    snap_compare just before and just after the time limit and
  358.  
  359.      the snapping of the nag screen.
  360.  
  361. -    Now collect carefully your printed "snaps" data: write
  362.  
  363.      clearly on the various sheets the occurrences of the snaps.
  364.  
  365. -    now comes the graceful "zen-cracking" moment: Sit down with
  366.  
  367.      a dry Martini and Wodka (obviously only russian Wodka will
  368.  
  369.      do) and contemplate the printing of the various mutant
  370.  
  371.      locations. Feel, perceive, empathize! Look closely at the
  372.  
  373.      locations that have changed in the snap compares. Analyze,
  374.  
  375.      interpretate, evaluate.
  376.  
  377. -    Mmm! Hey! Something fishy is changing there, and there, and
  378.  
  379.      there! (you are lucky, few do actually change in this case:
  380.  
  381.      only two dozen)
  382.  
  383. -    breakpoint on execute at the location that you believe act
  384.  
  385.      as a "continuous" counter, i.e. the location that triggers
  386.  
  387.      the "a second went by" event when it zeroes.
  388.  
  389. -    Now set the occurrence counter of BPX in order to break at
  390.  
  391.      the moment where the location "refills" and restarts from
  392.  
  393.      the beginning (the equivalent of "one second" went by,
  394.  
  395.      let's start anew). Use the occurrence counter in order not
  396.  
  397.      to single-step through the program your life long!
  398.  
  399. -    IN THIS CASE you 'll quickly locate the refill at location
  400.  
  401.      3DD0. Here follows the "refill" line:
  402.  
  403.      xxxx:3DCC C706F1013C00   MOV  WORD PTR [01F1], 003C
  404.  
  405. The "3C" byte at xxxx:3DD0 represents a counter_byte... i.e. the
  406.  
  407. program "charges" 3C in this location and then DECs it step by
  408.  
  409. step to 3B, 3A, 39, 38 etc... till 0. When it reaches 0: bingo!
  410.  
  411. Sucker user has lost one second more of his precious two minutes.
  412.  
  413.      Now, you would get a first wizard level if you searched
  414.  
  415. further on for the exact point where you get the "nag screen" in
  416.  
  417. order to eliminate the whole witless protection, but you may
  418.  
  419. think you got it already and you remember anyway that the first
  420.  
  421. principle in cracking is the following: "once you can eliminate
  422.  
  423. the effects of a protection, do not look further!"
  424.  
  425.      Most of the time this is true: you do not always need to
  426.  
  427. eliminate a "whole" protection scheme (unless you are just
  428.  
  429. studying it for the joy of it). It's normally easier (and
  430.  
  431. quicker) to eliminate the "effects" of a given protection scheme.
  432.  
  433. Unfortunately this is not true in this case.
  434.  
  435.      Here you believe that you have already found the way: you
  436.  
  437. got the counter that charges the reverse clock that triggers the
  438.  
  439. particular protection scheme of [pooldemo.exe]. Now you may think
  440.  
  441. that if you could modify the refill_value... say changing "3C"
  442.  
  443. to "EE" (Yeah, the maximum would be FF... but it's always good
  444.  
  445. practice to avoid such extreme values when cracking) you should
  446.  
  447. get four times more playtime for your game... more than enough
  448.  
  449. in order to make the protection scheme useless.
  450.  
  451.      So you change location xxxx:3DD0 from "3C" to "EE". To work
  452.  
  453. on bytes you should use a good Hexeditor like PSEDIT (Parity
  454.  
  455. solutions, [Psedit.exe], brilliant shareware: see the "tool of
  456.  
  457. the trade" section) but you could also work with simpler
  458.  
  459. debuggers like [debug] or [symdeb] (-> see lesson 2). If you do,
  460.  
  461. remember to work on a "dead" copy of your crippled [*.exe] file,
  462.  
  463. i.e.:
  464.  
  465.      ren POOLDEMO.EXE POOLDEMO.DED
  466.  
  467.      symdeb POOLDEMO.DED
  468.  
  469.      -s (cs+0000):0 Lffff C7 06 F1 01 C3 <-  this string
  470.  
  471.                                              corresponds to the
  472.  
  473.                                              refill line).
  474.  
  475.      cs:3E85   <- symdeb gives you two locations as answer
  476.  
  477.      cs:3EEA
  478.  
  479.      -e cs:3E85+4 EE     <- refill changed from C3 to EE
  480.  
  481.      -w
  482.  
  483.      ren POOLDEMO.DED POOLDEMO.EXE
  484.  
  485. Now you run your tampered pooldemo. You think you cracked it, you
  486.  
  487. glee with satisfaction... but loo! Nothing at all has changed,
  488.  
  489. everything's as lame as before, you still have only 2 minutes
  490.  
  491. playtime. How disappointing: how comez it didn't work?
  492.  
  493.      Well, for a start you have not been attentive enough! The
  494.  
  495. search in debug gave you TWO locations, you moron, and not just
  496.  
  497. the one you just tampered with. Check and you 'll see that the
  498.  
  499. second location (cs:3EEA) is a MIRROR/CONTROL location (more on
  500.  
  501. this later). Some times there exist "double" locations... coz at
  502.  
  503. times it's quicker to use a double routine than to use a
  504.  
  505. branching if or switch structure... some times the second
  506.  
  507. locations do mirror the first ones and correct them on the fly
  508.  
  509. if need be.
  510.  
  511.      So you need to modify this too... you act as said above but
  512.  
  513. this time you enter in debug a
  514.  
  515.      -e cs:3EEA+4 EE
  516.  
  517. before writing back the dead file and then renaming it to exe and
  518.  
  519. then running it... and loo! Hoow sloow! THERE YOU ARE! Your
  520.  
  521. crippled POOLDEMO.EXE is now (sort of) unprotected: You think
  522.  
  523. that you can now play the stupid game up to 12 minutes real time,
  524.  
  525. even if the protection scheme (and the counter) "believes" that
  526.  
  527. it is playing only two minutes.
  528.  
  529.      So you begin to play, and the seconds look veeery sloow, and
  530.  
  531. everything seems OK, but -alas- NO! At screen second 28 you get
  532.  
  533. the irritating "two minutes are over" nag screen! Obviously you
  534.  
  535. were dead wrong: the program "knows" the time directly from the
  536.  
  537. timer... you only modified the stupid counter ON THE SCREEN.
  538.  
  539.      So it's back to cracking, and now you are angry, and forget
  540.  
  541. the quiet ways of the zen-analyze and begin the heavy cracking
  542.  
  543. you should reserve -if ever- for really complicated schemes. You
  544.  
  545. now start to check the hooked vectors (you did your routinely
  546.  
  547. VECS_save before loading pooldemo in [Soft-ice] and your
  548.  
  549. VECS_compare afterwards) and you see some findings that you
  550.  
  551. believe interesting:
  552.  
  553.           vecs c
  554.  
  555.           08   1EFD:84C6 0CD1:17AC <- the clock
  556.  
  557.           09   1EFD:85EC 136A:069C <- the keyboard
  558.  
  559.           22   0BCE:02B1 0BCE:017E <- the terminate
  560.  
  561.      That's more like it -you think. Smack at the beginning: the
  562.  
  563. first hooked vector does it! It's good old interrupt_08: the
  564.  
  565. timer_clicker!
  566.  
  567.      Some basics for those of you that do not know anything:
  568.  
  569. INT_08 controls indirectly the INT_1C timer interrupt. The 8253
  570.  
  571. clock chip generates an IRQ_0 hardware interrupt at a rate of
  572.  
  573. 18.2 interrupts per second. This gives control to the ISR
  574.  
  575. (Interrupt Service Routine) that the INT_08 points to... and this
  576.  
  577. should be at 0CD1:17AC, but has been hooked here, by pooldemo,
  578.  
  579. to 1EFD:84C6.
  580.  
  581.      One of the actions taken by the INT_08 ISR within the BIOS
  582.  
  583. is to issue a software interrupt call to INT_1C, just in case any
  584.  
  585. software modules within the system have established an intercept.
  586.  
  587. If no intercepts have been established, the default contents of
  588.  
  589. the INT_1C vector point to an iret instruction within the BIOS,
  590.  
  591. so that a null action results.
  592.  
  593.      Normally a protectionist would intercept INT_1C, coz at
  594.  
  595. every ISR from INT_08 the CPU would fetch the contents of the
  596.  
  597. corresponding interrupt vector and make an interrupt style call
  598.  
  599. to the code at that address (which should contain the iret at
  600.  
  601. address F000:9876 but can contain any trick they could think of).
  602.  
  603.      So -you think- the protectionist hooked here INT_08 directly
  604.  
  605. (a pretty infrequently used protection scheme by the way): What
  606.  
  607. now?
  608.  
  609.      A rather drastic measure would be, in such circumstances,
  610.  
  611. to
  612.  
  613. disable the IRQ_0 level timer interrupt, which is controlled by
  614.  
  615. bit 0 of the mask register, at address I/O 0021h. When bit 0
  616.  
  617. within the mask register is set to 1, no further interrupts will
  618.  
  619. be recognized for this IRQ level. This unfortunately won't work
  620.  
  621. here, but it's an interesting technique per se, so you better
  622.  
  623. learn it anyway, just in case you should need it elsewhere:
  624.  
  625. --- Trick to disable the timer ("IRQ_0 masking" by +ORC) ---
  626.  
  627. *    prompt $t and hit ENTER a few times, see how the dos_clock
  628.  
  629.      is merrily ticking along?
  630.  
  631. *    enter DEBUG.COM
  632.  
  633. *    Assemble using the command 'a'
  634.  
  635. - a
  636.  
  637. in al,21
  638.  
  639. or al,1
  640.  
  641. out 21,al
  642.  
  643. ret
  644.  
  645. RETURN
  646.  
  647. RETURN    <- twice to exit immediate assembler
  648.  
  649. - g 100   <- to run the tiny program.
  650.  
  651. - q       <- to quit debug.
  652.  
  653. prompt $t is still on: hit ENTER a few times:
  654.  
  655. whoa! The clock has stopped advancing!
  656.  
  657.      Compliments: you loaded the current mask register's contents
  658.  
  659. into AL, you set the mask bit in the bit 0 position (which
  660.  
  661. corresponds to IRQ_0) at then updated the value back to the mask
  662.  
  663. register.
  664.  
  665. When you are ready to activate IRQ_0 events again, reenter DEBUG,
  666.  
  667. run the following and then reset the clock you stopped with DOS
  668.  
  669. TIME command:
  670.  
  671. - a
  672.  
  673. in al,21
  674.  
  675. and al,fe
  676.  
  677. out 21,al
  678.  
  679. ret
  680.  
  681. RETURN twice
  682.  
  683. - g 100
  684.  
  685. - q
  686.  
  687. A word of caution: with the timer click disabled some processes
  688.  
  689. will not operate correctly: once you access the diskette drive,
  690.  
  691. the motor will continue to run indefinitely afterwards, etcetera.
  692.  
  693. -------------------------------------------------------
  694.  
  695.      Unfortunately the above technique cannot work with our
  696.  
  697. [pooldemo.exe], where you now are looking closely to the INT_08
  698.  
  699. hook you found, believing that it hides the protection scheme:
  700.  
  701. herein you find immediately the EoI (End_of_interrupt: MOV
  702.  
  703. AL,20h... OUT 20h,AL). Both controllers have a second port
  704.  
  705. address at 20h (or 0a0h), from which the instructions are given.
  706.  
  707. The most important is the EoI command (20h). This instruction
  708.  
  709. indicates the end of the interrupt handler and frees up the
  710.  
  711. corresponding controller for the next interrupt. If somebody
  712.  
  713. writes a new custom interrupt handler (as many protectionists
  714.  
  715. do), it's up to him to see to it that at the end of the handler
  716.  
  717. the EoI command (20h) is written to either port 20h or port 0a0h.
  718.  
  719.      After the EoI follow the usual pushes, then some CALLS then
  720.  
  721. a call that issues some OUT 40,AL that look like timer refreshing
  722.  
  723. (OUT transfers data to an output port and ports 40-42 correspond
  724.  
  725. to the Timer/counter). Some do_maintenance follows, then a double
  726.  
  727. CALL, one more conditional CALL and then a "mysterious" call FAR
  728.  
  729. CS:[AA91] on which depends a byte PTR[970C] that decides another
  730.  
  731. final CALL... then the routine pops all registers and irets away.
  732.  
  733.      Ah! You say, and begin disassembling, reverse engineering
  734.  
  735. and looking inside each suspect call (the quicker method in
  736.  
  737. these cases is to breakpoint calls on entrance and see if you
  738.  
  739. find the one that's only called at the awakening of the time
  740.  
  741. limit protection).
  742.  
  743.      You work, and work, and work... and eventually find nothing
  744.  
  745. at all, coz the protection of this program is NOT HERE!
  746.  
  747.      Back to the zen-analyze of the snap printings... we forsake
  748.  
  749. it too soon, as you will see.
  750.  
  751.      If you watch with more attention the compare locations for
  752.  
  753. the range DS:0 DS:FFFF you 'll notice that one of them changes
  754.  
  755. relatively slowly from 0 to 1 to 2 to 3 and so on... the
  756.  
  757. precedent location changes very quickly, and runs the complete
  758.  
  759. cycle 0...FF. That's a counter, at locations DS:0009 and DS:000A!
  760.  
  761. How long will it tick along? Well, we saw above that the "charge"
  762.  
  763. every second is 3C, so it will be x3C*x78=x1C20, coz x78 is 120
  764.  
  765. seconds, i.e. the two minutes time limit.
  766.  
  767.      Now search this 1C20 value around inside the code
  768.  
  769. (protections are most of the time at the beginning of the
  770.  
  771. CS:offset section), and you 'll find quickly what follows:
  772.  
  773. The protection in [pooldemo.exe] is at code_locations
  774.  
  775. CS:0A8A   813E20A7201C   CMP  WORD PTR [A720], 1C20
  776.  
  777.                          compare location A720 with limit 1C20
  778.  
  779. CS:0A90   7C07           JL   okay_play_a_little_more
  780.  
  781. CS:0A92   E834FD         CALL beggar_off_time_is_up
  782.  
  783.      BINGO!: FOUND!
  784.  
  785. Now let's quickly crack it:
  786.  
  787. ------------------------------------------------
  788.  
  789. CRACKING POOLDEMO.EXE (by +ORC, January 1996)
  790.  
  791. ren pooldemo.exe pooldemo.ded
  792.  
  793. symdeb pooldemo.ded
  794.  
  795. -    s cs:0 Lffff 81 3E 20 A7 20 1C
  796.  
  797. xxxx:yyyy           <- this is the answer of the debugger
  798.  
  799. -    e xxxx:yyyy+5 4C  <- this time limit is much better
  800.  
  801. -    w
  802.  
  803. -    q
  804.  
  805. ren pooldemo.ded pooldemo.exe
  806.  
  807. -------------------------------------------------
  808.  
  809.      We have done here a "weak" crack: we limited ourselves to
  810.  
  811. accept a (better) time limit, changing it from 1C20 to 4C20 (4
  812.  
  813. minutes instead of two). We could obviously have done a more
  814.  
  815. radical crack if we had changed the JL (jump lower) instruction
  816.  
  817. in a JMP (jump anyway) instruction. In this case it would have
  818.  
  819. worked, but for reasons that will be explained in lesson 4, you
  820.  
  821. should choose a rather delicate approach in cracking when you
  822.  
  823. deal with time-limit protection schemes.
  824.  
  825.      As you have seen, in this artificial cracking session we
  826.  
  827. found the protection scheme after a little snooping around. But,
  828.  
  829. as you will see in the hands on part, there are always MANY ways
  830.  
  831. to crack a single protection scheme. You could -for instance-
  832.  
  833. have found this protection the other way round: set a trace on
  834.  
  835. memory range for the program, restricting the trace to the first
  836.  
  837. part of it (say CS:0 to CS:1000, if you do not fetch anything you
  838.  
  839. can always try the other blocks). Breakpoint at the nag screen,
  840.  
  841. have a look at the last 300-400 backtraced instructions, if you
  842.  
  843. did not move anything, everything will follow a repetitive
  844.  
  845. pattern, until the protection snaps on:
  846.  
  847.        ...
  848.  
  849.        JL 0A99
  850.  
  851.        CMP BYTE PTR [A72A],01
  852.  
  853.        ...
  854.  
  855.        JL 0A99
  856.  
  857.        CMP BYTE PTR [A72A],01
  858.  
  859.        ...
  860.  
  861.        for ages and ages and then...
  862.  
  863.        ...
  864.  
  865.        JL 0A99
  866.  
  867. E834FD CALL 0759           <- BINGO! (CALL beggar_off_time_is_up)
  868.  
  869. ... there it is, found the other way round. (But this apparently
  870.  
  871. better method is unfortunately very unstable: it depends on your
  872.  
  873. timing of the breaking in and on the distance between protection
  874.  
  875. and nag screen, therefore the somehow more complicated, but more
  876.  
  877. sure previous one should be favoured).
  878.  
  879.      The reason why "minimal" approaches in cracking are often
  880.  
  881. more successful than heavy vector_cracking, is that the programs
  882.  
  883. are hardly ever "overprotected", and therefore the protections
  884.  
  885. are seldom difficult to find (and those that are really worth
  886.  
  887. cracking for study reasons).
  888.  
  889.      Sometime you don't even need to crack anything at all! Some
  890.  
  891. applications are fully functional -per se-, but have been
  892.  
  893. crippled in a hurry in order to release them as demos. The
  894.  
  895. commercial programmers want only money, do not even try to
  896.  
  897. understand our zen ways, and do not care at all for a well done
  898.  
  899. job. That means, among other things, that the hard disk of the
  900.  
  901. user will be cluttered with files that the main program module
  902.  
  903. never calls. A typical example of this sloppy method is the demo
  904.  
  905. of [Panzer General] from SSI that appeared in the summer '95.
  906.  
  907. This was in reality no less than the complete beta version of the
  908.  
  909. game: you just had to substitute to one of the two "allowed"
  910.  
  911. scenarios one of the 20 or more scenarios of the beta version in
  912.  
  913. order to play them freely... you didn't ever need to crack!
  914.  
  915.      The pooldemo crack example above should not discourage you
  916.  
  917. from cracking intuitively. Be careful! Perform a thoroughly
  918.  
  919. zen_analyze before attempting deeper methods: do remember that
  920.  
  921. you want to crack the protection scheme SOMEHOW, and not
  922.  
  923. necessarily following the same line of thought that the
  924.  
  925. programmer eventually WANTED YOU TO CRACK IT with.
  926.  
  927. Well, that's it for this lesson, reader. Not all lessons of my
  928.  
  929. tutorial are on the Web.
  930.  
  931.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  932.  
  933. me back (via anon.penet.fi) with some tricks of the trade I may
  934.  
  935. not know that YOU discovered. Mostly I'll actually know them
  936.  
  937. already, but if they are really new you'll be given full credit,
  938.  
  939. and even if they are not, should I judge that you "rediscovered"
  940.  
  941. them with your work, or that you actually did good work on them,
  942.  
  943. I'll send you the remaining lessons nevertheless. Your
  944.  
  945. suggestions and critics on the whole crap I wrote are also
  946.  
  947. welcomed.
  948.  
  949.                                 E-mail +ORC
  950.  
  951.                         +ORC an526164@anon.penet.fi
  952.                      HOW TO CRACK, by +ORC, A TUTORIAL
  953.  
  954. ---------------------------------------------------------------------------
  955.  
  956.                   Lesson 2: tools and tricks of the trade
  957.  
  958. ---------------------------------------------------------------------------
  959.  
  960.                                  [INDY.EXE]
  961.  
  962.                    --------------------------------------
  963.  
  964. LOST IN THE DARK CODEWOODS
  965.  
  966.      When you break into a program you end up in portions of code
  967.  
  968. that are unfamiliar to you. It is also not uncommon for the
  969.  
  970. breakpoints to occur outside of the confines of the program you
  971.  
  972. want to crack. Getting your bearings is, in these cases, very
  973.  
  974. important.
  975.  
  976.      One of the handiest utilities is the memory dump tool -it
  977.  
  978. tells you where all the device drivers and TSR are loaded, in
  979.  
  980. which memory locations the program you are cracking dwells, how
  981.  
  982. much memory is left and what the next program load point is. The
  983.  
  984. tools you use should report on the following:
  985.  
  986. -    the contents of interrupt vectors
  987.  
  988. -    the state of the BIOS data area, beginning at address 40:0
  989.  
  990. -    internal structures within DOS, such as the MCB chain, the
  991.  
  992.      SFT (System File Table) chain, the chain of installed
  993.  
  994.      device drivers, the PSPs and memory allocations associated
  995.  
  996.      with installed TSRs
  997.  
  998. -    memory allocation statistic from XMS and EMS drivers
  999.  
  1000.      When seeking to understand a section of foreign code, you
  1001.  
  1002. must be especially careful to seek the real intent of the code.
  1003.  
  1004. Consider using a profiler prior to undertaking an analysis of an
  1005.  
  1006. unfamiliar program. This will help you by ensuring that you don't
  1007.  
  1008. waste time studying sections of the program that aren't even
  1009.  
  1010. involved in the protection scheme you are chasing down.
  1011.  
  1012.      Using a utility that charts a program's calling hierarchy
  1013.  
  1014. can give you an important perspective on how your babe conducts
  1015.  
  1016. its internal operations.
  1017.  
  1018. YOUR DEBUGGER: YOUR FAVOURITE TOOL
  1019.  
  1020.      First and foremost, your debugger must be designed for use
  1021.  
  1022. with resident modules (or must be itself a resident module).
  1023.  
  1024. Trying to crack with simplistic [debug.com] is a sure way to get
  1025.  
  1026. absolutely nowhere. We recommend Softice.exe from Nu-Mega
  1027.  
  1028. technologies (Version 2.6 [S-Ice.exe] has been cracked by MARQUIS
  1029.  
  1030. DE SOIREE and its vastly available on the Web). You could also
  1031.  
  1032. use [Periscope] or [Codeview] or Borland's Turbodebugger... all
  1033.  
  1034. these programs have been boldly cracked and/or distributed and
  1035.  
  1036. are now on the Web for free... learn how to use YAHOO and find
  1037.  
  1038. them. In emergency cases you could fix some quick crack using
  1039.  
  1040. [debug] or [symdeb], but, as said above, most of the time these
  1041.  
  1042. older debuggers won't do. I'll nevertheless ALWAYS give the final
  1043.  
  1044. crack procedure for [debug.com], in order to permit even lusers
  1045.  
  1046. to crack programs.
  1047.  
  1048.      When you first smell a protection, it can be tempting to
  1049.  
  1050. immediately begin your crack using invasive types of techniques.
  1051.  
  1052. While there is certainly nothing wrong with this approach,
  1053.  
  1054. provided that you are fairly familiar with the protection scheme
  1055.  
  1056. used, going in too deep too soon can be a problem when you don't
  1057.  
  1058. have a strong hunch. Most of the time you'll end up missing
  1059.  
  1060. important details. So first of all sit down and ponder... that's
  1061.  
  1062. the zen-way, the only one that really works.
  1063.  
  1064.      Single-stepping is expensive, not only because of the time
  1065.  
  1066. it requires but also because of the amount of detail with which
  1067.  
  1068. you must contend. Your immediate goal is to home in on the
  1069.  
  1070. protection scheme through a series of successively refined traps,
  1071.  
  1072. your broader aim is to get an overview idea of the program's
  1073.  
  1074. action... the wise use of breakpoints will condense these
  1075.  
  1076. minutiae into an understandable form.
  1077.  
  1078.      The first step is to try to identify the section of the
  1079.  
  1080. program where the protection scheme is snapping.
  1081.  
  1082.      Once you are able to isolate a certain section of a program,
  1083.  
  1084. breakpoints can be used to gather a trace history of the
  1085.  
  1086. program's execution. If your debugger sports a backtrace buffer,
  1087.  
  1088. logging window, or similar feature, by all means learn how to use
  1089.  
  1090. it. The debugger it's your best weapon, you must know all the
  1091.  
  1092. possibilities it offers and all the capabilities it possesses.
  1093.  
  1094. Having a debugger's display output echoed to a printer is another
  1095.  
  1096. possibility.
  1097.  
  1098.      Using breakpoints is beneficial for two basic reasons: speed
  1099.  
  1100. and reduction of detail. Manual single-stepping is invaluable
  1101.  
  1102. when you are close to the protection scheme, but too much of it
  1103.  
  1104. will bore you to death.
  1105.  
  1106.      When selecting breakpoint locations and the types of
  1107.  
  1108. breakpoint to use, it is important to step back once more, drink
  1109.  
  1110. a cool Martini-Wodka (use only Moskovskaja: non-russian Wodkas
  1111.  
  1112. are appalling) and ask yourself: "What is this going to tell me?"
  1113.  
  1114. and "What else will I need to know once the break occurs?". MOST
  1115.  
  1116. IMPORTANT OF ALL: "Is my current cracking approach the simplest
  1117.  
  1118. and most direct?", coz you do not want to waste precious cracking
  1119.  
  1120. time.
  1121.  
  1122.      When devising a set of breakpoints it is wise to consider
  1123.  
  1124. how "a trail of bread crumbs" can be left. Not allowing for an
  1125.  
  1126. execution chronicle from the start can mean having to restart a
  1127.  
  1128. cracking session.
  1129.  
  1130.      Setting breakpoints on certain software interrupt calls is
  1131.  
  1132. an excellent way to get an overview of a program's operations.
  1133.  
  1134. The INT_21 DOS services interrupt is probably the most universal
  1135.  
  1136. useful of these, with BIOS interrupts such as the INT_13 (BIOS
  1137.  
  1138. Disk services) and INT_16 (BIOS keyboard services) useful for
  1139.  
  1140. specific cracking.
  1141.  
  1142.      When working with a debugger, evaluative breakpoints are
  1143.  
  1144. usually your best shot. To avoid having to deal with a plethora
  1145.  
  1146. of calls, you would want to have a debugger capable of being told
  1147.  
  1148. to "break on any INT_21 call except where AH == 2C or AH == 0B".
  1149.  
  1150.      A real understanding of the working of a program is surely
  1151.  
  1152. important, but don't overdo it! To reverse-engineer even a small
  1153.  
  1154. program can involve many hours of analysis and documentation
  1155.  
  1156. work. If you'll not be able to use the zen-cracking techniques
  1157.  
  1158. described in this tutorial (sadly not everybody can) pace
  1159.  
  1160. yourself and make sure your chair is comfortable: you'll be
  1161.  
  1162. sitting for quite a spell.
  1163.  
  1164.      Much of the work involved in reverse-engineering consist of
  1165.  
  1166. chasing down tentacles. In order to understand the operations of
  1167.  
  1168. one function, you must understand what happens within each of the
  1169.  
  1170. functions it calls- its child functions. To understand these
  1171.  
  1172. child functions you must study their children; and so on down the
  1173.  
  1174. calling hierarchy tree. Then there is the data. Tracing tentacles
  1175.  
  1176. based on a program's calling hierarchy is a directed process.
  1177.  
  1178. Each function you encounter is basically a list of other
  1179.  
  1180. functions you must reckon with. When it comes to analyzing a
  1181.  
  1182. function's interrelationship with the program's data structure,
  1183.  
  1184. no such list is provided. You must have instinct, feeling and
  1185.  
  1186. luck.
  1187.  
  1188.      Data analysis requires more of a broad-based inquisition.
  1189.  
  1190. For each memory variable you are interested in, you must survey
  1191.  
  1192. all functions to determine which ones read and write that
  1193.  
  1194. variable. The use of memory conditional breakpoints and of a
  1195.  
  1196. disassembler that builds a cross-reference table can make this
  1197.  
  1198. task a lot easier. (Use Sourcer! It's a fairly good tool and
  1199.  
  1200. version 4.08 of [sr.exe] has been long ago cracked and
  1201.  
  1202. distributed on the Web).
  1203.  
  1204. ALL SYSTEM CALLS IN ONE LOCATION
  1205.  
  1206.      Remember that if the program you are cracking was written
  1207.  
  1208. in assembler in the first place (very unlikely knowing the
  1209.  
  1210. laziness of to_days programmers), system calls are probably made
  1211.  
  1212. directly from the functions which need them. But when a program
  1213.  
  1214. is developed in a high-level language, it is more likely that
  1215.  
  1216. common library functions will be used for many operations
  1217.  
  1218. involving system calls. When a program makes all of its INT_21
  1219.  
  1220. calls from the same location, you know that this is certainly the
  1221.  
  1222. case.
  1223.  
  1224.      Now, what happens sometimes is that the programmers write
  1225.  
  1226. the whole application in a overbloated language like C++, but are
  1227.  
  1228. afterwards compelled to "speed up" critical sections of the code
  1229.  
  1230. writing them in assembler. And loo! A section where you
  1231.  
  1232. repeatedly find assembler crafted patches is precisely the
  1233.  
  1234. protection scheme! So you could have a program with all INT_21
  1235.  
  1236. calls from the same location but for one or two calls which are
  1237.  
  1238. coming out of the section where the morons have "hidden" their
  1239.  
  1240. protection strategy. By just "looking" at the dead code of a
  1241.  
  1242. program, you should be capable to tell wich parts have been
  1243.  
  1244. "added on" in a later phase. They presents themselves as
  1245.  
  1246. unevenness and irregularities, especially if you use an utility
  1247.  
  1248. that represents graphicallly the code of a program. Protections
  1249.  
  1250. are often added on at the end of the development.
  1251.  
  1252.      Should you determine that the system calls relevant to your
  1253.  
  1254. cracking are made from common library functions, all is not lost.
  1255.  
  1256. The specific function from which these library calls were made,
  1257.  
  1258. the function you are seeking to locate, is executing at some
  1259.  
  1260. point in between these calls. Break in with your debugger at the
  1261.  
  1262. end of the first system call, just where it is returning to the
  1263.  
  1264. point of call. From there, trace through the remainder of the
  1265.  
  1266. common library routine until it returns to its caller. In short
  1267.  
  1268. order, you should find yourself in the function you need to see.
  1269.  
  1270. The trick is to be able to identify it for what it is.
  1271.  
  1272. ASCIIZ IN CODE
  1273.  
  1274.      In the interest of gaining an overall familiarity with the
  1275.  
  1276. program you want to crack, it can be enlightening to use a hex
  1277.  
  1278. dump utility to examine the message strings contained within the
  1279.  
  1280. program's binary modules. If the program happens to load its
  1281.  
  1282. message strings from separate files, your search has just been
  1283.  
  1284. simplified.
  1285.  
  1286.      Your debugger's memory-dumping feature is one tool that can
  1287.  
  1288. be useful for this type of exploration. You could also construct
  1289.  
  1290. a filtering program, which would read a binary file and output
  1291.  
  1292. all sequences of bytes that are comprised of displayable
  1293.  
  1294. characters and are over a certain minimum length (the best
  1295.  
  1296. cracker tools are often the ones you write yourself).
  1297.  
  1298.      When a protection scheme is marked by the issuance of a
  1299.  
  1300. specific message on the screen, you could go into the program and
  1301.  
  1302. locate the code that emits this message, and then determine what
  1303.  
  1304. triggers it. A good way to start the location process is to see
  1305.  
  1306. if a system call is used to display the string. Interrupt INT_21,
  1307.  
  1308. INT_10 or INT_29 are usually used to display text messages to the
  1309.  
  1310. console.
  1311.  
  1312.      When the message's display is not a result of one of these
  1313.  
  1314. system calls, direct video writing is probably being used. If you
  1315.  
  1316. know the screen location used, and if that part of video memory
  1317.  
  1318. is not used for anything else at the time (a big if), a memory
  1319.  
  1320. write breakpoint could be set on the video buffer address
  1321.  
  1322. corresponding to the first character's position. If this won't
  1323.  
  1324. work, use the step-over/step-around tracing technique while
  1325.  
  1326. watching for the message to appear.
  1327.  
  1328.      Now you found it: from a disassembled listing, you locate
  1329.  
  1330. the address of the message string and then survey the reminder
  1331.  
  1332. of the file for any instructions that reference this address.
  1333.  
  1334. [Sourcer] can generate labels for specific memory locations and
  1335.  
  1336. a cross-reference table showing where these labelled locations
  1337.  
  1338. are referenced. Otherwise, load the disassembled listing file
  1339.  
  1340. into your editor and use its search capabilities. Manually
  1341.  
  1342. searching for such things in a listing will make you old before
  1343.  
  1344. your time.
  1345.  
  1346. CODE AND DATA
  1347.  
  1348.      When stepping through code at the assembler level, watch out
  1349.  
  1350. for interrupt calls that are followed by data. Sometimes you will
  1351.  
  1352. find an interrupt call, typically within the range INT_34 to
  1353.  
  1354. INT_3F, where several bytes immediately following the interrupt
  1355.  
  1356. instruction will be data rather than code.
  1357.  
  1358.      Be especially suspicious of this type of code-and-data
  1359.  
  1360. mixture when your debugger's disassembly output of the
  1361.  
  1362. instructions immediately following an interrupt call doesn't make
  1363.  
  1364. sense. Sometimes you  can determine the offset of the next true
  1365.  
  1366. instruction by inspecting the following code and data. In other
  1367.  
  1368. cases, you will have to trace through the interrupt call to see
  1369.  
  1370. how it accesses the data following the interrupt call instruction
  1371.  
  1372. and how it manipulates the return address on the stack.
  1373.  
  1374. HOOKED VECTORS
  1375.  
  1376.      Seeing what interrupt intercepts already exist within a
  1377.  
  1378. system before running the program you want to crack, as well as
  1379.  
  1380. what interrupt handlers are established by the target program,
  1381.  
  1382. can provide useful clues. For example, if a protection
  1383.  
  1384. establishes an INT_09 intercept just before the snapping of a
  1385.  
  1386. keyboard verification routine, your range of suspects has just
  1387.  
  1388. been narrowed significantly.
  1389.  
  1390.      To study the interrupt vector activities of an application,
  1391.  
  1392. a vector dump map utility is useless. It can't be run while
  1393.  
  1394. running the application you want to crack. One solution is to run
  1395.  
  1396. the program under a debugger and watch for system calls to INT_21
  1397.  
  1398. functions 25h (set interrupt vector) and 35h (get interrupt
  1399.  
  1400. vector), but in the event that the program  reads and writes
  1401.  
  1402. interrupt vectors directly, this method will not give you a
  1403.  
  1404. complete picture. Normally you'll use a spy, trace or "step"
  1405.  
  1406. utility.
  1407.  
  1408.      APPLYING A MEMORY WRITE BREAKPOINT TO A SPECIFIC VECTOR OR
  1409.  
  1410. TO THE ENTIRE TABLE is another way to deal with this.
  1411.  
  1412.      Note that some sort of direct vector writing must be
  1413.  
  1414. occurring if a vector change is detected between system calls.
  1415.  
  1416.      If a vector change is detected during a system call but it
  1417.  
  1418. isn't function 25h of INT_21, suspect that an IRQ handler may be
  1419.  
  1420. effecting the change.
  1421.  
  1422. LITTLE TRICKS OF THE TRADE:
  1423.  
  1424. *    determining interrupt vector addresses ****************
  1425.  
  1426.      How do you determine the interrupt vector addresses? As
  1427.  
  1428. example let's find the address of the INT_21 interrupt vector.
  1429.  
  1430. Since the interrupt vector table starts at address 0000:0000
  1431.  
  1432. (easy to remember, isn't it?) and there are four bytes per
  1433.  
  1434. vector, the basic process is to multiply the interrupt number
  1435.  
  1436. four times and use the result at the offset (on segment zero).
  1437.  
  1438. 21h + 21h = 42h                         42h + 42h = 84h
  1439.  
  1440. The int_21 vector is located at address 0000:0084
  1441.  
  1442. You could also use a calculator, for instance, the address of
  1443.  
  1444. INT_63 is 63h*4=18ch               ->   0000:018C
  1445.  
  1446.  
  1447.  
  1448. * address conversion ***************************************
  1449.  
  1450.      After a painstaking cracking session, you have finally
  1451.  
  1452. determined that a byte of memory at address 6049:891C is the
  1453.  
  1454. trigger. But when you isolate the offending instruction, you find
  1455.  
  1456. that the address it is generating when the protection occur is
  1457.  
  1458. different, being 6109:7D1C instead! How can this be?
  1459.  
  1460.      An 80x86 type CPU, when running in real or VM86 mode, uses
  1461.  
  1462. what is known as segment:offset type addressing. One side effect
  1463.  
  1464. of this addressing method is that one physical address can be
  1465.  
  1466. equivalent to many different segment:offset addresses.
  1467.  
  1468.      To find the PHYSICAL ADDRESS for a given segment:offset do
  1469.  
  1470. the following:
  1471.  
  1472. - convert the segment portion of the address to a 1-based number
  1473.  
  1474. by multiplying it by 16 (x10)... it's easy: add 0 at the right
  1475.  
  1476. end of the number!...
  1477.  
  1478.      6049 -> 60490
  1479.  
  1480.      6109 -> 61090
  1481.  
  1482. now all you have to do is to add this value to the offset value
  1483.  
  1484.      60490+891C  -> 68DAC
  1485.  
  1486.      61090+7D1C  -> 68DAC          <-   Got it?
  1487.  
  1488. And the other way round? If you have a physical address, say
  1489.  
  1490. 19AC3, and you want to obtain a segment:offset address you must
  1491.  
  1492. first of all decide in which segment you want the address... if,
  1493.  
  1494. say, you choose segment 16CC, you proceed as follows:
  1495.  
  1496.      16CC           -> 16CC0
  1497.  
  1498.      19AC3-16CC0    =  2E03 (offset)
  1499.  
  1500.      address for 19AC3 in segment 16CC = 16CC:2E03
  1501.  
  1502. TOOLS OF THE TRADE
  1503.  
  1504. Before starting this section, for those of you that do not know
  1505.  
  1506. anything, here is the ARCHIE way you get all the program that do
  1507.  
  1508. EXIST on the planet: e-mail following
  1509.  
  1510. 1) (address)   archie@archie.univ-rennes1.fr
  1511.  
  1512. I use this french archie, but you can get a worldwide list using
  1513.  
  1514. the metacommand "servers"
  1515.  
  1516. 2) (text)      set search sub      <- anywhere in string
  1517.  
  1518.                set maxhits 140     <- (100-1000)
  1519.  
  1520.                set maxhitspm 15    <- not just 1 file all over
  1521.  
  1522.                find stepdos        <- search e.g. this file
  1523.  
  1524. Wait two hours, get your post and ftp the file you wanted (and
  1525.  
  1526. YES!, you 'll find also EVERYTHING else for free on the Web).
  1527.  
  1528. You could, instead of using archie, also learn how to use YAHOO.
  1529.  
  1530. [MEMSCAN.EXE]
  1531.  
  1532.      One of the most fascinating tools that I have ever seen is
  1533.  
  1534. a (very old) program: MEMSCAN.EXE.
  1535.  
  1536. This program was originally written in 1988 by Scott A. Mebust,
  1537.  
  1538. running in CGA. It's a "visual" utility: it enables you to see
  1539.  
  1540. graphically the 1-meg of PC memory in 8 kbyte chunks. It's a
  1541.  
  1542. powerful tool in order to locate quickly bit mapped graphics and
  1543.  
  1544. other 'objects' in memory, like program data tables, stack areas,
  1545.  
  1546. code areas, available RAM, etc. I used this great idea to create
  1547.  
  1548. (in C) my own tools: a "dead_programs scanner" and an ameliorate
  1549.  
  1550. version of Memscan itself. Looking at the VISUAL STRUCTURE of a
  1551.  
  1552. program it's a great help when you'll crack higher levels.
  1553.  
  1554. [TRACKMEM.COM]
  1555.  
  1556.      A very good tool by James W.Birdsall, tracks memory usage
  1557.  
  1558. of programs (EMS, XMS, conventional).
  1559.  
  1560. [SCANCODE.COM]
  1561.  
  1562.      "THE" scancode lister, by the code_masters from clockwork
  1563.  
  1564. software. The must utility for crackers that do not learn all
  1565.  
  1566. scancodes by heart.
  1567.  
  1568. [MAP.EXE]
  1569.  
  1570.      Actually "MAP2", THE memory mapper from the code_masters at
  1571.  
  1572. clockwork software. It's a very good tool and an interesting one
  1573.  
  1574. too, coz you get it with the "Nigel" nag screens. They are not
  1575.  
  1576. difficult to remove (a "passletter" protection scheme, you'll
  1577.  
  1578. learn how to find and remove it from [Map.exe] in LESSON 3.2).
  1579.  
  1580. [FILEDUMP.COM] [HEXDUMP.COM] [TDUMP.EXE] [DUMP.EXE]
  1581.  
  1582.      There are hundred of file dump utilities, coz file dumping
  1583.  
  1584. is one of the first exercise they learn you at C-school.
  1585.  
  1586. Hexdump.com is 558 bytes long, Tdump.exe 120.704, pick the one
  1587.  
  1588. you like better or write your own (even better). Filedump.com,
  1589.  
  1590. by Daniel M.O'Brien, 1046 bytes long, it's nice.
  1591.  
  1592. [SPRAY.COM]
  1593.  
  1594.      That's a good crack utility indeed! This 1989 program by
  1595.  
  1596. Daniel M.O'Brien gives you a "post-mortem" picture of your
  1597.  
  1598. memory. You redirect it to <myfile> and study it at ease. It's
  1599.  
  1600. difficult to say how many hours of cracking it did spare me (you
  1601.  
  1602. should study the program, only 252 bytes long, and will have to
  1603.  
  1604. modify it a bit, coz it's pretty primitive, in the original
  1605.  
  1606. version, for instance, the redirection to the printer works only
  1607.  
  1608. if there is NO SPACE between "spray" and ">").
  1609.  
  1610. [VEXE.EXE]
  1611.  
  1612.      A good EXE files analyzer, useful for windows programs too
  1613.  
  1614. (see --> LESSON 7). Some of its functions are present in
  1615.  
  1616. TDUMP.EXE too. This 1991 program by S.Krupa it's sometimes very
  1617.  
  1618. useful.
  1619.  
  1620. [SNOOP UTILITIES --> KGB.EXE INTMON.EXE INTRSPY.EXE etc...]
  1621.  
  1622. [TRACE UTILITIES --> TRACE.EXE STEPDOS.EXE etc...]
  1623.  
  1624.      A must to study the "calling hierarchy" of an unknown
  1625.  
  1626. program. KGB.EXE, a 1992 program by Petr Horàk could easily be
  1627.  
  1628. the best one, and comes with source code(!). I'll teach you how
  1629.  
  1630. to crack without any of them (you do not need them if you zen-
  1631.  
  1632. crack), but they can nevertheless be very useful in some
  1633.  
  1634. situations. Stepdos.exe, by Mike Parker, is a excellent program:
  1635.  
  1636. a pleasure to crack in order to use it for slightly different
  1637.  
  1638. purposes :=)
  1639.  
  1640.  
  1641.  
  1642. [SOURCERING UTILITIES]
  1643.  
  1644.      SR.EXE can be used for sourcering unknown programs. It's a
  1645.  
  1646. fairly good sourcering tool. Version 4.08 has been cracked (it's
  1647.  
  1648. a "ORIGINAL NUMBERCODE" protected program) and distributed on the
  1649.  
  1650. Web, so you should easily find it. This said, you should NEVER
  1651.  
  1652. use such a brute force approach, unless you are really desperate:
  1653.  
  1654. I'll teach you how to crack without sourcering (you don't need
  1655.  
  1656. to sourcer if you zen-crack).
  1657.  
  1658.  
  1659.  
  1660. [HEXEDITORS]
  1661.  
  1662. Every idiot has written at least one hexeditor, and you can find
  1663.  
  1664. very bad tools everywhere (the SIMTEL collection, on the Web,
  1665.  
  1666. lists at least 35 hexeditors). I suggest you write your own and
  1667.  
  1668. contribute to the flood, or (better) get PSEDIT.EXE, a good 1990
  1669.  
  1670. program by Gary C. Crider (Parity Solutions, 1903 Pavia Ct.
  1671.  
  1672. Arlington, TX 76006... sometimes even americans can write good
  1673.  
  1674. programs). If you do use it (as you should) disapt the nag screen
  1675.  
  1676. as small exercise in cracking.
  1677.  
  1678. [DEBUGGER]
  1679.  
  1680.      Your best friend in cracking, your weapon, your hidecloak...
  1681.  
  1682. I suggest [Softice.exe] from Nu-Mega technologies (Version 2.6
  1683.  
  1684. has been cracked by MARQUIS DE SOIREE and its vastly available
  1685.  
  1686. on the Web). You could also use [Periscope] or [Codeview] or
  1687.  
  1688. Borland's Turbodebugger... all these programs have been boldly
  1689.  
  1690. cracked and/or distributed and are now on the Web for free...
  1691.  
  1692. learn how to use ARCHIE and YAHOO in order to find them. Your
  1693.  
  1694. debugger is the only tool you 'll REALLY need, believe me. So
  1695.  
  1696. choose your weapon wisely and learn how to use backtrace ranges
  1697.  
  1698. and (FOREMOST!) breakpoint on user written qualifications
  1699.  
  1700. routines. You 'll be able to crack almost EVERYTHING using these
  1701.  
  1702. features in the right way.
  1703.  
  1704.      You should get all the programs mentioned above (all the
  1705.  
  1706. programs that EXIST for that matter) for free on the Web. Use
  1707.  
  1708. them, but also modify them recklessly! REMEMBER THAT YOU ARE
  1709.  
  1710. (GOING TO BE) A CRACKER! The first programs you should crack and
  1711.  
  1712. modify are therefore your very tools! So steal the code of the
  1713.  
  1714. best tools you find! Snatch the best routines and change them for
  1715.  
  1716. the better! That's the whole point in cracking: a mission to
  1717.  
  1718. IMPROVE the best accomplishments of humanity's genius :=)
  1719.  
  1720. HOW TO CRACK, ZEN-CRACKING
  1721.  
  1722.      You 'll learn, beginning with next lesson, how to crack
  1723.  
  1724. systematically the different protection schemes: paper & password
  1725.  
  1726. protections, time protections, access protections. At the end of
  1727.  
  1728. the "methodolocical" part, you'll be able to deprotect programs,
  1729.  
  1730. but you still wont be a cracker. In order to crack higher you
  1731.  
  1732. must use what I call (lacking a better definition) "zen-
  1733.  
  1734. cracking". I 'll give you right now an example of this, so that
  1735.  
  1736. you know what I'm talking about, but -unless you are already
  1737.  
  1738. capable- you'll have to finish this tutorial part for "normal"
  1739.  
  1740. cracking before attempting this techniques. Let's zen-crack
  1741.  
  1742. together a password protection scheme (aka "paper protection",
  1743.  
  1744. coz you need the original manual of the program in order to
  1745.  
  1746. answer). This protection is based on the typing, at the nag
  1747.  
  1748. screen, of the correct sequence of numbers. Our example is a game
  1749.  
  1750. for the reasons explained in lesson 1, but you 'll find the SAME
  1751.  
  1752. protection scheme in the access protection procedure of some old
  1753.  
  1754. Tapestry networks... so do not frown upon games protections.
  1755.  
  1756. INDIANAPOLIS 500, Papyrus software & Electronic Arts, 1989
  1757.  
  1758. It's a rather widespread program, you should therefore find it
  1759.  
  1760. pretty easily. The nag screen asks for data based on the
  1761.  
  1762. historical performances of race cars... that means that the
  1763.  
  1764. answers will consist in two to three digits.
  1765.  
  1766.      Now, the normal way to crack such a program (described in
  1767.  
  1768. -> lesson 3.1) embodyes following steps:
  1769.  
  1770. -    snap save program memory areas before typing your answer
  1771.  
  1772. -    snap compare after typing, say, "666"
  1773.  
  1774. -    search for the sequence 36,36,36 (i.e. 666)
  1775.  
  1776. -    breakpoint on memory range for reading
  1777.  
  1778. -    look at the program part fetching your data
  1779.  
  1780. -    find the snap procedure
  1781.  
  1782. -    disable it.
  1783.  
  1784.      The above crack it's relatively quick and should be most of
  1785.  
  1786. the time fairly effective, but there is a better way: the "zen
  1787.  
  1788. way", the only one that can really enable you to crack high
  1789.  
  1790. protection schemes.
  1791.  
  1792. -    Run the program and break in at the nag screen
  1793.  
  1794. -    Answer consist of 2-3 digits? Search for "AC" (i.e. the
  1795.  
  1796. instruction LODSB, load digit of answer in AL) in the area 500
  1797.  
  1798. bytes BEFORE and 500 bytes AFTER your position. You'll get some
  1799.  
  1800. locations. (In the case of INDY 500 you get 6 such locations).
  1801.  
  1802. -    "feel" the locations (that's the tricky part).
  1803.  
  1804. -    OK, you already made it! Here is the protection strategy:
  1805.  
  1806.   8BBF28A5     MOV  DI,[BX+A528]<-- DI points to coded data area
  1807.  
  1808. :compare_loop
  1809.  
  1810.   AC      LODSB          <-- load first digit of answer in AL
  1811.  
  1812.   B4FF    MOV  AH,FF     <-- load mask in AH
  1813.  
  1814.   2A25    SUB  AH,[DI]   <-- sub coded data from mask and get
  1815.  
  1816.                          real answer
  1817.  
  1818.   47      INC  DI        <-- ready to get next coded data
  1819.  
  1820.   3AC4    CMP  AL,AH     <-- user answer = real answer ?
  1821.  
  1822.   751A    JNZ  beggar_off_coz_false_answer
  1823.  
  1824.   0AC0    OR   AL,AL     <-- more numbers?
  1825.  
  1826.   75F2    JNZ  compare_loop
  1827.  
  1828.   59      POP  CX        <-- all OK, go on, nice guy
  1829.  
  1830.   ...
  1831.  
  1832. And if the protection scheme had been more far away? And if you
  1833.  
  1834. cannot "feel" the right one? And if my grandma had wheels? You'll
  1835.  
  1836. learn it, believe me.
  1837.  
  1838. Now let's quickly crack this crap.
  1839.  
  1840. ------------------------------------------------
  1841.  
  1842. CRACKING INDY.EXE (by +ORC, January 1996)
  1843.  
  1844. ren indy.exe indy.ded
  1845.  
  1846. symdeb indy.ded
  1847.  
  1848. -    s (cs+0000):0 Lffff B4 FF 2A 25 47 3A C4 75 1A
  1849.  
  1850. xxxx:yyyy           <-- this is the answer of the debugger
  1851.  
  1852. -    s (cs+1000):0 Lffff B4 FF 2A 25 47 3A C4 75 1A
  1853.  
  1854. (nothing, but you must be sure there isn't a mirror)
  1855.  
  1856. -    e xxxx:yyyy+8 00    <-- "JNZ 1A ahead" changes to "JNZ 0"
  1857.  
  1858. -    w
  1859.  
  1860. -    q
  1861.  
  1862. ren indy.ded indy.exe
  1863.  
  1864. -------------------------------------------------
  1865.  
  1866. Cracked: you just changed the JNZ beggar_off instruction in a JNZ
  1867.  
  1868. go_ahead_anyway. Nice, isnt'it?
  1869.  
  1870. WHY WE CRACK
  1871.  
  1872.      Strange as it may seem, the reasons for cracking are very
  1873.  
  1874. important for the success of our task. We (at least we old
  1875.  
  1876. crackers) crack AGAINST society, and OPPOSING laws and
  1877.  
  1878. conventions. We usually DO NOT crack for money or for other
  1879.  
  1880. "commercial" reasons (just sometimes, and we are expensive: I
  1881.  
  1882. have plenty of money already and my services are VERY expensive
  1883.  
  1884. if you need an aimed deprotection). But in general we don't care
  1885.  
  1886. much for money and -as you can see- I am giving away the basis
  1887.  
  1888. of what I know for free with this tutorial. The programs we crack
  1889.  
  1890. should be made free for everybody, even if we spent some of our
  1891.  
  1892. time deprotecting them. We could not care less of the commercial
  1893.  
  1894. value of a given program, not to mention the holy work of the
  1895.  
  1896. ethical programmers... we program ourselves, but only because we
  1897.  
  1898. LIKE it... if somebody does something only in order to gain
  1899.  
  1900. money, he does not deserve anything. It's the mind challenge that
  1901.  
  1902. counts, NEVER the profit! (Even if you can make good use of the
  1903.  
  1904. cracked programs and even if -as I said- there is at times a
  1905.  
  1906. personal profit).
  1907.  
  1908.      This is an indispensable attitude! Only a non-mercantile
  1909.  
  1910. mind can leap forward to the "satori" knowledge that you
  1911.  
  1912. desperately need if you want to crack quickly and elegantly huge
  1913.  
  1914. iperbloated monstruosities that somebody else wrote and
  1915.  
  1916. protected, or if you want to gain access to some hidden
  1917.  
  1918. information, data that you would like to snoop but that somebody
  1919.  
  1920. declared "off limits", coz a stupid government, or useless
  1921.  
  1922. industry sector, or money oriented programmer or dirty lobby of
  1923.  
  1924. interest decided it.
  1925.  
  1926.      If you do accept the society where we are compelled to live,
  1927.  
  1928. its awfully egoistic way of life and its dirty "profit" values,
  1929.  
  1930. you may eventually learn how to disable some simple protections,
  1931.  
  1932. but you'll never be able to crack in the "right" way. You must
  1933.  
  1934. learn to despise money, governments, televisions, trends,
  1935.  
  1936. opinion-makers, public opinion, newspapers and all this
  1937.  
  1938. preposterous, asinine shit if you want to grasp the noble art,
  1939.  
  1940. coz in order to be emphatic with the code you must be free from
  1941.  
  1942. all trivial and petty conventions, strange as it may sound. So
  1943.  
  1944. you better take a good look around you... you'll find plenty of
  1945.  
  1946. reasons to hate society and act against it, plenty of sparks to
  1947.  
  1948. crackle programs in the right way... Hope all this did not sound
  1949.  
  1950. too cretin.
  1951.  
  1952. Well, that's it for this lesson, reader. Not all lessons of my
  1953.  
  1954. tutorial are on the Web.
  1955.  
  1956.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  1957.  
  1958. me back (via anon.penet.fi) with some tricks of the trade I may
  1959.  
  1960. not know that YOU discovered. Mostly I'll actually know them
  1961.  
  1962. already, but if they are really new you'll be given full credit,
  1963.  
  1964. and even if they are not, should I judge that you "rediscovered"
  1965.  
  1966. them with your work, or that you actually did good work on them,
  1967.  
  1968. I'll send you the remaining lessons nevertheless. Your
  1969.  
  1970. suggestions and critics on the whole crap I wrote are also
  1971.  
  1972. welcomed.
  1973.  
  1974.                                 E-mail +ORC
  1975.  
  1976.                         +ORC an526164@anon.penet.fi
  1977.                      HOW TO CRACK, by +ORC, A TUTORIAL
  1978.  
  1979. ---------------------------------------------------------------------------
  1980.  
  1981.                 Lesson 3.1: hands on, paper protections (1)
  1982.  
  1983. ---------------------------------------------------------------------------
  1984.  
  1985.                    [UMS.EXE] [LIGHTSPD.EXE] [GENERAL.EXE]
  1986.  
  1987.                    --------------------------------------
  1988.  
  1989. SOME PROBLEMS WITH INTEL's INT
  1990.  
  1991. The INT instruction is the source of a great deal of the
  1992.  
  1993. flexibility in the PC architecture, because the ability to get
  1994.  
  1995. and set interrupt vectors means that system services (included
  1996.  
  1997. DOS itself) are infinitely extensible, replaceable and
  1998.  
  1999. MONITORABLE. Yet the Int instruction is also remarkably
  2000.  
  2001. inflexible in two key ways:
  2002.  
  2003. -    an interrupt handler DOES NOT KNOW which interrupt number
  2004.  
  2005.      invoked it.
  2006.  
  2007. -    the int instruction itself expects an IMMEDIATE operand:
  2008.  
  2009.      you cannot write MOV AX,x21, and then INT AX; you must
  2010.  
  2011.      write INT x21.
  2012.  
  2013. That would be very good indeed for us cracker... unfortunately
  2014.  
  2015. many high level language compilers compile interrupts into PUSHF
  2016.  
  2017. and FAR CALL instruction sequences, rather than do an actual INT.
  2018.  
  2019. Another method is to PUSH the address of the handler on the stack
  2020.  
  2021. and do RETF to it.
  2022.  
  2023.      Some protection schemes attempt to disguise interrupt calls,
  2024.  
  2025. 1) camouflaging the code, 2) putting in substitute interrupt
  2026.  
  2027. instructions which look harmless and modifying them "on the fly"
  2028.  
  2029. or 3) replicating whole interrupt routines inside the code. This
  2030.  
  2031. is particularly frequent in the various "disk access" protection
  2032.  
  2033. schemes that utilize INT_13 (the "disk" interrupt) and will
  2034.  
  2035. therefore be thoroughly explained in -> lesson 5.
  2036.  
  2037. A LITTLE BASIC ASSEMBLER
  2038.  
  2039. In order to understand the protection schemes and to defeat them,
  2040.  
  2041. you must acquire a passing knowledge of assembler, the "machine
  2042.  
  2043. language" code. You can find a lot of good, well explained code
  2044.  
  2045. for free: viruses are one of the best sources for good "tight and
  2046.  
  2047. tricky" assembler code. You can find the source code of almost
  2048.  
  2049. all viruses on the web: oddly all the would be hackers seem to
  2050.  
  2051. have an aberrant passion for this kind of stuff instead of
  2052.  
  2053. studying cracking techniques. But there are millions of lines of
  2054.  
  2055. good explained "commercial" assembler code on the net, just fish
  2056.  
  2057. it out and study it: the more you know, the better you crack.
  2058.  
  2059. I'll restrict myself to some observations, sprinkled throughout
  2060.  
  2061. this tutorial. Let's start with some must_know:
  2062.  
  2063. ------------------------ STRINGS ----------------------------
  2064.  
  2065. The string instructions are quite powerful (and play a great role
  2066.  
  2067. in password protection scheme). ALL of them have the property
  2068.  
  2069. that:
  2070.  
  2071. 1)   The source of data is described by the combination DS:SI
  2072.  
  2073. 2)   The destination of data is described by the combination
  2074.  
  2075.      ES:DI
  2076.  
  2077. 3)   As part of the operation, the SI and/or DI register(s)
  2078.  
  2079.      is(are) incremented or decremented so the operation can be
  2080.  
  2081.      repeated.
  2082.  
  2083. ------------------------- JUMPS -----------------------------
  2084.  
  2085. JZ   ero       means what it says
  2086.  
  2087. JNZ  ero       means what it says
  2088.  
  2089. JG   reater    means "if the SIGNED difference is positive"
  2090.  
  2091. JA   bove      means "if the UNSIGNED difference is positive"
  2092.  
  2093. JL   ess       means "if the SIGNED difference is negative"
  2094.  
  2095. JB   elow      means "if the UNSIGNED difference is negative"
  2096.  
  2097. JC   arry      assembles the same as JB, it's a matter of
  2098.  
  2099.                aesthetic choice
  2100.  
  2101. CRACKING PASSWORD PROTECTED PROGRAMS
  2102.  
  2103.      Refer to lesson one in order to understand why we are using
  2104.  
  2105. games instead of commercial applications as learn material: they
  2106.  
  2107. offer the same protection used by the more "serious" applications
  2108.  
  2109. (or BBS & servers) although inside files that are small enough
  2110.  
  2111. to be cracked without loosing too much time.
  2112.  
  2113.      A whole series of programs employ copy protection schemes
  2114.  
  2115. based upon the possess of the original manual or instructions.
  2116.  
  2117. That's obviously not a very big protection -per se- coz everybody
  2118.  
  2119. nowadays has access to a photocopier, but it's bothering enough
  2120.  
  2121. to motivate our cracks and -besides- you'll find the same schemes
  2122.  
  2123. lurking in many other password protected programs.
  2124.  
  2125.      Usually, at the beginning of the program, a "nag screen"
  2126.  
  2127. requires a word that the user can find somewhere inside the
  2128.  
  2129. original manual, something like: "please type in the first word
  2130.  
  2131. of line 3 of point 3.3.2". Often, in order to avoid mistakes, the
  2132.  
  2133. program indicates the first letter of the password... the user
  2134.  
  2135. must therefore only fill the remaining letters.
  2136.  
  2137. Some examples, some cracks:
  2138.  
  2139. ---------------------------------------------------
  2140.  
  2141. UMS (Universal Military Simulator) version 1
  2142.  
  2143. by Dr Ezra SIDRAN
  2144.  
  2145. (c) 1987 Intergalactic Development
  2146.  
  2147. European Union:     Rainbird Software
  2148.  
  2149. United States:      Firebird Software
  2150.  
  2151. ---------------------------------------------------
  2152.  
  2153.      This very old EGA program is one of the first I cracked in
  2154.  
  2155. my youth, and it's very interesting coz it employs a very basilar
  2156.  
  2157. protection scheme (a "PRIMITIVE"! More than 80% of the protection
  2158.  
  2159. schemes used to day (January 1996) are directly derived from one
  2160.  
  2161. of the 12 primitives.
  2162.  
  2163.      The nag screen snaps at the beginning and keeps indefinitely
  2164.  
  2165. asking your answer, only the use of CTRL+C will bring you out of
  2166.  
  2167. it, back to DOS. That's a clear sign of older protection schemes:
  2168.  
  2169. newer schemes let you in for only 3 attempts or even only one,
  2170.  
  2171. and pop out to the OS if you fail. In UMS, besides, there is no
  2172.  
  2173. "first letter" aid, a later improvement.
  2174.  
  2175.      The cracking procedure for password protected programs is,
  2176.  
  2177. first of all, to find out where are stored the letters that you
  2178.  
  2179. type in. So examine your memory map, find out where the program
  2180.  
  2181. dwells in memory, do a snap save of these memory areas and a
  2182.  
  2183. series of snap compares as you type your password in.
  2184.  
  2185.      Strangely enough, in the case of UMS, as you type your
  2186.  
  2187. password there seems to be no difference at all in the memory
  2188.  
  2189. locations where this program dwells... yet the data must be
  2190.  
  2191. somewhere... Usually such a situation is a clear sign that an
  2192.  
  2193. hooked interrupt is used to hide the data.
  2194.  
  2195.      Checking the hooked vectors you find out the following:
  2196.  
  2197. vecs 00, 02, 22          are hooked where needs be
  2198.  
  2199. vecs 34-3D               are hooked at xxxx:0
  2200.  
  2201. vec  3E                  is hooked at xxxx:00CA
  2202.  
  2203.      Ha! Let's have a closer look at this bizarre 3E hook. Let's
  2204.  
  2205. search for some words used in the nag_screen and then let's dump
  2206.  
  2207. the area where we find them (in UMS that will be at 3E_hook
  2208.  
  2209. address + 7656) and loo! You'll see the content of the nag screen
  2210.  
  2211. and, immediately afterwards, ALL the passwords "in extenso", i.e.
  2212.  
  2213. not encoded, not scrambled, nothing at all... THERE THEY ARE
  2214.  
  2215. (that's a very old protection scheme indeed). You could now, for
  2216.  
  2217. instance, easily patch all the different passwords to (for
  2218.  
  2219. instance) "PASS", and this would work... it's a very primitive
  2220.  
  2221. protection, as we said, nevertheless the use of a hooked vector
  2222.  
  2223. as hiding place for the protection code is not yet obsolete...
  2224.  
  2225. we'll find it elsewhere, in many "more modern" programs.
  2226.  
  2227.      Now let's go deeper and examine the "compare" mechanism, we
  2228.  
  2229. want to crack, here, not just to patch.
  2230.  
  2231.      Password protected programs (and access protection routines
  2232.  
  2233. for server and BBS, for that matter) have quite a lot of weak
  2234.  
  2235. points. The most obvious one (you 'll find out the other when
  2236.  
  2237. you'll high crack) is that they MUST compare the password of the
  2238.  
  2239. user with the original one(s). So you do not need to steal a
  2240.  
  2241. password, you just need to "ear" the echo of the original one in
  2242.  
  2243. the memory locations used for the compare, or, and that's more
  2244.  
  2245. correct, to crack the compare mechanism itself so as to make it
  2246.  
  2247. let you in even with a totally false password.
  2248.  
  2249.      The compare mechanism of UMS can be found setting a
  2250.  
  2251. breakpoint on the memory range that covers the three locations
  2252.  
  2253. where the password is stored (and you 'll find these with your
  2254.  
  2255. search capabilities and with a pair of snap compares):
  2256.  
  2257. ES:0F8E   (here you 'll see a copy of the password that the
  2258.  
  2259.           program is asking)
  2260.  
  2261. ES:0F5C   (here you 'll see a copy of the password that the user
  2262.  
  2263.           types in)
  2264.  
  2265. INT_3E hook_address + 7656 (here are all the possible passwords
  2266.  
  2267.           in extenso).
  2268.  
  2269. Here is how the protection scheme looks out:
  2270.  
  2271. MOV       CX,FFFF        Charge MAX in CX
  2272.  
  2273. REPNZ     SCASB          Scan ES:DI (the user password)
  2274.  
  2275. NOT       CX             Now CX holds the number of the
  2276.  
  2277.                          character that the user typed in
  2278.  
  2279. MOV       DI,SI          Real password offset to DI
  2280.  
  2281. LDS       SI,[BP+0A]     User password offset in SI
  2282.  
  2283. REPZ      CMPSB          Compares DS:SI with ES:DI (user
  2284.  
  2285.                          password and real password) then snap
  2286.  
  2287.                          out at CX=0 or at char_different,
  2288.  
  2289.                          whichever comes first.
  2290.  
  2291. Nice, we found the compare schema... how do we crack it now?
  2292.  
  2293. There are many elegant solutions, but let's remain on a basic
  2294.  
  2295. level... you look at the code that follows the CMPSB searching
  2296.  
  2297. the "snapping schema"... here it is immediately afterwards
  2298.  
  2299. (that's the case in most of the primitives). Remember: we sprung
  2300.  
  2301. out of the CMPSB check at the first different char, OR at the end
  2302.  
  2303. of the count of the user chars. Here it is what follows:
  2304.  
  2305.      MOV  AL,[SI-01]     loads in AL the before_different char
  2306.  
  2307.                          of the user password (should be zero)
  2308.  
  2309.      SUB  AL,ES:[DI-01]  subs with the before_different char of
  2310.  
  2311.                          the real password (should be zero)
  2312.  
  2313.      CBW                 zero flag set, "TRUE", if OK_match
  2314.  
  2315. Well let's now look for the next JZ near (it's a "74" code)
  2316.  
  2317.      CS:IP 740D     JZ  location no_good
  2318.  
  2319. Wait, let's continue a little... is there another check (often
  2320.  
  2321. you have a double check on DI)... yes there is!
  2322.  
  2323.      CS:IP 7590     JNZ location no_good
  2324.  
  2325. Cracking such a schema is very easy: you just need to substitute
  2326.  
  2327. 75 to 74 and 74 to 75: transform your JZ in a JNZ and the JNZ in
  2328.  
  2329. a JZ... now you will always pass, no matter what you write,
  2330.  
  2331. unless you exactly guess the password!
  2332.  
  2333. Now let's quickly crack it:
  2334.  
  2335. ------------------------------------------------
  2336.  
  2337. CRACKING UMS.EXE (by +ORC, January 1996)
  2338.  
  2339. ren ums.exe ums.ded
  2340.  
  2341. symdeb ums.ded
  2342.  
  2343. -    s (cs+0000):0 Lffff 74 0D 1E B8 C2 3F
  2344.  
  2345. (nothing)
  2346.  
  2347. -    s (cs+1000):0 Lffff 74 0D 1E B8 C2 3F
  2348.  
  2349. (nothing)
  2350.  
  2351. -    s (cs+2000):0 lffff 74 0D 1E B8 C2 3F
  2352.  
  2353. xxxx:yyyy           (this is the answer of the debugger)
  2354.  
  2355. -    e xxxx:yyyy    75
  2356.  
  2357. -    e xxxx:yyyy+17 74
  2358.  
  2359. -    w
  2360.  
  2361. -    q
  2362.  
  2363. ren ums.ded ums.exe
  2364.  
  2365. -------------------------------------------------
  2366.  
  2367.      In the debug/symdeb crack above we use as search string the
  2368.  
  2369. bytes comprising and following immediately the first JZ.
  2370.  
  2371. I know, I know... we saw them in [Soft-ice] and we could have
  2372.  
  2373. modified them there, but I'm teaching also pupils who may not
  2374.  
  2375. have [Soft-ice].
  2376.  
  2377.      Note that the program is x431A0 bytes long, and therefore
  2378.  
  2379. has a BX=4 sectors adding to the CX=31A0 in the initial
  2380.  
  2381. registers... that's the reason I wanted to examine all the
  2382.  
  2383. sectors (even if I knew that the snap was in sector (cs+2000):
  2384.  
  2385. that's good practice! If you do not find your string in the first
  2386.  
  2387. sector you must search for it in the next sectors, till you find
  2388.  
  2389. it, coz in many programs there may be MORE THAN ONE repetitions
  2390.  
  2391. of the same schema (more about this double check later).
  2392.  
  2393. That's it, pupils, that's the way to crack old [UMS.EXE].
  2394.  
  2395. Let's go over, now, to more elaborate and more modern password
  2396.  
  2397. protection schemes.
  2398.  
  2399. --------------------------------------------------------
  2400.  
  2401. LIGHTSPEED, from Microprose (we crack here version 461.01)
  2402.  
  2403. --------------------------------------------------------
  2404.  
  2405.      This program, released in 1990, operates a more "modern"
  2406.  
  2407. variation of the previous scheme. You 'll find this variation in
  2408.  
  2409. many access routines of remote servers (and this makes it very
  2410.  
  2411. interesting indeed).
  2412.  
  2413.      Let's begin as usual, with our hooked vectors examination
  2414.  
  2415. and our snap compares.
  2416.  
  2417. Hooked vectors: 00, 08, 1B, 22, 23: nothing particular.
  2418.  
  2419. The snap_comparisons of the main memory area -as you type the
  2420.  
  2421. password in- gives more than six pages of changing locations...
  2422.  
  2423. that's clearly much too much to examine.
  2424.  
  2425. What now?
  2426.  
  2427.      Sit down, have a Martini Wodka (I'm afraid that only
  2428.  
  2429. Moskovskaja 'll do) and meditate. Get the memory map of the
  2430.  
  2431. program's layout. Start anew: snap_save (before typing anything
  2432.  
  2433. in). Type as password "ABCDE". Get the print of the snap
  2434.  
  2435. compares. Sit down, sip Martini Wodka, relax. You know that the
  2436.  
  2437. code for A is x41, for B x42, for C x43 and so on... and in the
  2438.  
  2439. snap_compares, that you made between letters, you 'll have only
  2440.  
  2441. some locations with these values changing. Focus on these.
  2442.  
  2443.      You 'll soon enough find out that for LIGHTSPEED absolute
  2444.  
  2445. location (in my computer) 404307, i.e.: relative locations (in
  2446.  
  2447. my computer) 30BE:F857 or 4043:0007 evoke the characters you
  2448.  
  2449. type, i.e. something like
  2450.  
  2451. -----------------------------------------------------
  2452.  
  2453. F855 F856 F857                F858                F859...
  2454.  
  2455. 41   3E   first_ready_letter  your_1st_letter     your_2nd_one...
  2456.  
  2457. -----------------------------------------------------
  2458.  
  2459. Inspecting the same prints, you 'll find out that absolute
  2460.  
  2461. location 30C64 (imc) or relative location 30BE:F83E evokes the
  2462.  
  2463. LAST character you typed in. The relative code line is:
  2464.  
  2465.      CS:0097   MOV  AX,[BP-08] where SS:F83E = 00+letter_code
  2466.  
  2467.      Now breakpoint at these locations and investigate what's
  2468.  
  2469. going on (for instance, the instruction that follows is
  2470.  
  2471.      CS:009A   MOV [BX], AX
  2472.  
  2473. and this means that the code of the letter you just typed in will
  2474.  
  2475. be now copied in BX=F85A. What else can you do? Time to use a
  2476.  
  2477. little intuition: look for an instruction "CMP AX,000D", which
  2478.  
  2479. is the typical "IF the user hits ENTER then" instruction, coz
  2480.  
  2481. "x1D" its the ENTER keystroke. This must be somewhere around
  2482.  
  2483. here. Ha! You 'll soon enough find the line
  2484.  
  2485.      CS:0073  3D0D00     CMP AX,000D
  2486.  
  2487. And now the way is open to the crack. But YOU DO NOT NEED ALL
  2488.  
  2489. THIS! Since the password protection schemes are -as I told you-
  2490.  
  2491. all more or less the same, I would suggest that you use first of
  2492.  
  2493. all following trick: in the largest part of the program (use
  2494.  
  2495. memory map to see where the program dwells) search the "F3A6"
  2496.  
  2497. sequence, that's instruction REPZ CMPSB.
  2498.  
  2499.      In the case of Lightspd you 'll get as answer FOUR addresses
  2500.  
  2501. with this instruction: (pgsg=program main segment)
  2502.  
  2503.      pgsg:C6F9
  2504.  
  2505.      pgsg:E5CA
  2506.  
  2507.      pgsg:E63E
  2508.  
  2509.      pgsg:EAB0
  2510.  
  2511. There you are! Only four... have a short look at each of them:
  2512.  
  2513. you 'll see that the second one (pgsg:E5CA) is the "good" one.
  2514.  
  2515. The compare mechanism in this program of 1990 it's more or less
  2516.  
  2517. the same as in 1987'UMS (and do believe me: the same mechanism
  2518.  
  2519. is still in use to day (1996)!
  2520.  
  2521. B9FFFF    MOV       CX,FFFF   charge Max in CX
  2522.  
  2523. F2AE      REPNZ     SCASB     this scans ES:DI (the original
  2524.  
  2525.                               password)
  2526.  
  2527. F7D1      NOT       CX        so many chars in the original pw
  2528.  
  2529. 2BF9      SUB       DI,CX     change DI for compare
  2530.  
  2531. F3A6      REPZ      CMPSB     compares DS:SI with ES:DI (real
  2532.  
  2533.                               pw with user pw) then snaps out
  2534.  
  2535.                               at CX=0 or at char_differs
  2536.  
  2537.      See how easy? They all use the same old tricks the lazy
  2538.  
  2539. bastards! Here the section is preceded by a small routine to
  2540.  
  2541. lowercase the user password, coz the original muster is always
  2542.  
  2543. lowercased.
  2544.  
  2545.      Now you would like, may be, to breakpoint at one of these
  2546.  
  2547. locations, in order to stop the program "in the snap area" and
  2548.  
  2549. inspect the snap mechanism... that WILL NOT DO with a "fixed"
  2550.  
  2551. breakpoint, coz these locations are called by the snap with a
  2552.  
  2553. different segment:offset numeration as the one you found (that's
  2554.  
  2555. old dos magic). So you MUST first set a memory_read/write
  2556.  
  2557. breakpoint on these locations, and then get at them at the snap.
  2558.  
  2559. Now you can find out the segment:offset used by the snap and only
  2560.  
  2561. now you'll be able to set a fixed breakpoint (for instance on the
  2562.  
  2563. NOT CX instruction).
  2564.  
  2565.      Now run the program and breakpoint in: have a dump of the
  2566.  
  2567. ES:DI and see the original password. How nice! We have now the
  2568.  
  2569. original password in extenso in our memory dump window. That's
  2570.  
  2571. the "echo". By the way, there is a whole school of cracking
  2572.  
  2573. devoted to find and use these echoes... we work on different
  2574.  
  2575. paths, nevertheless password fishing can be interesting: where
  2576.  
  2577. are the password stored? From which locations do they come from?
  2578.  
  2579. A common practice of the protectionists is to hide them in
  2580.  
  2581. different files, far away, or in hooked vectors, or in SMC parts.
  2582.  
  2583. This is a program of 1990, that differs in respect to UMS: the
  2584.  
  2585. passwords are not "hidden" inside a hooked vector, coz that's a
  2586.  
  2587. pretty stupid protection: any hexdump utility would still permit
  2588.  
  2589. you to see them. Here the passwords are encoded (albeit in a very
  2590.  
  2591. primitive manner): looking for them (with memory range
  2592.  
  2593. breakpoints) you'll quickly find a section of the program code
  2594.  
  2595. that looks like this:
  2596.  
  2597. sg:0118   8C 91 9D 95 9B 8D 00 B8 EC 94 9B 8D 8F 8B 9B
  2598.  
  2599. sg:0128   94 9B 8D 00 AE EC 9C 9B 8A 9B 86 00 A9 EC 91
  2600.  
  2601. This is a typical encoded matrix, with clear 00 fences between
  2602.  
  2603. the encoded passwords.
  2604.  
  2605. Ha! If all codes where so easy to crack! This is no better than
  2606.  
  2607. children's crypt! It's a NEG matrix! And there is direct
  2608.  
  2609. correspondence: 91=6F="o"; 92=6E="n"; 93=6D="m" and so on... Ha!
  2610.  
  2611.      Let's now leave the "hidden" passwords and proceed with our
  2612.  
  2613. cracking... let's follow the snap procedure after the REPZ CMPSB
  2614.  
  2615. instruction looking for the "jump to OK" instruction...
  2616.  
  2617. F3A6      REPZ      CMPSB          ; compares DS:SI with ES:DI
  2618.  
  2619. 7405      JZ   preserved_AX=0000   <--- Here the first JZ
  2620.  
  2621. 1BC0      SBB  AX,AX
  2622.  
  2623. ADFFFF    SBB  AX,FFFF
  2624.  
  2625. :preserved_AX=0000
  2626.  
  2627. 8BF3      MOV  SI,BX
  2628.  
  2629. 8BFA      MOV  DI,DX
  2630.  
  2631. 5D        POP  BP
  2632.  
  2633. CB        RETF
  2634.  
  2635. ....
  2636.  
  2637. 83C404    ADD  SP,+04
  2638.  
  2639. 0BC0      OR   AX,AX
  2640.  
  2641. 7509      JNZ  0276                <------ And here it is!
  2642.  
  2643.      Now, remembering the UMS crack, you would probably want to
  2644.  
  2645. change the JZ instruction in a JNZ instruction (you tried it on
  2646.  
  2647. the fly INSIDE  [Soft-Ice] and it did work!), the "74" with a
  2648.  
  2649. "75" also. And then you would like to change the JNZ instruction
  2650.  
  2651. in a JZ instruction... Please feel free to try it... it will NOT
  2652.  
  2653. work! (You will not even find the second JNZ in the program
  2654.  
  2655. code). You should always be aware of the SMC (self modifying
  2656.  
  2657. code) protections: parts of the code my be decrypted "on the
  2658.  
  2659. fly", as needs arise, by the program. The code you modify while
  2660.  
  2661. the program is running may be different from the code of the
  2662.  
  2663. "dead" program.
  2664.  
  2665.      Here we have a small "improvement" of the primitive: the
  2666.  
  2667. same instruction is used as "muster" for manipulation of other
  2668.  
  2669. parts of the program... if you do change it in a JNZ you get an
  2670.  
  2671. overlay message and the program pops out with instability! You
  2672.  
  2673. cannot easily modify the JNZ instruction either, coz the part
  2674.  
  2675. after the RETF will be compiled "on the fly" by lightspeed, and
  2676.  
  2677. you would therefore have to search the decryption mechanism and
  2678.  
  2679. modify the original encrypted byte somewhere... and may be they
  2680.  
  2681. do encrypt it twice... and then you must hack all night long...
  2682.  
  2683. very annoying.
  2684.  
  2685.      So do the following: back to the snap, a sip of martini-
  2686.  
  2687. Wodka and meditate: loo! The only thing that happens after the
  2688.  
  2689. JZ, is the setting of the AX register to flag *FALSE* (AX=1...
  2690.  
  2691. that's what the two SBB instructions do) if the snap went out
  2692.  
  2693. with a non-zero flag... i.e. if you did not know the password.
  2694.  
  2695. So let's nop the 5 bytes of the two SBB instructions, or, more
  2696.  
  2697. elegantly, let's have a INC AX, DEC AX, NOP, INC AX, DEC AX
  2698.  
  2699. sequence instead of the two SBB! There is a good reason to use
  2700.  
  2701. a sequence of working instructions instead of a series of NOPs:
  2702.  
  2703. recent protection schemes "smell" patched nops inside the program
  2704.  
  2705. and trash everything if they find more than -say- three
  2706.  
  2707. consecutive NOPs! You should always try to choose THE LESS
  2708.  
  2709. INTRUSIVE and MORE "CAMOUFLAGED" solution when you crack!
  2710.  
  2711.      Eliminating the two SBBs we get our crack! No need to bother
  2712.  
  2713. with the second JNZ either... the program will work as if you got
  2714.  
  2715. the password if you have it AND if you do not (that's better as
  2716.  
  2717. the previous type of crack -seen for UMS- when you crack computer
  2718.  
  2719. accesses: hereby the legitimate user will not have any suspects
  2720.  
  2721. 'coz the system will not shut him out... everybody will access:
  2722.  
  2723. the good guys and the bad ones... that's nice isn't it?).
  2724.  
  2725.      Now let's quickly crack LIGHTSPD:
  2726.  
  2727. ------------------------------------------------
  2728.  
  2729. CRACKING LIGHTSPEED.EXE (by +ORC, January 1996)
  2730.  
  2731. ren lightspd.exe lightspd.ded
  2732.  
  2733. symdeb lightspd.ded
  2734.  
  2735. -    s (cs+0000):0 Lffff 2B F9 F3 A6 74
  2736.  
  2737. xxxx:yyyy           (this is the answer of the debugger)
  2738.  
  2739. -    s (cs+1000):0 Lffff 2B F9 F3 A6 74
  2740.  
  2741. (nothing, but do it nonetheless, just to be sure)
  2742.  
  2743. -    s (cs+2000):0 lffff 2B F9 F3 A6 74
  2744.  
  2745. (nothing, just to be sure, now it's enough)
  2746.  
  2747. -    e xxxx:yyyy+6  40 [SPACE] 48 [SP] 90 [SP] 40 [SP] 48
  2748.  
  2749. -    w
  2750.  
  2751. -    q
  2752.  
  2753. ren lightspd.ded lightspd.exe
  2754.  
  2755. -------------------------------------------------
  2756.  
  2757. All this CMPSB is very common. Some programs, nevertheless,
  2758.  
  2759. utilize a password protection scheme that is slightly different,
  2760.  
  2761. and does not rely on a F3A6 REPZ CMPSB instruction. Let's
  2762.  
  2763. analyze, for instance, the protection scheme used in the first
  2764.  
  2765. version of Perfect general I from QQP-White wolf, July 1992.
  2766.  
  2767. When you break in, at the nag screen, you are in the middle of
  2768.  
  2769. the BIOS procedures, coz the program expects your input (your
  2770.  
  2771. password, that's is). You 'll quickly find out (MAP MEMORY
  2772.  
  2773. USAGE!) that [General.exe] dwells in two main areas; Setting
  2774.  
  2775. breakpoints on memory write you 'll find out that the memory area
  2776.  
  2777. "queried" by the protection mechanism is
  2778.  
  2779.      xxxx:1180 to xxxx:11C0
  2780.  
  2781. where xxxx represents the second of the memory segments where the
  2782.  
  2783. program dwells. Now do the following (a very common cracking
  2784.  
  2785. procedure):
  2786.  
  2787. *    Breakpoint on memory range WRITE for the small memory area
  2788.  
  2789.      touched by the program in querying you for the password.
  2790.  
  2791. *    Breakpoint TRACE on the whole memory range of the MAIN
  2792.  
  2793.      CODE.
  2794.  
  2795. *    Run anew everything
  2796.  
  2797. It's already done! Now it's your intuition that should work a
  2798.  
  2799. little: Here the last 9 traces (traces [!], not instructions
  2800.  
  2801. following on a line) before the calling of the procedure sniffing
  2802.  
  2803. your memory area:
  2804.  
  2805. -9   xxxx:0185 7425           JZ   somewhere, not taken
  2806.  
  2807. -8   xxxx:0187 2D1103         SUB  AX,0311
  2808.  
  2809. -7   xxxx:018A 7430           JZ   somewhere, not taken
  2810.  
  2811. -6   xxxx:018C 2DFD04         SUB  AX,04FD
  2812.  
  2813. -5   xxxx:018F 7443           JZ   next_trace, taken
  2814.  
  2815. -4   xxxx:01D4 E85500         CALL funny_procedure
  2816.  
  2817. -3   xxxx:022C 803E8F8C11     CMP  BYTE PTR[8C8F],11
  2818.  
  2819. -2   xxxx:0231 750E           JNZ  somewhere, not taken
  2820.  
  2821. -1   xxxx:0233 9A0A0AC33E     CALL procedure_that_sniffs
  2822.  
  2823.                                    our_memory_area
  2824.  
  2825. Well, the call to funny_procedure followed by a byte compare
  2826.  
  2827. "feels" fishy from very far away, so let's immediately look at
  2828.  
  2829. this part of the code of [General.exe]
  2830.  
  2831. :funny_procedure
  2832.  
  2833.      803E8F8C11     CMP  BYTE PTR[8C8F],11
  2834.  
  2835.      750E           JNZ  compare_byte
  2836.  
  2837.      9A0A0AC333     CALL procedure_that_sniffs
  2838.  
  2839.      0AC0           OR   AL,AL
  2840.  
  2841.      7405           J2   compare_byte
  2842.  
  2843.      C6068F8C2A     MOV  BYTE PTR [8C8F],2A
  2844.  
  2845. :compare_byte
  2846.  
  2847.      803E8F8C2A     CMP  BYTE PTR [8C8F],2A
  2848.  
  2849.      7504           JNZ  after_ret
  2850.  
  2851.      B001           MOV  AL,01
  2852.  
  2853.      C3             RET
  2854.  
  2855. You should be enough crack-able ;=), by this lesson, to notice
  2856.  
  2857. immediately the inconsistency of the two successive instructions
  2858.  
  2859. MOV 2A and CMP 2A, coz there would be no sense in comparing the
  2860.  
  2861. "2A" in order to JNZ to after_ret if you just had the 2A set with
  2862.  
  2863. the precedent MOV instruction... but the first JNZ jumps to the
  2864.  
  2865. compare WITHOUT putting the "2A" inside. And "2A" is nothing else
  2866.  
  2867. as the "*" symbol, commonly used by programmer as "OK"! This
  2868.  
  2869. protection works in the following way (this is the above code
  2870.  
  2871. explained):
  2872.  
  2873. -    compare holy_location with 11
  2874.  
  2875. -    jump non zero to compare holy_loc with "*"
  2876.  
  2877. -    else call sniffing protection part
  2878.  
  2879. -    or al,al (al must be zero, else)
  2880.  
  2881. -    jump zero to compare holy_loc with "*"
  2882.  
  2883. -    if al was zero mov "*" inside holy_loc
  2884.  
  2885. -    compare holy_loc with "*"
  2886.  
  2887. -    if there is a difference then JNZ beggar_off_ugly_copier
  2888.  
  2889. -    else ret_ahead_nice_buyer
  2890.  
  2891. Now let's quickly crack it:
  2892.  
  2893. ------------------------------------------------
  2894.  
  2895. CRACKING GENERAL.EXE (by +ORC, January 1996)
  2896.  
  2897. ren general.exe general.ded
  2898.  
  2899. symdeb general.ded
  2900.  
  2901. -    s (cs+0000):0 Lffff 8C 11 75 0E
  2902.  
  2903. xxxx:yyyy           (this is the answer of the debugger)
  2904.  
  2905. -    e xxxx:yyyy+2  EB [SPACE] 09
  2906.  
  2907. -    w
  2908.  
  2909. -    q
  2910.  
  2911. ren general.ded general.exe
  2912.  
  2913. -------------------------------------------------
  2914.  
  2915. And in this way you changed the JNZ to the cmp "*" instruction
  2916.  
  2917. in a JMP to the mov "*" instruction. So no more nag screens, no
  2918.  
  2919. more protections... serene, placid, untroubled [general.exe].
  2920.  
  2921. Well, that's it for this lesson, reader. Not all lessons of my
  2922.  
  2923. tutorial are on the Web.
  2924.  
  2925.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  2926.  
  2927. me back (via anon.penet.fi) with some tricks of the trade I may
  2928.  
  2929. not know that YOU discovered. Mostly I'll actually know them
  2930.  
  2931. already, but if they are really new you'll be given full credit,
  2932.  
  2933. and even if they are not, should I judge that you "rediscovered"
  2934.  
  2935. them with your work, or that you actually did good work on them,
  2936.  
  2937. I'll send you the remaining lessons nevertheless. Your
  2938.  
  2939. suggestions and critics on the whole crap I wrote are also
  2940.  
  2941. welcomed.
  2942.  
  2943.                                 E-mail +ORC
  2944.  
  2945.                         +ORC an526164@anon.penet.fi
  2946.                      HOW TO CRACK, by +ORC, A TUTORIAL
  2947.  
  2948. ---------------------------------------------------------------------------
  2949.  
  2950.                 Lesson 3.2: hands on, paper protections (2)
  2951.  
  2952. ---------------------------------------------------------------------------
  2953.  
  2954.                 [TOP.EXE] [F19.EXE] [POPULOUS.EXE] [MAP.EXE]
  2955.  
  2956.                    --------------------------------------
  2957.  
  2958. You have seen in the previous lesson that the use of a password
  2959.  
  2960. protection, independently of the coding and hiding methods used
  2961.  
  2962. to store them in memory, implies the use of a comparing procedure
  2963.  
  2964. with the password that the user types in. You therefore have many
  2965.  
  2966. options to begin your cracking work:
  2967.  
  2968. -    find the location of the user password
  2969.  
  2970. -    find the "echo" in memory of the real password
  2971.  
  2972. -    find the routine that compares both
  2973.  
  2974. -    find the passwords hideout and encryption type
  2975.  
  2976. -    find the go_ahead_nice_buyer exit or jump
  2977.  
  2978. -    find the beggar_off_ugly_copier exit or jump
  2979.  
  2980. just to name the more obvious ones. In order to make things more
  2981.  
  2982. difficult for us crackers, the protectionists have devised many
  2983.  
  2984. counter-strategies, the more obvious ones being:
  2985.  
  2986. -    keeping the various part of the store/compare/hide routines
  2987.  
  2988. well apart in code (no match for zen-cracking);
  2989.  
  2990. -    filling these routines with "bogus" compares, bogus jumps
  2991.  
  2992. and bogus variables, in order to make things more difficult for
  2993.  
  2994. the crack (no match for decent crackers);
  2995.  
  2996. -    disseminating the code with anti-debugger tricks, like INT_3
  2997.  
  2998. instructions or jumps in and out protected mode (no match for our
  2999.  
  3000. beloved [Soft-Ice]);
  3001.  
  3002. -    trying to eliminate the need for passwords altogether
  3003.  
  3004. letting the user input "one letter" or "one number" or "one
  3005.  
  3006. image" as answer to some variable question. In this lesson I'll
  3007.  
  3008. teach you how to crack these "passletters" protection techniques.
  3009.  
  3010. Let's first resume the "uses" of a password protection:
  3011.  
  3012. PASSWORDS AS PERMISSION TO ACCESS
  3013.  
  3014. These passwords serve to acknowledge that a legitimate user is
  3015.  
  3016. using the program. This is the type of password that you'll find,
  3017.  
  3018. for example, protecting your user account on Compuserve, on
  3019.  
  3020. Networks or even in ATM machines used by banks or corporations.
  3021.  
  3022. These require a little hardwiring to crack: ATM passnumber
  3023.  
  3024. protection schemes rely on an answer from the central computer
  3025.  
  3026. (they do NOT verify only the three magnetic areas in the magnetic
  3027.  
  3028. strip on the card). The lines between ATM's & their hosts are
  3029.  
  3030. usually 'weak' in the sense that the information transmitted on
  3031.  
  3032. them is generally not encrypted in any way. (Some banks use
  3033.  
  3034. encrypted information, but this is fairly easy to crack too).
  3035.  
  3036. So for ATMs you should do the following 1) cross over the
  3037.  
  3038. dedicated line between the ATM and the host; 2) insert your
  3039.  
  3040. computer between the ATM and the host; 3) Listen to the "normal"
  3041.  
  3042. messages and DO NOT INTERFERE YET; 4) Try out some operations
  3043.  
  3044. with a legal card, make some mistakes, take note of the various
  3045.  
  3046. codes; 5) When you are ready insert a fraudulent card into the
  3047.  
  3048. ATM. Now the following happens:
  3049.  
  3050. -    the ATM sends a signal to the host, saying "Hey! Can I give
  3051.  
  3052. this guy money, or is he broke, or is this funny card invalid?";
  3053.  
  3054. -    the microcomputer intercepts the signal from the host,
  3055.  
  3056. discards it, sends on the "there's no one using the ATM" signal;
  3057.  
  3058. -    the host gets the "no one using" signal and sends back its
  3059.  
  3060. "good, keep watching out if somebody comes by, and for God's sake
  3061.  
  3062. don't spit out any money on the street!" signal to the ATM;
  3063.  
  3064. -    the microcomputer intercepts this signal (again), throws it
  3065.  
  3066. away (again), and sends the "Wow! That guy is like TOO rich! Give
  3067.  
  3068. him as much money as he wants. In fact, he's so loaded, give him
  3069.  
  3070. ALL the cash we have!  He is a really valued customer." signal.
  3071.  
  3072. -    the ATM obediently dispenses cash till the cows come home.
  3073.  
  3074.      All this should be possible, but as a matter of fact it has
  3075.  
  3076. not much to do with cracking, unless there is a special software
  3077.  
  3078. protection on the line... so if you want to work on ATMs contact
  3079.  
  3080. our fellow phreakers/hackers and learn their trade... and
  3081.  
  3082. please remember to hack only cash dispenser that DO NOT HAVE a
  3083.  
  3084. control camera :=)
  3085.  
  3086. PASSWORDS AS REGISTRATION
  3087.  
  3088. This type of password is often used in shareware programs. When
  3089.  
  3090. you register the shareware program, you are sent a password that
  3091.  
  3092. you use to upgrade your shareware program to a complete and more
  3093.  
  3094. powerful version. This method, used frequently for commercial
  3095.  
  3096. applications, has recently been used quite a lot by many windows
  3097.  
  3098. applications that come "crippled" on the magazines cover CD-roms,
  3099.  
  3100. requiring you to telephone a hot line (and paying) in order to
  3101.  
  3102. get the "unique key" to unlock the "special protection". It's all
  3103.  
  3104. bullshit: we'll learn in the "how to crack windows" lessons how
  3105.  
  3106. easy it is to disable the various routines that verify your
  3107.  
  3108. entry.
  3109.  
  3110. PASSWORDS AS COPY PROTECTIONS
  3111.  
  3112. This type of password is often used for games and entertainment
  3113.  
  3114. software. The password query does not usually appear any more at
  3115.  
  3116. the start of the program, or as the program is loading. Instead,
  3117.  
  3118. the password query appears after one or more levels are completed
  3119.  
  3120. (this innovation was pioneered by "EOB I" and the "Ultima"
  3121.  
  3122. series) or when the user reloads a saved game or session.
  3123.  
  3124. DONGLE PASSWORDS
  3125.  
  3126.      A few extremely expensive programs use a dongle (also called
  3127.  
  3128. an hardware key). A dongle is a small hardware device containing
  3129.  
  3130. a password or checksum which plugs into either a parallel or a
  3131.  
  3132. serial port. Some specially designed dongles even include
  3133.  
  3134. complete program routines. Dongles can be cracked, but the amount
  3135.  
  3136. of work involved is considerable and the trial and error
  3137.  
  3138. procedure currently used to crack them via software is extremely
  3139.  
  3140. tedious. It took me more than a week to crack MULTITERM,
  3141.  
  3142. Luxembourger dongle protected program. The quickest method to
  3143.  
  3144. crack dongle protected programs, involves the use of pretty
  3145.  
  3146. complicated hardware devices that cannot be dealt with here. I
  3147.  
  3148. myself have only seldom seen them, and do not like at all to
  3149.  
  3150. crack dongles via software, coz it requires a huge amount of zen
  3151.  
  3152. thinking and of luck and of time. If you want more information
  3153.  
  3154. on the hardware way to crack dongles, try to contact the older
  3155.  
  3156. ones on the appropriate web sites, they may even answer you if
  3157.  
  3158. you are nice, humble and really technically interested.
  3159.  
  3160.      The obvious principle, that applies to the software password
  3161.  
  3162. types mentioned above is the following: The better the password
  3163.  
  3164. is hidden, and the better it is encrypted, the more secure the
  3165.  
  3166. program will be. The password may be
  3167.  
  3168. -    encrypted and/or
  3169.  
  3170. -    in a hooked vector and/or
  3171.  
  3172. -    in an external file and/or
  3173.  
  3174. -    in a SMC (Self modifying code) part
  3175.  
  3176.      Let's finally inspect the common "ready_made" protection
  3177.  
  3178. schemes (used by many programmers that do not program
  3179.  
  3180. themselves):
  3181.  
  3182. *    password read in
  3183.  
  3184. *    letters added to a key to be entered
  3185.  
  3186. *    complement of the letters formed xoring with 255
  3187.  
  3188. *    saved key (1 char)
  3189.  
  3190. *    saved password (256 chars)
  3191.  
  3192. *    saved checksum (1 char), as protection, against simple
  3193.  
  3194.      manipulations
  3195.  
  3196. *    generating file PASSWORD.DAT with password, to be inserted
  3197.  
  3198.      inside a different file than the one containing the calling
  3199.  
  3200.      routine
  3201.  
  3202. Now the lazy programmer that wants to "protect" his program
  3203.  
  3204. searches first the file where the password is stored, then loads
  3205.  
  3206. the key, the password and the checksum. He uses a decrypt
  3207.  
  3208. procedure to decrypt the password and a check_checksum procedure
  3209.  
  3210. to check whether the password was modified. All this is obviously
  3211.  
  3212. crackabe in few seconds.
  3213.  
  3214. [PASSWORD ACCESS INSIDE THE SETUP]
  3215.  
  3216.      Some computers have a password protected access INSIDE the
  3217.  
  3218. Setup (at the beginning), the protection scheme does not allow
  3219.  
  3220. a boot with a floppy and does not allow a setup modify. In these
  3221.  
  3222. cases the only possible crack is an old hack method:
  3223.  
  3224. *    open the PC
  3225.  
  3226. *    find on the motherboard a small jumper (bridge) with the
  3227.  
  3228.      words "Pw"
  3229.  
  3230. *    take it away
  3231.  
  3232. *    PC on
  3233.  
  3234. *    run the setup with F1 or Del (depending from the BIOS) (the
  3235.  
  3236.      protection will not work any more)
  3237.  
  3238. *    deactivate inside the setup the option password
  3239.  
  3240. *    PC off
  3241.  
  3242. *    put the small jumper (bridge) back again
  3243.  
  3244. *    close the PC
  3245.  
  3246. *    PC on, cracked (if you want to be nasty you could now use
  3247.  
  3248.      the setup to set YOUR password)
  3249.  
  3250.      If you want to know more about access refuse and access
  3251.  
  3252. denying, encryption and locking of the FAT tables, get from the
  3253.  
  3254. web, and study, the (very well written) code of a virus called
  3255.  
  3256. "Monkey", that does exactly this kind of devastation. Virus
  3257.  
  3258. studying is, in general, very useful for cracking purposes, coz
  3259.  
  3260. the virus'code is at times
  3261.  
  3262. -    very well written (pure, tight assembly)
  3263.  
  3264. -    using concealing techniques not much different from the
  3265.  
  3266.      protection schemes (often far superior)
  3267.  
  3268. -    using the most recent and best SMC (self modifying code)
  3269.  
  3270.      tricks
  3271.  
  3272.      But, and this is very important, do not believe that the
  3273.  
  3274. protection schemes are very complicated! Most of the time the
  3275.  
  3276. protection used are incredibly ordinary: as a final example of
  3277.  
  3278. our paper protection schemes, let's take a program released not
  3279.  
  3280. long ago (1994), but with a ridiculous protection scheme: TOP
  3281.  
  3282. (Tiger on the prowl) a simulation from HPS.
  3283.  
  3284. Here the cracking is straightforward:
  3285.  
  3286. -    MAP(memory_usage) and find main_sector
  3287.  
  3288. -    type "AAAA" as password
  3289.  
  3290. -    (s)earch main_sector:0 lffff "AAAA"
  3291.  
  3292. -    dump L80 "AAAA" location -40 (gives you a "wide" dump),
  3293.  
  3294.      this gives you already the "echo" of the correct password
  3295.  
  3296. -    breakpoint on memory read & write to "AAAA" location and
  3297.  
  3298.      backtrace the complete main_sector
  3299.  
  3300. it's done! Here the code_lines that do protect TOP:
  3301.  
  3302.      8A841C12  MOV  AL,[SI+121C]   move in AL first user letter
  3303.  
  3304.      3A840812  CMP  AL,[SI+1208]   compare with echo
  3305.  
  3306.      7402      JZ   go_ahead_nice_buyer
  3307.  
  3308.      EB13      JMP  beggar_off_ugly_cracker
  3309.  
  3310. Now let's quickly crack it:
  3311.  
  3312. ------------------------------------------------
  3313.  
  3314. CRACKING TOP.EXE (by +ORC, January 1996)
  3315.  
  3316. ren top.exe top.ded
  3317.  
  3318. symdeb top.ded
  3319.  
  3320. -    s (cs+0000):0 Lffff 8A 84 1C 12 3A 84
  3321.  
  3322. xxxx:yyyy           (this is the answer of the debugger)
  3323.  
  3324. -    e xxxx:yyyy+2  08 (instead of 1C)
  3325.  
  3326. -    w
  3327.  
  3328. -    q
  3329.  
  3330. ren top.ded top.exe
  3331.  
  3332. -------------------------------------------------
  3333.  
  3334. And you changed the MOV  AL, [SI+121C] instruction in a MOV AL,
  3335.  
  3336. [SI+1208] instruction... it is now reading the ECHO instead of
  3337.  
  3338. the characters you typed in... no wonder that the ECHO does
  3339.  
  3340. compare exactly with itself... and you pass!
  3341.  
  3342. "SOMETHING FISHY UNDER COVERS"
  3343.  
  3344. Back to the "Passletter" type of password protected programs.
  3345.  
  3346. Let's take as an example the protection used in a game of 1990:
  3347.  
  3348. "F19", where the protection scheme asks you to identify a
  3349.  
  3350. particular plane's silhouette. This kind of protection is used
  3351.  
  3352. in order to avoid the use of memory locations where the passwords
  3353.  
  3354. are stored: we saw in the first part of our "passwords hands on"
  3355.  
  3356. how easy it is to crack those schemes.
  3357.  
  3358. To crack this kind of protection, you could try a technique know
  3359.  
  3360. as "memory snuffing". The protected program, START.EXE, install
  3361.  
  3362. itself first at location xxxx:0000 with a length of 6C62 bytes,
  3363.  
  3364. but proceeds to a relocation of its modules (with some SMC, self
  3365.  
  3366. modifying code parts) in different locations. What does all this
  3367.  
  3368. mean? Well, this could mean quite many things... the most
  3369.  
  3370. important one for crackers is that the protection code will
  3371.  
  3372. probably snap way ahead of the actual user input phase.
  3373.  
  3374. Now you 'll quickly find out that the routine determining
  3375.  
  3376. (randomly) which plane is being chosen, leaves the progressive
  3377.  
  3378. number of this plane in one memory location: (imc) 43CD:DADA.
  3379.  
  3380. This brings us to the random triggering mechanism:
  3381.  
  3382. E87FAF    CALL random_seed
  3383.  
  3384. 83C402    ADD  SP,02
  3385.  
  3386. 8946E8    MOV  [BP-18],AX     and ds:(BP-18) is the location
  3387.  
  3388.                               you are looking for
  3389.  
  3390. Now, every time this random triggers, you get a different number
  3391.  
  3392. (00-x14) in this location, corresponding to the different plane
  3393.  
  3394. the user should choose.
  3395.  
  3396. The random seed routine, evidently, comes back with the random
  3397.  
  3398. seed in AX... what we now need is to zero it: the user will
  3399.  
  3400. always have to choose the same plane: "plane 0", and he will have
  3401.  
  3402. given the correct answer. Note how elegant all this is: we do not
  3403.  
  3404. need to interfere with the whole mouse pointing routines, nor
  3405.  
  3406. with the actual choosing of the planes... the random seed may
  3407.  
  3408. choose whatever plane it wishes... the memory location for this
  3409.  
  3410. choice will always report the (legitimate) choice of zero.
  3411.  
  3412. So, let's quickly crack this program:
  3413.  
  3414. ---------------------------------------------------
  3415.  
  3416. CRACKING "F19" [START.EXE] (by +ORC, January 1996)
  3417.  
  3418. ren start.exe start.ded       <- let's have a dead file
  3419.  
  3420. symdeb start.ded              <- let's debug it
  3421.  
  3422. - s cs:O lffff 83 C4 02 89 46 E8 <- search ADD SP,02
  3423.  
  3424. xxxx:yyyy                     <- debugger's answer
  3425.  
  3426. - e xxxx:yyyy 58 [SPACE] 31 [SPACE] C0 [SPACE]
  3427.  
  3428. - w                           <- write the crack
  3429.  
  3430. - q                           <- back to the OS
  3431.  
  3432. ren start.ded start.exe       <- re-write the exe
  3433.  
  3434. ----------------------------------------------------
  3435.  
  3436. You just transformed the instruction you searched for
  3437.  
  3438.      83C402    ADD  SP,+02
  3439.  
  3440. in the following sequence:
  3441.  
  3442.      58        POP  AX        <- respecting ADD SP,+02
  3443.  
  3444.      31C0      XOR  AX,AX     <- xoring to zero
  3445.  
  3446. (the POP AX instruction increments the stack pointer by 2, in
  3447.  
  3448. order to respect the previous ADD SP,+02).
  3449.  
  3450. Well, nice. It's getting easier, isnt'it? Now let's take as
  3451.  
  3452. example a protection that has no "echo" in memory. (At the
  3453.  
  3454. beginning this was a smart idea: "the cracker won't find the
  3455.  
  3456. correct password, 'coz it's not there, ah!". We'll now therefore
  3457.  
  3458. crack one of the first programs that used this scheme:
  3459.  
  3460. [Populous.exe], from Bullfrog.
  3461.  
  3462. [POPULOUS.EXE]
  3463.  
  3464.      A old example of the protection scheme "password that is not
  3465.  
  3466. a password" can be found in [Populous.exe], from Bullfrog. It's
  3467.  
  3468. a very widespread program, and you'll surely be able to find a
  3469.  
  3470. copy of it in order to follow this lesson. The program asks for
  3471.  
  3472. the identification of a particular "shield", a combination of
  3473.  
  3474. letters of various length: the memory location were the user
  3475.  
  3476. password is stored is easily found, but there is (apparently) no
  3477.  
  3478. "echo" of the correct password. You should be able, by now, to
  3479.  
  3480. find by yourself the memory location were the user password is
  3481.  
  3482. stored. Set a breakpoint memory read & write on this area, and
  3483.  
  3484. you 'll soon come to the following section of code:
  3485.  
  3486. F7AE4EFF  IMUL WORD PTR [BP+FF4E]       <- IMUL with magic_N°
  3487.  
  3488. 40        INC  AX
  3489.  
  3490. 3B460C    CMP  AX, [BP+0C]
  3491.  
  3492. 7509      JNZ  beggar_off_ugly_copier
  3493.  
  3494. 8B460C    MOV  AX, [BP+0C]
  3495.  
  3496. A3822A    MOV  [2A82], AX
  3497.  
  3498. E930FE    JMP  nice_buyer
  3499.  
  3500. 817E0C7017CMP  WORD PTR[BP+0C],1770     <- beggar_off
  3501.  
  3502. I don't think that you need much more now... how do you prefer
  3503.  
  3504. to crack this protection scheme? Would you choose to insert a MOV
  3505.  
  3506. [BP+0C], AX and three NOPS (=6 bytes) after the IMUL instruction?
  3507.  
  3508. Wouldn't you rather prefer the more elegant JMP to nice_buyer
  3509.  
  3510. instruction at the place of the JNZ beggar_off? This solution has
  3511.  
  3512. less nops: remember that newer protection schemes smell
  3513.  
  3514. NOPs_patches!). Yeah, let's do it this way:
  3515.  
  3516. ---------------------------------------------------
  3517.  
  3518. CRACKING [Populous.exe] (by +ORC, January 1996)
  3519.  
  3520. ren populous.exe populous.ded      <- let's have a dead file
  3521.  
  3522. symdeb populous.ded                <- let's debug it
  3523.  
  3524. -    s cs:O lffff F7 AE 4E FF      <- the imul magic_N°
  3525.  
  3526. xxxx:yyyy                          <- debugger's answer
  3527.  
  3528. -    e xxxx:yyyy+4  EB [SPACE] 03  <- JMP anyway
  3529.  
  3530. -    w                             <- modify ded
  3531.  
  3532. -    q                             <- back to the OS
  3533.  
  3534. ren populous.ded populous.exe      <- let's re-have the exe
  3535.  
  3536. ----------------------------------------------------
  3537.  
  3538. This time was easy, wasnt'it?
  3539.  
  3540.      Now you are almost ready with this course... let's crack a
  3541.  
  3542. last application, a memory utility that is very widespread, very
  3543.  
  3544. good (the programmers at Clockwork software are Codemasters),
  3545.  
  3546. very useful for our purposes (you'll use it later to crack a lot
  3547.  
  3548. of TSR) and, unfortunately for Clockworkers, very easy to crack
  3549.  
  3550. at the level you are now.
  3551.  
  3552. But, Hey! Do not forget that you would have never done it without
  3553.  
  3554. this tutorial, so do the following: look toward east from your
  3555.  
  3556. window, sip a Martini-Wodka (Two blocks of ice first, 1/3 dry
  3557.  
  3558. Martini from Martini & Rossi, 1/3 Moskovskaia Wodka, 1/3
  3559.  
  3560. Schweppes indian tonic) and say three times: Thank-you +ORC!.
  3561.  
  3562. [MAP.EXE]
  3563.  
  3564.      Let's now go over to one of the best TOOLS for mapping your
  3565.  
  3566. memory usage that exist: MAP.EXE (version 2) from the masters at
  3567.  
  3568. Clockwork software. The usage of this tool has been recommended
  3569.  
  3570. in Lesson 2, and you should learn how to crack it, coz it comes
  3571.  
  3572. with an annoying nag-screen ("Nigel" screen). In [Map.exe] this
  3573.  
  3574. ubiquitous "Nigel" screen appears at random waiting for a random
  3575.  
  3576. amount of time before asking the user to press a key which varies
  3577.  
  3578. every time and is also selected at random.
  3579.  
  3580.      The use of a single letter -mostly encrypted with some XOR
  3581.  
  3582. or SHR- as "password" makes the individuation of the relevant
  3583.  
  3584. locations using "snap compares" of memory much more difficult.
  3585.  
  3586. But the crack technique is here pretty straightforward: just
  3587.  
  3588. break in and have a good look around you.
  3589.  
  3590.      The INT_16 routine for keyboard reading is called just after
  3591.  
  3592. the loading of the nag screen. You 'll quickly find the relative
  3593.  
  3594. LODSB routine inside a routine that paints on screen the word
  3595.  
  3596. "Press" and a box-edge after a given time delay:
  3597.  
  3598.      B95000         MOV  CX,0050
  3599.  
  3600.      2EFF366601     PUSH CS:[0166]
  3601.  
  3602.      07             POP  ES
  3603.  
  3604.      AC             LODSB
  3605.  
  3606.      ...
  3607.  
  3608. You could already eliminate the delay and you could already force
  3609.  
  3610. always the same passletter, in order to temperate the effects of
  3611.  
  3612. the protection... but we crack deep!: let's do the job and track
  3613.  
  3614. back the caller! The previous routine is called from the
  3615.  
  3616. following section of the code:
  3617.  
  3618.      91             XCHG AX,CX
  3619.  
  3620.      6792           XCHG AX,DX
  3621.  
  3622.      28939193       SUB  [BP+DI+9391],DL
  3623.  
  3624.      2394AA94       AND  DX,[SI+94AA]
  3625.  
  3626.      2EC7064B880100 MOV  WORD PTR CS:[884B],0001
  3627.  
  3628.      2E803E5C0106   CMP  BYTE PTR CS:[015C],06
  3629.  
  3630.      7416           JZ   ret       <- Ha! jumping PUSHa & POPa!
  3631.  
  3632.      505351525756   PUSH the lot
  3633.  
  3634.      E882F3         CALL 8870
  3635.  
  3636.      2E3B064B88     CMP  AX,CS:[884B]
  3637.  
  3638.      7307           JAE  after RET <- Ha! Not taking the RET!
  3639.  
  3640.      5E5F5A595B58   POP  the lot
  3641.  
  3642.      C3             RET
  3643.  
  3644.      ...                                <- some more instructions
  3645.  
  3646.      E86700         CALL delay_user
  3647.  
  3648.      BE9195         MOV  SI,9591
  3649.  
  3650.      2E8B3E255C     MOV  DI,CS:[5C25]
  3651.  
  3652.      83EF16         SUB  DI,+16
  3653.  
  3654.      2E8A263D01     MOV  AH,CS:[013D]
  3655.  
  3656.      50             PUSH AH
  3657.  
  3658.      E892C7         CALL routine_LODSB  <-- HERE!
  3659.  
  3660.      B42C           MOV  AH,2C
  3661.  
  3662.      CD21           INT  21             <- get seconds in DH
  3663.  
  3664.      80E60F         AND  DH,0F
  3665.  
  3666.      80C641         ADD  DH,41
  3667.  
  3668.      58             POP  AX
  3669.  
  3670.      8AC6           MOV  AL,DH
  3671.  
  3672.      83EF04         SUB  DI,+4
  3673.  
  3674.      AB             STOSW
  3675.  
  3676.      E85A00         CALL INT_16_AH=01
  3677.  
  3678.      B400           MOV  AH,00
  3679.  
  3680.      CD16           INT  16
  3681.  
  3682.      24DF           AND  AL,DF     <- code user's letter_answer
  3683.  
  3684.      3AC6           CMP  AL,DH     <- pass_compare
  3685.  
  3686.      75F3           JNZ  CALL INT_16_AH=01
  3687.  
  3688.      E807F3         go_ahead
  3689.  
  3690.      You just need to look at these instructions to feel it: I
  3691.  
  3692. think that unnecessary code segments (in this case protections)
  3693.  
  3694. are somehow like little snakes moving under a cover: you cannot
  3695.  
  3696. easily say what's exactly going on yet, but you could bet that
  3697.  
  3698. there is something fishy going on. Look at the code preceding
  3699.  
  3700. your LODSB routine call: you find two JUMPS there: a JZ ret, that
  3701.  
  3702. leaves a lot of pusha and popa aside, and a JAE after RET, that
  3703.  
  3704. does not take the previous ret. If you did smell something here
  3705.  
  3706. you are thoroughly right: The first JZ triggers the NIGEL screen
  3707.  
  3708. protection, and the second JAE does THE SAME THING (as usual,
  3709.  
  3710. there are always redundances, exactly as there are a lot of
  3711.  
  3712. possibilities to disable a single protection). Now you know...
  3713.  
  3714. you can disable this protection at different points: the two
  3715.  
  3716. easiest blueprints being
  3717.  
  3718. 1)   to change 7416 (JZ ret) in a EB16 (JMP ret anyway)
  3719.  
  3720. 2)   to change 7307 (JAE after ret) in a 7306 (JAE ret).
  3721.  
  3722.      We have not terminated yet: if you try locating this part
  3723.  
  3724. of the code in order to change it, you won't have any luck: it's
  3725.  
  3726. a SMC (Self modifying code) part: it is loaded -partly- from
  3727.  
  3728. other sections of the code (here without any encryption). You
  3729.  
  3730. must therefore first of all set a breakpoint on memory range;
  3731.  
  3732. find out the LODSW routine; find out the real area; dump that
  3733.  
  3734. memory region; find out a search sequence for the "dead" code...
  3735.  
  3736. and finally modify the "dead" program.
  3737.  
  3738. Now let's quickly crack it:
  3739.  
  3740. ------------------------------------------------
  3741.  
  3742. CRACKING MEM.EXE (version 2) (by +ORC, January 1996)
  3743.  
  3744. ren map.exe map.ded
  3745.  
  3746. symdeb map.ded
  3747.  
  3748. -    s (cs+0000):0 Lffff 74 16 50 53 51 52 57
  3749.  
  3750. xxxx:yyyy           <- this is the debugger's answer
  3751.  
  3752. -    e xxxx:yyyy    EB
  3753.  
  3754. -    w
  3755.  
  3756. -    q
  3757.  
  3758. ren map.ded map.exe
  3759.  
  3760. -------------------------------------------------
  3761.  
  3762. Now you have done it, NIGEL has been cracked!
  3763.  
  3764. Well, that's it for this lesson, reader. Not all lessons of my
  3765.  
  3766. tutorial are on the Web.
  3767.  
  3768.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  3769.  
  3770. me back (via anon.penet.fi) with some tricks of the trade I may
  3771.  
  3772. not know that YOU discovered. Mostly I'll actually know them
  3773.  
  3774. already, but if they are really new you'll be given full credit,
  3775.  
  3776. and even if they are not, should I judge that you "rediscovered"
  3777.  
  3778. them with your work, or that you actually did good work on them,
  3779.  
  3780. I'll send you the remaining lessons nevertheless. Your
  3781.  
  3782. suggestions and critics on the whole crap I wrote are also
  3783.  
  3784. welcomed.
  3785.  
  3786.                                 E-mail +ORC
  3787.  
  3788.                         +ORC an526164@anon.penet.fi
  3789.                      HOW TO CRACK, by +ORC, A TUTORIAL
  3790.  
  3791. ---------------------------------------------------------------------------
  3792.  
  3793.                  Lesson 5.1: Disk & CD-Rom access (basics)
  3794.  
  3795. ---------------------------------------------------------------------------
  3796.  
  3797.               [MARIO ANDRETTI] [REACH FOR THE SKY] [FS v.2.12]
  3798.  
  3799.                    --------------------------------------
  3800.  
  3801. LESSON 5 (1) - HOW TO CRACK, HANDS ON - Disk/CDROM access (plus
  3802.  
  3803. bypasses "on the fly")
  3804.  
  3805. Somewhere I have to put the bypasses (loader programs) in this
  3806.  
  3807. tutorial, allow me to put them here:
  3808.  
  3809. Preparing a loader to bypass a protection [MARIO ANDRETTI]
  3810.  
  3811.      At time the protectionists hook vectors in order to impose
  3812.  
  3813. a particular protection. In this (and similar) cases a good
  3814.  
  3815. crack-way is to prepare a "loader" program, that "de-hooks" the
  3816.  
  3817. vector used for the protection. This kind of crack can be used
  3818.  
  3819. also for internet cracking (on some firewall configurations, see
  3820.  
  3821. lesson A.2).
  3822.  
  3823.      As example let's take "Mario andretti racing challenge", a
  3824.  
  3825. stupid game that uses the SAME (!) protection scheme you'll still
  3826.  
  3827. find to day on some access routines of military servers around
  3828.  
  3829. the witlessly called "free" world.
  3830.  
  3831. In order to crack this cram you would prepare a loader on the
  3832.  
  3833. following lines:
  3834.  
  3835. loc   code           instruction        what's going on
  3836.  
  3837. -------------------------------------------------------
  3838.  
  3839. :0100 EB44           JMP 0146
  3840.  
  3841. ...
  3842.  
  3843. :0142 0000           <- storing for offset of INT_21
  3844.  
  3845. :0144 5887           <- storing for segment of INT_21
  3846.  
  3847. :0146 FA             CLI
  3848.  
  3849. :0147 0E             PUSH CS
  3850.  
  3851. :0148 1F             POP DS
  3852.  
  3853. :0149 BCB403         MOV SP,03B4
  3854.  
  3855. :014C FB             STI
  3856.  
  3857. :014D 8C1EA901       MOV [01A9],DS      <- save DS
  3858.  
  3859. :0151 8C1EAD01       MOV [01AD],DS         three
  3860.  
  3861. :0155 8C1EB101       MOV [01B1],DS         times
  3862.  
  3863. :0159 B82135         MOV AX,3521        <- get INT_21
  3864.  
  3865. :015C CD21           INT 21                in ES:BX
  3866.  
  3867. :015E 891E4201       MOV [0142],BX      <- store offset
  3868.  
  3869. :0162 8C064401       MOV [0144],ES      <- store segment
  3870.  
  3871. :0166 BA0201         MOV DX,0102
  3872.  
  3873. :0169 B82125         MOV AX,2521        <- set INT_21 to
  3874.  
  3875. :016C CD21           INT 21                DS:0102
  3876.  
  3877. :016E 0E             PUSH CS
  3878.  
  3879. :016F 07             POP ES             <- ES= current CS
  3880.  
  3881. :0170 BBB403         MOV BX,03B4
  3882.  
  3883. :0173 83C30F         ADD BX,+0F
  3884.  
  3885. :0176 B104           MOV CL,04
  3886.  
  3887. :0178 D3EB           SHR BX,CL          <- BX= 3C
  3888.  
  3889. :017A B8004A         MOV AX,4A00        <- Modify memory block
  3890.  
  3891. :017D CD21           INT 21                to 3C paragraphs
  3892.  
  3893. :017F BA9E01         MOV DX,019E        <- ds:dx=program name
  3894.  
  3895. :0182 BBA501         MOV BX,01A5        <- es:bx = param. block
  3896.  
  3897. :0185 B8004B         MOV AX,4B00        <- load ma.com
  3898.  
  3899. :0188 CD21           INT 21
  3900.  
  3901. :018A 2E8B164201     MOV DX,CS:[0142]   <- reset old int_21
  3902.  
  3903. :018F 2E8E1E4401     MOV DS,CS:[0144]
  3904.  
  3905. :0194 B82125         MOV AX,2521
  3906.  
  3907. :0197 CD21           INT 21
  3908.  
  3909. :0199 B8004C         MOV AX,4C00        <- terminate with return
  3910.  
  3911. :019C CD21           INT 21                code
  3912.  
  3913. :019E 6D612E636F6D00 "ma.com"
  3914.  
  3915.       0000           fence
  3916.  
  3917. :01A7 B2015887
  3918.  
  3919. :01AB B2015887
  3920.  
  3921. :O1AF B2015887
  3922.  
  3923.       0000           fence
  3924.  
  3925. let's now prepare a routine that hooks INT_21:
  3926.  
  3927. push all
  3928.  
  3929. CMP AX,2500    <- go on if INT_21 service 25
  3930.  
  3931. JNZ ret
  3932.  
  3933. CMP Word Ptr [0065], C00B <- go on if location 65 = C00B
  3934.  
  3935. JNZ ret
  3936.  
  3937. MOV  Byte Ptr [0060], EB  <- crack instructions
  3938.  
  3939. MOV  Byte Ptr [0061], 3C
  3940.  
  3941. MOV  Byte Ptr [0062], 40  <- INC AX
  3942.  
  3943. MOV  Byte Ptr [0063], 90  <- NOP
  3944.  
  3945. MOV  Byte Ptr [0064], 48  <- DEC AX
  3946.  
  3947. pop all
  3948.  
  3949. JMP  FAR CS:[0142]  <- JMP previous INT_21
  3950.  
  3951.      From now on this loader will work every time that a program
  3952.  
  3953. with location [0065] containing an 0R AX,AX instruction (0BC0:
  3954.  
  3955. it's the case of ma.com) calls INT_21 service 25 (hook a vector),
  3956.  
  3957. the target program will be modified on the fly and will get, at
  3958.  
  3959. location [0060], the instruction JMP 3C locations ahead, despite
  3960.  
  3961. the fact that it has routines capable of self checking in order
  3962.  
  3963. to make sure it has not been modified.
  3964.  
  3965.      The most important thing is the routine that YOU write that
  3966.  
  3967. will precede the call to INT_21 (or any other INT) service 25 (or
  3968.  
  3969. any other service) in order to crack on the fly the offending
  3970.  
  3971. program. I'll show you another one, this one for [Reach for the
  3972.  
  3973. skies] (reach.com):
  3974.  
  3975. push all
  3976.  
  3977. CMP  AH,3D      <- is it service 3D? (open file)
  3978.  
  3979. JNZ  ret        <- no, so ret
  3980.  
  3981. CMP  DX,13CE    <- you wanna open file at 13CE?
  3982.  
  3983. JNZ  ret        <- no, so ret
  3984.  
  3985. MOV  AX,[BP+04] <- in this case
  3986.  
  3987. MOV  DS,AX
  3988.  
  3989. CMP  Byte Ptr [B6DA],74 <- old instructions
  3990.  
  3991. JNZ  015B
  3992.  
  3993. CMP  Byte Ptr [B6DB],0F <- ditto
  3994.  
  3995. JNZ  015B
  3996.  
  3997. CMP  Byte Ptr [B6DC],80 <- ditto, now we now where we are
  3998.  
  3999. JNZ  015B
  4000.  
  4001. MOV  Byte Ptr [B6DA],EB <- crack
  4002.  
  4003. MOV  Byte Ptr [B697],40 <- camouflaged  no-opping
  4004.  
  4005. MOV  Byte Ptr [B698],48 <- cam          nop
  4006.  
  4007. MOV  Byte Ptr [B699],90 <- cam          nop
  4008.  
  4009. MOV  Byte Ptr [B69A],40 <- cam          nop
  4010.  
  4011. MOV  Byte Ptr [B69B],48 <- cam          nop
  4012.  
  4013. MOV  DX,CS:[0165]
  4014.  
  4015. MOV  DS,CS:[0167]
  4016.  
  4017. MOV  AX,2521  <- set hook
  4018.  
  4019. INT  21
  4020.  
  4021. POP  all
  4022.  
  4023. JMP  FAR CS:[0165]
  4024.  
  4025. Here you did change the instruction 740F in the instruction EB0F,
  4026.  
  4027. and you did "noop" the instructions at B697-B69B. (Well, more
  4028.  
  4029. elegantly than "noop" them with "90" bytes, you choose a INC AX,
  4030.  
  4031. DEC AX, NOP, INC AX, DEC AX sequence instead! There are sound
  4032.  
  4033. reasons to use a sequence of "working" instructions instead of
  4034.  
  4035. NOPs: recent protection schemes "smell" patched nops inside the
  4036.  
  4037. program and trash everything if they find more than -say- three
  4038.  
  4039. consecutive NOPs! You should always try to choose THE LESS
  4040.  
  4041. INTRUSIVE and MORE "CAMOUFLAGED" solution when you crack!)
  4042.  
  4043.      You can apply this kind of crack, on the same lines, to many
  4044.  
  4045. programs that perform self checking of the code and hook the
  4046.  
  4047. vectors.
  4048.  
  4049. REAL DISK ACCESS STUFF
  4050.  
  4051.      Now we may come to the subject of this lesson:
  4052.  
  4053.      As usual, let's begin from the beginning: history is always
  4054.  
  4055. the key that allows an understanding of present and future, in
  4056.  
  4057. cracking matters too. As the older 5 1/4 inch big black floppy
  4058.  
  4059. disks were still used (the 320K/8 tracks or 360K/9 tracks ones,
  4060.  
  4061. that were really "floppy" and have nowadays almost disappeared)
  4062.  
  4063. one of the more common methods to protect a program, was to
  4064.  
  4065. format the "master" (key) disk in a weird way. Old floppy disk
  4066.  
  4067. for the PC did usually store 360K at 9 sectors per track.
  4068.  
  4069.      Some basics for those of you that do not know anything: in
  4070.  
  4071. order to defeat this kind of cracks you need to know two things:
  4072.  
  4073. the floppy disk parameter block (FDPB) and the interrupt routines
  4074.  
  4075. dealing with format/read disk (basically INT_13).
  4076.  
  4077.      Most often, the protection scheme is to either format one
  4078.  
  4079. or more sectors or tracks with sector sizes other than the
  4080.  
  4081. standard 512 bytes, or to either give one of the sectors a wild
  4082.  
  4083. sector number like 211 or just not format a whole track of
  4084.  
  4085. eight/nine/15 sectors. If you, for instance, have got the same
  4086.  
  4087. (very old) copy of VisiCalc master I do, you'll find that sector
  4088.  
  4089. 8 on track 39 is missing entirely. The interrogation with
  4090.  
  4091. assembly or with an "ad hoc" utility (I use the tools I wrote
  4092.  
  4093. myself, but you 'll be able to find many such utilities in public
  4094.  
  4095. domain, the oldest one, from 1984 (!) being the seasoned [U-ZAP]
  4096.  
  4097. an "Ultra utility" from the "Freesoft company") will tell you
  4098.  
  4099. which sector numbers were altered, their size in bytes, and if
  4100.  
  4101. they were formatted with a CRC error (another not so fancy
  4102.  
  4103. trick).
  4104.  
  4105.      The floppy disk parameters are stored in the BIOS: interrupt
  4106.  
  4107. vector 1E contains the address of the floppy disk parameter
  4108.  
  4109. block. The FDPB's contents are the following:
  4110.  
  4111. Offset    Function                 crackworthy?        Example
  4112.  
  4113. 0    Step rate & head unload            no                  DF
  4114.  
  4115. 1    head load time                     no                  02
  4116.  
  4117. 2    Motor on delay                     no                  25
  4118.  
  4119. 3    Number of bytes per sector         yes                 02
  4120.  
  4121. 4    Last sector number                 yes                 12
  4122.  
  4123. 5    Gap length                         yes                 1B
  4124.  
  4125. 6    Data track length                  yes                 FF
  4126.  
  4127. 7    Format gap length                  yes                 54
  4128.  
  4129. 8    Format byte                        no                  F6
  4130.  
  4131. 9    Head settle time                   no                  0F
  4132.  
  4133. A    Motor start time                   no                  02
  4134.  
  4135. 0)   Offset #0: the left "nybble" (single digit) of this value
  4136.  
  4137.      is the step rate time for the disk drive head. The right
  4138.  
  4139.      nybble is the disk head unload time. These values are best
  4140.  
  4141.      left alone.
  4142.  
  4143. 1)   Offset #1: again, don't fool around with these values. The
  4144.  
  4145.      left nybble is the disk head load time, and the right
  4146.  
  4147.      nybble is the direct memory access mode select.
  4148.  
  4149. 2)   Wait time until motor is turned off. Not normally of use.
  4150.  
  4151. 3)   Bytes-per-sector value: AH-HAH! If you place a "0" in this
  4152.  
  4153.      value, the PC expects all sectors to be 128 bytes long. A
  4154.  
  4155.      "1" means a  sector size of 256 bytes, a "2" means 512
  4156.  
  4157.      bytes (this is the standard DOS value), and a "3" means
  4158.  
  4159.      1024 bytes per sector.
  4160.  
  4161. 4)   Highest sector number on a track: this is used for
  4162.  
  4163.      formatting and tells DOS how many sectors there are on each
  4164.  
  4165.      track.
  4166.  
  4167. 5)   Gap length for diskette reads: this is what you fool around
  4168.  
  4169.      with if you keep getting CRC errors when you try to read a
  4170.  
  4171.      non-standard size sector. Normally, you can just leave this
  4172.  
  4173.      alone except when formatting with a U-Format tool.
  4174.  
  4175. 6)   Data length: This contains the number of bytes in a sector
  4176.  
  4177.      when the value in table byte #4 doesn't contain a 0, 1, 2,
  4178.  
  4179.      or 3.
  4180.  
  4181. 7)   Number of bytes in the gap between sectors: this is also
  4182.  
  4183.      only used when formatting special tracks.
  4184.  
  4185. 8)   Format fill byte: When formatting, this is the
  4186.  
  4187.      initialization byte that will be placed in all new sectors.
  4188.  
  4189. 9)   Head settle time: leave this alone.
  4190.  
  4191. A)   Motor start time: don't fool with this either.
  4192.  
  4193. In order to modify globally the number of tracks on a given disk
  4194.  
  4195. and the number of sectors per track you can always format with
  4196.  
  4197. the DOS command switches "/t:" and "/n:"
  4198.  
  4199.                   FORMAT /t:tracks /n:sectors
  4200.  
  4201.      If you want to find out what the existing parameters are,
  4202.  
  4203. run [Debug.exe] or [Symdeb.exe] and enter the following commands:
  4204.  
  4205. -    d 0:78    l 4                 <- get FDPB address
  4206.  
  4207.  0000:0070     22 05 00       <- debugger's likely response
  4208.  
  4209. -    d 0:522   l a                 <- get 10 FDPB values
  4210.  
  4211.  0000:520 DF 02 25 02 12 1B FF...  <- see preceding table
  4212.  
  4213.      Remember that all standard disk formats under DOS support
  4214.  
  4215. a sector size of 512 bytes, therefore, for one-sided 5.25 inch
  4216.  
  4217. floppies:
  4218.  
  4219.                40t*8s*512b=163.840 bytes (160Kb)
  4220.  
  4221.                40t*9s*512b=184.320 bytes (180Kb)
  4222.  
  4223. and for two-sided 5.25 inch floppies:
  4224.  
  4225.            40t*8s*512b*2sides=327.680 bytes (320Kb)
  4226.  
  4227.            40t*9s*512b*2sides=368.640 bytes (360Kb)
  4228.  
  4229.      Beginning with DOS version 3.0 (Yeah, more and more
  4230.  
  4231. history!) a new floppy disk format has been supported: The IBM
  4232.  
  4233. AT (80286 CPU) introduced the so called "high capacity" 5.25 u-
  4234.  
  4235. inch floppy, capable of storing 1.2M at 15 sectors per track:
  4236.  
  4237.           80t*15s*512b*2sides=1.228.800 bytes (1.2Mb)
  4238.  
  4239.      Later on were introduced the to-day universally used 3.5
  4240.  
  4241. inch floppies, the ones inside a rigid small plastic cartridge,
  4242.  
  4243. and we have, similarly:
  4244.  
  4245.              3.5-inch double sided/double density      720K
  4246.  
  4247.             3.5-inch double sided/quad density (HD)    1440K
  4248.  
  4249.               3.5-inch double sided/high density       2880K
  4250.  
  4251. [INT_13, AH=18, Set media type for format]
  4252.  
  4253.      In order to create weird layouts, the protectionists use
  4254.  
  4255. interrupt 13h, service 18h, that specifies to the formatting
  4256.  
  4257. routines the number of tracks and sectors per track to be placed
  4258.  
  4259. on the media:
  4260.  
  4261. *    Registers on entry: AH=18h; CH=N° of tracks; CL= Sectors
  4262.  
  4263.      per track; DL= Drive number (A=0; B=1;C=2... bit 7 is set
  4264.  
  4265.      if the drive is an hard disk)
  4266.  
  4267. *    Registers on Return: DI: Offset address of 11-byte
  4268.  
  4269.      parameter table; ES: Segment address of 11-byte parameter
  4270.  
  4271.      table.
  4272.  
  4273. [INT_13, AH=2, Read disk sectors]
  4274.  
  4275. In order to read them, they have to use INT_13, service 2, read
  4276.  
  4277. disk sectors, with following layout:
  4278.  
  4279. *    Registers on entry: AH=2h; AL= N° of sectors; BX= Offset
  4280.  
  4281.      address of data buffer; CH=track; CL= Sector; DH= Head
  4282.  
  4283.      (side) number; DL= Drive number; ES: Segment address of
  4284.  
  4285.      data buffer.
  4286.  
  4287. *    Registers on Return: AH= return code. If the carry flag is
  4288.  
  4289.      not set, AH=0, therefore the weird sector has been read, if
  4290.  
  4291.      on the contrary the carry flag is set, AH reports the
  4292.  
  4293.      status byte as follows:
  4294.  
  4295. 76543210  HEX  DEC       Meaning
  4296.  
  4297. 1         80h  128       Time out - drive crazy
  4298.  
  4299.  1        40h  064       Seek failure, could not move to track
  4300.  
  4301.   1       20h  032       Controller kaputt
  4302.  
  4303.    1      10h  016       Bad CRC on disk read
  4304.  
  4305.     1     09h  009       DMA error - 64K boundary crossed
  4306.  
  4307.     1     08h  008       DMA overrun
  4308.  
  4309.      1    04h  004       Bad sector - sector not found
  4310.  
  4311.       11  03h  003       Write protect!
  4312.  
  4313.       1   02h  002       Bad sector ID (address mark
  4314.  
  4315.        1  01h  001       Bad command
  4316.  
  4317. [Return code AH=9: DMA boundary error]
  4318.  
  4319.      One of the possible errors should be explained, coz it is
  4320.  
  4321. used in some protection schemes: AH=9 DMA boundary error, means
  4322.  
  4323. that an illegal boundary was crossed when the in formation was
  4324.  
  4325. placed into RAM. DMA (Direct memory access) is used by the disk
  4326.  
  4327. service routines to place information into RAM. If a memory
  4328.  
  4329. offset address ending in three zeros (ES:1000, ES: 2000...) falls
  4330.  
  4331. in the middle of the area being overlaid by a sector, this error
  4332.  
  4333. will occur.
  4334.  
  4335. [INT_13, AH=4 Verify disk sectors]
  4336.  
  4337.      Another possible protection interrupt is interrupt 13H,
  4338.  
  4339. service 4, Verify disk sectors. Disk verification takes place on
  4340.  
  4341. the disk and DOES NOT involve verification of the data on the
  4342.  
  4343. disk against data in memory! This function has no buffer
  4344.  
  4345. specification, does not read or write a disk: it causes the
  4346.  
  4347. system to read the data in the designated sector or sectors and
  4348.  
  4349. to check its computed cyclic redundancy check (CRC) against data
  4350.  
  4351. stored on the disk. See INT_13, AH=2 registers and error report.
  4352.  
  4353. [CRC]
  4354.  
  4355.      The CRC is a checksum, that detects general errors. When a
  4356.  
  4357. sector is written to disk, an original CRC is calculated AND
  4358.  
  4359. WRITTEN ALONG with the sector data. The verification service
  4360.  
  4361. reads the sector, recalculates the CRC, and compares the
  4362.  
  4363. recalculated CRC with the original CRC.
  4364.  
  4365.      We saw that some protection schemes attempt to disguise
  4366.  
  4367. interrupt calls. This is particularly frequent in the disk access
  4368.  
  4369. protection schemes that utilize INT_13 (the "disk" interrupt).
  4370.  
  4371.      If you are attempting to crack such programs, the usual
  4372.  
  4373. course of action is to search for occurrences of "CD13", which
  4374.  
  4375. is machine language for interrupt 13. One way or another, the
  4376.  
  4377. protection scheme has to use this interrupt to check for the
  4378.  
  4379. special sectors of the disk. If you examine a cross section of
  4380.  
  4381. the program, however, you'll find programs which do not have
  4382.  
  4383. "CD13" in their machine code, but which clearly are checking the
  4384.  
  4385. key disk for weird sectors. How comez?
  4386.  
  4387.      There are several techniques which can be used to camouflage
  4388.  
  4389. the protection scheme from our nice prying eyes. I'll describe
  4390.  
  4391. here the three such techniques that are more frequent:
  4392.  
  4393. 1)   The following section of code is equivalent to issuing an
  4394.  
  4395. INT 13 command to read one sector from drive A, side 0, track
  4396.  
  4397. 29h, sector ffh, and then checking for a status code of 10h:
  4398.  
  4399.      cs:1000   MOV  AH,02     ;read operation
  4400.  
  4401.      cs:1002   MOV  AL,01     ;1 sector to read
  4402.  
  4403.      cs:1004   MOV  CH,29     ;track 29h
  4404.  
  4405.      cs:1006   MOV  CL,FF     ;sector ffh
  4406.  
  4407.      cs:1008   MOV  DX,0000   ;side 0, drive A
  4408.  
  4409.      cs:100B   XOR  BX,BX     ;move 0...
  4410.  
  4411.      cs:100D   MOV  DS,BX     ;...to DS register
  4412.  
  4413.      cs:100F   PUSHF          ;pusha flags
  4414.  
  4415.      cs:1010   PUSH CS        ;pusha CX
  4416.  
  4417.      cs:1011   CALL 1100      ;push address for next
  4418.  
  4419.                               instruction onto stack and branch
  4420.  
  4421.      cs:1014   COMP AH,10     ;check CRC error
  4422.  
  4423.      cs:1017   ... rest of verification code
  4424.  
  4425.      ...
  4426.  
  4427.      ...
  4428.  
  4429.      cs:1100   PUSHF          ;pusha flags
  4430.  
  4431.      cs:1101   MOV  BX,004C   ;address of INT_13 vector
  4432.  
  4433.      cs:1104   PUSH [BX+02]   ;push CS of INT_13 routine
  4434.  
  4435.      cs:1107   PUSH [BX]      ;push IP of INT_13 routine
  4436.  
  4437.      cs:1109   IRET           ;pop IP,CS and flags
  4438.  
  4439. Notice that there is no INT 13 command in the source code, so if
  4440.  
  4441. you had simply used a debugger to search for "CD13" in the
  4442.  
  4443. machine code, you would never have found the protection routine.
  4444.  
  4445. 2)   Another technique is to put in a substitute interrupt
  4446.  
  4447. instruction, such as INT 10, which looks harmless enough, and
  4448.  
  4449. have the program change the "10" to "13 (and then back to "10")
  4450.  
  4451. on the fly. A search for "CD13" would turn up nothing.
  4452.  
  4453. 3)   The best camouflage method for interrupts I have ever
  4454.  
  4455. cracked (albeit not on a INT 13) was a jump to a section of the
  4456.  
  4457. PROGRAM code that reproduces in extenso the interrupt code. This
  4458.  
  4459. elegant (if a little overbloated) disguise mocks every call to
  4460.  
  4461. the replicated interrupt.
  4462.  
  4463. LOADING ABSOLUTE DISK SECTORS
  4464.  
  4465. Old good [debug.com] has been called the "swiss army knife" of
  4466.  
  4467. the cracker. It allows a lot of nice things, inter alia the
  4468.  
  4469. loading, reading, modifying and writing of absolute sectors of
  4470.  
  4471. the disks. The sector count starts with the first sector of track
  4472.  
  4473. 0, next sector is track 0, second side (if double sided), then,
  4474.  
  4475. back to the first side, track 1, and so on, until the end of the
  4476.  
  4477. disk. Up to 80h (128) sectors can be loaded at one time. To use
  4478.  
  4479. you must specify starting address, drive (0=A, 1=B, etc...),
  4480.  
  4481. starting sector and number of sectors to load.
  4482.  
  4483.                                -   l 100 0 10 20
  4484.  
  4485. This instruction tells DEBUG to load, starting at DS:0100, from
  4486.  
  4487. drive A, sector 10h for 20h sectors. This allows at times the
  4488.  
  4489. retrieval of hidden and/or weird formatted data. If you get an
  4490.  
  4491. error, check the memory location for that data. Often times, part
  4492.  
  4493. of the data has been transferred before the error occurs, and the
  4494.  
  4495. remainder can be manually entered or gathered through repetitive
  4496.  
  4497. retries.
  4498.  
  4499. Bear all this in mind learning the following cracks.
  4500.  
  4501. Let's now crack an "oldie" primitive:
  4502.  
  4503. MS Flight simulator (old version 2.12, from 1985!)
  4504.  
  4505. This old program used -in 1985!- following beautiful protection
  4506.  
  4507. scheme: on the disk you had only a "stub", called FS.COM with few
  4508.  
  4509. bytes, which had following instructions:
  4510.  
  4511. loc   code           instruction        what's going on
  4512.  
  4513. -------------------------------------------------------
  4514.  
  4515. :0100 FA             CLI                ;why not?
  4516.  
  4517. :0101 33C0           XOR AX,AX          ;ax=0
  4518.  
  4519. :0103 8ED0           MOV SS,AX          ;ss=0
  4520.  
  4521. :0105 BCB0C0         MOV SP,C0B0        ;SP=C0B0
  4522.  
  4523. :0108 8EC0           MOV ES,AX          ;ES=0
  4524.  
  4525. :010A 26C70678003001 MOV Wptr ES:[0078],0130 ;Wp 0:78=130
  4526.  
  4527. :0111 268C0E7A00     MOV ES:[007A],CS   ;0:7A=Segment
  4528.  
  4529. :0116 BB0010         MOV BX,1000        ;BX=1000
  4530.  
  4531. :0119 8EC3           MOV ES,BX          ;ES=1000
  4532.  
  4533. :011B 33DB           XOR BX,BX          ;BX=0
  4534.  
  4535. :011D B80102         MOV AX,0201        ;AH=2 AL=1 sector
  4536.  
  4537. :0120 BA0000         MOV DX,0000        ;head=0 drive=0
  4538.  
  4539. :0123 B96501         MOV CX,0165        ;track=1 sector=65 (!)
  4540.  
  4541. :0126 CD13           INT 13             ;INT 13/AH=2
  4542.  
  4543. :0128 B83412         MOV AX,1234        ;AX=1234
  4544.  
  4545. :012B EA00000010     JMP 1000:0000      ;JMP to data we just read
  4546.  
  4547. :0130 CF             IRET               ;Pavlovian, useless ret
  4548.  
  4549.      You see what's happening in this old protection scheme,
  4550.  
  4551. don't you? Herein you can watch the same snap that happens in
  4552.  
  4553. more recent (much more recent) protection schemes (as you'll see
  4554.  
  4555. in the next lesson): the protection searches for a weird
  4556.  
  4557. formatted sector and/or for particular data.
  4558.  
  4559.      That should be no problem for you any more: you should just
  4560.  
  4561. reverse engineer everything (and that goes on pretty quickly:
  4562.  
  4563. just watch and break on the INT_13 calls), fetch the "weird"
  4564.  
  4565. data, tamper the whole crap and have your soup as you like it.
  4566.  
  4567.      One more word about "old" protection schemes. Be careful not
  4568.  
  4569. to spurn them! Some of them are
  4570.  
  4571.      -- CLEVER
  4572.  
  4573.      -- STILL USED
  4574.  
  4575.      -- DIFFICULT TO CRACK... I mean, this older DOS programs had
  4576.  
  4577. nice protections... it's pretty annoying to crack windows
  4578.  
  4579. programs that require a registration number: as you saw in Lesson
  4580.  
  4581. 3, you just type your name and a serial number of your choice in,
  4582.  
  4583. say "666666666", break into the program with WINICE, search the
  4584.  
  4585. "666666666" and search too, for good measure, your own name, set
  4586.  
  4587. a memory read breakpoint where the number dwells and look at the
  4588.  
  4589. code that manipulates your input. As [Chris] rightly pointed out,
  4590.  
  4591. you can even rip the code straight out of the program and create
  4592.  
  4593. a key generator which will produce a valid code. This code will
  4594.  
  4595. work for any name you typed in only in the "pure maths
  4596.  
  4597. manipulation" protection schemes, and will on the contrary be
  4598.  
  4599. specific, following the name you typed in, the "alpha-maths
  4600.  
  4601. manipulation" protection schemes (like MOD4WIN, see the Windows
  4602.  
  4603. lessons), watch in this case the "pseudo-random xoring" of the
  4604.  
  4605. letters that compose your name.
  4606.  
  4607.      -- STUNNING, coz new ideas have always been infrequent, and
  4608.  
  4609. they are getting more and more rare in this objectionable world
  4610.  
  4611. of lazy, incapable programmers patronizing us with ill-cooked
  4612.  
  4613. outrages like Windows'95... yeah, as usual there is no
  4614.  
  4615. "development" at all, quite the contrary, I would say. Take a
  4616.  
  4617. step backward, sip a good Martini-Wodka (please remember that
  4618.  
  4619. only Ice cubes, Dry Martini, Wodka Moskovskaja, Schweppes'
  4620.  
  4621. "Indian tonic" a green olive from Tuskany and a maltese lemon
  4622.  
  4623. zest will really be perfect) and watch from your balcony, with
  4624.  
  4625. unsullied eyes, your town and the people around you: slaves
  4626.  
  4627. everywhere, leaving home at 7.30 in the morning, stinking in a
  4628.  
  4629. progression of identical cars, forced to interminably watch
  4630.  
  4631. advertisement panels and endlessly listen to boorish publicity,
  4632.  
  4633. happy to go to work (if they happen to have the "luck" to work,
  4634.  
  4635. in this inequitable society) the whole day long in order to
  4636.  
  4637. produce other cars in order to buy, one day, a new car with a
  4638.  
  4639. different colour...
  4640.  
  4641.      Why people don't look at the stars, love each other, feel
  4642.  
  4643. the winds, ban the stinking cars from the places where they live
  4644.  
  4645. and eat, study colours... name yourself a not-consumistic
  4646.  
  4647. activity? Why don't they read any poems any more? No poetry any
  4648.  
  4649. more, in the grey society of the publicity-spots slaves...poetry
  4650.  
  4651. will soon be forbidden, coz you cannot CONSUME as you read poems,
  4652.  
  4653. and in this farce of a society you are BOUND to consume, that's
  4654.  
  4655. the only thing they want you to do... you are CULTIVATED to
  4656.  
  4657. consume... no books worth to read any more... stupid american
  4658.  
  4659. conventional cram everywhere... boy, at times I'm missing some
  4660.  
  4661. well placed neutron bombs, the ones that would kill all these
  4662.  
  4663. useless zombies and leave noble books and good Wodka untouched.
  4664.  
  4665. It's difficult to believe in democracy any more... if I ever
  4666.  
  4667. did... all the useless zombie do -unfortunately- vote, and they
  4668.  
  4669. do vote for "smiling semblances", for "conventionally minded
  4670.  
  4671. idiots" that so act as if they would "really" be like what they
  4672.  
  4673. "look" like and could not care less about anything else than
  4674.  
  4675. making bucks and defend intolerant and petty patterns. The slaves
  4676.  
  4677. choose the people they have "seen" on TV... as if the egyptians
  4678.  
  4679. would VOTE for their pharaohs, exhilarated under the whips of
  4680.  
  4681. publicity... sorry, at times I forget that you are here for the
  4682.  
  4683. cracks, and could not care less about what I think...
  4684.  
  4685.      You 'll obtain the OTHER missing lessons IF AND ONLY IF you
  4686.  
  4687. mail me back (via anon.penet.fi) with some tricks of the trade
  4688.  
  4689. I may not know that YOU discovered. Mostly I'll actually know
  4690.  
  4691. them already, but if they are really new you'll be given full
  4692.  
  4693. credit, and even if they are not, should I judge that you
  4694.  
  4695. "rediscovered" them with your work, or that you actually did good
  4696.  
  4697. work on them, I'll send you the remaining lessons nevertheless.
  4698.  
  4699. Your suggestions and critics on the whole crap I wrote are also
  4700.  
  4701. welcomed.
  4702.  
  4703.                                 E-mail +ORC
  4704.  
  4705.                         +ORC an526164@anon.penet.fi
  4706.                      HOW TO CRACK, by +ORC, A TUTORIAL
  4707.  
  4708. ---------------------------------------------------------------------------
  4709.  
  4710.                         Lesson 6.1: Funny tricks (1)
  4711.  
  4712. ---------------------------------------------------------------------------
  4713.  
  4714. LESSON 6 (1) - Funny tricks.  Xoring, Junking, Sliding
  4715.  
  4716. EXERCISE 01: [LARRY in search of the King]
  4717.  
  4718.      Before the next step let's resume what you have learned in
  4719.  
  4720. the lessons 3-5, beginning with a very simple crack exercise
  4721.  
  4722. (again, we'll use the protection scheme of a game, for the
  4723.  
  4724. reasons explained in lesson 1): SEARCH FOR THE KING (Version
  4725.  
  4726. 1.1.). This old "Larry" protection sequence, is a "paper
  4727.  
  4728. protection" primitive. It's a very widespread (and therefore easy
  4729.  
  4730. to find) program, and one of the first programs that instead of
  4731.  
  4732. asking meaningful passwords (which offer us the possibility to
  4733.  
  4734. immediately track them down in memory) asked for a random number
  4735.  
  4736. that the good buyer could find on the manual, whereby the bad
  4737.  
  4738. cracker could not. (Here you choose -with the mouse- one number
  4739.  
  4740. out of 5 possible for a "gadget" choosen at random). I don't need
  4741.  
  4742. any more to teach you how to find the relevant section of code
  4743.  
  4744. (-> see lesson 3). Once you find the protection, this is what you
  4745.  
  4746. get:
  4747.  
  4748. :protection_loop
  4749.  
  4750.  :C922 8E0614A3       MOV     ES,[A314]
  4751.  
  4752. ...
  4753.  
  4754.  :C952 50 0E          PUSH    AX & CS
  4755.  
  4756.  :C954 E81BFF         CALL    C872      <- call protection scheme
  4757.  
  4758.  :C957 5B             POP     BX twice
  4759.  
  4760.  :C959 8B76FA         MOV     SI,[BP-06] <- prepare store_room
  4761.  
  4762.  :C95C D1E6           SHL     SI,1       <- final prepare
  4763.  
  4764.  :C95E 8942FC         MOV     [BP+SI-04],AX  <- store AX
  4765.  
  4766.  :C961 837EFA00       CMP     Word Ptr [BP-06],+00  <- good_guy?
  4767.  
  4768.  :C965 75BB           JNZ     C922           <- loop, bad guy
  4769.  
  4770.  :C967 8E0614A3       MOV     ES,[A314]
  4771.  
  4772.  :C96B 26F606BE3501   TEST    Byte Ptr ES:[35BE],01  <- bad_guy?
  4773.  
  4774.  :C971 74AF           JZ C922                <- loop, bad guy
  4775.  
  4776.  :C973 8B46FC         MOV     AX,[BP-04]...  <- go on good guy
  4777.  
  4778. Let's see now the protection scheme called from :C954
  4779.  
  4780.  :C872 55             PUSH    BP
  4781.  
  4782. ...
  4783.  
  4784.  :C8F7 90             NOP
  4785.  
  4786.  :C8F8 0E             PUSH    CS
  4787.  
  4788.  :C8F9 E87234         CALL    FD6E <- call user input
  4789.  
  4790.  :C8FC 5B             POP     BX
  4791.  
  4792.  :C8FD 5B             POP     BX
  4793.  
  4794.  :C8FE 8B5E06         MOV     BX,[BP+06]
  4795.  
  4796.  :C901 D1E3           SHL     BX,1
  4797.  
  4798.  :C903 39872266       CMP     [BX+6622],AX  <- right answer?
  4799.  
  4800.  :C907 7505           JNZ     C90E      <- no, beggar_off
  4801.  
  4802.  :C909 B80100         MOV     AX,0001   <- yes, AX=1
  4803.  
  4804.  :C90C EB02           JMP     C910
  4805.  
  4806.  :C90E 2BC0           SUB     AX,AX     <- beggar_off with AX=0
  4807.  
  4808.  :C910 8BE5           MOV     SP,BP
  4809.  
  4810.  :C912 5D             POP     BP
  4811.  
  4812.  :C913 CB             RETF              <- back to main
  4813.  
  4814. Here follow 5 questions, please answer all of them:
  4815.  
  4816. 1)   Where in memory (in which locations) are stored the "right"
  4817.  
  4818.      passnumbers? Where in memory is the SEGMENT of this
  4819.  
  4820.      locations stored? How does the scheme get the OFFSET?
  4821.  
  4822. 2)   Would setting NOPs instructions at :C965 and :C971 crack?
  4823.  
  4824.      Would it be a good idea?
  4825.  
  4826. 3)   Would changing :C907 to JZ crack? Would it be a good idea?
  4827.  
  4828. 4)   Would changing :C907 to JNZ C909 crack? Would it be a good
  4829.  
  4830.      idea?
  4831.  
  4832. 5)   Write down (and try) at least 7 OTHER different patches to
  4833.  
  4834.      crack this scheme in spades (without using any NOP!).
  4835.  
  4836. Uff! By now you should be able to do the above 5 exercises in
  4837.  
  4838. less than 15 minutes WITHOUT USING THE DEBUGGER! Just look at the
  4839.  
  4840. data above and find the right answers feeling them... (you 'll
  4841.  
  4842. now which one are the right one checking with your debugger...
  4843.  
  4844. score as many points as you like for each correct answer and sip
  4845.  
  4846. a good Martini-Wodka... do you know that the sequence should
  4847.  
  4848. ALWAYS be 1) Ice cubes 2) Martini Dry 3) Wodka Moskovskaja 4)
  4849.  
  4850. olive 5) lemon 6) Schweppes Indian tonic?
  4851.  
  4852. Let's now come to the subject of this lesson:
  4853.  
  4854. -----> [Xoring] (Simple encryption methods)
  4855.  
  4856.      One easy way to encrypt data is the XOR method. XOR is a bit
  4857.  
  4858. manipulation instruction that can be used in order to cipher and
  4859.  
  4860. decipher data with the same key:
  4861.  
  4862.  Byte to encrypt                   key            result
  4863.  
  4864.      FF                  XOR       A1               5E
  4865.  
  4866.      5E                  XOR       A1               FF
  4867.  
  4868. As you can see XOR offers a very easy way to encrypt or to
  4869.  
  4870. decrypt data, for instance using the following routine:
  4871.  
  4872.  encrypt_decrypt:
  4873.  
  4874.      mov  bx, offset_where_encryption/decryption_starts
  4875.  
  4876.  xor_loop:
  4877.  
  4878.      mov  ah, [bx]            <-   get current byte
  4879.  
  4880.      xor  ah, encrypt_value   <-   engage/disengage xor
  4881.  
  4882.      mov [bx], ah             <-   back where you got it
  4883.  
  4884.      inc  bx                  <-   ahead one byte
  4885.  
  4886.      cmp  bx, offset_start_+_size  <- are we done?
  4887.  
  4888.      jle  xor_loop            <-   no, then next cycle
  4889.  
  4890.      ret                      <-   back where we came from
  4891.  
  4892. The encrypt_value can be always the same (fixed) or chosen at
  4893.  
  4894. random, for instance using INT_21, service 2Ch (get current time)
  4895.  
  4896. and choosing as encrypt_value the value reported in DL (but
  4897.  
  4898. remembering to discard the eventual value 0, coz otherwise it
  4899.  
  4900. would not xor anything at all!)
  4901.  
  4902.  random_value:
  4903.  
  4904.      mov  ah,2Ch
  4905.  
  4906.      int  21h
  4907.  
  4908.      cmp  dl,0
  4909.  
  4910.      je   random_value
  4911.  
  4912.      mov  encrypt_value,dl
  4913.  
  4914.      The problem with XORing (and with many other encryption
  4915.  
  4916. methods), is that the part of the code that calls the encryption
  4917.  
  4918. routine cannot be itself encrypted. You'll somewhere have, "in
  4919.  
  4920. clear" the encryption key.
  4921.  
  4922.      The protectionist do at times their best to hide the
  4923.  
  4924. decrypting routine, here are some common methods:
  4925.  
  4926. -----> JUNK FILLING, SLIDING KEYS AND MUTATING DECRYPTORS
  4927.  
  4928.   These are the more common protection method for the small
  4929.  
  4930. decryption part of the program code. This methods, originally
  4931.  
  4932. devised to fool signature virus scanners, have been pinched from
  4933.  
  4934. the polymorphic virus engines of our fellows viriwriters, and are
  4935.  
  4936. still in use for many simple decryption protection schemes. For
  4937.  
  4938. parts of the following many thanks go to the [Black Baron], it's
  4939.  
  4940. a real pity that so many potential good crackers dedicate so much
  4941.  
  4942. time to useless (and pretty repetitive) virus writing instead of
  4943.  
  4944. helping in our work. This said, virus studying is VERY important
  4945.  
  4946. for crackers coz the code of the viri is
  4947.  
  4948. *    ULTRAPROTECTED
  4949.  
  4950. *    TIGHT AND EFFECTIVE
  4951.  
  4952. *    CLOAKED AND CONCEALED.
  4953.  
  4954. Let's show as example of the abovementioned protection tactics
  4955.  
  4956. the following ultra-simple decryptor:
  4957.  
  4958.           MOV      SI,jumbled_data     ;Point to the jumbled data
  4959.  
  4960.           MOV      CX,10               ;Ten bytes to decrypt
  4961.  
  4962. mn_loop:  XOR      BYTE PTR [SI],44    ;XOR (un_scramble!) a byte
  4963.  
  4964.           INC      SI                  ;Next byte
  4965.  
  4966.           LOOP     mn_loop             ;Loop the 9 other bytes
  4967.  
  4968. This small program will XOR the ten bytes at the location pointed
  4969.  
  4970. to by SI with the value 44.  Providing the ten bytes were XORed
  4971.  
  4972. with 44 prior to running this decryptor the ten bytes will be
  4973.  
  4974. restored to their original state.
  4975.  
  4976. In this very simple case the "key" is the value 44. But there are
  4977.  
  4978. several tricks involving keys, the simplest one being the use of
  4979.  
  4980. a "sliding" key: a key that will be increased, or decreased, or
  4981.  
  4982. multiplied, or bit-shifted, or whatever, at every pass of the
  4983.  
  4984. loop.
  4985.  
  4986. A possible protection can also create a true "Polymorph"
  4987.  
  4988. decryptor, a whole decryptor ROUTINE that looks completely
  4989.  
  4990. different on each generation. The trick is to pepper totally
  4991.  
  4992. random amounts of totally random instructions, including JUMPS
  4993.  
  4994. and CALLS, that DO NOT AFFECT the registers that are used for the
  4995.  
  4996. decryption. Also this kind of protection oft uses a different
  4997.  
  4998. main decryptor (possibly from a selection of pre-coded ones) and
  4999.  
  5000. oft alters on each generation also all the registers that the
  5001.  
  5002. decryptor uses, invariably making sure that the JUNK code that
  5003.  
  5004. it generates doesn't destroy any of the registers used by the
  5005.  
  5006. real decryptor!  So, with these rules in mind, here is our simple
  5007.  
  5008. decryptor again:
  5009.  
  5010.          MOV      DX,10              ;Real part of the decryptor!
  5011.  
  5012.          MOV      SI,1234            ;junk
  5013.  
  5014.          AND      AX,[SI+1234]       ;junk
  5015.  
  5016.          CLD                         ;junk
  5017.  
  5018.          MOV      DI,jumbled_data    ;Real part of the decryptor!
  5019.  
  5020.          TEST     [SI+1234],BL       ;junk
  5021.  
  5022.          OR       AL,CL              ;junk
  5023.  
  5024. mn_loop: ADD      SI,SI              ;junk instr, but real loop!
  5025.  
  5026.          XOR      AX,1234            ;junk
  5027.  
  5028.          XOR      BYTE PTR [DI],44   ;Real part of the decryptor!
  5029.  
  5030.          SUB      SI,123             ;junk
  5031.  
  5032.          INC      DI                 ;Real part of the decryptor!
  5033.  
  5034.          TEST     DX,1234            ;junk
  5035.  
  5036.          AND      AL,[BP+1234]       ;junk
  5037.  
  5038.          DEC      DX                 ;Real part of the decryptor!
  5039.  
  5040.          NOP                         ;junk
  5041.  
  5042.          XOR      AX,DX              ;junk
  5043.  
  5044.          SBB      AX,[SI+1234]       ;junk
  5045.  
  5046.          AND      DX,DX              ;Real part of the decryptor!
  5047.  
  5048.          JNZ      mn_loop            ;Real part of the decryptor!
  5049.  
  5050. As you should be able to see, quite a mess! But still executable
  5051.  
  5052. code. It is essential that any junk code generated by the
  5053.  
  5054. Polymorph protection is executable, as it is going to be peppered
  5055.  
  5056. throughout the decryptor. Note, in this example, that some of the
  5057.  
  5058. junk instructions use registers that are actually used in the
  5059.  
  5060. decryptor! This is fine, providing the values in these
  5061.  
  5062. registers aren't destroyed. Also note, that now we have random
  5063.  
  5064. registers and random instructions on each generation. So, a
  5065.  
  5066. Polymorph protection Engine can be summed up into three major
  5067.  
  5068. parts:
  5069.  
  5070.   1 .. The random number generator.
  5071.  
  5072.   2 .. The junk code generator.
  5073.  
  5074.   3 .. The decryptor generator.
  5075.  
  5076. There are other discrete parts but these three are the ones where
  5077.  
  5078. most of the work goes on!
  5079.  
  5080. How does it all work?  Well a good protection would
  5081.  
  5082. *    choose a random selection of registers to use for the
  5083.  
  5084. decryptor and leave the remaining registers as "junk" registers
  5085.  
  5086. for the junk code generator.
  5087.  
  5088. *    choose one of the compressed pre-coded decryptors.
  5089.  
  5090. *    go into a loop generating the real decryptor, peppered with
  5091.  
  5092. junk code.
  5093.  
  5094. From the protectionist's point of view, the advantages of this
  5095.  
  5096. kind of method are mainly:
  5097.  
  5098. *    the casual cracker will have to sweat to find the decryptor.
  5099.  
  5100. *    the casual cracker will not be able to prepare a "patch" for
  5101.  
  5102. the lamers, unless he locates and patches the generators, (that
  5103.  
  5104. may be compressed) coz otherwise the decryptor will vary every
  5105.  
  5106. time.
  5107.  
  5108. To defeat this kind of protection you need a little "zen" feeling
  5109.  
  5110. and a moderate knowledge of assembler language... some of the
  5111.  
  5112. junk instructions "feel" quite singular when you look at them
  5113.  
  5114. (->see lesson B). Besides, you (now) know what may be going on
  5115.  
  5116. and memory breakpoints will immediately trigger on decryption...
  5117.  
  5118. the road is open and the rest is easy (->see lessons 3-5).
  5119.  
  5120. -----> Starting point number magic
  5121.  
  5122. For example, say the encrypted code started at address 10h, the
  5123.  
  5124. following could be used to index this address:
  5125.  
  5126.  MOV   SI,10h         ;Start address
  5127.  
  5128.  MOV   AL,[SI]        ;Index from initial address
  5129.  
  5130. But sometimes you'll instead find something like the following,
  5131.  
  5132. again based on the encrypted code starting at address 10h:
  5133.  
  5134.  MOV   DI,0BFAAh      ;Indirect start address
  5135.  
  5136.  MOV   AL,[DI+4066h)  ;4066h + 0BFAAh = 10010h (and FFFF = 10h)!!
  5137.  
  5138. The possible combinations are obviously infinite.
  5139.  
  5140. [BIG KEYS] (Complicated encryption methods)
  5141.  
  5142.      Prime number factoring is the encryption used to protect
  5143.  
  5144. sensible data and very expensive applications. Obviously for few
  5145.  
  5146. digit keys the decoding is much easier than for, say, 129 or 250
  5147.  
  5148. digit keys. Nevertheless you can crack those huge encryption too,
  5149.  
  5150. using distributed processing of quadratic sieve equations (which
  5151.  
  5152. is far superior for cracking purpose to the sequential processing
  5153.  
  5154. methods) in order to break the key into prime numbers. To teach
  5155.  
  5156. you how to do this sort of "high" cracking is a little outside
  5157.  
  5158. the scope of my tutorial: you'll have to write a specific short
  5159.  
  5160. dedicated program, linking together more or less half a thousand
  5161.  
  5162. PC for a couple of hours, for a 250 bit key, this kind of things
  5163.  
  5164. have been done quite often on Internet, were you can also find
  5165.  
  5166. many sites that do untangle the mysteries (and vagaries) of such
  5167.  
  5168. techniques.
  5169.  
  5170.   As References I would advocate the works of Lai Xueejia, those
  5171.  
  5172. swiss guys can crack *everything*. Begin with the following:
  5173.  
  5174. Xuejia Lai, James Massey, Sean Murphy, "Markov Ciphers and
  5175.  
  5176.      Differential Cryptanalysis", Advances in Cryptology,
  5177.  
  5178.      Eurocrypt 1991.
  5179.  
  5180. Xuejia Lai, "On the Design and Security of Block Ciphers",
  5181.  
  5182.      Institute for Signal and Information Processing,
  5183.  
  5184.      ETH-Zentrum, Zurich, Switzerland, 1992
  5185.  
  5186. Factoring and primality testing is obviously very important for
  5187.  
  5188. this kind of crack. The most comprehensive work I know of is:
  5189.  
  5190. (300 pages with lengthy bibliography!)
  5191.  
  5192.     W. Bosma & M. van der Hulst
  5193.  
  5194.     Primality Testing with Cyclotomy
  5195.  
  5196.     Thesis, University of Amsterdam Press.
  5197.  
  5198. A very good old book you can incorporate in your probes to build
  5199.  
  5200. very effective crack programs (not only for BBS accesses :=) is
  5201.  
  5202. *the* "pomerance" catalog:
  5203.  
  5204. Pomerance, Selfridge, & Wagstaff Jr.
  5205.  
  5206.     The pseudoprimes to 25*10^9
  5207.  
  5208.     Math. Comp. Vol 35 1980 pp. 1003-1026
  5209.  
  5210. Anyway... make a good search with Lykos, and visit the relevant
  5211.  
  5212. sites... if encryption really interests you, you'll be back in
  5213.  
  5214. two or three (or thirty) years and you'll resume cracking with
  5215.  
  5216. deeper erudite knowledge.
  5217.  
  5218. [PATENTED PROTECTION SYSTEMS]
  5219.  
  5220.   The study of the patented enciphering methods is also *quite*
  5221.  
  5222. interesting for our aims :=) Here are some interesting patents,
  5223.  
  5224. if you want to walk these paths get the complete texts:
  5225.  
  5226.      [BEST]    USPat 4168396 to Best discloses a microprocessor
  5227.  
  5228. for executing enciphered programs. Computer programs which have
  5229.  
  5230. been enciphered during manufacture to deter the execution of the
  5231.  
  5232. programs in unauthorized computers, must be decrypted before
  5233.  
  5234. execution. The disclosed microprocessor deciphers and executes
  5235.  
  5236. an enciphered program one instruction at a time, instead of on
  5237.  
  5238. a continuous basis, through a combination of substitutions,
  5239.  
  5240. transpositions, and exclusive OR additions, in which the address
  5241.  
  5242. of each instruction is combined with the instruction. Each unit
  5243.  
  5244. may use a unique set of substitutions so that a program which can
  5245.  
  5246. be executed on one microprocessor cannot be run on any other
  5247.  
  5248. microprocessor. Further, Best cannot accommodate a mixture of
  5249.  
  5250. encrypted and plain text programs.
  5251.  
  5252.      [JOHNSTONE]    USPat 4120030 to Johnstone describes a
  5253.  
  5254. computer in which the data portion of instructions are scrambled
  5255.  
  5256. and in which the data is of necessity stored in a separate
  5257.  
  5258. memory. There is no disclosure of operating with instructions
  5259.  
  5260. which are completely encrypted with both the operation code and
  5261.  
  5262. the data address portion being unreadable without a corresponding
  5263.  
  5264. key kernel.
  5265.  
  5266.      [TWINPROGS]    USPat 4183085 describes a technique for
  5267.  
  5268. protecting software by providing two separate program storages.
  5269.  
  5270. The first program storage is a secure storage and the second
  5271.  
  5272. program storage is a free storage. Security logic is provided to
  5273.  
  5274. check whether an output instruction has originated in the secure
  5275.  
  5276. store and to prevent operation of an output unit which receives
  5277.  
  5278. output instructions from the free storage. This makes it
  5279.  
  5280. difficult to produce information by loading a program into free
  5281.  
  5282. storage.
  5283.  
  5284.      [AUTHENTICATOR]     USPat 3996449 entitled "Operating System
  5285.  
  5286. Authenticator," discloses a technique for authenticating the
  5287.  
  5288. validity of a plain text program read into a computer, by
  5289.  
  5290. exclusive OR'ing the plain text of the program with a key to
  5291.  
  5292. generate a code word which must be a standard recognizable code
  5293.  
  5294. word which is successfully compared with a standard corresponding
  5295.  
  5296. code word stored in the computer. If there is a successful
  5297.  
  5298. compare, then the plain text program is considered to be
  5299.  
  5300. authenticated and is allowed to run, otherwise the program
  5301.  
  5302. is not allowed to run.
  5303.  
  5304. ELEMENTS OF [PGP] CRACKING
  5305.  
  5306. In order to try to crack PGP, you need to understand how these
  5307.  
  5308. public/private keys systems work. Cracking PGP seems extremely
  5309.  
  5310. difficult, though... I have a special dedicated "attack" computer
  5311.  
  5312. that runs 24 hours on 24 only to this aim and yet have only begun
  5313.  
  5314. to see the light at the famous other end of the tunnel. It's
  5315.  
  5316. hard, but good crackers never resign! We'll see... I publish here
  5317.  
  5318. the following only in the hope that somebody else will one day
  5319.  
  5320. be able to help...
  5321.  
  5322. In the public key cryptosystems, like PGP, each user has an
  5323.  
  5324. associated encryption key E=(e,n) and decryption key D=(d,n),
  5325.  
  5326. wherein the encryption keys for all users are available in a
  5327.  
  5328. public file, while the decryption keys for the users are only
  5329.  
  5330. known to the respective users. In order to maintain a high level
  5331.  
  5332. of security a user's decoding key is not determinable in a
  5333.  
  5334. practical manner from that user's encoding (public) key. Normally
  5335.  
  5336. in such systems, since
  5337.  
  5338.      e.multidot.d.ident.1 (mod(1 cm((p-1),(q-1)))),
  5339.  
  5340. (where "1 cm((p-1),(q-1))" is the least common multiple of the
  5341.  
  5342. numbers p-1 and q-1)
  5343.  
  5344. d can be determined from e provided p and q are also known.
  5345.  
  5346. Accordingly, the security of the system is dependent upon the
  5347.  
  5348. ability to determine p and q which are the prime factors of n.
  5349.  
  5350. By selecting p and q to be large primes, the resultant composite
  5351.  
  5352. number n is also large, and correspondingly difficult to factor.
  5353.  
  5354. For example, using known computer-implemented factorization
  5355.  
  5356. methods, on the order of 10.sup.9 years is required to factor a
  5357.  
  5358. 200 digit long number. Thus, as a practical matter, although a
  5359.  
  5360. user's encryption key E=(e,n) is public, the prime factors p and
  5361.  
  5362. q of n are effectively hidden from anyone due to the enormous
  5363.  
  5364. difficulty in factoring n. These aspects are described more fully
  5365.  
  5366. in the abundant publications on digital signatures and Public-Key
  5367.  
  5368. Cryptosystems. Most public/private systems relies on a message-
  5369.  
  5370. digest algorithm.
  5371.  
  5372.   A message-digest algorithm maps a message of arbitrary length
  5373.  
  5374. to a "digest" of fixed length, and has three properties:
  5375.  
  5376. Computing the digest is easy, finding a message with a given
  5377.  
  5378. digest "inversion" is hard, and finding two messages with the
  5379.  
  5380. same digest "collision" is also hard. Message-digest algorithms
  5381.  
  5382. have many applications, not only digital signatures and message
  5383.  
  5384. authentication. RSA Data Security's MD5 message-digest algorithm,
  5385.  
  5386. developed by Ron Rivest, maps a message to a 128-bit message
  5387.  
  5388. digest. Computing the digest of a one-megabyte message takes as
  5389.  
  5390. little as a second.  While no message-digest algorithm can yet
  5391.  
  5392. be secure, MD5 is believed to be at least as good as any other
  5393.  
  5394. that maps to a 128-bit digest.
  5395.  
  5396.   As a final gift, I'll tell you that PGP relies on MD5 for a
  5397.  
  5398. secure one-way hash function. For PGP this is troublesome, to say
  5399.  
  5400. the least, coz an approximate relation exists between any four
  5401.  
  5402. consecutive additive constants. This means that one of the design
  5403.  
  5404. principles behind MD4 (and MD5), namely to design a collision
  5405.  
  5406. resistant function, is not satisfied. You can construct two
  5407.  
  5408. chaining variables (that only differ in the most significant bit
  5409.  
  5410. of every word) and a single message block that yield the same
  5411.  
  5412. hashcode. The attack takes a few minutes on a PC. From here you
  5413.  
  5414. should start, as I did.
  5415.  
  5416. [DOS 4GW] cracking - This is only a very provisory part of this
  5417.  
  5418. tutorial. DOS 4GW cracking will be much better described as soon
  5419.  
  5420. as [Lost soul] sends his stuff, if he ever does. For (parts of)
  5421.  
  5422. the following I thank [The Interrupt].
  5423.  
  5424.      Most applications of every OS, and also of DOS 4GW, are
  5425.  
  5426. written in C language, coz as you'll have already learned or,
  5427.  
  5428. either, you'll learn, only C allows you to get the "guts" of a
  5429.  
  5430. program, almost approaching the effectiveness of assembler
  5431.  
  5432. language.
  5433.  
  5434.      C is therefore the LANGUAGE OF CHOICE for crackers, when you
  5435.  
  5436. prepare your tools and do not directly use assembler routines.
  5437.  
  5438. Besides... you'll be able to find VERY GOOD books about C for
  5439.  
  5440. next to nothing in the second hand bookshops. All the lusers are
  5441.  
  5442. throwing money away in spades buying huge, coloured and
  5443.  
  5444. absolutely useless books on unproductive "bloated" languages like
  5445.  
  5446. Visual basic, C++ and Delphy. Good C new books are now rare
  5447.  
  5448. (books on assembler language have always been) and can be found
  5449.  
  5450. almost exclusively on the second hand market. Find them, buy
  5451.  
  5452. them, read them, use them for your/our aims. You can find a lot
  5453.  
  5454. of C tutorials and of C material on the Web, by all means DO IT!
  5455.  
  5456. Be a conscientious cracker... learn C! It's cheap, lean, mean and
  5457.  
  5458. very productive (and creative) :=)
  5459.  
  5460.      Back to the point: most stuff is written in C and therefore
  5461.  
  5462. you need to find the "main" sub-routine inside the asm. With
  5463.  
  5464. DOS/4GW programs, search the exe file for "90 90 90 90", almost
  5465.  
  5466. always it'll be at the start of the compiled code. Now search for
  5467.  
  5468. an INT_21 executed with 4C in AH, the exec to dos code (if you
  5469.  
  5470. cannot "BPINT 21 AH=4C" with your tool, then search for the
  5471.  
  5472. sequence "b4 4c cd 21". This is the equivalent to [mov AH,4C &
  5473.  
  5474. int 21]: it's the most direct call, but as you'll have already
  5475.  
  5476. learned, there are half a dozen ways to put 4C in AX, try them
  5477.  
  5478. all in the order of their frequency).
  5479.  
  5480.      A few bytes above the INT_21 service 4C, you'll find the
  5481.  
  5482. call to the "main" subroutine: "E8 xx xx". Now place a "CC" byte
  5483.  
  5484. a few bytes above the call in the exe and run the exe under a
  5485.  
  5486. debugger. When the computer tries to execute the instruction
  5487.  
  5488. you'll be throw back in the debugger coz the "CC" byte acts as
  5489.  
  5490. INT_01 instruction. Then proceed as usual.
  5491.  
  5492. [THE "STEGONATED" PASSWORD HIDEOUT]
  5493.  
  5494.   A last, very nice trick should be explained to every wannabe
  5495.  
  5496. cracker, coz it would be embarrassing to search for passwords or
  5497.  
  5498. protection routines that (apparently) are not there. They may be
  5499.  
  5500. hidden INSIDE a picture (or a *.waw file for that matter). This
  5501.  
  5502. is steganography, a method of disguising messages within other
  5503.  
  5504. media.
  5505.  
  5506.   Depending on how many shades of grey or hues of colour you want
  5507.  
  5508. to have, a pixel can be expressed using 8. 16, 32 or even more
  5509.  
  5510. bits. If the least significant bit is changed. the shade of the
  5511.  
  5512. pixel is altered only one-256th, one-65,OOOth or even less. No
  5513.  
  5514. human eye could tell the difference.
  5515.  
  5516.   What the protectionist does, is hijack the least significant
  5517.  
  5518. bit in each pixel of a picture. It uses that bit to store one bit
  5519.  
  5520. of a protection, or of a password (or of a file, or of a secret
  5521.  
  5522. message). Because digitized pictures have lots of pixels, it's
  5523.  
  5524. possible to store lots of data in a single picture. A simple
  5525.  
  5526. algorithm will transfer them to the relevant parts of the program
  5527.  
  5528. when it needs be, and there we'll intercept them. You'll need to
  5529.  
  5530. learn very well the zen-cracking techniques to smell this kind
  5531.  
  5532. of stuff though (-> see lesson B).
  5533.  
  5534. Well, that's it for this lesson, reader. Not all lessons of my
  5535.  
  5536. tutorial are on the Web.
  5537.  
  5538.      You 'll obtain the OTHER missing lessons IF AND ONLY IF you
  5539.  
  5540. mail me back (via anon.penet.fi) with some tricks of the trade
  5541.  
  5542. I may not know that YOU discovered. Mostly I'll actually know
  5543.  
  5544. them already, but if they are really new you'll be given full
  5545.  
  5546. credit, and even if they are not, should I judge that you
  5547.  
  5548. "rediscovered" them with your work, or that you actually did good
  5549.  
  5550. work on them, I'll send you the remaining lessons nevertheless.
  5551.  
  5552. Your suggestions and critics on the whole crap I wrote are also
  5553.  
  5554. welcomed.
  5555.  
  5556.                                 E-mail +ORC
  5557.  
  5558.                        an526164@anon.penet.fi (+ORC)
  5559.                      HOW TO CRACK, by +ORC, A TUTORIAL
  5560.  
  5561. ---------------------------------------------------------------------------
  5562.  
  5563.                Lesson 8.1: How to crack Windows, an approach
  5564.  
  5565. ---------------------------------------------------------------------------
  5566.  
  5567.                                 [WINPGP.EXE]
  5568.  
  5569.                    --------------------------------------
  5570.  
  5571. --------------------------------------------------------
  5572.  
  5573.      SPECIAL NOTE: Please excuse the somehow "unshaven"
  5574.  
  5575.      character of the windows lessons... I'm cracking the
  5576.  
  5577.      newest Windows '95 applications right now, therefore
  5578.  
  5579.      at times I had to add "on the fly" some corrections to
  5580.  
  5581.      the older Windows 3.1 and Windows NT findings.
  5582.  
  5583.                 "homines, dum docent, discunt".
  5584.  
  5585. ---------------------------------------------------------
  5586.  
  5587. ->   1st THING TO REMEMBER
  5588.  
  5589. The NE format does give every windows executable the equivalent
  5590.  
  5591. of a debug symbol table: A CRACKER BLISS!
  5592.  
  5593. ->   UNDOCUMENTED DEBUGGING
  5594.  
  5595. One of the many feature of Windows based on undocumented
  5596.  
  5597. foundations is the "ability to debug".
  5598.  
  5599. A word about undocumented functions in the MS-Operating Systems:
  5600.  
  5601. Microsoft manipulates its rule and domination of the operating
  5602.  
  5603. systems in use to day (MS-DOS, Windows, Windows '95) with two
  5604.  
  5605. main wicked aims:
  5606.  
  5607. 1)   getting the concurrence completely bankrupt (that's the
  5608.  
  5609.      scope of all the using of undocumented functions and
  5610.  
  5611.      CHANGING them as soon as the concurrence uses them). The
  5612.  
  5613.      battle against Borland was fought in this way.
  5614.  
  5615. 2)   getting all future "programmers" to use windows as a "black
  5616.  
  5617.      box" that only Microsoft engineers (if ever) can master, so
  5618.  
  5619.      that everybody will have to sip the ill-cooked abominations
  5620.  
  5621.      from Microsoft without ever having a chance to alter or
  5622.  
  5623.      ameliorate them.
  5624.  
  5625. Strange as it may seem, only the sublime cracker community fights
  5626.  
  5627. against these intolerable plans. All stupid governments and
  5628.  
  5629. lobbies -on the contrary- hide behind the fig-leaf of the
  5630.  
  5631. "market" "freedom" in order to ALLOW such heinous developments
  5632.  
  5633. (I'm speaking as if they were capable to opposing them even if
  5634.  
  5635. they wanted, which they do not. Be assured, they couldn't anyway,
  5636.  
  5637. "Governments" are deliberately MADE to serve Gates and all the
  5638.  
  5639. remaining suckers, and lobbies are the shield of feudalism. You
  5640.  
  5641. can forget "democracy", the only rule existing is a malevolent
  5642.  
  5643. oligarchy based on money, personal connections, defect of
  5644.  
  5645. culture, lack of knowledge and dictatorship of bad taste through
  5646.  
  5647. television in order to keep the slaves tamed... enough now...)
  5648.  
  5649. The windows situation is particularly reminiscent of the older
  5650.  
  5651. situation in DOS, where for years the key "load but don't
  5652.  
  5653. execute" function, used by debuggers, such as [DEBUG], [SYMDEB]
  5654.  
  5655. and [CODEVIEW], was "reserved" by Microsoft.
  5656.  
  5657.      The windows debugging library, WINDEBUG.DLL, a number of
  5658.  
  5659. undocumented functions and even the interface it provides are
  5660.  
  5661. undocumented! The WinDebug() function is used by all available
  5662.  
  5663. windows debuggers, including [CVW] (CodeView for Windows), [TDW]
  5664.  
  5665. (TurboDebugger for Windows), [Multiscope] and [Quick C for
  5666.  
  5667. Windows] (the last two are GUI, not text debuggers. The use of
  5668.  
  5669. WinDebug() doesn't show up in MAPWIN output 'coz debuggers link
  5670.  
  5671. to it at run-time via the amazing GetProcAddress() function.
  5672.  
  5673.      WinDebug() is a hacked 32-bit version, for the old Windows
  5674.  
  5675. 3.0, of the poorly documented DOSPTrace() function from OS/2 1.x
  5676.  
  5677. (study these older Operating Systems! Studying the past you'll
  5678.  
  5679. understand EVERYTHING! Sometime I think that the only way to hack
  5680.  
  5681. and crack correctly is to be more a software historian than a
  5682.  
  5683. programmer... fac sapias et liber eris!). DOSPTrace is, in turn,
  5684.  
  5685. based on the ptrace() function in Unix.
  5686.  
  5687.      Like DosPTrace(), WinDebug() takes commands such as Go,
  5688.  
  5689. Single-Step, Write&Read Registers, Write&Read Memory. It returns
  5690.  
  5691. to its caller either when the command completes or when a
  5692.  
  5693. breakpoint occurs (or a DLL load). These commands and
  5694.  
  5695. notifications appear in a large structure whose address is passed
  5696.  
  5697. in WinDebug().
  5698.  
  5699.      WinDebug() was renamed CVWIN.DLL (and TDWIN.DLL) for Windows
  5700.  
  5701. 3.1., all crackers should study it and get the maximum possible
  5702.  
  5703. documentation about it. As you will see in the following, it is
  5704.  
  5705. worth to study also TOOLHELP.DLL (what Microsoft would like you
  5706.  
  5707. to fiddle with) and INT_41h (the real debugging interface).
  5708.  
  5709. Interrupt handling under Windows
  5710.  
  5711.      Interrupt handling under Windows can be tricky: you need to
  5712.  
  5713. use Toolhelp (a rather scaring lobotomy for your programs) or to
  5714.  
  5715. have special code for Standard vs. Enhanced modes, because the
  5716.  
  5717. information on the stack of an interrupt or exception handler
  5718.  
  5719. differs between the two windows modes. In addition, some handlers
  5720.  
  5721. would be installed using INT_21h, while others are set up using
  5722.  
  5723. DPMI services. Toolhelp has quite a bit of internal code that
  5724.  
  5725. "cooks" the interrupts and sends them to you in an easily
  5726.  
  5727. digestible form.
  5728.  
  5729.      Remember that Windows uses GP faults as a "hacker" method
  5730.  
  5731. of doing ring transitions that are not allowed with legal 80x86
  5732.  
  5733. instructions: the virtual memory system of Enhanced mode is
  5734.  
  5735. implemented via the page fault.
  5736.  
  5737. Some tools for cracking windows (-> see lesson 9)
  5738.  
  5739. -----------------          DEBUGGERS
  5740.  
  5741. CVW and TDW         (you have to know the function's
  5742.  
  5743.                     segment:offset address beforehand in order
  5744.  
  5745.                     to crack a function)
  5746.  
  5747. WCB                 [Windows Codeback] by Leslie Pusztai (it's
  5748.  
  5749.                     a really cool tool!)
  5750.  
  5751. WDEB386             Microsoft's WDEB386 (clumsy, and requires a
  5752.  
  5753.                     second monitor)
  5754.  
  5755. Soft-Ice/Windows    best (BY FAR!) windows debugger! NuMega is
  5756.  
  5757.                     so good I am at times really sorry to crack
  5758.  
  5759.                     their products! [WINICE] is the single,
  5760.  
  5761.                     absolutely essential debugger and snooping
  5762.  
  5763.                     utility for windows crackers. Get it!
  5764.  
  5765. -----------------   POST MORTEM INSPECTORS
  5766.  
  5767. CORONER, etc.            (a lot of shareware)
  5768.  
  5769. MS-DrWatson              Old and clumsy
  5770.  
  5771. Borland's Winspector     THE BEST! It has the BUILDSYM utility
  5772.  
  5773.                          that allows the creation of a debug
  5774.  
  5775.                          .SYM file from an .EXE without debug
  5776.  
  5777.                          information.
  5778.  
  5779. -----------------         INSPECTORS
  5780.  
  5781. MS-Spy                   Old
  5782.  
  5783. Borland's WinSight       (Best one, select "Other")
  5784.  
  5785. MicroQuill's Windows DeMystifiers (from Jeff Richter):
  5786.  
  5787.      VOYEUR (hold SHIFT picking Message Selection), COLONEL,
  5788.  
  5789.      MECHANIC and ECOLOGIST
  5790.  
  5791. -----------------          SNOOPERS
  5792.  
  5793. [INFSPY.EXE], 231.424 bytes, version 2.05 28/8/1994 by Dean
  5794.  
  5795. Software Design, may be the more complete one.
  5796.  
  5797. [SUPERSPY.EXE], 24.576 bytes, 10,6,1994, quite handy for quick
  5798.  
  5799. informations.
  5800.  
  5801. [WINVIEW.EXE], 30.832 bytes, Version 3.00 by Scott McCraw, MS(c)
  5802.  
  5803. 1990-1992, this is the old MS-Spy, distributed by MS
  5804.  
  5805. [TPWSPY.EXE], 9.472 bytes, quite primitive, but you get the
  5806.  
  5807. pascal source code with it.
  5808.  
  5809. ->   INSIDE A WINDOWS '95 DEBUGGER
  5810.  
  5811.      You can debug a program at the assembly-language level
  5812.  
  5813. without any debugging information. The DOS [DEBUG] program does
  5814.  
  5815. that, allowing breakpoints and single-stepping, all of which
  5816.  
  5817. implies that the hardware must be cooperating. Back in the time
  5818.  
  5819. of the 4-MHz Z-80s, you used a debugger that plugged interrupt
  5820.  
  5821. op codes into the instruction stream to generate breakpoints.
  5822.  
  5823.      Nothing has changed. That's how you debug a program on a
  5824.  
  5825. 80586 (=Pentium). The x86 architecture includes software
  5826.  
  5827. interrupts. The 1-byte op code xCC is the INT_03 instruction,
  5828.  
  5829. reserved for debuggers. You can put the INT_03 op code in place
  5830.  
  5831. of the program instruction op code where the break is to occur
  5832.  
  5833. and replace the original op code at the time of the interrupt.
  5834.  
  5835. In the 80386 and later, you can set a register flag that tells
  5836.  
  5837. the processor to generate a not-intrusive INT_01 instruction for
  5838.  
  5839. every machine instruction executed. That device supports single
  5840.  
  5841. stepping.
  5842.  
  5843.      The Win32SDK (Windows '95 software developer's kit) includes
  5844.  
  5845. functions that allow one program to launch another program and
  5846.  
  5847. debug it. The SDK's debug API takes care of how the interrupts
  5848.  
  5849. and interrupt vectors get managed. The logical consequence of
  5850.  
  5851. such an approach is that fewer and fewer people will be able to
  5852.  
  5853. know what's going on inside an application. The bulk of the
  5854.  
  5855. programmers -in few years time- will not be able any more to
  5856.  
  5857. reverse engineer an application, unless the few that will still
  5858.  
  5859. understand assembler-language do offer them the tools to do it.
  5860.  
  5861. Microsoft -it is evident- would like the programmers to use a
  5862.  
  5863. "black box" approach to programming, writing nice little "hallo
  5864.  
  5865. world" application and leaving to the engineers in Microsoft
  5866.  
  5867. alone the capacity to push forward (and sell) real programs that
  5868.  
  5869. are not toy application.
  5870.  
  5871.      The Win32 documentation seems vast, almost luxurious, until
  5872.  
  5873. you begin serious work and you discover its shortcomings, like
  5874.  
  5875. the fact that extended error codes are not documented, and
  5876.  
  5877. numerous APIs are documented either incorrectly or so poorly that
  5878.  
  5879. you must burn precious time testing them. What we definitely need
  5880.  
  5881. is to find some secret fellows inside Microsoft (like good old
  5882.  
  5883. Prometeus) that smuggles to the outside the real documentation
  5884.  
  5885. that the Microsoft engineers have reserved for themselves. If you
  5886.  
  5887. are reading this and do work for Microsoft, consider the
  5888.  
  5889. possibility of double-crossing your masters for the sake of
  5890.  
  5891. humanity and smuggle us the secret information.
  5892.  
  5893.      In windows '95 a debugger program launches a program to be
  5894.  
  5895. debugged by calling the _CreateProcess function, specifying in
  5896.  
  5897. an argument that the program is to be debugged. Then the debugger
  5898.  
  5899. program enters a loop to run the program. At the top of the loop
  5900.  
  5901. the debugger calls _WaitForDebugEvent.
  5902.  
  5903.      Each time _WaitForDebugEvent returns it sets indicators that
  5904.  
  5905. tell about the vent that suspended the program being debugged.
  5906.  
  5907. This is where the debugger traps breakpoints and single-step
  5908.  
  5909. exceptions. _WaitForDebugEvent fills in an event structure that
  5910.  
  5911. contains among other things the address that was interrupted end
  5912.  
  5913. the event that caused the interrupt.
  5914.  
  5915.      The debugger calls _GetThreadContext to get the running
  5916.  
  5917. context of the debugged program, including the contents of the
  5918.  
  5919. registers. The debugger can, as the result of cracker
  5920.  
  5921. interaction, modify these values and the contents of the debugged
  5922.  
  5923. program's memory.
  5924.  
  5925.      The debugger sets breakpoints by saving the op code at the
  5926.  
  5927. instruction to be intercepted and putting the INT_03 op code at
  5928.  
  5929. its place, it's always the same old marmalade. When the
  5930.  
  5931. breakpoint occurs, the debugger replaces the original op code in
  5932.  
  5933. the program's instruction memory, and decrements the interrupted
  5934.  
  5935. program counter in the saved context so that execution resumes
  5936.  
  5937. at the instruction that was broken.
  5938.  
  5939.      To single-step a program, the debugger sets a bit in the
  5940.  
  5941. context's flags register that tells the processor to generate an
  5942.  
  5943. INT_01 for every instruction cycle. When that interrupt occurs,
  5944.  
  5945. the debugger checks to see if the interrupted address is at a new
  5946.  
  5947. source-code line number. If not, the debugger continues
  5948.  
  5949. execution. Otherwise, the debugger displays the new line in the
  5950.  
  5951. IDE and waits for the cracker to take an action that resumes the
  5952.  
  5953. program.
  5954.  
  5955.      While the debugged program is suspended, the debugger
  5956.  
  5957. interacts with the cracker and provides full access to the
  5958.  
  5959. debugged program's context and memory. This access permits the
  5960.  
  5961. cracker to examine and modify part of the code.
  5962.  
  5963.      To resume the debugged program, the debugger resets the
  5964.  
  5965. program's context by calling _SetThreadContext and calls
  5966.  
  5967. _ContinueDebugEvent. Then, the debugger returns to the top of the
  5968.  
  5969. loop to call _WaitForDebugEvent again.
  5970.  
  5971.      To extract debug information from a Win32 executable file,
  5972.  
  5973. you must understand the format of that file (best thing to do,
  5974.  
  5975. to practice yourself, would be to reverse engineer small
  5976.  
  5977. programs). The executable file has two sections not found in
  5978.  
  5979. other executable files: ".stab" and ".stabstr". How nice that
  5980.  
  5981. they used names that suggest their purpose (nomen est omen).
  5982.  
  5983. You'll find them inside a table of fixed-length entries that
  5984.  
  5985. include entries for .text, .bss, .data and .idata. Inside these
  5986.  
  5987. sections the compilers put different parts of a program.
  5988.  
  5989.      There are several different formats for encoding debug
  5990.  
  5991. information in an executable file. Borland's Turbo Debugger  one
  5992.  
  5993. format. Microsoft's CodeView  another. The gnu-win32 port from
  5994.  
  5995. Cygnus the stab format, an acronym meaning "symbol table",
  5996.  
  5997. although the table contains much more than just symbol
  5998.  
  5999. information.
  6000.  
  6001.      The .stab section in a portable executable file is a table
  6002.  
  6003. of fixed-length entries that represent debugging information in
  6004.  
  6005. the stab format. The .stabstr section contains variable-length,
  6006.  
  6007. null terminated strings into which the .stab table entries point.
  6008.  
  6009.      The documentation for the stab format is available in text
  6010.  
  6011. format on the Cygnus ftp site (ftp.cygnus.com//pub/gnu-win32).
  6012.  
  6013.      Stabs contain, in a most cryptic format, the names and
  6014.  
  6015. characteristics of all intrinsic and user-defined types, the
  6016.  
  6017. memory address of every symbol in external memory and on the
  6018.  
  6019. stack, the program counter address of every function, the program
  6020.  
  6021. counter address where every brace-surrounded statement block
  6022.  
  6023. starts and ends, the memory address of line numbers within
  6024.  
  6025. source-code files, and anything else that a debugger needs. The
  6026.  
  6027. format is complex and cryptic because it is intended to support
  6028.  
  6029. any source-code language. It is the responsibility of a debugger
  6030.  
  6031. program to translate the stab entries into something meaningful
  6032.  
  6033. to the debugger in the language being debugged.
  6034.  
  6035.      Windows '95 invokes dozens of INT_21 services from 32-bit
  6036.  
  6037. code, including KERNEL32.DLL and possess Krn32Mutex, which
  6038.  
  6039. apparently controls access to certain parts of the kernel. Some
  6040.  
  6041. of the functions in KERNEL32 can be blocked by the Win16Mutex,
  6042.  
  6043. even though Microsoft says this isn't the case.
  6044.  
  6045. SO, I WANNA CRACK, WHAT SHOULD I DO?
  6046.  
  6047.      I'll show you a simple windows crack, so easy it can be done
  6048.  
  6049. without WINICE: let's take [WINPGP4.1.] (front-end for PGPing in
  6050.  
  6051. windows, by Geib - I must thank "Q" for the idea to work on this
  6052.  
  6053. crack).
  6054.  
  6055.      Using WCB you'll find out quickly that the "CONGRATULATIONS
  6056.  
  6057. your registration number is OK" and the "SORRY, your registration
  6058.  
  6059. number is not correct" data blocks are at the block starting at
  6060.  
  6061. 36.38B8 (respectively at 36.38D5 and 36.3937), that relocs to
  6062.  
  6063. 13.081B.
  6064.  
  6065.      Looking at 13.0000 and following code, you'll find a push
  6066.  
  6067. 38D5 (68D538) and a push 3937 (683739) at 13.064D and 13.06AE.
  6068.  
  6069.      The road to the crack is now open, you just need to find and
  6070.  
  6071. "fool" the calling routines. You'll learn the exact procedures
  6072.  
  6073. for this kind of WINcracks in part 2 and 3 of -> Lesson 8. Let's
  6074.  
  6075. now have a look at the protection scheme (disassembly from WCB):
  6076.  
  6077. ...
  6078.  
  6079. 13.0E88   660FBF46F8     movsx     eax, word ptr [bp-08]
  6080.  
  6081. 13.0E8D   668946F4       mov       [bp-0C], eax
  6082.  
  6083. 13.0E91   668B46F4       mov       eax, [bp-0C]
  6084.  
  6085. 13.0E95   6669C00A000300 imul      eax, 0003000A
  6086.  
  6087. 13.0E9C   668946F0       mov       [bp-10], eax
  6088.  
  6089. 13.0EA0   668B4606       mov       eax, [bp+06]
  6090.  
  6091. 13.0EA4   663B46F0       cmp       eax, [bp-10]
  6092.  
  6093. 13.0EA8   7505           jne       0EAF      <- beggar_off
  6094.  
  6095. 13.0EAA   B80100         mov       ax, 0001  <- flag 1 = "Right!"
  6096.  
  6097. 13.0EAD   EB04           jmp       0EB3      <- and go on
  6098.  
  6099. beggar_off:
  6100.  
  6101. 13.0EAF   33C0           xor       ax,ax     <- flag 0 = "Nope!"
  6102.  
  6103. 13.0EB1   EB00           jmp       0EB3      <- and go on
  6104.  
  6105.      I want you to have a good look at this protection scheme.
  6106.  
  6107. IT'S THE SAME OLD SOUP! You do remember lesson 3 and the
  6108.  
  6109. protection schemes of the old DOS stupid games of the '80s, don't
  6110.  
  6111. you? IT'S THE SAME OLD SOUP! In this "up-to-date" "new" windows
  6112.  
  6113. application, in WINPGP version 4.1 of 1995/1996, exactly the same
  6114.  
  6115. kind of protection is used to "conceal" the password!
  6116.  
  6117. A)   compare user input with memory echo
  6118.  
  6119. B)   beggar off if not equal with AX=0
  6120.  
  6121. C)   go on if equal with AX=1... how boring!
  6122.  
  6123.      Besides, look at all the mov eax, and  eax, moves preceding
  6124.  
  6125. the compare! That's a typical pattern for these "number_password"
  6126.  
  6127. protections! I wrote (years ago) a little crack utility that
  6128.  
  6129. searches for code blocks with a "66" as first instruction_byte
  6130.  
  6131. repeating in four or more consecutive instructions and it still
  6132.  
  6133. allows me to crack more than half of these windows password smuts
  6134.  
  6135. in less than three seconds flat. The IMUL instruction creates the
  6136.  
  6137. "magic" number, and if you give a closer look at the mathematical
  6138.  
  6139. part of the "conceal" routine, it could help you to crack
  6140.  
  6141. analogous schemes used in order to protect the "Instant access"
  6142.  
  6143. (c) & (tm) time_crippled software :=)
  6144.  
  6145.      Now you could crack the above code in 101 different ways,
  6146.  
  6147. the most elegant one would probably substitute je 0EAF (or jZ
  6148.  
  6149. 0EAF, that's the same) to the jne 0EAF at 13.0EA8. You just write
  6150.  
  6151. a 74 at the place of the 75, like you did for the cracks in
  6152.  
  6153. 1978... how boring: it's really the same old soup! (But you'll
  6154.  
  6155. see some new tricks in the next lessons).
  6156.  
  6157. Well, that's it for this lesson, reader. Not all lessons of my
  6158.  
  6159. tutorial are on the Web.
  6160.  
  6161.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  6162.  
  6163. me back (via anon.penet.fi) with some tricks of the trade I may
  6164.  
  6165. not know that YOU discovered. Mostly I'll actually know them
  6166.  
  6167. already, but if they are really new you'll be given full credit,
  6168.  
  6169. and even if they are not, should I judge that you "rediscovered"
  6170.  
  6171. them with your work, or that you actually did good work on them,
  6172.  
  6173. I'll send you the remaining lessons nevertheless. Your
  6174.  
  6175. suggestions and critics on the whole crap I wrote are also
  6176.  
  6177. welcomed.
  6178.  
  6179.                                 E-mail +ORC
  6180.  
  6181.                          +ORC 526164@anon.penet.fi
  6182.                      HOW TO CRACK, by +ORC, A TUTORIAL
  6183.  
  6184. ---------------------------------------------------------------------------
  6185.  
  6186.              Lesson 8.2: How to crack Windows, a deepr approach
  6187.  
  6188. ---------------------------------------------------------------------------
  6189.  
  6190.                          [SNAP95] [WINZIP] [WINCAT]
  6191.  
  6192.                    --------------------------------------
  6193.  
  6194.      SPECIAL NOTE: Please excuse the somehow "unshaven"
  6195.  
  6196.      character of the windows lessons... I'm cracking the
  6197.  
  6198.      newest Windows '95 applications right now, therefore
  6199.  
  6200.      at times I had to add "on the fly" some corrections to
  6201.  
  6202.      the older Windows 3.1 and Windows NT findings.
  6203.  
  6204.                 "homines, dum docent, discunt".
  6205.  
  6206. ---------------------------------------------------------
  6207.  
  6208. ->   1st THING TO REMEMBER
  6209.  
  6210. If you thought that DOS was a mess, please notice that windows
  6211.  
  6212. 3.1 is a ghastly chaos, and windows 95 a gruesome nightmare of
  6213.  
  6214. ill-cooked spaghetti code. Old Basic "GOTO" abominations were
  6215.  
  6216. quite elegant in comparison with this concoction... One thing is
  6217.  
  6218. sure: This OS will not last... it's way too messy organised,
  6219.  
  6220. impossible to consolidate, slow and neurotic (but I must warn
  6221.  
  6222. you... I thought exactly the same things about DOS in 1981).
  6223.  
  6224.   The most striking thing about windows 95 is that it is neither
  6225.  
  6226. meat not fish: neither 16 nor 32... you could call it a "24 bit"
  6227.  
  6228. operating system.
  6229.  
  6230.   We'll never damage Microsoft interests enough to compensate for
  6231.  
  6232. this moronic situation... where you have to wait three minutes
  6233.  
  6234. to get on screen a wordprocessor that older OS (and even old DOS)
  6235.  
  6236. kick up in 5 seconds. I decide therefore, hic et nunc, to add an
  6237.  
  6238. ADDENDUM to this tutorial: Addendum 1 will be dedicated to teach
  6239.  
  6240. everybody how to crack ALL Microsoft programs that do exist on
  6241.  
  6242. this planet. I'll write it this sommer and give it away between
  6243.  
  6244. the "allowed" lessons.
  6245.  
  6246.   Anyway you can rely on good WINICE to crack everything, you'll
  6247.  
  6248. find it on the web for free, I use version 1.95, cracked by [The
  6249.  
  6250. Lexicon] (do not bother me for Warez, learn how to use the search
  6251.  
  6252. engines on the web and fish them out yourself). Learn how to use
  6253.  
  6254. this tool... read the whole manual! Resist the temptation to
  6255.  
  6256. crack immediatly everything in sight... you 'll regret pretty
  6257.  
  6258. soon that you did not wanted to learn how to use it properly.
  6259.  
  6260. A little tip: as Winice is intended more for software developers
  6261.  
  6262. than for crackers, we have to adapt it a little to our purposes,
  6263.  
  6264. in order to make it even more effective: a good idea is to have
  6265.  
  6266. in the *.DAT initialization file following lines:
  6267.  
  6268.      INIT = "CODE ON; watchd es:di; watchd ds:si;"
  6269.  
  6270.      TRA = 92
  6271.  
  6272. This way you'll always have the hexadecimal notation on, two very
  6273.  
  6274. useful watch windows for passwords deprotection and enough buffer
  6275.  
  6276. for your traces.
  6277.  
  6278. WINDOWS 3.1. basic cracking: [ALGEBRAIC PROTECTIONS]
  6279.  
  6280.      The most used windows protections are "registration codes",
  6281.  
  6282. these must follow a special pattern: have a "-" or a "+" in a
  6283.  
  6284. predetermined position, have a particular number in particular
  6285.  
  6286. position... and so on.
  6287.  
  6288. For the program [SHEZ], for instance, the pattern is to have a
  6289.  
  6290. 14 bytes long alphanumeric sequence containing CDCE1357 in the
  6291.  
  6292. first 8 bytes.
  6293.  
  6294.      The second level of protection is to "connect" such a
  6295.  
  6296. pattern to the alphanumeric contents of the NAME of the user...
  6297.  
  6298. every user name will give a different "access key". This is the
  6299.  
  6300. most commonly used system.
  6301.  
  6302.      As most of these protections have a "-" inside the answering
  6303.  
  6304. code, you do not need to go through the normal cracking procedure
  6305.  
  6306. (described in the next lesson):
  6307.  
  6308. *    load WINICE
  6309.  
  6310. *    hwnd [name_of_the_crackanda_module]
  6311.  
  6312. *    choose the window Handle of the snap, i.e, the exact
  6313.  
  6314.      "FIELD" where the code number input arrives... say 091C(2)
  6315.  
  6316. *    BMSG 091C WM_GETTEXT
  6317.  
  6318. *    Run anew
  6319.  
  6320. *    Look at the memory location(s)
  6321.  
  6322. *    Do the same for the "Username" input FIELD. (Sometimes
  6323.  
  6324.      linked, sometimes not, does not change much, though)
  6325.  
  6326. *    BPR (eventually with TRACE) on the memory locations (these
  6327.  
  6328.      will be most of the time FOUR: two NUMBERCODES and two
  6329.  
  6330.      USERNAMES). The two "mirrored" ones are the most important
  6331.  
  6332.      for your crack. At times there will be a "5th" location,
  6333.  
  6334.      where the algebraic play will go on...
  6335.  
  6336. *    Look at the code that performs algebraic manipulations on
  6337.  
  6338.      these locations and understand what it does...
  6339.  
  6340. *    Disable the routine or jump over it, or reverse it, or
  6341.  
  6342.      defeat it with your own code... there are thousand
  6343.  
  6344.      possibilities...
  6345.  
  6346. *    Reassemble everything.
  6347.  
  6348. Uff... quite a long cracking work just to crack some miserable
  6349.  
  6350. program... isn'there a quicker way? OF COURSE THERE IS! Actually
  6351.  
  6352. there are quite a lot of them (see also the crack of Wincat Pro
  6353.  
  6354. below): Look at the following code (taken from SNAP32, a screen
  6355.  
  6356. capture utility for Windows 95, that uses a pretty recent
  6357.  
  6358. protection scheme):
  6359.  
  6360.      XOR  EBX,EBX   ; make sure EBX is zeroed
  6361.  
  6362.      MOV  BL, [ESI] ; load input char in BL
  6363.  
  6364.      INC  ESI       ; point at the next character
  6365.  
  6366.      MOV  EDI,EBX   ; save the input character in EDI
  6367.  
  6368.      CMP  EBX,+2D   ; input char is a "-" ?
  6369.  
  6370.      JZ   ok_it's_a_+_or_a_-
  6371.  
  6372.      CMP  EBX,+2B   ; input char is a "+" ?
  6373.  
  6374.      JNZ  Jesus_it's_neither_a_minus_nor_a_plus_let's_check_it
  6375.  
  6376. :ok_it's_a_+_or_a_-
  6377.  
  6378.      XOR  EBX,EBX   ; EBX is zeroed
  6379.  
  6380.      MOV  BL,[ESI]  ; recharge BL
  6381.  
  6382.      INC  ESI       ; point to next char (do not check - or +)
  6383.  
  6384. :Jesus_it's_neither_a_minus_nor_a_plus_let's_check_it
  6385.  
  6386.      XOR  EBP,EBP   ; zero EBP
  6387.  
  6388.      CMP  DWORD PTR [boguschecker], +01
  6389.  
  6390.      ...
  6391.  
  6392. even if you did not read all my precedent lessons, you do not
  6393.  
  6394. need much more explications... this is a part of the algebraic
  6395.  
  6396. check_procedure inside the SNAP32 module...  you could also get
  6397.  
  6398. here through the usual
  6399.  
  6400.      USER!BOZOSLIVEHERE
  6401.  
  6402.      KERNEL!HMEMCPY
  6403.  
  6404.      USER!GLOBALGETATOMNAME
  6405.  
  6406. Windows wretched and detestable APIs used for copy protections,
  6407.  
  6408. as usual with WINICE cracking, and as described elsewhere in my
  6409.  
  6410. tutorial.
  6411.  
  6412.   The above code is the part of the routine that checks for the
  6413.  
  6414. presence of a "+" or a "-" inside the registration number (many
  6415.  
  6416. protections scheme requires them at a given position, other need
  6417.  
  6418. to jump over them).
  6419.  
  6420.   Now sit down, make yourself comfortable and sip a good Martini-
  6421.  
  6422. Wodka (invariably very useful in order to crack... but be aware
  6423.  
  6424. that only Moskowskaia russian Wodka and a correct "Tumball" glass
  6425.  
  6426. will do, do not forget the lemon)... what does this "-" stuff
  6427.  
  6428. mean for us little crackers?
  6429.  
  6430.   It means that we can search directly for the CMP EBX,+2B
  6431.  
  6432. sequence inside any file protected with these schemes... and
  6433.  
  6434. we'll land smack in the middle of the protection scheme! That's
  6435.  
  6436. amazing... but you will never underrate enough the commercial
  6437.  
  6438. programmers... the only really amazing thing is how simpleton the
  6439.  
  6440. protectionists are! You don't believe me? Try it... you 'll get
  6441.  
  6442. your crack at least 4 out of 5 times.
  6443.  
  6444.   Yes I know, to find this code is not yet to crack it... but for
  6445.  
  6446. this kind of copy protection (that's the reason it is so
  6447.  
  6448. widespread) there is no single solution... each makes a slightly
  6449.  
  6450. different algebraic manipulation of the alphanumeric and of the
  6451.  
  6452. numeric data. It's up to you to crack the various schemes... here
  6453.  
  6454. you can only learn how to find them and circumvene them. I'll not
  6455.  
  6456. give you therefore a "debug" crack solution. You'll find it
  6457.  
  6458. yourself using my indications (see the crack of the Wincat Pro
  6459.  
  6460. program below).
  6461.  
  6462. WHERE ARE THE CODES? WHERE ARE THE MODIFIED FILES? WHERE DO THE
  6463.  
  6464. PROTECTIONS KEEP COUNT OF THE PASSING DAYS?
  6465.  
  6466. Most of the time the protection schemes use their own *.ini files
  6467.  
  6468. in the c:\WINDOWS directory for registration purposes... at time
  6469.  
  6470. they even use the "garbage sammler" win.ini file. Let's take as
  6471.  
  6472. example WINZIP (versions 5 and 5.5), a very widespread program,
  6473.  
  6474. you'll surely have one shareware copy of it somewhere between
  6475.  
  6476. your files.
  6477.  
  6478.   In theory, winzip should be registered per post, in order to
  6479.  
  6480. get a "NEW" copy of it, a "registered" copy.
  6481.  
  6482.   This scares most newby crackers, since if the copy you have
  6483.  
  6484. it's not full, there is no way to crack it and make it work,
  6485.  
  6486. unless you get the REAL stuff. The youngest among us do not
  6487.  
  6488. realize that the production of a real "downsized" demo copy is
  6489.  
  6490. a very expensive nightmare for the money-infatuated commercial
  6491.  
  6492. programmers, and that therefore almost nobody does it really...
  6493.  
  6494. nearly all "demos" and "trywares" are therefore CRIPPLED COMPLETE
  6495.  
  6496. PROGRAMS, and not "downsized" demos, independently of what the
  6497.  
  6498. programmers and the protectionists have written inside them.
  6499.  
  6500.   Back to Winzip... all you need, to crack winzip, is to add a
  6501.  
  6502. few lines inside the win.ini file, under the heading [WinZip],
  6503.  
  6504. that has already been created with the demo version, before the
  6505.  
  6506. line with "version=5.0".
  6507.  
  6508.  I will not help you any further with this... I'll leave it to
  6509.  
  6510. you to experiment with the correct sequences... inside win.ini
  6511.  
  6512. you must have following sequence (these are only template to
  6513.  
  6514. substitute for your tries inside WINICE... you'll get it, believe
  6515.  
  6516. me):
  6517.  
  6518.    [WinZip]
  6519.  
  6520.    name=Azert Qwerty
  6521.  
  6522.    sn=########
  6523.  
  6524.    version=5.5
  6525.  
  6526.   The *important* thing is that this means that you DO NOT NEED
  6527.  
  6528. to have a "new registered version" shipped to you in order to
  6529.  
  6530. make it work, as the protectionist sellers would like you to
  6531.  
  6532. believe. The same applies most of the time... never believe what
  6533.  
  6534. you read in the read.me or in the registration files...
  6535.  
  6536.   This brings me to a broader question: NEVER believe the
  6537.  
  6538. information they give you... never believe what television and/or
  6539.  
  6540. newspapers tell you... you can be sure that the only reason they
  6541.  
  6542. are notifying you something is to hinder you to read or
  6543.  
  6544. understand something else... this stupid_slaves_society can only
  6545.  
  6546. subsist if nobody thinks... if you are really interested in what
  6547.  
  6548. is going on, real information can be gathered, but surely not
  6549.  
  6550. through the "conventional" newspapers and/or news_agencies (and
  6551.  
  6552. definitely NEVER through television, that's really only for the
  6553.  
  6554. stupid slaves)... yes, some bit of information can be
  6555.  
  6556. (laboriously) gathered... it's a cracking work, though.
  6557.  
  6558. HOW TO CRACK INFORMATION [WHERE WHAT]
  6559.  
  6560. *    INTERNET
  6561.  
  6562.   In the middle of the hugest junk collection of the planet, some
  6563.  
  6564. real information can be laboriously gathered if you do learn how
  6565.  
  6566. to use well the search engines (or if you do build your ones...
  6567.  
  6568. my spiders are doing most of the work for me... get your robots
  6569.  
  6570. templates from "Harvest" or "Verify" and start your "spider
  6571.  
  6572. building" activity beginning from Martijn Koster's page). As
  6573.  
  6574. usual in our society, in the Internet the real point is exactly
  6575.  
  6576. the same point you'll have to confront all your life long: HOW
  6577.  
  6578. TO THROW AWAY TONS OF JUNK, HOW TO SECLUDE MYRIADS OF USELESS
  6579.  
  6580. INFORMATION and HOW TO FISH RARE USEFUL INFORMATION, a very
  6581.  
  6582. difficult art to learn per se. Internet offers some information,
  6583.  
  6584. though, mainly BECAUSE it's (still) unregulated. You want a
  6585.  
  6586. proof? You are reading it.
  6587.  
  6588. *    SOME (RARE) NEWSPAPERS.
  6589.  
  6590.   The newspaper of the real enemies, the economic powers that
  6591.  
  6592. rule this slaves world, are paradoxically most of the time the
  6593.  
  6594. only ones worth studying... somewhere even the real rulers have
  6595.  
  6596. to pass each other some bits of real information. The "Neue
  6597.  
  6598. Zuercher Zeitung", a newspaper of the Swiss industrials from
  6599.  
  6600. Zuerich, is possibly the best "not_conformist trend analyzer"
  6601.  
  6602. around that you can easily find (even on the web). These
  6603.  
  6604. swissuckers do not give a shit for ideology, nor preconcerted
  6605.  
  6606. petty ideas, the only thing they really want is to sell
  6607.  
  6608. everywhere their ubiquitous watches and their chocolates... in
  6609.  
  6610. order to do it, a land like Switzerland, with very high salaries
  6611.  
  6612. and a good (and expensive) social system, must use something
  6613.  
  6614. brilliant... they found it: a clear vision of the world... as a
  6615.  
  6616. consequence this newspaper is very often "against" the trend of
  6617.  
  6618. all the other medias in the world, the ones that are used only
  6619.  
  6620. in order to tame the slaves... If the only language you know is
  6621.  
  6622. english (poor guy) you could try your luck with the weekly
  6623.  
  6624. "Economist"... you'll have to work a lot with it, coz it has been
  6625.  
  6626. tailored for the "new riches" of the Tatcher disaster, but you
  6627.  
  6628. can (at times) fish something out of it... they do a lot of
  6629.  
  6630. idiotic propaganda, but are nevertheless compelled to write some
  6631.  
  6632. truth. American newspapers (at least the ones you can get here
  6633.  
  6634. in Europe) are absolute shit... one wonders where the hell do the
  6635.  
  6636. americans hyde the real information.
  6637.  
  6638.   On the "non-capitalistic" side of information there is a
  6639.  
  6640. spanish newspaper "El Pais" that seems to know about what's going
  6641.  
  6642. on in South America, but it's so full of useless propaganda about
  6643.  
  6644. irrelevant Spanish politics that it's not really worth reading.
  6645.  
  6646. The monthly "Le Monde diplomatique" offers something too... this
  6647.  
  6648. one exaggerates a little on the pauperistic "third world" side,
  6649.  
  6650. but has a lot of useful information. See what you can do with all
  6651.  
  6652. this information (or disinformation?)
  6653.  
  6654. [BELIEVE THE COUNTRARY]
  6655.  
  6656.      Another good rule of thumb in choosing your medias is the
  6657.  
  6658. following... if all medias around you assure, for instance, that
  6659.  
  6660. "the Serbians are evil"... the only logical consequence is that
  6661.  
  6662. the Serbians are not so evil at all and that "the Croats" or some
  6663.  
  6664. other Yugoslavian shits are the real culprits. This does not mean
  6665.  
  6666. at all that the Serbians are good, I warn you, it means only what
  6667.  
  6668. I say: something is surely hidden behind the concerted propaganda
  6669.  
  6670. you hear, the best reaction is to exaggerate in the other
  6671.  
  6672. direction and believe the few bit of information that do say the
  6673.  
  6674. countrary of the trend. This rule of thumb may be puerile, but
  6675.  
  6676. it works somehow most of the time... if somewhere everybody
  6677.  
  6678. writes that the commies are bad then THERE the commies must not
  6679.  
  6680. be so bad at all and, conversely, if everybody in another place
  6681.  
  6682. writes that the commies are all good and nice and perfect (like
  6683.  
  6684. the Soviet propaganda did) then THERE the commies are surely not
  6685.  
  6686. so good... it's a matter of perspective, much depends on where
  6687.  
  6688. you are, i.e. whose interests are really at stake. There is NEVER
  6689.  
  6690. real information in this society, only propaganda... if you still
  6691.  
  6692. do not believe me do yourself a little experiment... just read
  6693.  
  6694. the media description of a past event (say the Vietnam war) as
  6695.  
  6696. written AT THE MOMENT of the event and (say) as described 10
  6697.  
  6698. years later. You'll quickly realize how untrustworthy all
  6699.  
  6700. newspapers and medias are.
  6701.  
  6702. *    SEMIOTICS You'll have to study it (as soon as you can) to
  6703.  
  6704. interpret what they let you believe, in order to get your
  6705.  
  6706. bearings. A passing knowledge of ancient RHETORIC can help quite
  6707.  
  6708. a lot. Rhetoric is the "Softice" debugger you need to read
  6709.  
  6710. through the propaganda medias: concentrate on Periphrasis,
  6711.  
  6712. Synecdoche, Antonomasia, Emphasis, Litotes and Hyperbole at the
  6713.  
  6714. beginning... you'll later crack higher with Annominatio,
  6715.  
  6716. Polyptoton, Isocolon and all the other lovely "figurae
  6717.  
  6718. sententiae".
  6719.  
  6720. Enough, back to software cracking.
  6721.  
  6722. HOW A REGISTRATION CODE WORKS [WINCAT]
  6723.  
  6724.      Let's take as an example for the next crack, a Username-
  6725.  
  6726. algebraic registration code, WINCAT Pro, version 3.4., a 1994
  6727.  
  6728. shareware program by Mart Heubel. It's a good program, pretty
  6729.  
  6730. useful to catalogue the millions of files that you have on all
  6731.  
  6732. your cd-roms (and to find them when you need them).
  6733.  
  6734. The kind of protection Wincat Pro uses is the most utilized
  6735.  
  6736. around: the username string is manipulated with particular
  6737.  
  6738. algorithms, and the registration key will be made "ad hoc" and
  6739.  
  6740. depends on the name_string. It's a protection incredibly easy to
  6741.  
  6742. crack when you learn how the relevant procedures work.
  6743.  
  6744.      [WINCAT Pro] is a good choice for cracking studies, coz you
  6745.  
  6746. can register "over your registration" one thousand times, and you
  6747.  
  6748. can herefore try for this crack different user_names to see all
  6749.  
  6750. the algebrical correspondences you may need to understand the
  6751.  
  6752. protection code.
  6753.  
  6754.      In this program, when you select the option "register", you
  6755.  
  6756. get a window where you can input your name and your registration
  6757.  
  6758. number (that's what you would get, emailed, after registering
  6759.  
  6760. your copy). If you load winice and do your routinely hwnd to
  6761.  
  6762. individuate the nag window, and then breakpoint on the
  6763.  
  6764. appropriate memory ranges you'll peep in the working of the whole
  6765.  
  6766. bazaar (this is completely useless in order to crack these
  6767.  
  6768. schemes, but it'll teach you a lot for higher cracking, so you
  6769.  
  6770. better do it also with two or three other programs, even if it
  6771.  
  6772. is a little boring): a series of routines act on the input (the
  6773.  
  6774. name) of the user: the User_name_string (usn). First of all the
  6775.  
  6776. usn_length will be calculated (with a REPNZ SCASB and a following
  6777.  
  6778. STOSB). Then various routines store and move in memory the usn
  6779.  
  6780. and the registration_number (rn) and their relative lengths. In
  6781.  
  6782. order to compare their lengths and to check the correct
  6783.  
  6784. alphanumeric correspondence between usn and rn, the program first
  6785.  
  6786. uppercases the usn and strips all eventual spaces away.
  6787.  
  6788.      Here the relevant code (when you see an instruction like
  6789.  
  6790. SUB  AL,20 you should immediately realize that you are in a
  6791.  
  6792. uppercasing routine, which is important for us, since these are
  6793.  
  6794. mostly used for password comparisons)... here the relevant Winice
  6795.  
  6796. unassemble and my comments:
  6797.  
  6798. 253F:00000260  AC        LODSB          <- get the usn chars
  6799.  
  6800. 253F:00000261  08C0      OR   AL,AL     <- check if zero
  6801.  
  6802. 253F:00000263  740F      JZ   0274      <- 0: so usn finished
  6803.  
  6804. 253F:00000265  3C61      CMP  AL,61     <- x61 is "a", man
  6805.  
  6806. 253F:00000267  72F7      JB   0260      <- not a lower, so loop
  6807.  
  6808. 253F:00000269  3C7A      CMP  AL,7A     <- x7A is "z", what else?
  6809.  
  6810. 253F:0000026B  77F3      JA   0260      <- not a lower, so loop
  6811.  
  6812. 253F:0000026D  2C20      SUB  AL,20     <- upper it if it's lower
  6813.  
  6814. 253F:0000026F  8844FF    MOV  [SI-01],AL<- and hyde it away
  6815.  
  6816. 253F:00000272  EBEC      JMP  0260      <- loop to next char
  6817.  
  6818. 253F:00000274  93        XCHG AX,BX
  6819.  
  6820. ...
  6821.  
  6822. The instruction  MOV [SI-01],AL that you see here is important
  6823.  
  6824. at times, coz it points to the location of the "pre-digested"
  6825.  
  6826. usn, i.e. the usn formatted as it should be for the number
  6827.  
  6828. comparison that will happen later. In some more complicated
  6829.  
  6830. protection schemes the reasoning behind this formatting is the
  6831.  
  6832. following: "Stupid cracker will never get the relation algorhitm
  6833.  
  6834. usn <-> rn, coz he does not know that usn AND rn are slightly
  6835.  
  6836. changed before comparing, ah ah... no direct guessing is
  6837.  
  6838. possible". Here is only "polishing": you have to "polish" a
  6839.  
  6840. string before comparing it in order to concede some mistakes to
  6841.  
  6842. the legitimate user (too many spaces in the name, upper-lower
  6843.  
  6844. case mismatch, foreign accents in the name etc.) You just need
  6845.  
  6846. to know, for now, that this checking is usually still 5 or 6
  6847.  
  6848. calls ahead of the real checking (it's what we call a "green
  6849.  
  6850. light").
  6851.  
  6852.      You should in general realize that the real checking of the
  6853.  
  6854. algebrical correspondence follows after a whole series of memory
  6855.  
  6856. operations, i.e.: cancelling (and erasing) the previous (if ever)
  6857.  
  6858. attempts; reduplicating the usn and the rn somewhere else in
  6859.  
  6860. memory; double checking the string lengths (and saving all these
  6861.  
  6862. values somewhere... be particularly attentive when you meet stack
  6863.  
  6864. pointers (for instance [BP+05]): most of the programs you'll find
  6865.  
  6866. have been written in C (what else?). C uses the stack (SS:SP) to
  6867.  
  6868. pass parameters or to create local variables for his procedures.
  6869.  
  6870. The passwords, in particular, are most of the time compared to
  6871.  
  6872. data contained within the stack. If inside a protection a BP
  6873.  
  6874. register points to the stack you have most of the time fished
  6875.  
  6876. something... remember it pupils: it will spare you hours of
  6877.  
  6878. useless cracking inside irrelevant routines. Back to our CATWIN:
  6879.  
  6880. another little check is about the "minimal" length allowed for
  6881.  
  6882. a user name, in our babe, for instance, the usn must have at
  6883.  
  6884. least 6 chars:
  6885.  
  6886.      230F:00003483  3D0600    CMP  AX,0006
  6887.  
  6888.      230F:00003486  730F      JAE  3497      <- go to nice_name
  6889.  
  6890. :too_short
  6891.  
  6892.      230F:00003488  BF9245    MOV  DI,4592   <- no good: short
  6893.  
  6894.   After a lot of other winicing you'll finally come across
  6895.  
  6896. following section of the code:
  6897.  
  6898. 2467:00000CA3  B90100    MOV  CX,0001
  6899.  
  6900. 2467:00000CA6  03F1      ADD  SI,CX
  6901.  
  6902. 2467:00000CA8  2BC1      SUB  AX,CX
  6903.  
  6904. 2467:00000CAA  7213      JB   0CBF
  6905.  
  6906. 2467:00000CAC  40        INC  AX
  6907.  
  6908. 2467:00000CAD  368B4F04  MOV  CX,SS:[BX+04]  <- here
  6909.  
  6910. 2467:00000CB1  0BC9      0R   CX,CX
  6911.  
  6912. 2467:00000CB3  7D02      JGE  0CB7
  6913.  
  6914. 2467:00000CB5  33C9      XOR  CX,CX
  6915.  
  6916. 2467:00000CB7  3BC1      CMP  AX,CX
  6917.  
  6918. 2467:00000CB9  7606      JBE  0CC1
  6919.  
  6920. 2467:00000CBB  8BC1      MOV  AX,CX
  6921.  
  6922. 2467:00000CBD  EB02      JMP  0CC1
  6923.  
  6924. 2467:00000CBF  33C0      XOR  AX,AX
  6925.  
  6926. 2467:00000CC1  AA        STOSB               <- and here
  6927.  
  6928. 2467:00000CC2  8BC8      MOV  CX,AX
  6929.  
  6930. 2467:00000CC4  F3A4      REPZ MOVSB          <- and here!
  6931.  
  6932. 2467:00000CC6  8EDA      MOV  DS,DX
  6933.  
  6934. 2467:00000CC8  FC        RETF 0008
  6935.  
  6936.      This is obviously the last part of the checking routine
  6937.  
  6938. (I'll not delve here with the mathematical tampering of it, if
  6939.  
  6940. you want to check its workings, by all means, go ahead, it's
  6941.  
  6942. quite interesting, albeit such study is NOT necessary to crack
  6943.  
  6944. these schemes). The important lines are obviously the MOV
  6945.  
  6946. CX,SS:[BX+04], the STOSB and the REPZ MOVSB (as usual in password
  6947.  
  6948. protection schemes, you do remember lesson 3, don't you?).
  6949.  
  6950.      You should be enough crack-able :=) by now (if you have read
  6951.  
  6952. all the precedent lessons of my tutorial), to find out easily,
  6953.  
  6954. with these hints, how the working of the protection goes and
  6955.  
  6956. where dwells in memory the ECHO of the correct rn (passkey) that
  6957.  
  6958. matches the name you typed in. Remember that in these kind of
  6959.  
  6960. cracks the ECHO is present somewhere (90% of the cases). There
  6961.  
  6962. are obviously one thousand way to find such ECHOs directly,
  6963.  
  6964. without going through the verificayions routines... for instance
  6965.  
  6966. you could also find them with a couple of well placed
  6967.  
  6968. snap_compares, it's a "5 minutes" cracking, once you get the
  6969.  
  6970. working of it. I leave you to find, as interesting exercise, the
  6971.  
  6972. routine that checks for a "-" inside the rn, a very common
  6973.  
  6974. protection element.
  6975.  
  6976.   In order to help you understand the working of the protection
  6977.  
  6978. code in [Wincat Pro] I'll give you another hint, though: if you
  6979.  
  6980. type "+ORC+ORC+ORC" as usn, you'll have to type 38108-37864 as
  6981.  
  6982. rn, if you usn as usn "+ORC+ORC" then the relative rn will be
  6983.  
  6984. 14055-87593. But these are my personal cracks... I have offered
  6985.  
  6986. this information only to let you better explore the mathematical
  6987.  
  6988. tampering of this specific program... you'll better see the
  6989.  
  6990. snapping mechanism trying them out (going through the routines
  6991.  
  6992. inside Winice) alternatively with a correct and with a false
  6993.  
  6994. password. Do not crack Wincat with my combination! If you use a
  6995.  
  6996. different usn than your own name to crack a program you only show
  6997.  
  6998. that you are a miserable lamer... no better than the lamers that
  6999.  
  7000. believe to "crack" software using huge lists of serial numbers...
  7001.  
  7002. that is really software that they have stolen (Yeah: stolen, not
  7003.  
  7004. cracked). You should crack your programs, not steal them...
  7005.  
  7006. "Warez_kids" and "serial#_aficionados" are only useless zombies.
  7007.  
  7008. I bomb them as soon as I spot them. YOU ARE (gonna be) A CRACKER!
  7009.  
  7010. It makes a lot of a difference, believe me.
  7011.  
  7012. Well, that's it for this lesson, reader. Not all lessons of my
  7013.  
  7014. tutorial are on the Web.
  7015.  
  7016.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  7017.  
  7018. me back (via anon.penet.fi) with some tricks of the trade I may
  7019.  
  7020. not know that YOU discovered. Mostly I'll actually know them
  7021.  
  7022. already, but if they are really new you'll be given full credit,
  7023.  
  7024. and even if they are not, should I judge that you "rediscovered"
  7025.  
  7026. them with your work, or that you actually did good work on them,
  7027.  
  7028. I'll send you the remaining lessons nevertheless. Your
  7029.  
  7030. suggestions and critics on the whole crap I wrote are also
  7031.  
  7032. welcomed.
  7033.  
  7034.      "If you give a man a crack he'll be hungry again
  7035.  
  7036.      tomorrow, but if you teach him how to crack, he'll
  7037.  
  7038.      never be hungry again"
  7039.  
  7040.                                 E-mail +ORC
  7041.  
  7042.                            an526164@anon.penet.fi
  7043.                      HOW TO CRACK, by +ORC, A TUTORIAL
  7044.  
  7045. ---------------------------------------------------------------------------
  7046.  
  7047.                 Lesson 9 (1): How to crack Windows, Hands on
  7048.  
  7049. ---------------------------------------------------------------------------
  7050.  
  7051.                             [Winformant][Snap32]
  7052.  
  7053.                    --------------------------------------
  7054.  
  7055.   THE [DATA_CONSTRAINT] TRICK - [WINFORMANT 4]
  7056.      I have chosen an older windows application for Win 3.1.
  7057. (WIN4MANT.EXE, 562271 bytes, Version 1.10, by Joseph B. Albanese;
  7058. you'll find it searching the web with the usual tools, see how
  7059. to do it at the end of this lesson), in order to show you how to
  7060. use a nice little trick, at times really useful in cracking
  7061. password protected programs: [data_constraint]. Inside almost all
  7062. protection routines, as you have already learned, there is a
  7063. moment when on the stack the ECHO of the real, "correct"
  7064. passnumber or password appears. The location of this ECHO varies,
  7065. but most of the time it'll be in a range of +- 0x90 bytes from
  7066. one of the locations where the user input dwells. This is due to
  7067. datadump windows constraints inside the tools used by the
  7068. protectionists... but this use is bound to diminish... especially
  7069. after this lesson :=)
  7070.  
  7071. [WINFORMANT CRACKING]
  7072.  This application is -per se- crappy, I doubt you'll ever use
  7073. it... but its curious (and pretty rare) "deactivate" mode is
  7074. nevertheless very interesting for us: you can "unregister"
  7075. Winformant on the fly if you feel the need to.
  7076.  This feature is pretty useful for scholars that like to
  7077. investigate password algorithms with valid and invalid codes
  7078. without having to reinstall every time to delete a valid code.
  7079. For your cracking exercises choose programs that have
  7080. "REVERSIBLE" protections (rare) or that can be re-registered a
  7081. billion times (more frequent). Programs that keep the valid
  7082. registration on *.ini or special files will also do the job: you
  7083. just change a couple of lines to "unregister" them.
  7084.  The trick of this lesson: [data_constraint], or "password
  7085. proximity", bases on the protectionist's need to keep an eye on
  7086. the protection "working" when he assembles it. He must "see" the
  7087. relationships between USER INPUT NUMBER, USER INPUT TRANSFORMED
  7088. and the CORRECT NUMBER ANSWER (in our jargon: the "Bingo"). These
  7089. relationships must be constantly checked In order to debug the
  7090. protection code. Mostly they will dwell TOGETHER inside a small
  7091. stack area, allowing them to be "seen" in the SAME watchwindow.
  7092. Most of the time, therefore, the "ECHO" will "materialize"
  7093. shortly not very far away from one of the locations of the USER
  7094. INPUT. Let's crack:
  7095.  
  7096. * Fire Winice and then Winformant
  7097. * Choose HELP and then choose REGISTRATION
  7098. * Fill the registration fields with "+ORC+ORC" as "Registrant"
  7099. and "12121212" as "Activation" code (use whatever you fancy).
  7100. CTRL+D              ;switch to Winice
  7101. :task               ;let's see what's the name of this crap
  7102. TaskName  SS:SP StackTop StackBot StackLow TaskDB  hQueue  Events
  7103. WINWORD   1AD7:85F2 4A52  8670      7532     1247    122F    0000
  7104. PROGMAN   1737:200A 0936  2070      1392     066F    07F7    0000
  7105. DISKOMAT *2C5F:6634 1D3C  6AC6      5192     2CB7    2C9F    0000
  7106.  
  7107. :hwnd DISKOMAT      ;which window is getting the input?
  7108. WinHandle   Hqueue  QOwner    Class Name        Window Procedure
  7109. 0EB4(0)      2C9F    DISKOMAT  #32769            04A7:9E6B
  7110.  0F34(1)     2C9F    DISKOMAT  #32768            USER!BEAR306
  7111.  365C(1)     2C9F    DISKOMAT  #32770            2C3F:0BC6
  7112.   36BC(2)    2C9F    DISKOMAT  Button            2C3F:1CEA
  7113.   3710(2)    2C9F    DISKOMAT  Edit              2C3F:24BE
  7114. ... and many more irrelevant windows.
  7115.  
  7116. Let's pinpoint the code, here the relevant window is the first
  7117. "Edit" one, for obvious reasons (more on this later).
  7118. :bmsg 3710 wm_gettext           ;set breakpoint
  7119. CTRL+D                          ;run the babe until you get:
  7120. Break Due to BMSG 3710 WM_GETTEXT C=01
  7121.   Hwnd=3710 wParam=0050 lParam=2C5F629A msg=000D WM_GETTEXT
  7122. 2C3F:000024BE B82F2C            MOV     AX,2C2F
  7123. So! Now we have "pinpointed" the babe (more on "pinpointing"
  7124. later). Let's snoop around a little: look at the stack to fetch
  7125. your babe's last call (if it does not show immediately, just keep
  7126. pinpointing, for instance on GetWindowText() or do a BPRW
  7127. diskomat (very useful), and then try and retry the stack...
  7128. should this too fail to work, search for your input in memory (in
  7129. the 30:0 lffffffff selector, as usual) and breakpoint range on
  7130. it with ReadWrite, and then stack, stack, stack... until you get
  7131. the "real" list of calls coming from your babe's protection.
  7132. :stack              ; let's see
  7133. USER(19) at 073F:124C [?] through 073F:1239
  7134. CTL3D(02) at 2C3F:0D53 [?] through 2C3F:0D53
  7135. DISKOMAT(01) at 2C97:20B9 [?] through 2C97:20B9
  7136. DISKOMAT(01) at 2C97:3D94 [?] through 2C97:3D94
  7137. DISKOMAT(01) at 2C97:49E2 [?] through 2C97:4918
  7138. DISKOMAT(04) at 2C7F:EA20 [?] through 2C7F:EA20
  7139. USER(01) at 04A7:19BE [?] through USER!GETWINDOWTEXT
  7140. == CTL3D(02) at 2C3F:24BE [?] through 04A7:3A3Cµ
  7141.  
  7142.  Beautiful stack fishing! Do immediately a BPX on babe:EA20.
  7143. 2C7F:EA35 9A25ABA704   CALL   USER!GETWINDOWTEXT
  7144. 2C7F:EA3A 8D46AE       LEA    AX,[BP-52]     ;load ptr "+ORC+ORC"
  7145. 2C7F:EA3D 16           PUSH   SS   ;save pointer segment
  7146. 2C7F:EA3E 50           PUSH   AX   ;save pointer offset
  7147. 2C7F:EA3F 9A768D872C   CALL   2C87:8D76; get strlen "ORC+ORC"
  7148. 2C7F:EA44 83C404       ADD    SP,+04
  7149. 2C7F:EA47 3D2800       CMP    AX,0028
  7150. 2C7F:EA4A 762C         JBE    EA78
  7151. ...
  7152. 2C7F:EA97 8D46AE       LEA    AX,[BP-52]     ;load ptr "+ORC+ORC"
  7153. 2C7F:EA9A 16           PUSH   SS     ;various algors on input
  7154. 2C7F:EA9B 50           PUSH   AX     ;follow here, we do not
  7155. ...                                  ;need to care
  7156. 2C7F:EAB2 0F851101     JNE    EBC7
  7157. 2C7F:EAB6 8D8E5CFF     LEA    CX,[BP+FF5C]  ;ptr "12121212"
  7158. 2C7F:EABA 16           PUSH   SS
  7159. 2C7F:EABB 51           PUSH   CX
  7160. 2C7F:EABC 9A768D872C   CALL   2C87:8D76 ;get strlen "12121212"
  7161. 2C7F:EAC1 83C404       ADD    SP,+04
  7162. 2C7F:EAC4 50           PUSH   AX
  7163. 2C7F:EAC5 8D865CFF     LEA    AX,[BP+FF5C] ;ptr "12121212" HERE!
  7164. 2C7F:EAC9 16           PUSH   SS
  7165. 2C7F:EACA 50           PUSH   AX
  7166. ...etc, various algors on input follow here
  7167.  
  7168.   OK, it's enough: now obviously follows the code that
  7169. "algorithmize" the number string, and then, somewhere, you'll
  7170. have the hideous compare that divides good guys and bad crackers.
  7171. You could examine, and crack, and search...
  7172.   BUT NOW IT'S THE "MAGIC MOMENT" OF THE ECHO! We know and *feel*
  7173. it: The echo must be somewhere... how do we find it? Searching
  7174. "12121212" in memory fishes at least 10 different locations...
  7175. :s 30:0 lffffffff '12121212'
  7176. Pattern Found at 0030:0005AD6A
  7177. .... (7 more)
  7178. Pattern Found at 0030:80509D6A
  7179. Pattern Found at 0030:8145AD6A
  7180.  Should we look for all occurrences of string '12121212',
  7181. starting with the two at 80000000, dumping +-0x90 around it...
  7182. until we find the echo? We could, and it would work, but that's
  7183. not zen... that's boring! In other protections these locations
  7184. could proliferate on purpose, to deter the casual cracker. There
  7185. must be some other way... And lo and behold! YES! There is a
  7186. quicker way... THE LAST loading of the numeric input string in
  7187. the code (the one after the strlen count) is the "right" one for
  7188. our cracking purposes, coz protections follow (mostly) this
  7189. pattern (remember: we are inside a "stack-heavy" section of the
  7190. code... if you want to crack higher I suggest you read some good
  7191. literature about stack working, stack tricks and stack magics
  7192. with the Intel processors):
  7193.      LOAD NAMEString - COUNT NAMEStringLen
  7194.      LOAD NAMEString - TRANSFORM NAMEString
  7195.      LOAD CODEString - COUNT CODEStringLen
  7196.      LOAD CODEString
  7197.                *ECHO must be here*
  7198.      TRANSFORM CODEString
  7199.                *ECHO must be here*
  7200.      COMPARE TRANSFORMED_NAMEString WITH TRANSFORMED_CODEString
  7201.  
  7202.   This means that at line
  7203. 2C7F:EAC5 8D865CFF   LEA  AX,[BP+FF5C]  ;ptr "12121212"
  7204. you'll already have your echo somewhere... just dump the memory
  7205. around the pointer [BP+FF5C]:
  7206. :d 2c5f:61e8   ;these numbers will differ in your computer
  7207. 02 62 2F 06 02 00 26 2E-A3 4E A3 4E 01 00 38 30  .b/...&..N.N..80
  7208. 33 37 2D 36 34 36 2D 33-38 33 36 00 01 06 02 00  37-646-3836.....
  7209. 2F 06 75 62 C3 2E B7 04-F2 24 2F 06 CE 6E 2F 06  /.ub.....$/..n/.
  7210. 49 00 5A 00 01 00-04 2C 2F 06 AE 24 36 62 00 00  I.Z......,/..$6b
  7211. 74 62 7A 2E B7 04 36 62-01 00 C2 62 2F 2C 26 2E  tbz...6b...b/,&.
  7212. 03 01 BA 0F AE 24 5F 02-C9 01 5E 02 BA 01 5F 02  .....$_...^..._.
  7213. 31 32 31 32 31 32 31 32-00 0C 00 BC 02 00 00 00  12121212........
  7214. 00 49 00 BA 0F-AE 24 F2 24 2F 06 00 00 00 00 00  ....I....$.$/...
  7215. AF 17 00 E2 5F-7A 62 FE FF 79 1B BA 0F 00 00 00  ......._zb..y...
  7216. 96 0B 01 00 02 4E 00-37 01 8A 62 D2 0F 8F 17 00  .....N..7..b....
  7217. 2F 06 00 37 01-98 62 20 10 16 03 2F 06 00 00 00  /.....7..b .../.
  7218. C2 62 2B 4F 52 43 2B 4F-52 43 00 0D AE 24 2F 06  .b+ORC+ORC......
  7219.  
  7220.  Look at this dump: everybody is there! The stack pointers points
  7221. in the middle, at string "12121212". 0x50 bytes before it you'll
  7222. find our good old ECHO (i.e. the CORRECT passnumber) and 0x50
  7223. bytes afterwards you'll see your handle: here "+ORC+ORC".
  7224.      It's cracked! The code for my "+ORC+ORC" is 8037-646-3836...
  7225. Now begin your assignments: if you rally want to learn cracking:
  7226. -    "Unregister" and find anew your own code for your own
  7227.      handle. *DO NOT* use serial numbers with any other name
  7228.      that your own handle, that's miserable stealing, not
  7229.      cracking. I'll begin to punish the serial#_aficionados on
  7230.      the Web, coz I like real outlaws, but I detest stupid
  7231.      pickpockets.
  7232. -    Study the two coding algorithms, the one for the input name
  7233.      and the one for the input number, this will be very useful
  7234.      for your future cracking sessions.
  7235. -    Find the "Compare", i.e. the code that sets the two usual
  7236.      flags "good guy, you may move on" and "bad cracker, beggar
  7237.      off", and
  7238. -    Create a "real" crack for this protection, that will allow
  7239.      anybody you think deserves it, with any name and any
  7240.      password number, to get through.
  7241.  
  7242. [CRACKING SNAP 32]
  7243.      Snap 32  (SNAP32.EXE 356.352 bytes, 24/11/95,  Version 2.54,
  7244. by Greg Kochaniak) is a "snapshot" shareware program for Windows
  7245. 95, that allows users to save the screen, parts of it, or a
  7246. single window. It's a very common 'try before you buy' program,
  7247. limited to 30 days use. You'll find it everywhere on the Web. If
  7248. you do not know how to search the Web (poor guy!), learn at the
  7249. end of this lesson the correct procedure to find all the files
  7250. you need on the Net and get them automatically emailed to you
  7251. (that's something you should learn: SEARCHING! It's even more
  7252. important than cracking!).
  7253.      Snap32 is not very interesting (I don't think I used it more
  7254. than a couple of times), but its protection is: in order to (try
  7255. to) deter casual crackers it does not compare strings, it
  7256. compares a "magic" sum (from Namestring) with another magic sum
  7257. (from Numberstring). And:
  7258. *    SUMS magics inside the GDI, not inside its own code;
  7259. *    USES a look_up table for input validation instead of
  7260.      "plain" code;
  7261. *    COMPARES the "magic" manipulation from input NUMBER with
  7262.      the "magic" manipulation from input NAME.
  7263.  
  7264.   The cracking procedure for most of these windows programs is
  7265. pretty simple and relatively straightforward:
  7266.  
  7267. 1)   SEE THE NAME OF YOUR BABE AND ITS QUEUE SELECTOR
  7268. :task     ;This is the Winice95 command you type after firing
  7269. snap32 and getting at the "Enter License" nag window:
  7270.  
  7271. TaskName SS:SP     StckTp   StckBt  StckLw TaskDB  Hqueue  Events
  7272. Snap32   0000:0000 006 AC000 006B0000       270E    D27    0000
  7273.  
  7274. OK, the babe is Snap32,it's HQUEUE is 0xD27, it's TaskDB is
  7275. 0x27OE, orright.
  7276.  
  7277. 2)   SEE THE MODULES OF YOUR BABE:
  7278. :map32 snap32       ;Your command
  7279. Owner     Obj Name  Obj#  Address        Size      Type
  7280. SNAP32    .text     0001  0137:00401000  00043000  CODE  RO
  7281. SNAP32    .rdata    0002  013F:00444000  00002E00  IDATA RO
  7282. SNAP32    .data     0003  013F:00447000  00009000  IDATA RW
  7283. SNAP32    .idata    0004  013F:00471000  00001C00  IDATA RW
  7284. SNAP32    .rsrc     0005  013F:00473000  00001600  IDATA RO
  7285. SNAP32    .reloc    0006  013F:00475000  00004C00  IDATA RO
  7286.  
  7287. OK, so the code is in selector 137:(as usual), and you have there
  7288. 43000 bytes of code from 401000 to 401000+43000; the DATA,
  7289. ReadWrite and ReadOnly, are in selector 13F: (as usual).
  7290.  
  7291. 3) SEE THE HANDLE OF THE PROTECTION "NAG" WINDOW
  7292. :hwnd snap32             ;Your command
  7293. Window Handle  Hqueue  SZ  Qowner   Class Name Window Procedure
  7294.  0350(1)       0D27    32  SNAP32   #02071     144F:0560
  7295.   0354(2)      0D27    32  SNAP32   #02071     17CF:102E
  7296.   ... and many more windows that we do not care of.
  7297.  
  7298.   OK, so, for our cracking purposes, it's Handle 0x350. Most of
  7299. the times the "nag" window you want to crack will be the first
  7300. one in the hwnd listing (coz it was the last one to appear).
  7301. Watch the number in parentheses that follows the Whandle: (1) is
  7302. a mother, (2) are "children" windows. At times you'll find under
  7303. "Class Name" something like "Edit" (see before the Winformant
  7304. cracking)... SNIFF THERE! At times the "Window Procedure" code
  7305. location in a list of more than twenty, will be slightly
  7306. different for one or two windows... SNIFF THERE!
  7307.  
  7308. 4) BREAKPOINT MESSAGE WM_GETTEXT (or any other WM_ that you can
  7309. think of in order to "pinpoint" the code of our babe).
  7310. "Pinpointing" the code is extremely important in windows
  7311. cracking... this idiotic OS moves code, data and stack out and
  7312. inside the pages all the time... so you'll keep getting on
  7313. "INVALID" sections without a correct pinpointing. Good
  7314. Pinpointing points are in general:
  7315.   BMSG xxxx WM_GETTEXT   (good for passwords)
  7316.   BMSG xxxx WM_COMMAND   (good fro OK buttons)
  7317.   BPRW *your babe* TW    (good for tracking)
  7318.   u USER!GETWINDOWTEXT   (u and then BPX inside the code)
  7319.   u GETDLGITEM           (for the Hwnd of an Item inside a
  7320.                          Dialog Box)
  7321.   CSIP NOT GDI           (if you have too many interferences)
  7322.   u USER!SHOWWINDOW      (bpx with counter occurrence to get to
  7323.                          the "right" window)
  7324.   u GETSYSTEMTIME        (for "time-crippled" software)
  7325. and many others pinpointing points you'll learn. If you are
  7326. really desperate for pinpointing, just do a BMSG xxxx WM_MOVE and
  7327. then move the nag window, this will always work. Let's go on:
  7328.  
  7329. :bmsg 350 wm_gettext     ;Your command
  7330. OK, so the code is ready to be pinpointed.
  7331.  
  7332. 5)RUN THE PROGRAM TO THE BREAKPOINT:
  7333. CTRL+D                   ;Your command to exit Winice and run
  7334.                          until it pops out at breakpoint
  7335. OK, now you pop out inside Winice somewhere... (look at the stack
  7336. to know where) so the code has been pinpointed.
  7337.  
  7338. 6) SEARCH THE DATA AREA for your input string (4 Gigabytes from
  7339. 30:0... remember that DATA are *always* in 30:0 to 30:FFFFFFFF
  7340. and CODE is *always* in 28:0 to 28:FFFFFFFF). In most protection
  7341. the "registration_number" string must match the "username"
  7342. string, which cannot be constrained, in order to allow users to
  7343. choose whatever stupid name they fancy. Some protections requires
  7344. fixed symbols inside the "username" string, though... in these
  7345. rare eventualities, just apply to the "username" string what
  7346. we'll do here with the "registration_number" string. The point
  7347. to remember is: begin always with the protection fumbling your
  7348. number, crack only if necessary the protection that fumbles your
  7349. name. Let's search now.
  7350.  
  7351. :s 30:0 lffffffff '12121212'  ;Your command
  7352.      Pattern Found at 0030:80308612
  7353.  
  7354. 80000000 is good. Lower era videos, mirrors and BIOS, higher
  7355. (around C0000000) you have the OS dustbins... the point to
  7356. remember is: investigate always FIRST the 80000000 locations.
  7357.  
  7358. 7)   BREAKPOINT ON MEMORY RANGE ON THIS STRING.
  7359. By the way: prepare a watch window  dex 3 es:di, you'll soon see
  7360. how useful such an automated watchwindow is in password cracking.
  7361.  
  7362. :bpr 30:80308612 30:80308612+8 RW  ;Your command
  7363.  
  7364. OK Now we'll begin to dig out the relevant parts of the code.
  7365. Remember that you must breakpoint *every* copy of the string that
  7366. protection generates. A typical copy routine, very frequently
  7367. used in windows copy protection schemes, dwells inside
  7368. KERNEL!HMEMCPY (+0076):
  7369.  
  7370. 0117:9E8E 66C1E902      SHR     ECX,02
  7371. 0117:9E92 F36766A5      REPZ MOVSD      ;makes a copy in es:di
  7372. 0117:9E96 6659          POP     ECX
  7373. 0117:9E98 6683E103      AND     ECX,+03
  7374. 0117:9E9C F367A4        REPZ MOVSB
  7375. 0117:9E9F 33D2          XOR     DX,DX
  7376.  
  7377. In fact, this piece of copying code is so often used for password
  7378. verifications that sometimes you just need to bpx on 0117:9E92
  7379. to get the correct stack sequence... but let's, for now, continue
  7380. without such little tricks: just keep on BPRring (Breakpoint on
  7381. memory range) all copies that protection makes.
  7382.  
  7383. 8) LET THE BABE RUN, it will breakpoint on all manipulations of
  7384. your input string. One of them will lead to the magic.
  7385. 8.1.)     VALIDATION phase
  7386. There are many routines that check and "validate" your inputs.
  7387. The most common ones check that your numbers ARE really numbers,
  7388. i.e. in the range 0x30-0x39. Usually this is done with:
  7389.           CMP  EAX,+30
  7390.           JB   no_number
  7391.           CMP  EAX,+39
  7392.           JA   no_number
  7393. At times the protectionists use TABLES instead... The number
  7394. itself is used as a pointer to a "ready made" table where the
  7395. relevant magic can be used as a protection. Imagine that a number
  7396. 4  in your input points to a code section that throws you
  7397. immediately outside the validation routine... or imagine that a
  7398. number 7, if found in your input, fetches a magic code that
  7399. removes the whole program from your harddisk (or worse): "Ah, ah!
  7400. Stupid cracker will never know that he should not have used
  7401. number 4... and definitely not number 7! Next time he'll
  7402. learn..." Yes, tables have been used for such nasty tricks.
  7403. Here the relevant code for the "validation" part of our
  7404. protection (still checking my favourite input string '12121212'):
  7405. :check_if_valid
  7406. 0137:4364AE 8A16       MOV     DL,[ESI] ;load license number
  7407. 0137:4364B0 33C0       XOR     EAX,EAX  ;zero AX
  7408. 0137:4364B2 668B0451   MOV     AX,[ECX+2*EDX] ;look table for 84
  7409. 0137:4364B6 83E008     AND     EAX,+08  ;OK if AND'S TO zero
  7410. 0137:4364B9 85C0       TEST    EAX,EAX  ;and therefore
  7411. 0137:4364BB 7403       JZ      004364C0 ;go on
  7412. 0137:4364BD 46         INC     ESI      ; ready for next number
  7413. 0137:4364BE EBCD       JMP     0043648D
  7414. :strip_-_&_+_signs
  7415. 0137:4364C0 33DB       XOR     EBX,EBX  ;clean BX
  7416. 0137:4364C2 8A1E       MOV     BL,[ESI] ;load license number
  7417. 0137:4364C4 46         INC     ESI      ;ready for next
  7418. 0137:4364C5 8BFB       MOV     EDI,EBX  ;save copy
  7419. 0137:4364C7 83FB2D     CMP     EBX,+2D  ;is it a "-"?
  7420. 0137:4364CA 7405       JZ      004364D1
  7421. 0137:4364CC 83FB2B     CMP     EBX,+2B  ;is it a "+"?
  7422.  
  7423. 8.2.)     MANIPULATION (summing magic numbers)
  7424. Your wisely set breakpoints on memory range for the occurrence
  7425. of the string "12121212" will pop you out, inter alia, inside
  7426. following piece of code (note how this part of protection dwells
  7427. inside GDI, and  NOT inside the code selector of snap32):
  7428. 0557:11BD 33C0         XOR  EAX,EAX        ;zero AX
  7429. 0557:11BF 66648B06     MOV  AX,FS:[ESI]    ;load number
  7430. 0557:11C3 83C602       ADD  ESI,+02        ;point to next
  7431. 0557:11C6 66833C4700   CMP  WORD PTR [EDI+2*EAX],+00
  7432. 0557:11CB 0F8424010000 JE   000012F5
  7433. 0557:11D1 668B0442     MOV  AX,[EDX+2*EAX] ;load from magic table
  7434. 0557:11D5 03D8         ADD  EBX,EAX        ;save sum in EBX
  7435. 0557:11D7 49           DEC  ECX            ;till we are done
  7436. 0557:11D8 75E5         JNZ  000011BF       ;loop along
  7437.  
  7438. Interesting, isn't it? Protection is using this GDI routine to
  7439. create a SUM (through pointers to another table) that depends on
  7440. your very input numbers. We are now very near to the crack... can
  7441. you *feel* it? If not, prepare yourself a good Martini Vodka!
  7442. This is the correct way to do it:
  7443.  * Get a "highball" glass;
  7444.  * Put some ice cubes inside it (2 or 3);
  7445.  * Add Martini Dry (From Martini & Rossi). Fill to 1/3;
  7446.  * Add Moskowskaja Wodka (the only real Vodka). Fill to 2/3;
  7447.  * Add a zest of lemon (From Malta or Southern France);
  7448.  * Add a green "sound" olive (from Italy or Israel);
  7449.  * Add Schweppes Indian Tonic. Fill to the brim.
  7450. Sit deeper and relax, sip slowly and *feel* where the code of the
  7451. protection scheme you are cracking "moves"... It's like a
  7452. current... a slow tide. If you still do not believe me, just try
  7453. it.
  7454.  
  7455. We'll now find out where protection stores the "magic" sum (and
  7456. now you'll pop out inside the very own snap32 code, this is the
  7457. "real" protection part):
  7458.  
  7459. 8.3.)     The ludicrous "HIDING" of the magic sum
  7460. 0137:40437E 83C404       ADD     ESP,+04
  7461. 0137:404381 8B4DE8       MOV     ECX,[EBP-18]
  7462. 0137:404384 8945F0       MOV     [EBP-10],EAX  ;***HERE!***
  7463. 0137:404387 68FF000000   PUSH    000000FF
  7464. 0137:40438C 8D8574FBFFFF LEA     EAX,[EBP+FFFFFB74] ;load string
  7465. 0137:404392 50    PUSH   EAX                      ;push it
  7466. 0137:404393 E886410100   CALL    0041851E         ;manipulate
  7467. 0137:404398 8D8574FBFFFF LEA     EAX,[EBP+FFFFFB74] ;load string
  7468. 0137:40439E 50    PUSH   EAX                      ;push it
  7469. 0137:40439F E88C210300   CALL    00436530         ;manipulate
  7470.  
  7471. As you can see, the protection is very simple: The "magic" sum
  7472. is hidden only two lines before the further manipulations of the
  7473. input string. We have found location 137:404384, here, in the
  7474. CORRECT way, through bprring of the string that has been
  7475. manipulated in the GDI, but actually, we could have found it
  7476. quickly just checking superficially what's happening "around" all
  7477. manipulations of the input string. Do we really need to follow
  7478. all manipulations of our registration_number and eventually also
  7479. all manipulation of our username? NO, not at all: we just set a
  7480. BPR on the stack location where protection hides the sum [EBP-10]
  7481. and we'll see what happens: 90% of these protections just create
  7482. two sums, a sum from your username and a sum from your
  7483. registration_number... somewhere there will be a compare that
  7484. must use this location (or a copy of it... we'll see).
  7485.  
  7486. 8.4.) COMPARING THE MAGICS FROM THE TWO INPUT STRING
  7487. Breakpoint on memory range on the sum location [EBP-10] that you
  7488. saw in the previous code and you'll land at this piece of code:
  7489. 0137:404412 E82F050000   CALL 00404946
  7490. 0137:404417 83C40C       ADD  ESP,+0C
  7491. 0137:40441A 3B45F0       CMP  EAX,[EBP-10] ;comp AX & magicsum
  7492. 0137:40441D 740F         JZ   0040442E
  7493. 0137:40441F 68C0874400   PUSH 004487C0
  7494. 0137:404424 E8149E0000   CALL 0040E23D
  7495. 0137:404429 83C404       ADD  ESP,+04
  7496. 0137:40442C EB5B         JMP  00404489
  7497. 0137:40442E 893DA0714400 MOV  [004471A0],EDI
  7498. 0137:404434 85FF         TEST EDI,EDI
  7499.  
  7500. That's it, you have made it! We found the compare between the
  7501. "username" magic number (for my "+ORC+ORC" string that's here
  7502. 0x7C25621B) in AX (we do not need to know how this landed
  7503. there... it's irrelevant!) and the "license_number" '12121212'
  7504. (whose magic is here 0x00B8F47C) stored in [pointer-10.] How do
  7505. we find now the correct INPUT number for +ORC+ORC? Well, it's
  7506. easy...  the "magic number" must be the same... therefore:
  7507.  
  7508. Cracked=Dec(0x7C25621B)
  7509. Cracked=2082824731
  7510.  
  7511.      That was it. Old Snap32 has been cracked. You could now
  7512. prepare a crack in order to distribute this program around
  7513. without its simple protection. Good cracked applications should
  7514. be given free (i.e. cracked) to all the people that NEED them and
  7515. do not have the money to buy them. Don't forget that in this
  7516. intolerable society the 0,5% of the citizens own the 56% of the
  7517. industrial capital and the 63% of the propaganda machines (data
  7518. from US researchers... therefore suspect... the real situation
  7519. is probably even worser) effectively conditioning the destiny of
  7520. millions of slaves, moronized by television watching. So crack
  7521. the applications and give them to the people you care and the
  7522. peolple that need them, but for the others... just EXPLAIN
  7523. everybody how you did it... this is real help: giving knowledge,
  7524. not wares. DO NOT use my handle and my codes to crack this
  7525. program, get yours, I gave you mine only as an help for this
  7526. cracking lesson. I have showed you the way enough... THIEFS, not
  7527. crackers, use the codes that others have found. You are (gonna
  7528. be) CRACKERS! Remember it, look straight ahead, crack accurately
  7529. and keep your tommy in.
  7530.  
  7531. HOW TO SEARCH THE INTERNET FOR FILES WITHOUT MOVING A FINGER
  7532.   It's amazing: most of the people roaming around inside Internet
  7533. DO NOT know how to use effectively the web. I'll be very
  7534. altruistic and explain how to fetch the very example of Snap32,
  7535. the babe we cracked in this lesson.
  7536.  
  7537. 1) Choose an archie from this list (I will not explain you what
  7538. an archie is, you should know it... if you do not, be ashamed):
  7539.      archie.univie.ac.at      131.130.1.23        Austria
  7540.      archie.belnet.be         193.190.248.18      Belgium
  7541.      archie.funet.fi          128.214.6.102       Finland
  7542.      archie.univ-rennes1.fr   129.20.254.2        France
  7543.      archie.th-darmstadt.de   130.83.22.1         Germany
  7544.      archie.ac.il             132.65.16.8         Israel
  7545.      archie.unipi.it          131.114.21.10       Italy
  7546.      archie.uninett.no        128.39.2.20         Norway
  7547.  
  7548. 2) Email a message to your archie:
  7549.      To:       archie.univie.ac.at (for instance)
  7550.      Subject:                      (nothing on this field)
  7551.      Body:     set search sub      (substrings too)
  7552.                set maxhits 140     (max 140 hits)
  7553.                set maxhitspm 9     (not the same file all over)
  7554.                find snap32         (we want this)
  7555.  
  7556. 3) After a while you'll get (per email) your answer: Here the
  7557. answer from the Austrian archie
  7558.  
  7559. Host ftp.wu-wien.ac.at    (137.208.8.6)
  7560.  Last updated 17:48  9 Aug 1995
  7561.  Location: /pub/systems/windows.32/misc
  7562.   FILE    -rw-r-----  128957 bytes  15:59 16 Jun 1995  snap32.zip
  7563. Host space.mit.edu    (18.75.0.10)
  7564.  Last updated 00:45  4 Mar 1996
  7565.  Location: /pub/mydir
  7566.   FILE    -rw-r--r--  407040 bytes  11:55 28 Nov 1995  snap32.exe
  7567.  
  7568. 4) ftpmail your file (Browsing is no good: too busy and lame).
  7569. Again, I will not explain you what an FTPMAIL server is: learn
  7570. it by yourself... choose a good one from this list (there are
  7571. many more... you'll learn):
  7572.    bitftp@vm.gmd.de                           (Germany)
  7573.    ftpmail@ieunet.ie                          (Ireland)
  7574.    bitftp@plearn.edu.pl                       (Poland)
  7575.    ftpmail@ftp.sun.ac.za                      (South Africa)
  7576.    ftpmail@ftp.sunet.se                       (Sweden)
  7577.    ftpmail@ftp.luth.se                        (Sweden)
  7578.    ftpmail@src.doc.ic.ac.uk                   (United Kingdom)
  7579.  
  7580. To:       ftpmail@ftp.sun.ac.za.   (for instance)
  7581. Subject:                           (leave blank)
  7582. Body:     open space.mit.edu       (the last occurrence that
  7583.                                    the archie sent)
  7584.           cd/pub/mydir             (get the correct subdir)
  7585.           bin                      (prepare for BINARY)
  7586.           get snap32.exe           (I want this)
  7587.           quit                     (bye)
  7588.  
  7589. 5) Your FTPMAIL server will first notice you a receipt:
  7590.  
  7591. FTP EMAIL response...
  7592. ftpmail has received the following job from you:
  7593.       reply-to +ORC
  7594.       open space.mit.edu +ORC@now.here
  7595.       get snap32.exe
  7596. ftpmail has queued your job as: 1834131821.5514
  7597. Your priority is 1 (0 = highest, 9 = lowest)
  7598. Requests to sunsite.doc.ic.ac.uk will be done before other jobs.
  7599. There are 14 jobs ahead of this one in the queue.
  7600. 4 ftpmail handlers available.
  7601. To remove send a message to ftpmail containing just:
  7602. delete 1834131821.5514
  7603.  
  7604. After a while you'll get a second message, with your file
  7605. uuencoded inside... everything has been done.
  7606. YESSIR! there is absolutely no need to loose time on the WWW,
  7607. "surfing" idiotically from a junk site to the next or waiting
  7608. hours to download some slow file from an instable server! Wasting
  7609. time of your own LIFE, that you could use to read poetry, to make
  7610. love, to look at the stars, to sail slowly between the Aegean
  7611. islands or to start a nice cracking session. What's the point of
  7612. wasting your time when machines can perform all the searches you
  7613. need better, more productively and faster than you ever could...
  7614. YESSIR! You can get *everything* on the Web, and without paying
  7615. your Internet provider more than a couple of dimes... Nice, isn't
  7616. it?
  7617.  
  7618. By now, if you have followed all my lessons, you should be able
  7619. to crack relatively quickly "normal" applications. There are some
  7620. new projects for 1997: a cracking "university", that will allow
  7621. us to prepare for the divine war against Microsoft repulsive
  7622. dominion. If you do not have already chosen your handle (your
  7623. "cracker" name, that's it), you may consider choosing an handle
  7624. with a "+" somewhere inside it or, eventually, add a "+" to your
  7625. handle. This sign is used by me and by friends that have studied
  7626. and/or contributed. But a "+" in your handle ("official +ORC
  7627. cracker") will mean even more:
  7628. 1)   allows support from me personally (on a "do ut des" basis)
  7629. 2)   allows pupils to identify each other (good for joining
  7630.      forces)
  7631. 3)   will open you (eventually) the doors to the "higher"
  7632.      cracking university I'll set up on the Web in 1997.
  7633. (I'm not getting megalomaniac... In reality I only need a "quick"
  7634. method to know on which (anonymous) people I can count on for the
  7635. next phase).
  7636.  
  7637. Well, that's it for this lesson, reader. Not all lessons of my
  7638. tutorial are on the Web.
  7639.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  7640. me back (via anon.penet.fi) with some tricks of the trade I may
  7641. not know that YOU discovered. Mostly I'll actually know them
  7642. already, but if they are really new you'll be given full credit,
  7643. and even if they are not, should I judge that you "rediscovered"
  7644. them with your work, or that you actually did good work on them,
  7645. I'll send you the remaining lessons nevertheless. Your
  7646. suggestions and critics on the whole crap I wrote are also
  7647. welcomed.
  7648.  
  7649.                                 E-mail +ORC
  7650.  
  7651.                         +ORC an526164@anon.penet.fi
  7652.                      HOW TO CRACK, by +ORC, A TUTORIAL
  7653.  
  7654. ---------------------------------------------------------------------------
  7655.  
  7656.           Lesson A.1: Advanced Cracking: Internet Cracking (Unix)
  7657.  
  7658. ---------------------------------------------------------------------------
  7659.  
  7660. ------------->   INTERNET CRACKING: FIREWALLS
  7661.  
  7662.      With each new company that connects to the "Information
  7663.  
  7664. Superhighway" new frontiers are created for crackers to explore.
  7665.  
  7666. Site administrators (Siteads) have implemented various security
  7667.  
  7668. measures to protect their internal networks. One of these is
  7669.  
  7670. xinetd, covered later. A more general solution is to construct
  7671.  
  7672. a guarded gateway, called a [Firewall], that sits between a
  7673.  
  7674. site's internal network and the wild and woolly Internet where
  7675.  
  7676. we roam. In fact only one third of all Internet connected
  7677.  
  7678. machines are already behind firewalls. Most information services
  7679.  
  7680. have to deal with the same problem we have: getting OUT through
  7681.  
  7682. a local firewall or GETTING INTO a service through their
  7683.  
  7684. Firewall. There lays also the crack_solution.
  7685.  
  7686. ------------>         What is a Firewall?
  7687.  
  7688.      The main purpose of a Firewall is to prevent unauthorized
  7689.  
  7690. access between networks. Generally this means protecting a site's
  7691.  
  7692. inner network from the Internet. If a site has a firewall,
  7693.  
  7694. decisions have been made as to what is allowed and disallowed
  7695.  
  7696. across the firewall. These decisions are always different and
  7697.  
  7698. always incomplete, given the multiplicity of Internet, there are
  7699.  
  7700. always loopholes where a cracker can capitalize on.
  7701.  
  7702.      A firewall basically works by examining the IP packets that
  7703.  
  7704. travel between the server and the client. This provides a way to
  7705.  
  7706. control the information flow for each service by IP address, by
  7707.  
  7708. port and in each direction.
  7709.  
  7710.      A firewall embodies a "stance". The stance of a firewall
  7711.  
  7712. describes the trade-off between security and ease-of-use. A
  7713.  
  7714. stance of the form "that which is not expressly permitted is
  7715.  
  7716. prohibited" requires that each new service be enabled
  7717.  
  7718. individually and is seldom used, coz very slow and annoying.
  7719.  
  7720. Conversely, the stance "that which is not expressly prohibited
  7721.  
  7722. is permitted" has traded a level of security for convenience. It
  7723.  
  7724. will be useful to guess the stance of the firewall you are
  7725.  
  7726. cracking when making probe decisions.
  7727.  
  7728.      A firewall has some general responsibilities:
  7729.  
  7730. *    First and foremost if a particular action is not allowed by
  7731.  
  7732. the policy of the site, the firewall must make sure that all
  7733.  
  7734. attempts to perform the action will fail.
  7735.  
  7736. *    The firewall should log suspicious events
  7737.  
  7738. *    The firewall should alert internal administration of all
  7739.  
  7740. cracking attempts
  7741.  
  7742. *    Some firewall provide usage statistics as well.
  7743.  
  7744. ------------>          Types of Firewall
  7745.  
  7746.      In order to avoid head-scratching, it's a good idea to know
  7747.  
  7748. the TOPOLOGY of "your" firewall -and its limitations- before
  7749.  
  7750. attempting to get through it. Discussed below are two popular
  7751.  
  7752. firewall topologies. Although other types exist, the two below
  7753.  
  7754. represent the basic forms; most other firewalls employ the same
  7755.  
  7756. concepts and thus have -luckily- the same limitations.
  7757.  
  7758.                    1) THE DUAL-HOMED GATEWAY
  7759.  
  7760.      A dual-homed Gateway is a firewall composed of a single
  7761.  
  7762. system with at least two network interfaces. This system is
  7763.  
  7764. normally configured such that packets are not directly routed
  7765.  
  7766. from one network (the Internet) to the other (the internal net
  7767.  
  7768. you want to crack). Machines on the Internet can talk to the
  7769.  
  7770. gateway, as can machines on the internal network, but direct
  7771.  
  7772. traffic between nets is blocked.
  7773.  
  7774.      In discussing firewalls, it's generally accepted that you
  7775.  
  7776. should think of the inner network as a medieval castle. The
  7777.  
  7778. "bastions" of a castle are the critical points where defence is
  7779.  
  7780. concentrated. In a dual-homed gateway topology, the dual-homed
  7781.  
  7782. host itself is called the [BASTION HOST].
  7783.  
  7784.      The main disadvantage of a dual-homed gateway, from the
  7785.  
  7786. viewpoints of the users of the network and us crackers alike, is
  7787.  
  7788. the fact that it blocks direct IP traffic in both directions. Any
  7789.  
  7790. programs running on the inner network that require a routed path
  7791.  
  7792. to external machines will not function in this environment. The
  7793.  
  7794. services on the internal network don't have a routed path to the
  7795.  
  7796. clients outside. To resolve these difficulties, dual-homed
  7797.  
  7798. gateways run programs called [PROXIES] to forward application
  7799.  
  7800. packets between nets. A proxy controls the conversation between
  7801.  
  7802. client and server processes in a firewalled environment. Rather
  7803.  
  7804. than communicating directly, the client and the server both talk
  7805.  
  7806. to the proxy, which is usually running on the bastion host
  7807.  
  7808. itself. Normally the proxy is transparent to the users.
  7809.  
  7810.      A proxy on the bastion host does not just allow free rein
  7811.  
  7812. for certain services. Most proxy software can be configured to
  7813.  
  7814. allow or deny forwarding based on source or destination addresses
  7815.  
  7816. or ports. Proxies may also require authentication of the
  7817.  
  7818. requester using encryption- or password-based systems.
  7819.  
  7820.      The use of proxy software on the bastion host means that the
  7821.  
  7822. firewall administrator has to provide replacements for the
  7823.  
  7824. standard networking clients, a nightmare in heterogeneous
  7825.  
  7826. environments (sites with many different operating systems
  7827.  
  7828. platforms, PC, Sun, IBM, DEC, HP...) and a great burden for
  7829.  
  7830. administrator and users alike.
  7831.  
  7832.                  2) THE SCREENED HOST GATEWAY
  7833.  
  7834.      A screened host gateway is a firewall consisting of at least
  7835.  
  7836. one router and a bastion host with a single network interface.
  7837.  
  7838. The router is typically configured to block (screen) all traffic
  7839.  
  7840. to the internal net such that the bastion host is the only
  7841.  
  7842. machine that can be reached from the outside. Unlike the dual-
  7843.  
  7844. homed gateway, a screened host gateway does not necessarily force
  7845.  
  7846. all traffic through the bastion host; through configuration of
  7847.  
  7848. the screening router, it's possible to open "holes" in the
  7849.  
  7850. firewall to the other machines on the internal net you want to
  7851.  
  7852. get into.
  7853.  
  7854.      The bastion host in a screened host firewall is protected
  7855.  
  7856. from the outside net by the screening router. The router is
  7857.  
  7858. generally configured to only allow traffic FROM SPECIFIC PORTS
  7859.  
  7860. on the bastion host. Further, it may allow that traffic only FROM
  7861.  
  7862. SPECIFIC EXTERNAL HOSTS. For example the router may allow Usenet
  7863.  
  7864. news traffic to reach the bastion host ONLY if the traffic
  7865.  
  7866. originated from the site's news provider. This filtering can be
  7867.  
  7868. easily cracked: it is relying on the IP address of a remote
  7869.  
  7870. machine, which can be forged.
  7871.  
  7872.      Most sites configure their router such that any connection
  7873.  
  7874. (or a set of allowed connections) initiated from the inside net
  7875.  
  7876. is allowed to pass. This is done by examining the SYN and ACK
  7877.  
  7878. bits of TCP packets. The "start of connection" packet will have
  7879.  
  7880. both bits set. If this packets source address is internal... or
  7881.  
  7882. seems to be internal :=) the packet is allowed to pass. This
  7883.  
  7884. allows users on the internal net to communicate with the internet
  7885.  
  7886. without a proxy service.
  7887.  
  7888.      As mentioned, this design also allows "holes" to be opened
  7889.  
  7890. in the firewall for machines on the internal net. In this case
  7891.  
  7892. you can crack not only the bastion host, but also the inner
  7893.  
  7894. machine offering the service. Mostly this or these machine/s will
  7895.  
  7896. be far less secure than the bastion host.
  7897.  
  7898.      New services, for instance recent WEB services, contain a
  7899.  
  7900. lot of back doors and bugs, that you'll find in the appropriate
  7901.  
  7902. usenet discussion groups, and that you could use at freedom to
  7903.  
  7904. crack inner machines with firewall holes. Sendmail is a good
  7905.  
  7906. example of how you could crack in this way, read the whole
  7907.  
  7908. related history... very instructive. The rule of thumb is "big
  7909.  
  7910. is good": the bigger the software package, the more chance that
  7911.  
  7912. we can find some security related bugs... and all packages are
  7913.  
  7914. huge nowadays, 'coz the lazy bunch of programmers uses
  7915.  
  7916. overbloated, buggy and fatty languages like Visual Basic or
  7917.  
  7918. Delphy!
  7919.  
  7920. Finally, remember that the logs are 'mostly) not on the bastion
  7921.  
  7922. host! Most administrators collect them on an internal machine not
  7923.  
  7924. accessible from the Internet. An automated process scan the logs
  7925.  
  7926. regularly and reports suspicious information.
  7927.  
  7928.  
  7929.  
  7930.                  3) OTHER FIREWALL TOPOLOGIES
  7931.  
  7932. The dual-homed gateway and the screened host are probably the
  7933.  
  7934. most popular, but by no mean the only firewall topologies. Other
  7935.  
  7936. configurations include the simple screening router (no bastion
  7937.  
  7938. host), the screened subnet (two screening routers and a bastion
  7939.  
  7940. host) as well as many commercial vendor solutions.
  7941.  
  7942. ------------>   Which software should we study?
  7943.  
  7944. Three popular unix software solutions allow clients inside a
  7945.  
  7946. firewall to communicate with server outside: CERN Web server in
  7947.  
  7948. proxy mode, SOCKS and the TIS Firewall toolkit.
  7949.  
  7950. 1)   The CERN Web server handles not only HTTP but also the other
  7951.  
  7952. protocols that Web clients use and makes the remote connections,
  7953.  
  7954. passing the information back to the client transparently. X-based
  7955.  
  7956. Mosaic can be configured for proxy mode simply by setting a few
  7957.  
  7958. environment variables.
  7959.  
  7960. 2)   The SOCKS package (available free for anonymous ftp from
  7961.  
  7962. ftp.nec.com in the file
  7963.  
  7964.         /pub/security/socks.cstc/socks.cstc.4.2.tar.gz
  7965.  
  7966. includes a proxy server that runs on the bastion host of a
  7967.  
  7968. firewall. The package includes replacements for standard IP
  7969.  
  7970. socket calls such as connect(), getsockname(), bind(), accept(),
  7971.  
  7972. listen() and select(). In the package there is a library which
  7973.  
  7974. can be used to SOCKSify your crack probes.
  7975.  
  7976. 3)   The Firewall Toolkit
  7977.  
  7978. The toolkit contains many useful tools for cracking firewall and
  7979.  
  7980. proxy server. netacl can be used in inetd.conf to conceal
  7981.  
  7982. incoming requests against an access table before spawning ftpd,
  7983.  
  7984. httpd or other inetd-capable daemons. Mail will be stored in a
  7985.  
  7986. chroot()ed area of the bastion for processing (mostly by
  7987.  
  7988. sendmail).
  7989.  
  7990. The Firewall toolkit is available for free, in anonymous ftp from
  7991.  
  7992. ftp.tis.com in the file
  7993.  
  7994.                /pub/firewalls/toolkit/fwtk.tar.Z
  7995.  
  7996. The popular PC firewall solution is the "PC Socks Pack", for MS-
  7997.  
  7998. Windows, available from ftp.nec.com It includes a winsock.dll
  7999.  
  8000. file.
  8001.  
  8002.      The cracking attempts should concentrate on ftpd, normally
  8003.  
  8004. located on the bastion host. It's a huge application, necessary
  8005.  
  8006. to allow anonymous ftp on and from the inner net, and full of
  8007.  
  8008. bugs and back doors. Normally, on the bastion host, ftpd is
  8009.  
  8010. located in a chroot()ed area and runs as nonprivileged user. If
  8011.  
  8012. the protection is run from an internal machine (as opposing the
  8013.  
  8014. bastion host), you could take advantage of the special inner-net
  8015.  
  8016. privileges in hostp.equiv or .rhosts. If the internal machine
  8017.  
  8018. "trusts" the server machine, you'll be in pretty easily.
  8019.  
  8020.      Another good method, that really works, is to locate your
  8021.  
  8022. PC physically somewhere along the route between network and
  8023.  
  8024. archie server and "spoof" the firewall into believing that you
  8025.  
  8026. are the archie server. You'll need the help of a fellow hacker
  8027.  
  8028. for this, though.
  8029.  
  8030.      Remember that if you gain supervisor privileges on a machine
  8031.  
  8032. you can send packets from port 20, and that in a screened host
  8033.  
  8034. environment, unless FTP is being used in proxy mode, the access
  8035.  
  8036. filters allow often connections from any external host if the
  8037.  
  8038. source port is 20 and the destination port is greater than 1023!
  8039.  
  8040.      remember that NCSA Mosaic uses several protocols, each on
  8041.  
  8042. a different port, and that -if on the firewall no proxy Web
  8043.  
  8044. server is operating- each protocol must be dealt with
  8045.  
  8046. individually, what lazy administrators seldom do.
  8047.  
  8048.      Be careful for TRAPS: networking clients like telnet and ftp
  8049.  
  8050. are often viciously replaced with programs that APPEAR to execute
  8051.  
  8052. like their namesake, but actually email an administrator. A
  8053.  
  8054. fellow cracker was almost intercepted, once, by a command that
  8055.  
  8056. simulated network delays and spat out random error messages in
  8057.  
  8058. order to keep me interested long enough to catch me. Read the
  8059.  
  8060. (fictions) horror story from Bill Cheswick: "An evening with
  8061.  
  8062. Berferd in which a cracked is lured, endured and studied",
  8063.  
  8064. available from ftp.research.att.com in
  8065.  
  8066.               /dist/internet_security/berferd.ps
  8067.  
  8068. As usual, all kind of traps can be located and uncovered by
  8069.  
  8070. correct zen-cracking: you must *FEEL* that some code (or that
  8071.  
  8072. some software behaviour) is not "genuine". Hope you believe me
  8073.  
  8074. and learn it before attempting this kind of cracks.
  8075.  
  8076. ------------>      How do I crack Firewalls?
  8077.  
  8078.      Some suggestions have been given above, but teaching you how
  8079.  
  8080. to crack firewalls would take at least six complete tutorial
  8081.  
  8082. lessons for a relatively unimportant cracking sector, and you
  8083.  
  8084. would almost surely get snatched immediately, 'coz you would
  8085.  
  8086. believe you can crack it without knowing nothing at all. So, for
  8087.  
  8088. your sake, I'll teach you HOW TO LEARN IT, not HOW TO DO IT
  8089.  
  8090. (quite a fascinating difference): First Text, then the software
  8091.  
  8092. above. For text, start with Marcus Ranum's paper "Thinking about
  8093.  
  8094. Firewalls", available from ftp.tis.com in the file/pub/firewalls/firewalls.ps.Z
  8095.  
  8096. and do an archie search for newer literature.
  8097.  
  8098. Join the firewall discussion list sending a message to
  8099.  
  8100. majordomo@greatcircle.com, you'll get a message with
  8101.  
  8102. instructions, as usual, lurk only... never show yourself to the
  8103.  
  8104. others.
  8105.  
  8106.      You can find for free on the web quite a lot of early
  8107.  
  8108. versions of proxy software. Study it, study it and then study it
  8109.  
  8110. again. The cracking efforts on your copies, and your machines,
  8111.  
  8112. before attempting anything serious, are MANDATORY if you do not
  8113.  
  8114. want to be immediately busted on the Internet. When you feel
  8115.  
  8116. ready to try serious cracking, you must OBLIGATORY start with a
  8117.  
  8118. small BBS which uses a firewall version you already studied very
  8119.  
  8120. well (sysops are not firewall administrators, and many of them
  8121.  
  8122. do not know nothing about the software they use). As soon as you
  8123.  
  8124. gain access to the bastion host, remember to subvert entirely the
  8125.  
  8126. firewall itself before entering the inner net.
  8127.  
  8128. If you feel ready and everything went well so far, if your zen-
  8129.  
  8130. cracking abilities are working well... then take a moment for
  8131.  
  8132. yourself... prepare yourself a good Martini-Wodka (you should
  8133.  
  8134. only use Moskovskaia), take a deep breath and by all means go
  8135.  
  8136. ahead! You will then be able to try your luck on the Cyberspace
  8137.  
  8138. and get quickly busted (if you did not follow my admonitions and
  8139.  
  8140. if you cannot zen-crack) or, may be, fish quite a lot of
  8141.  
  8142. jewels... :=)
  8143.  
  8144. ------------->     INTERNET CRACKING: XINETD
  8145.  
  8146.      [Xinetd] a freely available enhanced replacement for the
  8147.  
  8148. internet service daemon inetd, allows just those particular users
  8149.  
  8150. to have FTP or Telnet access, without opening up access to the
  8151.  
  8152. world. Xinetd can only protect the system from intrusion by
  8153.  
  8154. controlling INITIAL access to most system services and by logging
  8155.  
  8156. activities so that you can detect break-in attempts. However,
  8157.  
  8158. once a connection has been allowed to a service, xinetd is out
  8159.  
  8160. of the picture. It cannot protect against a server program that
  8161.  
  8162. has security problems internally. For example, the finger server
  8163.  
  8164. had a bug several years ago that allowed a particularly clever
  8165.  
  8166. person to overwrite part of its memory. This was used to gain
  8167.  
  8168. access to many systems. Even placing finger under the control of
  8169.  
  8170. xinetd wouldn't have helped.
  8171.  
  8172.      Think of the secured firewall system as a fortress wall:
  8173.  
  8174. each service that is enabled for incoming connections can be
  8175.  
  8176. viewed as a door or window in the walls. Not all these doors have
  8177.  
  8178. secure and reliable locks. The more openings are available, the
  8179.  
  8180. more opportunities are open for us.
  8181.  
  8182. ------------->         What xinetd does
  8183.  
  8184. Xinetd listens to all enabled service ports and permits only
  8185.  
  8186. those incoming connection request that meet authorization
  8187.  
  8188. criteria.
  8189.  
  8190. -    Accept connections from only certain IP addresses
  8191.  
  8192. -    Accept connections only from authorized users
  8193.  
  8194. -    Reject connections outside of aithorized hours
  8195.  
  8196. -    Log selected service when connections are accepted or
  8197.  
  8198.      rejected, capturing following informations:
  8199.  
  8200.      * Remote Host Address
  8201.  
  8202.      * User ID of remote user (in some cases)
  8203.  
  8204.      * Entry and Exit time
  8205.  
  8206.      * Terminal type
  8207.  
  8208.      Support login, shell, exec and finger
  8209.  
  8210. ------------->        SERVICES TO CRACK &
  8211.  
  8212.                   UNWITTING INSIDE COMPLICES
  8213.  
  8214. In this order the easy services:
  8215.  
  8216.      FTP  TELNET    LOGIN (rlogin) SHELL (rcmd)   EXEC
  8217.  
  8218. In this order the more difficult ones:
  8219.  
  8220.      MOUNT     TFT  FINGER    NFS(Network File System)
  8221.  
  8222.      DNS(Domain Name Service)
  8223.  
  8224. Remember that sendmail (SMTP), by default, accepts a message from
  8225.  
  8226. any incoming connection. The "sender" of such a message can
  8227.  
  8228. appear to have originated anywhere, therefore your claim of
  8229.  
  8230. identity will be accepted! Thus you can forge a message's
  8231.  
  8232. originator. Most of the recipients inside the protected
  8233.  
  8234. (firewalled) net will take your claim at face value and send you
  8235.  
  8236. (to the "return address" you provide) all the sensitive
  8237.  
  8238. information you need to crack the system. Finding unwitting
  8239.  
  8240. inside complices is most of the time pretty easy.
  8241.  
  8242.      By far the best method, for entering xinetd, is to get the
  8243.  
  8244. real version from panos@cs.colorado.edu, modify the system files
  8245.  
  8246. in order to have some backdoors, and then distribute them to the
  8247.  
  8248. mirror servers on the WEB. Each time a new administrator will
  8249.  
  8250. download "your" version of xinetd, you'll have an easy access to
  8251.  
  8252. the "protected" system.
  8253.  
  8254.      On the Nets, it's important to conceal your identity (they
  8255.  
  8256. will find you out pretty quickly if you do not). The best method
  8257.  
  8258. is to obtain the IP address of a legitimate workstation during
  8259.  
  8260. normal hours. Then, late at night, when the workstation is known
  8261.  
  8262. to be powered-off or disconnected from a dialup PPP link, a
  8263.  
  8264. different node on the network can be configured to use the
  8265.  
  8266. counterfeit IP address. To everyone on the network, it will
  8267.  
  8268. appear that the "legitimate" user is active. If you follow this
  8269.  
  8270. strategy, you may want to crack somehow more negligently... the
  8271.  
  8272. search for the cracker will go on -later- in the false confidence
  8273.  
  8274. that a sloppy novice (the legitimate user) is at work, this will
  8275.  
  8276. muddle the waters a little more.
  8277.  
  8278. Well, that's it for this lesson, reader. Not all lessons of my
  8279.  
  8280. tutorial are on the Web.
  8281.  
  8282.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  8283.  
  8284. me back (via anon.penet.fi) with some tricks of the trade I may
  8285.  
  8286. not know that YOU discovered. Mostly I'll actually know them
  8287.  
  8288. already, but if they are really new you'll be given full credit,
  8289.  
  8290. and even if they are not, should I judge that you "rediscovered"
  8291.  
  8292. them with your work, or that you actually did good work on them,
  8293.  
  8294. I'll send you the remaining lessons nevertheless. Your
  8295.  
  8296. suggestions and critics on the whole crap I wrote are also
  8297.  
  8298. welcomed.
  8299.  
  8300.                                 E-mail +ORC
  8301.  
  8302.                         +ORC an526164@anon.penet.fi
  8303.                      HOW TO CRACK, by +ORC, A TUTORIAL
  8304.  
  8305. ---------------------------------------------------------------------------
  8306.  
  8307.               LESSON C (1) - How to crack, Cracking as an art
  8308.  
  8309. ---------------------------------------------------------------------------
  8310.  
  8311.                         [BARCODES] [INSTANT ACCESS]
  8312.  
  8313.                    --------------------------------------
  8314.  
  8315. [BARCODES]
  8316.      First of all, let me stress the importance of cracking in
  8317. our everyday life. Cracking it's not just about software, it's
  8318. about information, about all patterns of life. To crack is to
  8319. refuse to be controlled and used by others, to crack is to be
  8320. free. But you must also be yourself free from petty conventions
  8321. in order to crack properly.
  8322.      You must learn to discerne cracking possibilities all around
  8323. yourself, and believe me, the development of this ghastly society
  8324. brings every day new codes, protections and concealing
  8325. mechanismes.
  8326.      All around us grows a world of codes and secret and not so
  8327. secret patterns. Codes that are at times so familiar and common
  8328. that we do not even notice them any more... and yet they are
  8329. there to fool us, and yet they offer marvellous cracking
  8330. possibilities.
  8331.      Let's take as an striking example BARCODES... those little
  8332. lines that you see on any book you buy, on any bottle you get,
  8333. on any item around you... do you know how they work? If you do
  8334. not you may be excused, but you cannot be excused if you never
  8335. had the impulse to understand them... crackers are curious by
  8336. nature... heirs of an almost extinct race of researchers that has
  8337. nothing in common with the television slaves and the publicity
  8338. and trend zombies around us. Cracker should always be capable of
  8339. going beyond the obvious, seek knowledge where others do not see
  8340. and do not venture.
  8341.  
  8342. [BARCODE HISTORY]
  8343.      Let's begin with a little history. Universal Product Code
  8344. (UPC) was adopted for commercial use by the grocery industry in
  8345. the USA. Among the advantages were a rapid, accurate and reliable
  8346. way of entering stock information into a computer and the
  8347. possibility to sack a lot of workers and to do more profit. The
  8348. early success led to the development of the European Article
  8349. Numbering System (EAN), a symbology similar to UPC, that is
  8350. widely used in Europe and in the rest of the World. I'll teach
  8351. you to crack this one, since I do not -fortunately- live in the
  8352. States. Keep in mind, anyway, that there are different barcode
  8353. symbologies, each with its own particular pattern of bars. The
  8354. UPC/EAN code used on retail products is an all-numeric code; so
  8355. is the Interleaved 2 of 5 Code. Code 39 includes upper case
  8356. letters, digits, and a few symbols. Code 128 includes every
  8357. printable and unprintable ASCII character code. The most new one
  8358. is a 2-D code. These are special rectangular codes, called
  8359. stacked barcodes or matrix codes. They can store considerably
  8360. more information than a standard barcode. They require special
  8361. readers which cost more than a standard scanner. The practical
  8362. limit for a standard barcode depends on a number of factors, but
  8363. 20 to 25 characters is an approximate maximum. For applications
  8364. that need more data, matrix codes are used. For example, the next
  8365. time you receive a package from United Parcel Service look for
  8366. a small square label with a pattern of dots and a small bullseye
  8367. in the centre. This is a MaxiCode label, and it is used by UPS
  8368. for automatic destination sortition.
  8369.      The manufacturer's ID number on the barcode uniquely
  8370. identifies products. These numbers are managed by the Uniform
  8371. Code Council in Dayton, Ohio for the States and Canada and by the
  8372. EAN authority (Internationale Article Numbering Association) in
  8373. Bruxelles, for Europe and the rest of the World. The
  8374. manufacturer's ID number accounts for some digits of the code,
  8375. which leaves other digits to be assigned in any way the producer
  8376. wants. He provides retail outlets with a list of his products and
  8377. their assigned codes so that they can be entered in the cash
  8378. register system. Many codes are NOT on the products and are added
  8379. by the supermarkets on the fly, using an internal code schema
  8380. that may be non standard. Now it's enough... let's crack.
  8381.      BARCODES are the only thing an automated casher needs to see
  8382. on a product to calculate its price and automatically catalogate
  8383. the sold merchandise... imagine (just imagine it :=) coz it would
  8384. be extremely illegal to act in this way) somebody would fasten
  8385. an adhesive home-made codebar label direct on the top of the
  8386. supermarket/mall/retail store label, say on a bottle of Pomerol
  8387. (that's a very good but unfortunately very expensive french
  8388. wine).
  8389.      The new label would mean for the casher something like
  8390. "cheap wine from Bordeaux, France, cost so and so, everything
  8391. it's OK, do not worry"... do you think that anybody would come
  8392. to the idea that there is something wrong with the label, with
  8393. the bottle or with you? I have been codebaring for years and had
  8394. only once a problem, coz my printer was running out of ink and
  8395. the scanner in the supermarket could not read it... so what? Act
  8396. uninterested, always wear jackets of the utmost quality, shetland
  8397. pullovers and beautiful expensive shoes... (all articles that you
  8398. may codebar too, by the way), in this society appearance and look
  8399. count much more than substance and knowledge... LET'S USE THIS
  8400. TO OUR ADVANTAGE! Nobody will ever come to the idea that you may
  8401. actually really know the working of the scheme... coz codebar is
  8402. pretty complicated and not exactly exceptionally public. On the
  8403. Web there are a lot information about it, but most of them are
  8404. useless, unless you know how to search most of the time you'll
  8405. find only sentences like this one:
  8406.           "The calculated check digit is the twelfth and final
  8407.           digit in the U.P.C.code. It is calculated based on a
  8408.           specific algorithm, and is necessary to ensure that
  8409.           the number is read or key-entered correctly."
  8410.  
  8411. But good +ORC will now explain you everything you need to crack:
  8412.  
  8413. [THE 13 BAR "CODES"]
  8414. Each barcode label has 13 values, from #0 to #12 (that's the EAN
  8415. code, the UPC american one has only 12, from #0 to #11).
  8416.      #0 and #1 indicate the origin of the product.
  8417.      #2 to #11 give the article code
  8418.      #12 (the last and 13th one) is a checksum value, that
  8419.      verifies the validity of all the other numbers.
  8420. How is it calculated? #12 is calculated in 4 steps
  8421.      VALUE A:  You sum odd position numbers (#0+#2+#4+#6+#8+#10)
  8422.      VALUE B:  You sum even position numbers and multiply by 3
  8423.                ((#1+#3+#5+#7+#9+#11)*3)
  8424.      VALUE C:  You sum value A and value B
  8425.      VALUE D:  You mod value C (you divide by 10 and only keep
  8426.      the remaining units, a very widespread checking scheme as
  8427.      you'll see in the software part of this lesson)
  8428.      If the result is not zero, you subtract it from 10.
  8429. Now look at a barcode label, get some books or other barcoded
  8430. items and *watch* it...
  8431. Bar codes are supposed to have "quiet zones" on either side of
  8432. the symbol. Quiet zones are blank areas, free of any printing or
  8433. marks,typically 10 times the width of the narrowest bar or space
  8434. in the bar code. Failure to allow adequate space on either side
  8435. of the symbol for quiet zones can make it impossible to read the
  8436. bar code.
  8437. On the barcode there are two "borders", left and right, and a
  8438. "middle" longer line. These three lines are longer than the
  8439. others and are used to "regulate" the scanner to whatever
  8440. dimension has been used for the barcode.
  8441. #0 dwells left of the first (left) border and has a special
  8442. meaning, the other 12 numbers are written "inside" the code and
  8443. are divided in two "groups" by the middle bar.
  8444. Each value is coded through SEVEN bars: black=1 and White=0.
  8445. These form two couples of "optic" bars of different widths.
  8446. We come now to the "magic" part: In order to bluff the
  8447. simpletons, barcode uses three different SETS of characters to
  8448. represent the values 0-9. This should make it impossible for you
  8449. to understand what's going on, as usual, in this society, slaves
  8450. should not need to worry with the real functioning of things.
  8451.    Here are the graphic codes of the three graphic sets:
  8452.  
  8453.      CODE A            CODE B (XOR C)    CODE C (NOT A)
  8454. 0:  0001101   (13)     0100111   (39)    1110010   (114)
  8455. 1:  0011001   (25)     0110011   (51)    1100110   (102)
  8456. 2:  0010011   (19)     0011011   (27)    1101100   (108)
  8457. 3:  0111101   (61)     0100001   (33)    1000010   (066)
  8458. 4:  0100011   (35)     0011101   (29)    1011100   (092)
  8459. 5:  0110001   (49)     0111001   (57)    1001110   (078)
  8460. 6:  0101111   (47)     0000101   (05)    1010000   (080)
  8461. 7:  0111011   (59)     0010001   (17)    1000100   (068)
  8462. 8:  0110111   (55)     0001001   (09)    1001000   (072)
  8463. 9:  0001011   (11)     0010111   (23)    1110100   (116)
  8464.  
  8465. Borders:       101
  8466. Centre:        01010
  8467.  
  8468. - The C graphic set is a "NOT A" graphic set.
  8469. - The B graphic set is a "XOR C" graphic set.
  8470. - each value has two couples of bars with different widths
  8471.  
  8472.  Now watch some labels yourself... see the difference between the
  8473. numbers left and the numbers right? The first "half" of the
  8474. barcode is coded using sets A and B, the second "half" using set
  8475. C. As if that were not enough, A and B are used inside the first
  8476. "half" in a combination that varies and depends from value #0,
  8477. following 10 different patterns:
  8478.               #1   #2   #3   #4   #5  #6
  8479.    0          A    A    A    A    A    A
  8480.    1          A    A    B    A    B    B
  8481.    2          A    A    B    B    A    B
  8482.    3          A    A    B    B    B    A
  8483.    4          A    B    A    A    B    B
  8484.    5          A    B    B    A    A    B
  8485.    6          A    B    B    B    A    A
  8486.    7          A    B    A    B    A    B
  8487.    8          A    B    A    B    B    A
  8488.    9          A    B    B    A    B    A
  8489.  
  8490. "Ah! Stupid buyer will never understand why the same values gives
  8491. different bars! Nothing is as reliable as barcodes!" :=)
  8492.  
  8493. Let's take as example the codebar for Martini Dry:
  8494. BARCODE:    8 0 00570 00425 7
  8495. Let's see: we have a 8 0 0 = booze
  8496. Then a 000570 as ABABBA and a 004257 as C
  8497. "Even" sum: 8+0+5+0+0+2 = 15 (even sum)
  8498. Then a 0+0+7+0+4+5= 16 and 16 *3 = 48 (odd sum)
  8499. Then a 15+48=63
  8500. 63 === 3
  8501. 10 - 3 = 7 = checksum
  8502. Pattern = 8 = ABABBA CCCCCC
  8503.  
  8504. OK, one more example: Osborne Windows programming series Volume
  8505. 2 General purpose API functions (always here on my table)...
  8506. BARCODE: 9 7 80078 81991 9
  8507. Let's see: we have a 9 7 8 = book
  8508. Then a 780078 as ABBABA and a 819919 as C
  8509. "Even" sum: 9+8+5+8+8+4 = 42 (even sum)
  8510. Then a 7+1+5+2+4+4= 23 and 23 * 3 = 69 (odd sum)
  8511. Then a 42+69=111
  8512. 111 === 1
  8513. 10 - 1 = 9 = checksum
  8514. Pattern = 9 = ABBABA
  8515.  
  8516. Well... what's the point of all this?
  8517. The point, my pupils, is that who DOES NOT KNOW is taken along
  8518. on a boat ride, who KNOWS and LEARNS can use his knowledge in
  8519. order to try to beat blue and black the loathsome consumistic
  8520. oligarchy where we are compelled to live. Try it out for
  8521. yourself... if you crack correctly and wisely your supermarket,
  8522. mall and library bills will be cut to almost zero.
  8523.      Write a small program to print whichever codebar you fancy
  8524. (or whichever your mall uses) in whichever size on whichever sort
  8525. of label you (or better your targets) fancy... it's quickly done
  8526. with Visualbasic or Delphy... but you'll not find much on the Web
  8527. Alternatively you could also write, as I did long ago, a short
  8528. c program in dos, using a modified upper char set... and there
  8529. you are, have labels... see the world.
  8530.      A small word of caution... crack only ONE item at time and
  8531. try it out first with the SAME label for the same product... i.e.
  8532. the correct code for that item, but on your own label. If it goes
  8533. through your program works good, if not, nobody will ever be able
  8534. to harm you. Anyway it never happens anything, never: the bar
  8535. code reading equipments have great tolerance, coz the scanners
  8536. must be able to recognize barcodes that have been printed on many
  8537. different medias. You should choose labels similar to the ones
  8538. effectively used only in order not to arise human suspects, coz
  8539. for all the scanner itself cares, your label could be pink with
  8540. green stripes and with orange hand-written, numbers. Mind you,
  8541. we are still just academically imagining hypothetical situations,
  8542. coz it would be extremely illegal to act in such an inconsiderate
  8543. manner.
  8544.      CRACKING POWER! It's true for barcodes, for Telecom bills,
  8545. for Compuserve accounts, for Amexco cards, for banking cheques
  8546. (do you know what MICR is? Magnetic Ink Character Recognition...
  8547. the stylized little printing on the lower left of new cheques...
  8548. there is a whole cracking school working on it), for registration
  8549. numbers... you name it, they develope it, we crack it...
  8550.      Begin with barcodes: it's easy, nice and pretty useful! Live
  8551. in opulence, with the dignity and affluence that should always
  8552. distinguish real crackers. Besides... you should see the
  8553. assortment of 'Pomerols' in my "Cave-a-vin" :=)
  8554.  
  8555. [INSTANT ACCESS]
  8556.      The (c) Instant access routines are a commercial protection
  8557. scheme used to "unlock" complete commercial applications that
  8558. have been encrypted on CD-
  8559. ROMs which are distributed (mostly) through reviews.
  8560.      This is an ideal cracking target: it's commercial software,
  8561. complete, uncrippled and of (relatively) prominent quality, that
  8562. you can get in tons for the price of a coke. Obviously this kind
  8563. of protection represents an ideal subject for our lessons. This
  8564. fairly intricate protection scheme has not yet been cracked by
  8565. anybody that I am aware of, anyway not publicly, therefore it's
  8566. an ideal candidate for a "strainer" to my university. I'll teach
  8567. you here how to crack it in three lessons, C.1, C.2 and C.3. I warn
  8568. you... it's a difficult cracking session, and this protection
  8569. represents quite an intellectual challenge. But if you are
  8570. seriously interested in our trade you will enjoy these lessons
  8571. more than anything else.
  8572.      This cracking is intended as an "assignment" for my +HCU
  8573. "cracking university": you'll find inside lessons C.1 and C.2 a
  8574. relatively deep "introduction" to Instant access cracking. This
  8575. will teach you a lot anyway, and spare you hours of useless
  8576. roaming around, bringing you straight to the cracking point. But
  8577. I'll release the third part of this session, with the complete
  8578. solution (lesson C.3) on the Web only in october 1996, not a day
  8579. before. All the students that would like to apply to the Higher
  8580. Cracking University, opening on the web 01/01/1997, should work
  8581. in July, August and September (three months is more than enough
  8582. time) on this assignment. They should crack completely the
  8583. instant access scheme and send me their solutions, with a good
  8584. documentation of their cracking sessions, before 30/09/1996
  8585. (WATCH IT! You can crack this scheme in -at least- three
  8586. different paths, be careful and choose the *best* one. WATCH IT!
  8587. Some of the informations) in lesson C.1 and C.2 are slightly incorrect:
  8588. check it!).
  8589. There are four possibilities:
  8590. 1)   The candidate has not found the crack or his solution is
  8591.      not enough documented or not enough viable... the candidate
  8592.      is therefore not (yet) crack-able, he will not be admitted
  8593.      to the +HCU 1997 curses, better luck in 1998;
  8594. 2)   The cracking solution proposed by the candidate is not as
  8595.      good as mine (you'll judge for yourself in october) but it
  8596.      works nevertheless... he'll be admitted at the 1997
  8597.      courses;
  8598. 3)   The cracking solution of the candidate is more or less
  8599.      equal to mine, he'll be admitted, personally monitored, and
  8600.      he'll get all the material he needs to crack on higher
  8601.      paths;
  8602. 4)   The cracking solution of the candidate is better than mine,
  8603.      he'll be admitted, get all the material he wishes and asked
  8604.      to teach us as well as study with us: "homines, dum docent,
  8605.      discunt".
  8606.  
  8607. [Cracking Instant access]
  8608.      The user that wants to "unlock" a software application
  8609. protected with (c) Instant Access must enter first of all a
  8610. REGISTRATION number string, which through a series of
  8611. mathematical manipulations gives birth to a special "product"
  8612. code. On the basis of this "product code" the user is asked to
  8613. phone the commercial protectors (and pay) in order to get a
  8614. special "unlock code" that will allow him to decrypt the relevant
  8615. software.
  8616.      This kind of "passnumber" protection routines are widely
  8617. used for software unlocking, BBS access, server access, backdoor
  8618. opening and many other protection schemes. We have already seen
  8619. password cracks in different lessons of this tutorial (in
  8620. particular Lessons 3.1 and 3.2 for DOS and Lessons 8.1, 8.2 and
  8621. 9.1 for WIN) albeit on a more simplistic scale: there it did
  8622. mostly not matter very much *HOW* you passed the protection: once
  8623. passed, you could have access to the application. This is not the
  8624. case with (c) Instant Access. Face it: it's a little boring, but
  8625. important that you learn how to defeat intricate protection
  8626. routines (you'll meet them often in the next years) and I believe
  8627. that the following example will give you a "feeling" for the
  8628. right cracking approach.
  8629.      In this case we must not only "crack" this protection scheme
  8630. but also study it thoroughly in order to achieve our blessed
  8631. aims. This is a very good exercise: reverse disassembling will
  8632. teach you a lot of little tricks that you'll be able to use in
  8633. your other future cracking sessions.
  8634.      Instant access (c) is a exceptionally widespread protection
  8635. scheme, and it should be relatively easy for you to gather some
  8636. encrypted software that has been protected with this method...
  8637. *DO IT QUICKLY!!* After the Web publishing of this lessons (I am
  8638. sending C.1 to 8 pages and 4 usenet groups on 25/06/1996) this
  8639. protection is obviously as dead as a Dodo. The "Accessors" guys
  8640. will have to conceive something smarter if they want to keep
  8641. selling "protections" to the lamer producers of "big" software.
  8642.      BTW, if you are reading this and are working for some
  8643. commercial "protection" company, consider the possibility to
  8644. double cross your masters! Deliver me anonymously all the future
  8645. projects you are working on! That will amuse me, speed up the
  8646. advent of a true altruistic society and earn you the respect of
  8647. the better part of humanity.
  8648.      As I said, many "huge" application are still protected with
  8649. this "Instant access" system. I have personally bought at least
  8650. 7 or 8 "second hand" CD-ROMs packed full with Microsoft, Lotus,
  8651. Norton, Symantec, you name it, applications all "protected"
  8652. through this crap. The cost of this bunch of CD-ROMs was the
  8653. equivalent of a bottle of Dry Martini, maybe less. The same
  8654. software is sold, unlocked, to zombies and lusers for ludicrous
  8655. amounts of money.
  8656.      Never buy CD-ROMs magazines when they appear! Be cool! Buy
  8657. them two or three months after the publishing date! Buy
  8658. "remainders" or "second hand" CD-ROM magazines "at kilo price"...
  8659. Come to think of it, never buy *anything* when it appears or when
  8660. some (paid) advertiser tells you to... remember that "trends",
  8661. "vogues", "fashions" and "modes" are only different names for the
  8662. whips that drill and chain the dull-witted slaves of this
  8663. loathsome society: "clever crackers consider cool, crack cheap,
  8664. cheat customary culture" (a rhetorical figure: an "Alliteration".
  8665. To defend yourself learn rhetoric... it's a more powerful and
  8666. more useful weapon than Kung-fu).
  8667.      The "triple" password protection routine in (c) Instant
  8668. Access is very interesting from a cracker point of view. It's a
  8669. relatively complex scheme: I'll teach you to crack it in two
  8670. phases: First of all you must find the "allowed" registration
  8671. code, the one that "ignites" the "product code". We must crack
  8672. and understand this re_code first if we want to crack the rest.
  8673.      Just for the records, I am cracking here (c) Action Instant
  8674. access version 1.0 (CD-ROM found on a old copy of "Personal
  8675. Computer World" of August 1994, packed full with encrypted Lotus,
  8676. Symantec, Claris and Wordperfect applications. Just to be sure
  8677. I crosschecked my results with another CD-ROM which also has
  8678. applications protected with (c) Instant Access: Paragon
  8679. Publishing's PC OFFICE: the protection scheme remains the same).
  8680. I am focusing for this lesson on the cracking of the specific
  8681. protection for the encrypted Symantec's Norton Utilities v.8.0.
  8682.      Please refer to the previous lessons for the basic
  8683. techniques used in order to find the protection routine inside
  8684. our babe... for "low" cracking purposes you -basically- type a
  8685. number (in this case, where the input gets 10 numbers, we'll use
  8686. "1212-1212-12"), do your search inside the memory (s 30:0
  8687. lffffffff "your_string") and then set memory breakpoints on all
  8688. the relevant memory locations till winice pops (I know, I know,
  8689. buddies... there are more effective ways... but hold your mouth:
  8690. for now we'll keep them among us: let's make things a little
  8691. harder for the protectionists who read this... Besides: the old
  8692. approach works here flawlessly). After getting the Registration
  8693. window on screen the Winice standard procedure is:
  8694.  :task                        ; how
  8695.  :heap IABROWSE               ; where & what
  8696.  :hwnd IABROWSE               ; get the Winhandle
  8697.  :bpx [winhandle] WM_GETTEXT  ; pinpoint code
  8698.  :bpx GetProcAddress          ; in case of funny routines
  8699.  :dex 0 ds:dx                 ;          let's see their name
  8700.  :gdt                         ; sniff the selectors
  8701.  :s 30:0 lffffffff "Your_input_string" ; search in 4 giga data
  8702.  :bpr [all memory ranges for your string that are above 80000000]
  8703. and so on.  (continued in lesson C.2)
  8704.  
  8705. Well, that's it for this lesson, reader. Not all lessons of my
  8706. tutorial are on the Web.
  8707.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  8708. me back (via anon.penet.fi) with some tricks of the trade I may
  8709. not know that YOU discovered. Mostly I'll actually know them
  8710. already, but if they are really new you'll be given full credit,
  8711. and even if they are not, should I judge that you rediscovered them
  8712. with your work, or that you actually did good work on them,
  8713. I'll send you the remaining lessons nevertheless. Your
  8714. suggestions and critics on the whole crap I wrote are also
  8715. welcomed.
  8716.  
  8717.                                 E-mail +ORC
  8718.  
  8719.                         +ORC an526164@anon.penet.fi
  8720.                      HOW TO CRACK, by +ORC, A TUTORIAL
  8721.  
  8722. ---------------------------------------------------------------------------
  8723.  
  8724.               LESSON C (2) - How to crack, Cracking as an art
  8725.  
  8726. ---------------------------------------------------------------------------
  8727.  
  8728.                               [INSTANT ACCESS]
  8729.  
  8730.                    --------------------------------------
  8731.  
  8732.       cracking Instant Access (2) - strainer for the +HCU
  8733.  
  8734. [SEE LESSON C.1 for the first part of this cracking session]
  8735.      Here follow the relevant protection routines for the first
  8736. (The "Registration") number_code of Instant Access, with my
  8737. comments: you have to investigate a little the following code.
  8738.      Later, when you'll crack on your own, try to recognize the
  8739. many routines that fiddle with input BEFORE the relevant (real
  8740. protection) one. In this case, for instance, a routine checks the
  8741. correctness of the numbers of your input:
  8742.  
  8743. This_loop_checks_that_numbers_are_numbers:
  8744. 1B0F:2B00 C45E06    LES    BX,[BP+06]  ; set/reset pointer
  8745. 1B0F:2B03 03DF      ADD    BX,DI
  8746. 1B0F:2B05 268A07    MOV    AL,ES:[BX]  ; get number
  8747. 1B0F:2B08 8846FD    MOV    [BP-03],AL  ; store
  8748. 1B0F:2B0B 807EFD30  CMP    BYTE PTR [BP-03],30
  8749. 1B0F:2B0F 7C06      JL     2B17        ; less than zero?
  8750. 1B0F:2B11 807EFD39  CMP    BYTE PTR [BP-03],39
  8751. 1B0F:2B15 7E05      JLE    2B1C        ; between 0 & 9?
  8752. 1B0F:2B17 B80100    MOV    AX,0001     ; no, set flag=1
  8753. 1B0F:2B1A EB02      JMP    2B1E        ; keep flag
  8754. 1B0F:2B1C 33C0      XOR    AX,AX       ; flag=0
  8755. 1B0F:2B1E 0BC0      OR     AX,AX       ; is it zero?
  8756. 1B0F:2B20 7507      JNZ    2B29        ; flag NO jumps away
  8757. 1B0F:2B22 8A46FD    MOV    AL,[BP-03]  ; Ok, get number
  8758. 1B0F:2B25 8842CC    MOV    [BP+SI-34],AL ; Ok, store number
  8759. 1B0F:2B28 46        INC    SI          ; inc storespace
  8760. 1B0F:2B29 47        INC    DI          ; inc counter
  8761. 1B0F:2B2A C45E06    LES    BX,[BP+06]  ; reset pointer
  8762. 1B0F:2B2D 03DF      ADD    BX,DI       ; point next number
  8763. 1B0F:2B2F 26803F00  CMP    BYTE PTR ES:[BX],00 ; input end?
  8764. 1B0F:2B33 75CB      JNZ    2B00        ; no:loop next num
  8765.  
  8766.      You now obviously understand that the "real" string is
  8767. stored inside memory location [BP+SI-34]... set a memory
  8768. breakpoint on this area to get the next block of code that
  8769. fiddles with the transformed input. Notice how this routine
  8770. "normalizes" the input, strips the "-" off and puts the 10
  8771. numbers together:
  8772. user input:  1  2  1  2  1  2  1  2  1  2 End
  8773.   1E7F:92E2 31 32 31 32 31 32 31 32 31 32 00 45 AF 1F 70 9B
  8774.  Stack ptr:  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
  8775.      Let's now look at the "real" protection routine: the one
  8776. that checks these numbers and throw you out if they are not
  8777. "sound". Please pay attention to the following block of code:
  8778.  
  8779. check_if_sum_other_9_numbers_=_remainder_of_the_third_number:
  8780. :4B79 8CD0       MOV    AX,SS ; we'll work inside the stack...
  8781. :4B7B 90         NOP
  8782. :4B7C 45         INC    BP
  8783. :4B7D 55         PUSH   BP    ; save real BP
  8784. :4B7E 8BEC       MOV    BP,SP ; BP = stackpointer
  8785. :4B80 1E         PUSH   DS    ; save real Datasegment
  8786. :4B81 8ED8       MOV    DS,AX ; Datasegment = stacksegment
  8787. :4B83 83EC04     SUB    SP,+04
  8788. :4B86 C45E06     LES    BX,[BP+06] ; BX points input_start
  8789. :4B89 268A07     MOV    AL,ES:[BX] ; load first number
  8790. :4B8C 98         CBW               ; care only for low
  8791. :4B8D C45E06     LES    BX,[BP+06] ; reset pointer
  8792. :4B90 50         PUSH   AX         ; save 1st number
  8793. :4B91 268A4701   MOV    AL,ES:[BX+01] ; load 2nd number
  8794. :4B95 98         CBW               ; only low
  8795. :4B96 8BD0       MOV    DX,AX      ; 2nd number in DX
  8796. :4B98 58         POP    AX         ; get 1st number
  8797. :4B99 03C2       ADD    AX,DX      ; sum with second
  8798. :4B9B C45E06     LES    BX,[BP+06] ; reset pointer
  8799. :4B9E 50         PUSH   AX         ; save sum
  8800. :4B9F 268A4707   MOV    AL,ES:[BX+07] ; load 8th number
  8801. :4BA3 98         CBW               ; only low
  8802. :4BA4 8BD0       MOV    DX,AX      ; 8th number in DX
  8803. :4BA6 58         POP    AX         ; old sum is back
  8804. :4BA7 03C2       ADD    AX,DX      ; sum 1+2+8
  8805. :4BA9 C45E06     LES    BX,[BP+06] ; reset pointer
  8806. :4BAC 50         PUSH   AX         ; save sum
  8807. :4BAD 268A4703   MOV    AL,ES:[BX+03] ; load 4rd number
  8808. :4BB1 98         CBW               ; only low
  8809. :4BB2 8BD0       MOV    DX,AX      ; #4 in DX
  8810. :4BB4 58         POP    AX         ; sum is back
  8811. :4BB5 03C2       ADD    AX,DX      ; sum 1+2+8+4
  8812. :4BB7 C45E06     LES    BX,[BP+06] ; reset pointer
  8813. :4BBA 50         PUSH   AX         ; save sum
  8814. :4BBB 268A4704   MOV    AL,ES:[BX+04] ; load 5th number
  8815. :4BBF 98         CBW               ; only low
  8816. :4BC0 8BD0       MOV    DX,AX      ; #5 in DX
  8817. :4BC2 58         POP    AX         ; sum is back
  8818. :4BC3 03C2       ADD    AX,DX      ; 1+2+8+4+5
  8819. :4BC5 C45E06     LES    BX,[BP+06] ; reset pointer
  8820. :4BC8 50         PUSH   AX         ; save sum
  8821. :4BC9 268A4705   MOV    AL,ES:[BX+05] ; load 6th number
  8822. :4BCD 98         CBW               ; only low
  8823. :4BCE 8BD0       MOV    DX,AX      ; #6 in DX
  8824. :4BD0 58         POP    AX         ; sum is back
  8825. :4BD1 03C2       ADD    AX,DX      ; 1+2+8+4+5+6
  8826. :4BD3 C45E06     LES    BX,[BP+06] ; reset pointer
  8827. :4BD6 50         PUSH   AX         ; save sum
  8828. :4BD7 268A4706   MOV    AL,ES:[BX+06] ; load 7th number
  8829. :4BDB 98         CBW               ; only low
  8830. :4BDC 8BD0       MOV    DX,AX      ; #7 in DX
  8831. :4BDE 58         POP    AX         ; sum is back
  8832. :4BDF 03C2       ADD    AX,DX      ; 1+2+8+4+5+6+7
  8833. :4BE1 C45E06     LES    BX,[BP+06] ; reset pointer
  8834. :4BE4 50         PUSH   AX         ; save sum
  8835. :4BE5 268A4708   MOV    AL,ES:[BX+08] ; load 9th number
  8836. :4BE9 98         CBW               ; only low
  8837. :4BEA 8BD0       MOV    DX,AX      ; #9 in DX
  8838. :4BEC 58         POP    AX         ; sum is back
  8839. :4BED 03C2       ADD    AX,DX      ; 1+2+8+4+5+6+7+9
  8840. :4BEF C45E06     LES    BX,[BP+06] ; reset pointer
  8841. :4BF2 50         PUSH   AX         ; save sum
  8842. :4BF3 268A4709   MOV    AL,ES:[BX+09] ; load 10th #
  8843. :4BF7 98         CBW               ; only low
  8844. :4BF8 8BD0       MOV    DX,AX      ; #10 in DX
  8845. :4BFA 58         POP    AX         ; sum is back
  8846. :4BFB 03C2       ADD    AX,DX      ; 1+2+8+4+5+6+7+9+10
  8847. :4BFD 0550FE     ADD    AX,FE50    ; clean sum to 0-51
  8848. :4C00 BB0A00     MOV    BX,000A    ; BX holds 10
  8849. :4C03 99         CWD               ; only AL
  8850. :4C04 F7FB       IDIV   BX         ; remainder in DX
  8851. :4C06 C45E06     LES    BX,[BP+06] ; reset pointer
  8852. :4C09 268A4702   MOV    AL,ES:[BX+02] ; load now # 3
  8853. :4C0D 98         CBW               ; only low
  8854. :4C0E 05D0FF     ADD    AX,FFD0    ; clean # 3 to 0-9
  8855. :4C11 3BD0       CMP    DX,AX  ; remainder = pampered #3?
  8856. :4C13 7407       JZ     4C1C       ; yes, go on good guy
  8857. :4C15 33D2       XOR    DX,DX  ; no! beggar off! Zero DX
  8858. :4C17 33C0       XOR    AX,AX  ;     and FLAG_AX = FALSE
  8859. :4C19 E91701     JMP    4D33       ; go to EXIT
  8860. let's_go_on_if_first_check_passed:
  8861. :4C1C C45E06     LES    BX,[BP+06] ; reset pointer
  8862. :4C1F 268A4701   MOV    AL,ES:[BX+01] ; now load #2 anew
  8863. :4C23 98         CBW               ; only low
  8864. :4C24 05D7FF     ADD    AX,FFD7    ; pamper adding +3
  8865. :4C27 A38D5E     MOV    [5E8D],AX  ; save SEC_+3
  8866. :4C2A 3D0900     CMP    AX,0009    ; was it < 9? (no A-F)
  8867. :4C2D 7E05       JLE    4C34       ; ok, no 0xletter
  8868. :4C2F 832E8D5E0A SUB    WORD PTR [5E8D],+0A ; 0-5 if A-F
  8869. :4C34 C45E06     LES    BX,[BP+06] ; reset pointer
  8870. :4C37 268A07     MOV    AL,ES:[BX] ; load 1st input number
  8871. :4C3A 98         CBW               ; only low
  8872. :4C3B 05C9FF     ADD    AX,FFC9    ; pamper adding +7
  8873. :4C3E A38F5E     MOV    [5E8F],AX  ; save it in FIR_+7
  8874. :4C41 0BC0       OR     AX,AX      ; if #1 > 7
  8875. :4C43 7D05       JGE    4C4A       ; no need to add 0xA
  8876. :4C45 83068F5E0A ADD    WORD PTR [5E8F],+0A ; FIR_+7 + 0xA
  8877. now_we_have_the_sliders_let's_prepare_for_loop:
  8878. :4C4A C45E0E     LES    BX,[BP+0E] ; Set pointer to E
  8879. :4C4D 26C747020000 MOV  WORD PTR ES:[BX+02],0000 ; 0 flag
  8880. :4C53 26C7070000   MOV  WORD PTR ES:[BX],0000    ; 0 flag
  8881. :4C58 C706975E0900 MOV  WORD PTR [5E97],0009     ; counter=9
  8882. :4C5E E99500     JMP    4CF6       ; Jmp check_counter
  8883. loop_8_times:
  8884. :4C61 C45E06     LES    BX,[BP+06] ; reset pointer
  8885. :4C64 031E975E   ADD    BX,[5E97]  ; add running counter
  8886. :4C68 268A07     MOV    AL,ES:[BX] ; load # counter+1
  8887. :4C6B 98         CBW               ; only low
  8888. :4C6C 50         PUSH   AX         ; save 10th number
  8889. :4C6D A18D5E     MOV    AX,[5E8D]  ; ld SEC_+3 down_slider
  8890. :4C70 BA0A00     MOV    DX,000A    ; BX holds 0xA
  8891. :4C73 F7EA       IMUL   DX         ; SEC_+3 * 0xA
  8892. :4C75 03068F5E   ADD    AX,[5E8F]  ; plus FIR_+7 up_slider
  8893. :4C79 BAA71E     MOV    DX,1EA7    ; fixed segment
  8894. :4C7C 8BD8       MOV    BX,AX ; BX = Lkup_val=(SEC_+3*10+FIR_+7)
  8895. :4C7E 8EC2       MOV    ES,DX      ; ES = 1EA7
  8896. :4C80 268A870000 MOV    AL,ES:[BX+0000] ; ld 1EA7:[Lkup_val]
  8897. :4C85 98         CBW               ; only low: KEY_PAR
  8898. :4C86 8BD0       MOV    DX,AX      ; save KEY_PAR in DX
  8899. :4C88 58         POP    AX         ; repops 10th number
  8900. :4C89 03C2       ADD    AX,DX      ; RE_SULT=KEY_PAR+#10
  8901. :4C8B 05D0FF     ADD    AX,FFD0    ; polish RE_SULT
  8902. :4C8E 99         CWD               ; only low: RE_SULT
  8903. :4C8F 8956FC     MOV    [BP-04],DX ; save here KEY_PAR [9548]
  8904. :4C92 8946FA     MOV    [BP-06],AX ; save here RE_SULT [9546]
  8905. :4C95 0BD2       OR     DX,DX      ; KEY_PAR < 0?
  8906. :4C97 7C0F       JL     4CA8       ; yes: KEY_PAR < 0
  8907. :4C99 7F05       JG     4CA0       ; no: KEY_PAR > 0
  8908. :4C9B 3D0900     CMP    AX,0009    ; KEY_PAR = 0
  8909. :4C9E 7608       JBE    4CA8 ; no pampering if RE_SULT < 9
  8910. :4CA0 836EFA0A   SUB    WORD PTR [BP-06],+0A ; else pamper
  8911. :4CA4 835EFC00   SBB    WORD PTR [BP-04],+00 ; and SBB [9548]
  8912. :4CA8 C45E0E     LES    BX,[BP+0E] ; reset pointer to E
  8913. :4CAB 268B4F02   MOV    CX,ES:[BX+02] ; charge CX [958C]
  8914. :4CAF 268B1F     MOV    BX,ES:[BX] ; charge BX slider [958A]
  8915. :4CB2 33D2       XOR    DX,DX      ; clear DX to zero
  8916. :4CB4 B80A00     MOV    AX,000A    ; 10 in AX
  8917. :4CB7 9A930D2720 CALL   2027:0D93  ; call following RO_routine
  8918.  
  8919.   This is the only routine called from our protection, inside the
  8920. loop (therefore 8 times), disassembly from WCB. Examining this
  8921. code please remember that we entered here with following
  8922. configuration: DX=0, AX=0xA, CX=[958C] and BX=[958A]...
  8923.  1.0D93  56      push   si     ; save si
  8924.  1.0D94  96      xchg   ax, si ; ax=si, si=0xA
  8925.  1.0D95  92      xchg   ax, dx ; dx=0xA ax=dx
  8926.  1.0D96  85C0    test   ax, ax ; TEST this zero
  8927.  1.0D98  7402    je     0D9C   ; zero only 1st time
  8928.  1.0D9A  F7E3    mul    bx     ; BX slider! 0/9/5E/3B2...
  8929.  1.0D9C >E305    jcxz   0DA3   ; cx=0? don't multiply!
  8930.  1.0D9E  91      xchg   ax, cx ; cx !=0? cx = ax & ax = cx
  8931.  1.0D9F  F7E6    mul    si     ;     ax*0xA in ax
  8932.  1.0DA1  03C1    add    ax, cx ; ax=  ax*0xA+cx = M_ULT
  8933.  1.0DA3 >96      xchg   ax, si ; ax=0xA; si evtl. holds M_ULT
  8934.  1.0DA4  F7E3    mul    bx     ; ax= bx*0xA
  8935.  1.0DA6  03D6    add    dx, si ; dx= dx_add
  8936.  1.0DA8  5E      pop    si     ; restore si
  8937.  1.0DA9  CB      retf          ; back to caller with two
  8938.                                         parameters: DX and AX
  8939. Back_to_main_protection_loop_from_RO_routine:
  8940. :4CBC C45E0E     LES    BX,[BP+0E] ; reset pointer
  8941. :4CBF 26895702   MOV    ES:[BX+02],DX ; save R_DX par  [958C]
  8942. :4CC3 268907     MOV    ES:[BX],AX ; save R_AX par     [958A]
  8943. :4CC6 0346FA     ADD    AX,[BP-06] ; add to AX RE_SULT [9546]
  8944. :4CC9 1356FC     ADC    DX,[BP-04] ; add to DX KEY_PAR [9548]
  8945. :4CCC C45E0E     LES    BX,[BP+0E] ; reset pointer
  8946. :4CCF 26895702   MOV    ES:[BX+02],DX ; save R_DX+KEY_PAR [958C]
  8947. :4CD3 268907     MOV    ES:[BX],AX ; save R_AX+RE_SULT    [958A]
  8948. :4CD6 FF0E8D5E   DEC    WORD PTR [5E8D] ; down_slide SEC_+3
  8949. :4CDA 7D05       JGE    4CE1       ; no need to add
  8950. :4CDC 83068D5E0A ADD    WORD PTR [5E8D],+0A  ; pamper adding 10
  8951. :4CE1 FF068F5E   INC    WORD PTR [5E8F] ; up_slide FIR_+7
  8952. :4CE5 A18F5E     MOV    AX,[5E8F]  ; save upslided FIR_+7 in AX
  8953. :4CE8 3D0900     CMP    AX,0009    ; is it over 9?
  8954. :4CEB 7E05       JLE    4CF2       ; no, go on
  8955. :4CED 832E8F5E0A SUB    WORD PTR [5E8F],+0A ; yes, pamper -10
  8956. :4CF2 FF0E975E   DEC    WORD PTR [5E97]  ; decrease loop counter
  8957. check_loop_counter:
  8958. :4CF6 833E975E03 CMP    WORD PTR [5E97],+03  ; counter = 3?
  8959. :4CFB 7C03       JL     4D00       ; finish if counter under 3
  8960. :4CFD E961FF     JMP    4C61       ; not yet, loop_next_count
  8961. loop_is_ended:
  8962. :4D00 C45E06     LES    BX,[BP+06] ; reset pointer to input
  8963. :4D03 268A4701   MOV    AL,ES:[BX+01] ; load 2nd number (2)
  8964. :4D07 98         CBW               ; only low
  8965. :4D08 05D0FF     ADD    AX,FFD0    ; clean it
  8966. :4D0B BA0A00     MOV    DX,000A    ; DX = 10
  8967. :4D0E F7EA       IMUL   DX         ; AX = SEC_*10 = 14
  8968. :4D10 C45E06     LES    BX,[BP+06] ; reset pointer
  8969. :4D13 50         PUSH   AX         ; save SEC_*10
  8970. :4D14 268A07     MOV    AL,ES:[BX] ; load 1st number (1)
  8971. :4D17 98         CBW               ; only low
  8972. :4D18 8BD0       MOV    DX,AX      ; save in DX
  8973. :4D1A 58         POP    AX         ; get SEC_*10
  8974. :4D1B 03C2       ADD    AX,DX      ; sum SEC_*10+1st number
  8975. :4D1D 05D0FF     ADD    AX,FFD0    ; clean it
  8976. :4D20 99         CWD               ; only low
  8977. :4D21 C45E0A     LES    BX,[BP+0A] ; get pointer    to   [9582]
  8978. :4D24 26895702   MOV    ES:[BX+02],DX ; save 1st (1) in  [9584]
  8979. :4D28 268907     MOV    ES:[BX],AX ; save FINAL_SUM (15) [9582]
  8980. :4D2B 33D2       XOR    DX,DX      ; DX = 0
  8981. :4D2D B80100     MOV    AX,0001    ; FLAG TRUE !
  8982. :4D30 E9E6FE     JMP    4C19       ; OK, you_are_a_nice_guy
  8983. EXIT:
  8984. :4D33 59         POP    CX         ; pop everything and
  8985. :4D34 59         POP    CX         ;  return with flag
  8986. :4D35 1F         POP    DS         ;  AX=TRUE if RegNum OK
  8987. :4D36 5D         POP    BP         ;  with 1st # in     [9584]
  8988. :4D37 4D         DEC    BP         ;  with FINAL_SUM in [9582]
  8989. :4D38 CB         RETF
  8990.  
  8991.   Let's translate the preceding code: first of all the pointers:
  8992. At line :4B86 we have the first of a long list of stack ptrs:
  8993.                         LES BX,[BP+06]
  8994.  This stack pointer points to the beginning of the input string,
  8995. which, once polished from the "-", has now a length of 10 bytes,
  8996. concluded by a 00 fence. At the beginning, before the main loop,
  8997. 9 out of our 10 numbers are added, all but the third one.
  8998.   Notice that protection has jumped # 3 (and added # 8 out of the
  8999. line). The rest is straightforward. Now, at line :4BFD we have
  9000. our first "cleaning" instruction. You see: the numbers are
  9001. hexadecimal represented by the codes 0x30 to 0x39. If you add
  9002. FE50 to the minimum sum you can get adding 9 numbers (0x30*9 =
  9003. 0x160) You get 0. The maximum you could have adding 9 numbers,
  9004. on the contrary is (0x39*9=0x201), which, added to FE50 gives
  9005. 0x51. So we'll have a "magic" number between 0x0 and 0x51 instead
  9006. of a number between 0x160 and 0x201. Protection pampers this
  9007. result, and retains only the last ciffer: 0-9.  Then protection
  9008. divides this number through 0xA, and what happens? DX get's the
  9009. REMAINDER of it.
  9010.   If we sum the hexcodes of our (1212-1212-12) we get 0x1BE (we
  9011. sum only 9 out of then numbers: the third "1" -i.e. "31"- does
  9012. not comes into our count); 0x1BE, cleaned and pampered gives E.
  9013. Therefore (0xE/0xA = 1) We get 1 with a remainder of 4.
  9014.   You may observe that of all possible answers, only sums
  9015. finishing with A, B, C, D, E or F give 1 (and rem=0,1,2,3,4 or
  9016. 5). Sums finishing 0 1 2 3 4 5 6 7 8 or 9 give 0 as result and
  9017. themselves as reminder. The chance of getting a 0,1,2,3 or 4 are
  9018. therefore bigger as the chance of getting a 5, 6, 7, 8 or 9. We
  9019. are just observing... we do not know yet if this should play a
  9020. role or not.
  9021.   Now this remainder is compared at :4C11 with the third number
  9022. polished from 0x30-0x39 to 0-9. This is the only protection check
  9023. for the registration number input: If your third number does not
  9024. match with the remainder of the sum of all the 9 others numbers
  9025. of your input you are immediately thrown out with FLAG AX=FALSE
  9026. (i.e. zero).
  9027.  To crack the protection you now have to MODIFY your input string
  9028. accordingly. Our new input string will from now on be "1242-1212-
  9029. 12": we have changed our third number (originally a "2") to a "4"
  9030. to get through this first strainer in the correct way. Only now
  9031. protection starts its mathematical part (We do not know yet why
  9032. it does it... in order to seed the random product number? To
  9033. provide a check for the registration number you'll input at the
  9034. end? We'll see).
  9035. -    Protection saves the second number of your input (cleaned
  9036.      with FFD7) in SEC_+3 [5E8D], pampering it if it is bigger
  9037.      than 9 (i.e. if it is 0xA-0xF). Here you'll have therefore
  9038.      following correspondence: 0=7 1=8 2=9 3=0 4=1 5=2 6=3 7=4
  9039.      8=5 9=6. The second number of your input has got added +3.
  9040.      This is value SEC_+3. In (lengthy) C it would look like
  9041.      this:
  9042.        If (RegString(2)is lower than  7) RegString(2) = RegString(2)+3
  9043.        Else Regstring(2) = ((RegString(2)-10)+3)
  9044. -    Protection saves your first number in FIR_+7 [5E8F] with a
  9045.      different cleaning parameter (FFC9). The next pampering
  9046.      adds 0xA if it was not 7/8/9 therefore you have here
  9047.      following correspondence 7=0 8=1 9=2 0=3 1=4 2=5 3=6 4=7
  9048.      5=8 6=9). This is value FIR_+7. In (lengthy) C it would
  9049.      look like this:
  9050.        If (RegString(1) is lower than 3) RegString(1) = RegString(1)+7
  9051.        Else Regstring(1) = ((RegString(1)-10)+7)
  9052.   So protection has "transformed" and stored in [5E8D] and [5E8F]
  9053. the two numbers 1 and 2. In our RegString: 1242-1212-12 the first
  9054. two numbers "12" are now stored as "94". These will be used as
  9055. "slider" parameters inside the main loop, as you will see.
  9056.  Only now does protection begin its main loop, starting from the
  9057. LAST number, because the counter has been set to 9 (i.e. the
  9058. tenth number of RegString). The loop, as you'll see, handles only
  9059. the numbers from 10 to 3: it's an 8-times loop that ends without
  9060. handling the first and second number. What happens in this
  9061. loop?... Well, quite a lot: Protection begins the loop loading
  9062. the number (counter+1) from the RegString. Protection then loads
  9063. the SEC_+3 down_slider parameter (which began its life as second
  9064. number "transformed"), multiplies it with 0xA and then adds the
  9065. up_slider parameter FIR_+7 (at the beginning it was the first
  9066. number transformed).
  9067.      This sum is used as "lookup pointer" to find a parameter
  9068. inside a table of parameters in memory, which are all numbers
  9069. between 0 and 9. Let's call this value Lkup_val.
  9070. Protection looks for data in 1EA7:[Lkup_val]. In our case (we
  9071. entered 1242-1212-12, therefore the first SEC_+3 value is 9 and
  9072. the first FIR_+7 value is 4): [Lkup_val] = 9*0xA+4; 0x5A+4 =
  9073. 0x5E. At line :4C80 therefore AL would load the byte at 1EA7:005E
  9074. (let's call it KEY_PAR), which now would be ADDED to the #
  9075. counter+1 of this loop. In our case KEY_PAR at 1EA7:005E it's a
  9076. "7" and is added to the pampered 0x32=2, giving 9.
  9077.      Let's establish first of all which KEY_PAR can possibly get
  9078. fetched: the maximum is 0x63 and the minimum is 0x0. The possible
  9079. KEY_PARs do therefore dwell in memory between 1EA7: and
  9080. 1EA7:0063. Let's have a look at the relative table in memory,
  9081. where these KEY_PARs are stored ("our" first 0x5Eth byte is
  9082. underlined):
  9083. 1EA7:0000 01 03 03 01 09 02 03 00-09 00 04 03 08 07 04 04
  9084. 1EA7:0010 05 02 09 00 02 04 01 05-06 06 03 02 00 08 05 06
  9085. 1EA7:0020 08 09 05 00 04 06 07 07-02 00 08 00 06 02 04 07
  9086. 1EA7:0030 04 04 09 05 09 06 00 06-08 07 00 03 05 09 00 08
  9087. 1EA7:0040 03 07 07 06 08 09 01 05-07 04 06 01 04 02 07 01
  9088. 1EA7:0050 03 01 08 01 05 03 03 01-02 08 02 01 06 05 07 02
  9089. 1EA7:0060 05 09 09 08 02 09 03 00-00 04 05 01 01 03 08 06
  9090. 1EA7:0070 01 01 09 00 02 05 05 05-01 07 01 05 08 07 01 09
  9091. 1EA7:0080 08 07 07 04 04 08 03 00-06 01 09 08 08 04 09 09
  9092. 1EA7:0090 00 07 05 02 03 01 03 08-06 05 07 06 03 07 06 07
  9093. 1EA7:00A0 04 02 02 05 02 04 06 02-06 09 09 01 05 02 03 04
  9094. 1EA7:00B0 04 00 03 05 00 03 08 07-06 04 08 08 02 00 03 06
  9095. 1EA7:00C0 09 00 00 06 09 04 07 02-00 01 01 01 01 00 01 FF
  9096. 1EA7:00D0 00 FF FF FF FF 00 FF 01-00 00 00 00 00 00 00 00
  9097.  
  9098.      An interesting table, where all the correspondences are
  9099. between 0 and 9... are we getting some "secret" number here? But,
  9100. hey, look there... funny, isn't it? Instead of only 0-0x63 bytes
  9101. we have roughly the DOUBLE here: 0-0xC8 bytes (the 01 sequence
  9102. starting at CA "feels" like a fence). We'll see later how
  9103. important this is. At the moment you should only "perceive" that
  9104. something must be going on with a table that's two time what she
  9105. should be.
  9106.      As I said the result of KEY_PAR + input number is polished
  9107. (with a FFDO) and pampered (subtracting, if necessary, 0xA).
  9108. Therefore the result will be the (counter+1) input number +
  9109. KEY_PAR (let's call it RE_SULT], in our case, (at the beginning
  9110. of the loop) a 9. Now (DX=0 because of the CWD instruction) DX
  9111. will be saved in [9548] and RE_SULT in [9546].
  9112.  Now Protection prepares for the RO_routine: resets its pointer
  9113. and charges CX and BX from [958C] and from [958A] respectively,
  9114. charges AX with 0xA and sets DX to zero.
  9115.  The routine performs various operations on AX and DX and saves
  9116. the results in the above mentioned locations [958A] and [958C].
  9117.  Now KEY_PAR and RE_SULT are added respectively to the DX and AX
  9118. value we got back from the RO_routine call, and saved once more
  9119. in the last two locations: AX+RE_SULT in [958A] and DX+KEY_PAR
  9120. in [958C]
  9121.  Now the value in SEC_+3 is diminished by 1 (if it was 9 it's now
  9122. 8, if it was zero it will be pampered to 9). It's a "slider"
  9123. parameter (in this case a down_slider), typically used in
  9124. relatively complicated protections to give a "random" impression
  9125. to the casual observer. The value in FIR_+7, on the contrary, is
  9126. augmented by one, from 4 to 5... up_sliding also.
  9127.      Protection now handles the next number of your input for the
  9128. loop. In our case this loop uses following protection
  9129. configuration with our "sliding" parameters:
  9130.  Input #  pamp_2nd   pamp_1st   Lookup value  KEY_PAR  # RE_SULT
  9131. # 10 = 2, SEC_+3= 9, FIR_+7= 4, Lkup_val = 0x5E, KEY=7 +2 = 9
  9132. # 9  = 1, SEC_+3= 8, FIR_+7= 5, Lkup_val = 0x55, KEY=3 +1 = 4
  9133. # 8  = 2, SEC_+3= 7, FIR_+7= 6, Lkup_val = 0x4C, KEY=4 +2 = 6
  9134. # 7  = 1, SEC_+3= 6, FIR_+7= 7, Lkup_val = 0x43, KEY=7 +1 = 7
  9135. # 6  = 2, SEC_+3= 5, FIR_+7= 8, Lkup_val = 0x3A, KEY=0 +2 = 2
  9136. # 5  = 1, SEC_+3= 4, FIR_+7= 9, Lkup_val = 0x31, KEY=4 +1 = 5
  9137. # 4  = 2, SEC_+3= 3, FIR_+7= 0, Lkup_val = 0x1E, KEY=5 +2 = 7
  9138. # 3  = 4, SEC_+3= 2, FIR_+7= 1, Lkup_val = 0x15, KEY=2 +4 = 5
  9139. Notice how our "regular" input 21212124 has given an "irregular"
  9140. 94672575.
  9141.      You may legitimately ask yourself what should all this mean:
  9142. what are these RE_SULTs used for? Well they are used to slide
  9143. another parameter: this one inside the called routine... this is
  9144. what happens to AX and DX inside the routine, and the lines after
  9145. the called routine:
  9146. :4CBF 26895702   MOV    ES:[BX+02],DX ; save R_DX par  [958C]
  9147. :4CC3 268907     MOV    ES:[BX],AX ; save R_AX par     [958A]
  9148. :4CC6 0346FA     ADD    AX,[BP-06] ; add to AX RE_SULT [9546]
  9149. :4CC9 1356FC     ADC    DX,[BP-04] ; add to DX KEY_PAR [9548]
  9150. :4CCC C45E0E     LES    BX,[BP+0E] ; reset pointer to E
  9151. :4CCF 26895702   MOV    ES:[BX+02],DX ; save R_DX+KEY_PAR [958C]
  9152. :4CD3 268907     MOV    ES:[BX],AX ; save R_AX+RE_SULT    [958A]
  9153.  
  9154.             :4CC6     :4CC9  :4CCF Odd_DX  :4CD3 slider_sum
  9155.   RE_SULT   [958A]    [958C]   [958C]        [958A]
  9156.      0         0        0        0            0
  9157.      9         5A       0        0            9
  9158.      4         3AC      0        0            5E
  9159.      6         24F4     0        0            3B2
  9160.      7         71CE     1        1            24FB
  9161.      2         7220     4        E            71D0
  9162.      5         7572     4        90           7225
  9163.                                               7579
  9164.  
  9165. Now the loops ends, having handled the input numbers from tenth
  9166. to third. Protection loads the second number and multiplies it
  9167. by 10 (let's call this result SEC_*10), in our case 2*0xA=14.
  9168. Protection loads the first number and adds it to the
  9169. multiplication, in our case 1+0x14=0x15 (FINAL_SUM].
  9170. Now everything will be added to FFDO to "clean" it.
  9171. Pointer will now be set to the end of the input number.
  9172. DX, zeroed by CDW, will be saved as parameter in [9584] and the
  9173. cleaned and pampered sum will be saved in [9582].
  9174. FLAG is set to true and this routine is finished! No parameter
  9175. are passed and the only interesting thing is what actually
  9176. happens in the locations [9582], [9584], [958A] and [958C], i.e.:
  9177. FINAL_SUM, 0, slider_sum, odd_dx.
  9178.      In the next lesson we'll crack everything, but I'll give you
  9179. already some hints here, in case you would like to go ahead on
  9180. your own: we'll see how the scheme used for the third (the
  9181. registration) number show analogies and differences with the
  9182. scheme we have studied (and cracked) here for the first number.
  9183. Our 3434-3434-3434-3434-34 input string for the registration
  9184. number will be transformed in the magic string
  9185. 141593384841547431, but this will not work because the "magic"
  9186. 12th number: "1" will not correspond to the remainder calculated
  9187. inside this check through the previous locations of the other
  9188. checks.
  9189.      Here the things are more complicated because every little
  9190. change in your input string transforms COMPLETELY the "magic"
  9191. string... therefore in order to pass the strainer you'll have to
  9192. change 3434-3434-3434-3434-34 in (for instance) 7434-3434-3434-
  9193. 3434-96. The "magic" string 219702960974498056 that this
  9194. registration input gives will go through the protection strainer.
  9195. Only then we'll be able to step over and finally crack the whole
  9196. protection... it's a pretty complicated one as I said. Now crack
  9197. it pupils... you have three months time. From this crack depends
  9198. your admission to the Uni, there will be no other admission text
  9199. till summer 1997 (it's a hell of work to prepare this crap)...
  9200. work well.
  9201.  
  9202. Well, that's it for this lesson, reader. Not all lessons of my
  9203. tutorial are on the Web.
  9204.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  9205. me back (via anon.penet.fi) some tricks of the trade I may not
  9206. know but YOU've discovered. I'll probably know most of them
  9207. already, but if they are really new you'll be given full credit,
  9208. and even if they are not, should I judge that you "rediscovered"
  9209. them with your work, or that you actually did good work on them,
  9210. I'll send you the remaining lessons nevertheless. Your
  9211. suggestions and critics on the whole crap I wrote are also
  9212. welcomed.
  9213.  
  9214.                                 E-mail +ORC
  9215.  
  9216.                         +ORC an526164@anon.penet.fi
  9217.