home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / pc / crack / crak2.doc < prev    next >
Encoding:
Text File  |  2003-06-11  |  22.5 KB  |  532 lines

  1.                                 Example Cracks
  2.  
  3.  
  4.  
  5.      -------------------------------------------------------------
  6.      OK,  now let's put some of this information into practice  by
  7.      examining a few cracks of some common programs.   First we'll
  8.      look at a Crack for Mean-18 Golf by Accolade.   Accolade  has
  9.      been one of those companies that has a fervent belief in Copy
  10.      Protection.
  11.      -------------------------------------------------------------
  12.  
  13.  
  14.  
  15.  
  16.      Title:         MEAN-18 UnProtect For CGA/EGA Version
  17.  
  18.  
  19.      This crack works by eliminating the code that tests for known
  20.      bad  sectors  on the original diskette to see if  it  is  the
  21.      genuine article or an illegal copy.   The code begins with an
  22.      INT 13 (CD 13 HEX),  a DOS BIOS disk service routine followed
  23.      a few bytes later by another INT 13 instruction.  The program
  24.      then checks the returned value for the bit configuration that
  25.      signifies the bad sectors and, if all is as expected, contin-
  26.      ues on with program execution.
  27.  
  28.      The code that needs to be patched is in the GOLF.EXE file and
  29.      in the ARCH.EXE file.  It is identical in both files and lies
  30.      near the end of each file.
  31.  
  32.      In the following steps,  you'll locate the start of the  test
  33.      code and patch it by replacing it with NOP instructions  (HEX
  34.      90).   The  method described uses the DOS DEBUG  utility  but
  35.      Norton's Utility (NU) works too.
  36.  
  37.      Copy  all  of the files from the MEAN-18 disk  onto  a  fresh
  38.      floppy  using  the DOS COPY command and place  your  original
  39.      diskette out of harm's way.
  40.  
  41.      Assuming DEBUG is in the A:  drive and the floppy  containing
  42.      the files to be unlocked is in the B: drive , proceed as fol-
  43.      lows:
  44.  
  45.      First  REName  the  GOLF.EXE  file  so  it  has  a  different
  46.      EXTension other than .EXE.
  47.  
  48.                     REN GOLF.EXE GOLF.DEB
  49.  
  50.  
  51.      Next  load the file GOLF.DEB into DEBUG and displays the  "-"
  52.      DEBUG prompt.
  53.  
  54.                     A:> DEBUG B:GOLF.EXE
  55.  
  56.                                   13
  57.      Search for the beginning of the code to be patched by typing:
  58.  
  59.  
  60.                     - S CS:100 FFFF CD 13
  61.  
  62.      Searches  the file for the two byte INT 13  instruction.   If
  63.      all goes well, two addresses should appear on the screen.
  64.  
  65.                     XXXX:019C
  66.                     XXXX:01A8
  67.  
  68.      XXXX indicates that the numbers preceeding the ":"  vary from
  69.      system  to system but the numbers following the ":"  are  the
  70.      same on all systems.
  71.  
  72.      The  next  step is to use the "U"  command  as  indicated  to
  73.      un-assemble  a few bytes in order to verify your position  in
  74.      the file)
  75.  
  76.                     - U CS:019C
  77.  
  78.      (Un-assembles  32 bytes of code.   Verify the  following  se-
  79.      quence of instructions:
  80.  
  81.                     INT       13
  82.                     JB        01E9
  83.                     MOV       AL,[BX+01FF]
  84.                     PUSH      AX
  85.                     MOV       AX,0201
  86.                     INT       13
  87.                     POP       AX
  88.                     JB        01E9
  89.                     CMP       AL,F7
  90.                     JNZ       01B5
  91.  
  92.      These are the instructions you'll be patching out in the fol-
  93.      lowing step)
  94.  
  95.                     - A CS:019C
  96.  
  97.      This command assembles the new instructions you enter at  the
  98.      keyboard into the addresses shown.  Beginning at CS:019C, and
  99.      for the next 21 bytes, ending with and including CS:01B0, en-
  100.      ter  the no op command "NOP" (90h) followed by a <return>  or
  101.      <enter>.   Just hit <enter> at address XXXX:01B1 to  end  the
  102.      assemble command.)
  103.  
  104.                     XXXX:019C  NOP <enter>
  105.                     XXXX:019D  NOP <enter>
  106.                                .
  107.                                .
  108.                                .
  109.                     XXXX:01AE  NOP <enter>
  110.                     XXXX:01AF  NOP <enter>
  111.  
  112.                                   14
  113.                     XXXX:01B0  NOP <enter>
  114.                     XXXX:01B1 <enter>
  115.  
  116.      This just wipes out the section of code containing the INT 13
  117.      check.
  118.  
  119.      Now  do  a HEX dump and verify that bytes 019C  through  01B0
  120.      have been set to 90 HEX.
  121.  
  122.                     - D CS:019C
  123.  
  124.      If they have, write the patched file to the disk as follows)
  125.  
  126.                     - W
  127.  
  128.      This    writes    the    patched    file    back    to    the
  129.  
  130.      disk where it can be run by typing    GOLF just as before but
  131.      now,  it  can be run from any drive,  including  the     hard
  132.      drive)
  133.  
  134.      Now just [Q]uit or exit back to DOS.  This command can be ex-
  135.      ecuted at any "-" DEBUG prompt if you get lost.  No modifica-
  136.      tion will be made to the file on the disk until you issue the
  137.      "W" command.
  138.  
  139.                     - Q
  140.  
  141.      The process is the same for the ARCH.EXE file but because  it
  142.      is a different length, the segment address, (XXXX part of the
  143.      address),  will be different.   You should find the first INT
  144.      13  instruction  at address XXXX:019C and the second  one  at
  145.      XXXX:01A8 as before.
  146.  
  147.      You  will again be patching 21 bytes and you will start  with
  148.      019C and end with 01B0 as before.   After doing the HEX  dump
  149.      starting  at address 019C,  you again write the file back  to
  150.      the disk with a "W" command then "Q" uit.
  151.  
  152.      Norton's utilities can also be used to make this patch.   Be-
  153.      gin  by searcing the GOLF.EXE or ARCH.EXE files for  the  two
  154.      byte  combination  CD  13 (remember to  enter  these  as  HEX
  155.      bytes).  Once located, change the 21 bytes, starting with the
  156.      first "CD"  byte, to 90 (a NOP instruction).  As a check that
  157.      you  are in the right place, the byte sequence in both  files
  158.      is  CD 13 72 49 8A 87 FF 01 50 B8 01 02 CD 13 58 72 3C 3C  F7
  159.      75 04.   After modifying the bytes,  write the modified  file
  160.      back to the disk.  It can then be run from any drive.
  161.  
  162.      END.
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.                                   15
  170.      ------------------------------------------------------------
  171.      That was the first the tutorial cracks,  here's another crack
  172.      based on the same ideas but using Norton's Utilities instead.
  173.      The  following  is an unprotect method  for  Eypx  Submarine.
  174.      Eypx is another one of those companies bent on protecting the
  175.      world.
  176.      ------------------------------------------------------------
  177.  
  178.  
  179.      By:            Assembler Magic
  180.      Title:         EPYX Submarine Unprotect
  181.  
  182.  
  183.        You  will  only need to make one modification to  the  main
  184.      executable program of Submarine, SUB.EXE.  I will assume that
  185.      your  computer  has a hard disk and that you have a  path  to
  186.      DOS. It's time to fire up DEBUG as follows:
  187.  
  188.                     DEBUG SUB.EXE<cr>
  189.  
  190.        The computer should respond with a "-" prompt.  Now look at
  191.      the  registers,  just to make sure everything came  up  okay.
  192.      Type the letter "R"  immediately after the prompt.   The com-
  193.      puter should respond with a few lines of info as follows:
  194.  
  195.      AX=0000  BX=0001  CX=6103  DX=0000  SP=0080  BP=0000  SI=0000
  196.      DI=0000  DS=12CE ES=12CE SS=37B2 CS=27FC IP=0010 NV UP EI  PL
  197.      NZ NA PO NC
  198.           27FC:0010 8CC0       MOV     AX,ES
  199.      -
  200.  
  201.        Note  the value of CS is "27FC".   That is the  hexadecimal
  202.      segment address for the beginning of the program code in your
  203.      computer's memory.   It is highly probable that the value you
  204.      see for CS will differ from mine.   Whatever it is,  write it
  205.      down.  Also, the values you see for DS, ES and SS will almost
  206.      certainly differ from mine and should not cause you  concern.
  207.      The other registers should show the same values mine do,  and
  208.      the flags should start with the same values.
  209.  
  210.        Next,  we will do a search for Interrupt 13's.   These  are
  211.      BIOS  (not DOS) Interrupts built into the program  which  are
  212.      used  to ensure that the original disk is being used  to  run
  213.      the program. The whole key to this unprotect scheme is to by-
  214.      pass these Interrupts in the program code.   The tricky  part
  215.      of this unprotect is to find them!   They are not in the seg-
  216.      ment  of  program code starting at the value of CS  equal  to
  217.      "27FC".   They are closer to the beginning of the program  in
  218.      memory.   Easy enough!   Reset the value of CS to  equal  the
  219.      value  of DS as follows; type immediately after  Debug's  "-"
  220.      prompt:
  221.  
  222.                     RCS<cr>
  223.  
  224.  
  225.                                   16
  226.      Debug will prompt you for the new value of CS with:
  227.  
  228.                     CS:27FC:
  229.  
  230.        You  respond  by typing the value of DS you  saw  when  you
  231.      dumped the registers the first time.   For example,  I  typed
  232.      "12CE<cr>".   The  value you type will be  different.   Debug
  233.      will  again respond with the "-"  prompt which means  we  are
  234.      ready to do our search.   Type in the following after the "-"
  235.      prompt:
  236.  
  237.                     S CS:0 FFFF CD 13<cr>
  238.  
  239.        The computer should respond with three lines of information
  240.      which are the addresses of the three Interrupt 13 calls built
  241.      into the program.   The first four digits are the segment ad-
  242.      dress  and will equal to the value of CS you have  just  set.
  243.      The second four digits following the colon are the offset ad-
  244.      dresses which are of primary interest to us.   On my  machine
  245.      they came back as follows:
  246.  
  247.                     12CE:4307
  248.                     12CE:431F
  249.                     12CE:4335
  250.  
  251.        The segment addresses will be identical and the three  off-
  252.      set  addresses should all be relatively close together.   Now
  253.      look at the first offset address.  (As you can see,  mine was
  254.      "4307".) Write it down.  Now we do a bit of Unassembly.
  255.  
  256.        Type "U4307<cr>"  which is the letter "U", followed immedi-
  257.      ately  (with no blank spaces) by whatever your  first  offset
  258.      address turned out to be, followed by a carriage return.   If
  259.      you are not familiar with unassembled machine code,  it  will
  260.      look like lines of gibberish as follows:
  261.  
  262.                     12CE:4307 CD13        INT      13
  263.                     12CE:4309 4F          DEC      DI
  264.                     12CE:430A 744C        JZ       4358
  265.                               .
  266.                               .
  267.                     12CE:431F CD13        INT      13
  268.                     12CE:4321 4F          DEC      DI
  269.                               .
  270.                               .
  271.                     12CE:4324 BF0400      MOV      DI,0004
  272.                     12CE:4326 B80102      MOV      AX,0201
  273.  
  274.        In  my computer,  Unassemble will automatically  output  16
  275.      lines of code to the screen.  Yours may differ.  Note, in the
  276.      abbreviated list I have shown above, the addresses at the be-
  277.      ginning  of  the two lines which contain the  Interrupt  13's
  278.      (INT  13) correspond to the first two addresses we  found  in
  279.      our search.  Now we continue the unassemble, and here comes
  280.  
  281.                                   17
  282.      another  tricky part.   Just type in "U<cr>"  after  the  "-"
  283.      prompt.
  284.  
  285.        You'll get sixteen more lines of code with the third Inter-
  286.      rupt 13 on a line which begins with the address (CS):4335  if
  287.      you  have  the same version of Submarine as I do.   It's  not
  288.      terribly  important  to  this  exercise,   but  it  will   at
  289.      least show you that things are proceeding okay.   Now type in
  290.      "U<cr>"  again  after the prompt.  You are  now  looking  for
  291.      three key lines of code.   On my program they appear as  fol-
  292.      lows:
  293.  
  294.                     12CE:4335 07          POP      ES
  295.                     12CE:4356 5D          POP      BP
  296.                     12CE:4357 CB          RETF
  297.  
  298.      The true key is the instruction "POP ES".   This  instruction
  299.      begins  the normal return sequence after the program has  ex-
  300.      ecuted its Interrupt 13 instructions and accompanying checks.
  301.      If  Debug on your machine prints fewer than 16 lines of  code
  302.      at a shot, you may have to type in "U" more than twice at the
  303.      "-" to find these instructions.  (If you haven't found any of
  304.      this stuff, either get help on the use of Debug or go back to
  305.      using your diskette version!)  Write down the offset  address
  306.      of  the "POP ES"  instruction; the four digits following  the
  307.      colon,  which in my example is "4354".   You're well on  your
  308.      way now, so please persevere.
  309.  
  310.        The  next step is to modify the program to JUMP around  the
  311.      code which executes the Interrupt 13's and go immediately  to
  312.      the  instruction  which  begins the  normal  return  sequence
  313.      (again,  it's the "POP ES".  Type in the  following  instruc-
  314.      tions carefully:
  315.  
  316.                     A4307<cr>
  317.  
  318.        This first bit tells Debug that new Assembler code will  be
  319.      inserted at the address of the first Interrupt 13.   If  your
  320.      first  Interrupt 13 is at an address other that  "4307",  use
  321.      the correct address,  not mine.  The computer will prompt you
  322.  
  323.      with the address:
  324.  
  325.                     12CE:4307
  326.  
  327.      After which you will immediately type:
  328.  
  329.                     JMP 4354<cr>
  330.  
  331.      This instruction jumps the program immediately to the  normal
  332.      return code instructions.  Again, at the risk of being redun-
  333.      dant, if your "POP ES" instruction is at a different address,
  334.      use that address, not "4354"!
  335.  
  336.      The computer will prompt you with the address of the next in-
  337.  
  338.                                   18
  339.      struction  if  all went well.   MAKE SURE you  just  hit  the
  340.      carriage  return at this point.  Debug will then  return  the
  341.      familiar "-" prompt.
  342.  
  343.      Now  it's  time  to examine your  handiwork.   Let's  do  the
  344.      unassemble again starting at the address of what had been the
  345.      first Interrupt 13 instruction, but which is now the Jump in-
  346.      struction.  Type in "U4307<cr>" or "U" followed by the appro-
  347.      priate address and a carriage return.   The first line begin-
  348.      ning with the address should appear as follows:
  349.  
  350.                     12CE:4307 EB4B        JMP      4354
  351.  
  352.      The key here is the four bytes immediately following the  ad-
  353.      dress.   In my example they are "EB4B".   Yours may  not  be.
  354.      But,  they are VERY IMPORTANT because they represent the  ac-
  355.      tual machine code which is the Jump instruction.  WRITE THESE
  356.      FOUR BYTES DOWN AND MAKE SURE THEY ARE CORRECT.
  357.  
  358.        Now  if  you want to have some fun before we go  on,  reset
  359.      register  CS to its original value by first typing  "RCS<cr>"
  360.      at  the "-"  prompt.   Then type in the original value of  CS
  361.      that I asked you to write down.   Using my example,  I  typed
  362.      "27FC<cr>".  Next, you will type "G<cr>" after the "-" prompt
  363.      which  means GO!   If all went well,  SUB should run at  this
  364.      point.   At  least it will if you put all  of  the  Submarine
  365.      files  onto the diskette or into the hard  disk  subdirectory
  366.      where youre working.   If it didn't run, you may have made an
  367.      error. Check through what you have done.
  368.  
  369.      Don't give up at this point if it does not run.  Your version
  370.      of Debug may simply have not tolerated our shenanigans.  When
  371.      you are done playing, quit Submarine ("Alt-Q<cr>") and type a
  372.      "Q<cr>" after the Debug prompt "-" appears.
  373.  
  374.      Now  comes  the tough part.   I can't walk you  through  this
  375.      phase  in complete detail,  because you may be using  one  of
  376.      several programs available to modify the contents of SUB.EXE.
  377.      Debug is not the way to go,  because it can't write out  .EXE
  378.      files, only .COM files.
  379.  
  380.      -------------------------------------------------------------
  381.      Note:  Another method of doing this is to REName the  SUB.EXE
  382.      file  so it has a different extension other than .EXE  before
  383.      you enter DEBUG.   That way after you've made the change  you
  384.      can then [W]rite then changes out to the file right in DEBUG.
  385.      Then one drawback is that you can't run the program in  DEBUG
  386.      once you've changed the name.
  387.      -------------------------------------------------------------
  388.  
  389.      You have to get into your sector modification package (NORTON
  390.      works good) and work on the SUB.EXE file on your new diskette
  391.      or your hard disk.  Remember, I warned you that doing this on
  392.      your hard disk is dangerous if you are not fully aware of
  393.  
  394.                                   19
  395.      what you are doing.  So, IF YOU MESS UP, it's YOUR OWN FAULT!
  396.  
  397.      You  are looking for the first occurrence of an Interrupt  13
  398.      (the "CD 13") using the search facility in your program.   If
  399.      you  don't have the ability to search for the two-byte  hexa-
  400.      decimal code "CD 13" directly, then you will have to manually
  401.      search.
  402.  
  403.      -------------------------------------------------------------
  404.      Note:  Norton 4.x now has a search utility.   When you get to
  405.      the  point of typing in the search text,  just press the  TAB
  406.      key, and you can type in the actual hexadecimal code "CD 13".
  407.      -------------------------------------------------------------
  408.  
  409.      Start  at the beginning of SUB.EXE and proceed.   Again,  you
  410.      want to find the first of the three (first from the beginning
  411.      of the program).
  412.  
  413.      I  will give you a hint.   I found it in NORTON  at  location
  414.      4407  hexadecimal  which is location 17,415  decimal  in  the
  415.      SUB.EXE program file.   DOS standard sectors are 512  decimal
  416.      bytes.  Replace  the two bytes "CD 13"  with the "EB  4B"  or
  417.      whatever  your Jump instruction turned out to be.   Write  or
  418.      save the modified file.
  419.  
  420.      That's ALL there is to modifying SUB.EXE.   You can go  ahead
  421.      and execute your program.   If you have followed my  instruc-
  422.      tions, it should run fine.  Get help if it doesn't.  Now, you
  423.      should be all set.  You can load onto your hard disk,  if you
  424.      haven't already.  You can run it from a RAM disk using a  BAT
  425.      file if you really want it to hum.   Or,  if you have the fa-
  426.      cilities,  you can copy it from 5-1/4" floppy to 3-1/2"  dis-
  427.      kette and run it on machines which accept that medium if  you
  428.      upgrade to a new computer.
  429.  
  430.      END.
  431.                                   20
  432.      -------------------------------------------------------------
  433.      Now let's take a look at a newer crack on the program,  Space
  434.      Station Oblivion by Eypx.  At a first [S]earch with Debug and
  435.      Norton's  Utility no CD 13's could be found,  and yet it  was
  436.      using them... So a different approach had to be taken...
  437.      -------------------------------------------------------------
  438.  
  439.  
  440.      By:            PTL
  441.      Title:         Space Station Oblivion Crack
  442.  
  443.  
  444.      First of all,  you must determine which file the INT 13's are
  445.      in,  in this case it had to be the file OBLIVION.EXE since it
  446.      was the main program and probably contained the INT 13's.  So
  447.      then rename it to a different EXTension and load it into  De-
  448.      bug.
  449.  
  450.      Then do a [S]earch for INT 13's.
  451.  
  452.                     -S 100 FFFF CD 13
  453.  
  454.      Which will promptly turned up nothing.  Hmmm...
  455.  
  456.      Next you might decide that, maybe, the code was modifying it-
  457.      self.   So quit from Debug and load up PC-Watch,  include all
  458.      the  INT  13  Calls.   For those of  you  not  familiar  with
  459.      PC-Watch,  it is a memory resident program that can be set to
  460.      look  for  any type of BIOS call.   When that  call  is  made
  461.      PC-Watch prints to the screen the contents of all the  regis-
  462.      ters  and the current memory location that the call was  made
  463.      from.
  464.  
  465.      After PC-Watch is initialized, then run the OBLIVION.EXE file
  466.      from the hard disk,  leaving the floppy drive door open,  and
  467.      sure  enough,  when the red light comes on in   the  diskette
  468.      drive,  PC-Watch  will report the address's of  some  INT  13
  469.      calls.  Which you should then write down.
  470.  
  471.      From  there,  quit the game, reboot,  (To dump PC-Watch  from
  472.      memory) and load the OBLIVION.EXE into Debug and issue a [G]o
  473.      command with a breakpoint.  What address should you use for a
  474.      breakpoint?   You guessed it, the same address PC-Watch gives
  475.      you.
  476.  
  477.      Well,  it locked up did'nt it?  Which is quite common in this
  478.      line of work so don't let that discourage you.   So next  re-
  479.      loaded  it into debug and this time [U]nassemble the  address
  480.      that you got from PC-Watch.   But instead of finding the  INT
  481.      13's you'll find harmless INT 21's.
  482.  
  483.      Hmm...  could  it be that the program was converting  the  CD
  484.      21's to CD 13's during the run?   Well,  to test the idea as-
  485.      semble an INT 20 (Program Terminate) right after the first
  486.  
  487.                                   21
  488.      INT 21. Then I run the program, and yes immediately after the
  489.      red light comes on the drive, the program will terminate nor-
  490.      mally.
  491.  
  492.      Then [U]nassemble that same area of memory,  and low and  be-
  493.      hold,  some  of the INT 21's have magically turned  into  INT
  494.      13's.  How clever...
  495.  
  496.      So,  then it is just a matter of locating the address of  the
  497.      routine that it jumped (JMP) to if the correct disk was found
  498.      in  drive A:.   Once you have that address,  just go  to  the
  499.      start of all this nonsense and [A]ssemble a JMP XXXX command.
  500.      Where  XXXX was the address to jump to if the  original  disk
  501.      was in drive A:.
  502.  
  503.      Then  just [W]rite the file back out to the disk  and  [Q]uit
  504.      debug,   and  then  REName  the  file  back  to  OBLIVION.EXE
  505.      afterwhich it should work fine.
  506.  
  507.  
  508.      END.
  509.  
  510.  
  511. Which G-file (Q=Quit) ? 
  512.  
  513.  
  514.      Another file downloaded from:                     NIRVANAnet(tm)
  515.  
  516.      & the Temple of the Screaming Electron              415-935-5845
  517.      Just Say Yes                                        415-922-1613
  518.      Rat Head                                            415-524-3649
  519.      Cheez Whiz                                          408-363-9766
  520.      Reality Check                                       415-474-2602
  521.  
  522.    Specializing in conversations, obscure information, high explosives,
  523.        arcane knowledge, political extremism, diversive sexuality,
  524.        insane speculation, and wild rumours. ALL-TEXT BBS SYSTEMS.
  525.  
  526.   Full access for first-time callers.  We don't want to know who you are,
  527.    where you live, or what your phone number is. We are not Big Brother.
  528.  
  529.                          "Raw Data for Raw Nerves"
  530.  
  531.  
  532.