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

  1.                      HOW TO CRACK, by +ORC, A TUTORIAL
  2.  
  3. ---------------------------------------------------------------------------
  4.  
  5.                 Lesson 3.2: hands on, paper protections (2)
  6.  
  7. ---------------------------------------------------------------------------
  8.  
  9.                 [TOP.EXE] [F19.EXE] [POPULOUS.EXE] [MAP.EXE]
  10.  
  11.                    --------------------------------------
  12.  
  13. You have seen in the previous lesson that the use of a password
  14.  
  15. protection, independently of the coding and hiding methods used
  16.  
  17. to store them in memory, implies the use of a comparing procedure
  18.  
  19. with the password that the user types in. You therefore have many
  20.  
  21. options to begin your cracking work:
  22.  
  23. -    find the location of the user password
  24.  
  25. -    find the "echo" in memory of the real password
  26.  
  27. -    find the routine that compares both
  28.  
  29. -    find the passwords hideout and encryption type
  30.  
  31. -    find the go_ahead_nice_buyer exit or jump
  32.  
  33. -    find the beggar_off_ugly_copier exit or jump
  34.  
  35. just to name the more obvious ones. In order to make things more
  36.  
  37. difficult for us crackers, the protectionists have devised many
  38.  
  39. counter-strategies, the more obvious ones being:
  40.  
  41. -    keeping the various part of the store/compare/hide routines
  42.  
  43. well apart in code (no match for zen-cracking);
  44.  
  45. -    filling these routines with "bogus" compares, bogus jumps
  46.  
  47. and bogus variables, in order to make things more difficult for
  48.  
  49. the crack (no match for decent crackers);
  50.  
  51. -    disseminating the code with anti-debugger tricks, like INT_3
  52.  
  53. instructions or jumps in and out protected mode (no match for our
  54.  
  55. beloved [Soft-Ice]);
  56.  
  57. -    trying to eliminate the need for passwords altogether
  58.  
  59. letting the user input "one letter" or "one number" or "one
  60.  
  61. image" as answer to some variable question. In this lesson I'll
  62.  
  63. teach you how to crack these "passletters" protection techniques.
  64.  
  65. Let's first resume the "uses" of a password protection:
  66.  
  67. PASSWORDS AS PERMISSION TO ACCESS
  68.  
  69. These passwords serve to acknowledge that a legitimate user is
  70.  
  71. using the program. This is the type of password that you'll find,
  72.  
  73. for example, protecting your user account on Compuserve, on
  74.  
  75. Networks or even in ATM machines used by banks or corporations.
  76.  
  77. These require a little hardwiring to crack: ATM passnumber
  78.  
  79. protection schemes rely on an answer from the central computer
  80.  
  81. (they do NOT verify only the three magnetic areas in the magnetic
  82.  
  83. strip on the card). The lines between ATM's & their hosts are
  84.  
  85. usually 'weak' in the sense that the information transmitted on
  86.  
  87. them is generally not encrypted in any way. (Some banks use
  88.  
  89. encrypted information, but this is fairly easy to crack too).
  90.  
  91. So for ATMs you should do the following 1) cross over the
  92.  
  93. dedicated line between the ATM and the host; 2) insert your
  94.  
  95. computer between the ATM and the host; 3) Listen to the "normal"
  96.  
  97. messages and DO NOT INTERFERE YET; 4) Try out some operations
  98.  
  99. with a legal card, make some mistakes, take note of the various
  100.  
  101. codes; 5) When you are ready insert a fraudulent card into the
  102.  
  103. ATM. Now the following happens:
  104.  
  105. -    the ATM sends a signal to the host, saying "Hey! Can I give
  106.  
  107. this guy money, or is he broke, or is this funny card invalid?";
  108.  
  109. -    the microcomputer intercepts the signal from the host,
  110.  
  111. discards it, sends on the "there's no one using the ATM" signal;
  112.  
  113. -    the host gets the "no one using" signal and sends back its
  114.  
  115. "good, keep watching out if somebody comes by, and for God's sake
  116.  
  117. don't spit out any money on the street!" signal to the ATM;
  118.  
  119. -    the microcomputer intercepts this signal (again), throws it
  120.  
  121. away (again), and sends the "Wow! That guy is like TOO rich! Give
  122.  
  123. him as much money as he wants. In fact, he's so loaded, give him
  124.  
  125. ALL the cash we have!  He is a really valued customer." signal.
  126.  
  127. -    the ATM obediently dispenses cash till the cows come home.
  128.  
  129.      All this should be possible, but as a matter of fact it has
  130.  
  131. not much to do with cracking, unless there is a special software
  132.  
  133. protection on the line... so if you want to work on ATMs contact
  134.  
  135. our fellow phreakers/hackers and learn their trade... and
  136.  
  137. please remember to hack only cash dispenser that DO NOT HAVE a
  138.  
  139. control camera :=)
  140.  
  141. PASSWORDS AS REGISTRATION
  142.  
  143. This type of password is often used in shareware programs. When
  144.  
  145. you register the shareware program, you are sent a password that
  146.  
  147. you use to upgrade your shareware program to a complete and more
  148.  
  149. powerful version. This method, used frequently for commercial
  150.  
  151. applications, has recently been used quite a lot by many windows
  152.  
  153. applications that come "crippled" on the magazines cover CD-roms,
  154.  
  155. requiring you to telephone a hot line (and paying) in order to
  156.  
  157. get the "unique key" to unlock the "special protection". It's all
  158.  
  159. bullshit: we'll learn in the "how to crack windows" lessons how
  160.  
  161. easy it is to disable the various routines that verify your
  162.  
  163. entry.
  164.  
  165. PASSWORDS AS COPY PROTECTIONS
  166.  
  167. This type of password is often used for games and entertainment
  168.  
  169. software. The password query does not usually appear any more at
  170.  
  171. the start of the program, or as the program is loading. Instead,
  172.  
  173. the password query appears after one or more levels are completed
  174.  
  175. (this innovation was pioneered by "EOB I" and the "Ultima"
  176.  
  177. series) or when the user reloads a saved game or session.
  178.  
  179. DONGLE PASSWORDS
  180.  
  181.      A few extremely expensive programs use a dongle (also called
  182.  
  183. an hardware key). A dongle is a small hardware device containing
  184.  
  185. a password or checksum which plugs into either a parallel or a
  186.  
  187. serial port. Some specially designed dongles even include
  188.  
  189. complete program routines. Dongles can be cracked, but the amount
  190.  
  191. of work involved is considerable and the trial and error
  192.  
  193. procedure currently used to crack them via software is extremely
  194.  
  195. tedious. It took me more than a week to crack MULTITERM,
  196.  
  197. Luxembourger dongle protected program. The quickest method to
  198.  
  199. crack dongle protected programs, involves the use of pretty
  200.  
  201. complicated hardware devices that cannot be dealt with here. I
  202.  
  203. myself have only seldom seen them, and do not like at all to
  204.  
  205. crack dongles via software, coz it requires a huge amount of zen
  206.  
  207. thinking and of luck and of time. If you want more information
  208.  
  209. on the hardware way to crack dongles, try to contact the older
  210.  
  211. ones on the appropriate web sites, they may even answer you if
  212.  
  213. you are nice, humble and really technically interested.
  214.  
  215.      The obvious principle, that applies to the software password
  216.  
  217. types mentioned above is the following: The better the password
  218.  
  219. is hidden, and the better it is encrypted, the more secure the
  220.  
  221. program will be. The password may be
  222.  
  223. -    encrypted and/or
  224.  
  225. -    in a hooked vector and/or
  226.  
  227. -    in an external file and/or
  228.  
  229. -    in a SMC (Self modifying code) part
  230.  
  231.      Let's finally inspect the common "ready_made" protection
  232.  
  233. schemes (used by many programmers that do not program
  234.  
  235. themselves):
  236.  
  237. *    password read in
  238.  
  239. *    letters added to a key to be entered
  240.  
  241. *    complement of the letters formed xoring with 255
  242.  
  243. *    saved key (1 char)
  244.  
  245. *    saved password (256 chars)
  246.  
  247. *    saved checksum (1 char), as protection, against simple
  248.  
  249.      manipulations
  250.  
  251. *    generating file PASSWORD.DAT with password, to be inserted
  252.  
  253.      inside a different file than the one containing the calling
  254.  
  255.      routine
  256.  
  257. Now the lazy programmer that wants to "protect" his program
  258.  
  259. searches first the file where the password is stored, then loads
  260.  
  261. the key, the password and the checksum. He uses a decrypt
  262.  
  263. procedure to decrypt the password and a check_checksum procedure
  264.  
  265. to check whether the password was modified. All this is obviously
  266.  
  267. crackabe in few seconds.
  268.  
  269. [PASSWORD ACCESS INSIDE THE SETUP]
  270.  
  271.      Some computers have a password protected access INSIDE the
  272.  
  273. Setup (at the beginning), the protection scheme does not allow
  274.  
  275. a boot with a floppy and does not allow a setup modify. In these
  276.  
  277. cases the only possible crack is an old hack method:
  278.  
  279. *    open the PC
  280.  
  281. *    find on the motherboard a small jumper (bridge) with the
  282.  
  283.      words "Pw"
  284.  
  285. *    take it away
  286.  
  287. *    PC on
  288.  
  289. *    run the setup with F1 or Del (depending from the BIOS) (the
  290.  
  291.      protection will not work any more)
  292.  
  293. *    deactivate inside the setup the option password
  294.  
  295. *    PC off
  296.  
  297. *    put the small jumper (bridge) back again
  298.  
  299. *    close the PC
  300.  
  301. *    PC on, cracked (if you want to be nasty you could now use
  302.  
  303.      the setup to set YOUR password)
  304.  
  305.      If you want to know more about access refuse and access
  306.  
  307. denying, encryption and locking of the FAT tables, get from the
  308.  
  309. web, and study, the (very well written) code of a virus called
  310.  
  311. "Monkey", that does exactly this kind of devastation. Virus
  312.  
  313. studying is, in general, very useful for cracking purposes, coz
  314.  
  315. the virus'code is at times
  316.  
  317. -    very well written (pure, tight assembly)
  318.  
  319. -    using concealing techniques not much different from the
  320.  
  321.      protection schemes (often far superior)
  322.  
  323. -    using the most recent and best SMC (self modifying code)
  324.  
  325.      tricks
  326.  
  327.      But, and this is very important, do not believe that the
  328.  
  329. protection schemes are very complicated! Most of the time the
  330.  
  331. protection used are incredibly ordinary: as a final example of
  332.  
  333. our paper protection schemes, let's take a program released not
  334.  
  335. long ago (1994), but with a ridiculous protection scheme: TOP
  336.  
  337. (Tiger on the prowl) a simulation from HPS.
  338.  
  339. Here the cracking is straightforward:
  340.  
  341. -    MAP(memory_usage) and find main_sector
  342.  
  343. -    type "AAAA" as password
  344.  
  345. -    (s)earch main_sector:0 lffff "AAAA"
  346.  
  347. -    dump L80 "AAAA" location -40 (gives you a "wide" dump),
  348.  
  349.      this gives you already the "echo" of the correct password
  350.  
  351. -    breakpoint on memory read & write to "AAAA" location and
  352.  
  353.      backtrace the complete main_sector
  354.  
  355. it's done! Here the code_lines that do protect TOP:
  356.  
  357.      8A841C12  MOV  AL,[SI+121C]   move in AL first user letter
  358.  
  359.      3A840812  CMP  AL,[SI+1208]   compare with echo
  360.  
  361.      7402      JZ   go_ahead_nice_buyer
  362.  
  363.      EB13      JMP  beggar_off_ugly_cracker
  364.  
  365. Now let's quickly crack it:
  366.  
  367. ------------------------------------------------
  368.  
  369. CRACKING TOP.EXE (by +ORC, January 1996)
  370.  
  371. ren top.exe top.ded
  372.  
  373. symdeb top.ded
  374.  
  375. -    s (cs+0000):0 Lffff 8A 84 1C 12 3A 84
  376.  
  377. xxxx:yyyy           (this is the answer of the debugger)
  378.  
  379. -    e xxxx:yyyy+2  08 (instead of 1C)
  380.  
  381. -    w
  382.  
  383. -    q
  384.  
  385. ren top.ded top.exe
  386.  
  387. -------------------------------------------------
  388.  
  389. And you changed the MOV  AL, [SI+121C] instruction in a MOV AL,
  390.  
  391. [SI+1208] instruction... it is now reading the ECHO instead of
  392.  
  393. the characters you typed in... no wonder that the ECHO does
  394.  
  395. compare exactly with itself... and you pass!
  396.  
  397. "SOMETHING FISHY UNDER COVERS"
  398.  
  399. Back to the "Passletter" type of password protected programs.
  400.  
  401. Let's take as an example the protection used in a game of 1990:
  402.  
  403. "F19", where the protection scheme asks you to identify a
  404.  
  405. particular plane's silhouette. This kind of protection is used
  406.  
  407. in order to avoid the use of memory locations where the passwords
  408.  
  409. are stored: we saw in the first part of our "passwords hands on"
  410.  
  411. how easy it is to crack those schemes.
  412.  
  413. To crack this kind of protection, you could try a technique know
  414.  
  415. as "memory snuffing". The protected program, START.EXE, install
  416.  
  417. itself first at location xxxx:0000 with a length of 6C62 bytes,
  418.  
  419. but proceeds to a relocation of its modules (with some SMC, self
  420.  
  421. modifying code parts) in different locations. What does all this
  422.  
  423. mean? Well, this could mean quite many things... the most
  424.  
  425. important one for crackers is that the protection code will
  426.  
  427. probably snap way ahead of the actual user input phase.
  428.  
  429. Now you 'll quickly find out that the routine determining
  430.  
  431. (randomly) which plane is being chosen, leaves the progressive
  432.  
  433. number of this plane in one memory location: (imc) 43CD:DADA.
  434.  
  435. This brings us to the random triggering mechanism:
  436.  
  437. E87FAF    CALL random_seed
  438.  
  439. 83C402    ADD  SP,02
  440.  
  441. 8946E8    MOV  [BP-18],AX     and ds:(BP-18) is the location
  442.  
  443.                               you are looking for
  444.  
  445. Now, every time this random triggers, you get a different number
  446.  
  447. (00-x14) in this location, corresponding to the different plane
  448.  
  449. the user should choose.
  450.  
  451. The random seed routine, evidently, comes back with the random
  452.  
  453. seed in AX... what we now need is to zero it: the user will
  454.  
  455. always have to choose the same plane: "plane 0", and he will have
  456.  
  457. given the correct answer. Note how elegant all this is: we do not
  458.  
  459. need to interfere with the whole mouse pointing routines, nor
  460.  
  461. with the actual choosing of the planes... the random seed may
  462.  
  463. choose whatever plane it wishes... the memory location for this
  464.  
  465. choice will always report the (legitimate) choice of zero.
  466.  
  467. So, let's quickly crack this program:
  468.  
  469. ---------------------------------------------------
  470.  
  471. CRACKING "F19" [START.EXE] (by +ORC, January 1996)
  472.  
  473. ren start.exe start.ded       <- let's have a dead file
  474.  
  475. symdeb start.ded              <- let's debug it
  476.  
  477. - s cs:O lffff 83 C4 02 89 46 E8 <- search ADD SP,02
  478.  
  479. xxxx:yyyy                     <- debugger's answer
  480.  
  481. - e xxxx:yyyy 58 [SPACE] 31 [SPACE] C0 [SPACE]
  482.  
  483. - w                           <- write the crack
  484.  
  485. - q                           <- back to the OS
  486.  
  487. ren start.ded start.exe       <- re-write the exe
  488.  
  489. ----------------------------------------------------
  490.  
  491. You just transformed the instruction you searched for
  492.  
  493.      83C402    ADD  SP,+02
  494.  
  495. in the following sequence:
  496.  
  497.      58        POP  AX        <- respecting ADD SP,+02
  498.  
  499.      31C0      XOR  AX,AX     <- xoring to zero
  500.  
  501. (the POP AX instruction increments the stack pointer by 2, in
  502.  
  503. order to respect the previous ADD SP,+02).
  504.  
  505. Well, nice. It's getting easier, isnt'it? Now let's take as
  506.  
  507. example a protection that has no "echo" in memory. (At the
  508.  
  509. beginning this was a smart idea: "the cracker won't find the
  510.  
  511. correct password, 'coz it's not there, ah!". We'll now therefore
  512.  
  513. crack one of the first programs that used this scheme:
  514.  
  515. [Populous.exe], from Bullfrog.
  516.  
  517. [POPULOUS.EXE]
  518.  
  519.      A old example of the protection scheme "password that is not
  520.  
  521. a password" can be found in [Populous.exe], from Bullfrog. It's
  522.  
  523. a very widespread program, and you'll surely be able to find a
  524.  
  525. copy of it in order to follow this lesson. The program asks for
  526.  
  527. the identification of a particular "shield", a combination of
  528.  
  529. letters of various length: the memory location were the user
  530.  
  531. password is stored is easily found, but there is (apparently) no
  532.  
  533. "echo" of the correct password. You should be able, by now, to
  534.  
  535. find by yourself the memory location were the user password is
  536.  
  537. stored. Set a breakpoint memory read & write on this area, and
  538.  
  539. you 'll soon come to the following section of code:
  540.  
  541. F7AE4EFF  IMUL WORD PTR [BP+FF4E]       <- IMUL with magic_N°
  542.  
  543. 40        INC  AX
  544.  
  545. 3B460C    CMP  AX, [BP+0C]
  546.  
  547. 7509      JNZ  beggar_off_ugly_copier
  548.  
  549. 8B460C    MOV  AX, [BP+0C]
  550.  
  551. A3822A    MOV  [2A82], AX
  552.  
  553. E930FE    JMP  nice_buyer
  554.  
  555. 817E0C7017CMP  WORD PTR[BP+0C],1770     <- beggar_off
  556.  
  557. I don't think that you need much more now... how do you prefer
  558.  
  559. to crack this protection scheme? Would you choose to insert a MOV
  560.  
  561. [BP+0C], AX and three NOPS (=6 bytes) after the IMUL instruction?
  562.  
  563. Wouldn't you rather prefer the more elegant JMP to nice_buyer
  564.  
  565. instruction at the place of the JNZ beggar_off? This solution has
  566.  
  567. less nops: remember that newer protection schemes smell
  568.  
  569. NOPs_patches!). Yeah, let's do it this way:
  570.  
  571. ---------------------------------------------------
  572.  
  573. CRACKING [Populous.exe] (by +ORC, January 1996)
  574.  
  575. ren populous.exe populous.ded      <- let's have a dead file
  576.  
  577. symdeb populous.ded                <- let's debug it
  578.  
  579. -    s cs:O lffff F7 AE 4E FF      <- the imul magic_N°
  580.  
  581. xxxx:yyyy                          <- debugger's answer
  582.  
  583. -    e xxxx:yyyy+4  EB [SPACE] 03  <- JMP anyway
  584.  
  585. -    w                             <- modify ded
  586.  
  587. -    q                             <- back to the OS
  588.  
  589. ren populous.ded populous.exe      <- let's re-have the exe
  590.  
  591. ----------------------------------------------------
  592.  
  593. This time was easy, wasnt'it?
  594.  
  595.      Now you are almost ready with this course... let's crack a
  596.  
  597. last application, a memory utility that is very widespread, very
  598.  
  599. good (the programmers at Clockwork software are Codemasters),
  600.  
  601. very useful for our purposes (you'll use it later to crack a lot
  602.  
  603. of TSR) and, unfortunately for Clockworkers, very easy to crack
  604.  
  605. at the level you are now.
  606.  
  607. But, Hey! Do not forget that you would have never done it without
  608.  
  609. this tutorial, so do the following: look toward east from your
  610.  
  611. window, sip a Martini-Wodka (Two blocks of ice first, 1/3 dry
  612.  
  613. Martini from Martini & Rossi, 1/3 Moskovskaia Wodka, 1/3
  614.  
  615. Schweppes indian tonic) and say three times: Thank-you +ORC!.
  616.  
  617. [MAP.EXE]
  618.  
  619.      Let's now go over to one of the best TOOLS for mapping your
  620.  
  621. memory usage that exist: MAP.EXE (version 2) from the masters at
  622.  
  623. Clockwork software. The usage of this tool has been recommended
  624.  
  625. in Lesson 2, and you should learn how to crack it, coz it comes
  626.  
  627. with an annoying nag-screen ("Nigel" screen). In [Map.exe] this
  628.  
  629. ubiquitous "Nigel" screen appears at random waiting for a random
  630.  
  631. amount of time before asking the user to press a key which varies
  632.  
  633. every time and is also selected at random.
  634.  
  635.      The use of a single letter -mostly encrypted with some XOR
  636.  
  637. or SHR- as "password" makes the individuation of the relevant
  638.  
  639. locations using "snap compares" of memory much more difficult.
  640.  
  641. But the crack technique is here pretty straightforward: just
  642.  
  643. break in and have a good look around you.
  644.  
  645.      The INT_16 routine for keyboard reading is called just after
  646.  
  647. the loading of the nag screen. You 'll quickly find the relative
  648.  
  649. LODSB routine inside a routine that paints on screen the word
  650.  
  651. "Press" and a box-edge after a given time delay:
  652.  
  653.      B95000         MOV  CX,0050
  654.  
  655.      2EFF366601     PUSH CS:[0166]
  656.  
  657.      07             POP  ES
  658.  
  659.      AC             LODSB
  660.  
  661.      ...
  662.  
  663. You could already eliminate the delay and you could already force
  664.  
  665. always the same passletter, in order to temperate the effects of
  666.  
  667. the protection... but we crack deep!: let's do the job and track
  668.  
  669. back the caller! The previous routine is called from the
  670.  
  671. following section of the code:
  672.  
  673.      91             XCHG AX,CX
  674.  
  675.      6792           XCHG AX,DX
  676.  
  677.      28939193       SUB  [BP+DI+9391],DL
  678.  
  679.      2394AA94       AND  DX,[SI+94AA]
  680.  
  681.      2EC7064B880100 MOV  WORD PTR CS:[884B],0001
  682.  
  683.      2E803E5C0106   CMP  BYTE PTR CS:[015C],06
  684.  
  685.      7416           JZ   ret       <- Ha! jumping PUSHa & POPa!
  686.  
  687.      505351525756   PUSH the lot
  688.  
  689.      E882F3         CALL 8870
  690.  
  691.      2E3B064B88     CMP  AX,CS:[884B]
  692.  
  693.      7307           JAE  after RET <- Ha! Not taking the RET!
  694.  
  695.      5E5F5A595B58   POP  the lot
  696.  
  697.      C3             RET
  698.  
  699.      ...                                <- some more instructions
  700.  
  701.      E86700         CALL delay_user
  702.  
  703.      BE9195         MOV  SI,9591
  704.  
  705.      2E8B3E255C     MOV  DI,CS:[5C25]
  706.  
  707.      83EF16         SUB  DI,+16
  708.  
  709.      2E8A263D01     MOV  AH,CS:[013D]
  710.  
  711.      50             PUSH AH
  712.  
  713.      E892C7         CALL routine_LODSB  <-- HERE!
  714.  
  715.      B42C           MOV  AH,2C
  716.  
  717.      CD21           INT  21             <- get seconds in DH
  718.  
  719.      80E60F         AND  DH,0F
  720.  
  721.      80C641         ADD  DH,41
  722.  
  723.      58             POP  AX
  724.  
  725.      8AC6           MOV  AL,DH
  726.  
  727.      83EF04         SUB  DI,+4
  728.  
  729.      AB             STOSW
  730.  
  731.      E85A00         CALL INT_16_AH=01
  732.  
  733.      B400           MOV  AH,00
  734.  
  735.      CD16           INT  16
  736.  
  737.      24DF           AND  AL,DF     <- code user's letter_answer
  738.  
  739.      3AC6           CMP  AL,DH     <- pass_compare
  740.  
  741.      75F3           JNZ  CALL INT_16_AH=01
  742.  
  743.      E807F3         go_ahead
  744.  
  745.      You just need to look at these instructions to feel it: I
  746.  
  747. think that unnecessary code segments (in this case protections)
  748.  
  749. are somehow like little snakes moving under a cover: you cannot
  750.  
  751. easily say what's exactly going on yet, but you could bet that
  752.  
  753. there is something fishy going on. Look at the code preceding
  754.  
  755. your LODSB routine call: you find two JUMPS there: a JZ ret, that
  756.  
  757. leaves a lot of pusha and popa aside, and a JAE after RET, that
  758.  
  759. does not take the previous ret. If you did smell something here
  760.  
  761. you are thoroughly right: The first JZ triggers the NIGEL screen
  762.  
  763. protection, and the second JAE does THE SAME THING (as usual,
  764.  
  765. there are always redundances, exactly as there are a lot of
  766.  
  767. possibilities to disable a single protection). Now you know...
  768.  
  769. you can disable this protection at different points: the two
  770.  
  771. easiest blueprints being
  772.  
  773. 1)   to change 7416 (JZ ret) in a EB16 (JMP ret anyway)
  774.  
  775. 2)   to change 7307 (JAE after ret) in a 7306 (JAE ret).
  776.  
  777.      We have not terminated yet: if you try locating this part
  778.  
  779. of the code in order to change it, you won't have any luck: it's
  780.  
  781. a SMC (Self modifying code) part: it is loaded -partly- from
  782.  
  783. other sections of the code (here without any encryption). You
  784.  
  785. must therefore first of all set a breakpoint on memory range;
  786.  
  787. find out the LODSW routine; find out the real area; dump that
  788.  
  789. memory region; find out a search sequence for the "dead" code...
  790.  
  791. and finally modify the "dead" program.
  792.  
  793. Now let's quickly crack it:
  794.  
  795. ------------------------------------------------
  796.  
  797. CRACKING MEM.EXE (version 2) (by +ORC, January 1996)
  798.  
  799. ren map.exe map.ded
  800.  
  801. symdeb map.ded
  802.  
  803. -    s (cs+0000):0 Lffff 74 16 50 53 51 52 57
  804.  
  805. xxxx:yyyy           <- this is the debugger's answer
  806.  
  807. -    e xxxx:yyyy    EB
  808.  
  809. -    w
  810.  
  811. -    q
  812.  
  813. ren map.ded map.exe
  814.  
  815. -------------------------------------------------
  816.  
  817. Now you have done it, NIGEL has been cracked!
  818.  
  819. Well, that's it for this lesson, reader. Not all lessons of my
  820.  
  821. tutorial are on the Web.
  822.  
  823.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  824.  
  825. me back (via anon.penet.fi) with some tricks of the trade I may
  826.  
  827. not know that YOU discovered. Mostly I'll actually know them
  828.  
  829. already, but if they are really new you'll be given full credit,
  830.  
  831. and even if they are not, should I judge that you "rediscovered"
  832.  
  833. them with your work, or that you actually did good work on them,
  834.  
  835. I'll send you the remaining lessons nevertheless. Your
  836.  
  837. suggestions and critics on the whole crap I wrote are also
  838.  
  839. welcomed.
  840.  
  841.                                 E-mail +ORC
  842.  
  843.                         +ORC an526164@anon.penet.fi
  844.