home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersclub / km / library / cracking / xoanon-timelock.txt < prev   
Text File  |  1998-03-25  |  8KB  |  181 lines

  1. TimeLOCK DLL "a cracking approach"
  2.  
  3.      The DLL i will talk about is a DLL frequently used to protect
  4.      commercial programs distributed on the web. This DLL provide a time
  5.      limit protection: after xx days your program will not run anymore
  6.      without purchasing.
  7.  
  8. The protection scheme is quite simple:
  9.  
  10.      1) You are given a serial number by the program itself
  11.      2) You are asked to enter an unlock code calculated from this #
  12.      3) Name,Company and other stuffs doesn't interest the protection
  13.  
  14. Here the interresting findings:
  15.  
  16.      1) Everytime the program is installed the serial provided changes.
  17.      2) The registering information are stored in the W95 Registry AND in a
  18.      file .TSF stored in some locations of your HD, in encrypted form.
  19.  
  20.      For example, in GeoBoy v1.3.1 (one of the many programs protected with
  21.      TimeLOCK) if you search the registry for the word "GeoBoy" you will
  22.      find some locations where there are a bunch of strange characters....
  23.      that's your information, encrypted.
  24.  
  25.      But in this approach we will crack the DLL brutally, so we will not
  26.      care much about the registry! Finally, if you want to reinstall it
  27.      after the trial is expired (eh eh.... are you too lazy to try cracking
  28.      it??? :) you have to COMPLETELY clean up the registry (all branches
  29.      where the word "Geoboy" dwells).
  30.  
  31. Now some Frequently Asked Questions:
  32.  
  33.      Q: So, WHICH programs use this DLL? Where can I find them?
  34.  
  35.      A: Well, i found a lot of programs that do use this DLL .... for
  36.      example: E-BroadCaster, NetObject Fusion v2.0, GeoBoy v1.3.1. They're
  37.      all on the web, search them using AltaVista or some other engine.
  38.      Simply put in the name of the program you are looking for, and then
  39.      get it!
  40.  
  41.      Q: Ok dude, i found that program! how can i see if it's protected with
  42.      the DLL ?
  43.  
  44.      A: Obvious..... it has to load it from your HD everytime it runs...
  45.      so, simply search it with a DIR /S (will dwell most of the time inside
  46.      the installation directory of your new program, or else inside
  47.      WIN/SYSTEM)
  48.  
  49. Ok boyz, now let's go cracking!
  50.  
  51.      In this approach i will use as example target the program GeoBoy
  52.      v1.3.1. Find it on the web, it's done by NDG Software so i think
  53.      you'll easily find it (every software house has at least an
  54.      homepage!).
  55.  
  56.      Well, fire your SoftICE as usually, light your cigarette (like me, or
  57.      if you prefer the +ORC way, prepare a good Martini Vodka!) and install
  58.      GeoBoy. Installed? Ok, now run it! You will see the classic TimeLOCK
  59.      window (it's the same in all the programs protected with it, this
  60.      makes it easy to see if a program use this protection scheme). Enter a
  61.      name, a company and an unlock code. As you can see, you have in the
  62.      window 3 edit lines.
  63.  
  64.      Now enter in SoftICE and act as usual with password-protected
  65.      programs:
  66.  
  67.      :TASK
  68.  
  69.      hmmmm is GeoBoy its task name? ...... found! Let's do an HWND on it!
  70.  
  71.      :HWND GEOBOY
  72.  
  73.      good! let's see... we're searching for some edit boxes.... found!
  74.  
  75.      Handle         hQueue  SZ      QOwner  Class Name      Window Procedure
  76.      .......        ....    ..      ......  ....            .............
  77.      052C(2)        0D57    32      GEOBOY  Edit            177F:00000BF4 *
  78.      0508(2)        0D57    32      GEOBOY  Edit            177F:00000BF4 *
  79.      050C(2)        0D57    32      GEOBOY  Static          178f:000052FA
  80.      0510(2)        0D57    32      GEOBOY  Edit            177f:00000BF4 *
  81.      .......        ....    ..      ......  ....            .............
  82.  
  83.      We found 3 edit references.... let's try BMSGging the first (but will
  84.      work alsoBMSGging on the others)
  85.  
  86.      :BMSG 052C WM_GETTEXT
  87.  
  88.      Break due to BMSG 052C WM_GETTEXT !!! SoftICE pops up again!!! Well,
  89.      now you are inside Windows95 Kernel (if i remember well) ... First,
  90.      disable the breakpoint with BD 00 (or it will break on anyother
  91.      GETWINDOWTEXT function.... generally if you found an entry point you
  92.      should disable the BP after...).
  93.  
  94.      Now step some instructions (not too many) until you reach TL32V20. We
  95.      have reached the DLL, now you have to show all your cracking
  96.      capabilities! Well.... step step step and step, watching the
  97.      EAX,ECX,EDI,ESI after every CALL or MOV EAX or MOV ECX or LEA EAX or
  98.      LEA ECX (with D ). You'll soon find that the DLL use these register to
  99.      store the addresses to everything you enter (name,company,unlock code)
  100.      and also for the serial number (generated at every install) and the
  101.      correct unlock code.
  102.  
  103.      You will also notice that the unlock code (es. 121212) you entered is
  104.      stored at EBP-14, while the correct one is stored at EBP-28.
  105.  
  106.      Can we crack our target faking the MOV and LEA to these register? YES!
  107.  
  108.      Watch this piece of code (you will reach it after some stepping once
  109.      you are working inside the DLL):
  110.  
  111.      ......
  112.      LEA EAX, [EBP-28]
  113.      PUSH EAX
  114.      CALL 10001D08     < Generate the correct unlock code for the
  115.      ADD ESP,04              serial you're provided with
  116.      LEA EAX,[EBP-14]  < do "D [EBP-14]" and you'll see the code you entered
  117.      LEA ECX,[EBP-28]  < do "D [EBP-28]" and you'll see the CORRECT code
  118.      PUSH EAX          < save the location
  119.      PUSH ECX          < save the location
  120.      ......
  121.  
  122.      Well..... we found something interesting, don't you think? Try
  123.      immediately to change the LEA EAX,[EBP-14] in LEA EAX,[EBP-28]. In
  124.      this way, the correct code is moved in EAX instead of the bogus code
  125.      that we have entered. Act as usual (write down some bytes after and
  126.      some before these LEA, write down also the bytes of the changed
  127.      instructions, search them with your hex-editor inside TL32V20.DLL and
  128.      patch it). To make your life easy, write down and use as search string
  129.      a LOT of bytes before the LEA instruction, or you will find a lot of
  130.      occurences of the same sequence inside the file.
  131.  
  132.      Ok, patched? Well, now try it and look if it works! Load back GeoBoy
  133.      and enter whatever you want as unlock code. Wow! it seems to work! it
  134.      says "Thanks for purchasing!" Eh eh.... Xoanon rulez!! :) Now you
  135.      think that your program is completely registered. But...... But? Try
  136.      to load it another time...... AAARGH!!!! The time-limit reminder pops
  137.      up again! Why?
  138.  
  139.      Well, it seems there are some other instructions referring to the code
  140.      you entered... Ok! Fire SoftICE again and back to work! Reach again
  141.      the point where you found the LEA EAX,[EBP-14] (now changed in
  142.      [EBP-28]). Step a little ahead and...... eh eh... look at this (some
  143.      instructions after):
  144.  
  145.      ..........
  146.      ADD ESP,08
  147.      TEST EAX,EAX     < checks if the values at [EAX] and [ECX] are the same....
  148.                         now they are, 'coz we patched the DLL before.
  149.  
  150.      JNZ 10004028     < if EAX isn't 0 (bad unlock code) will jump. Now no, 'coz
  151.                         EAX is 0.
  152.  
  153.      LEA EAX,[EBP-14] < Eh eh.... this is the instruction we are searching for!
  154.                         As you see with "D EAX", it will move again in EAX the
  155.                         code you entered (which is a bad code, obviously)....
  156.                         Probably we need to change it too? YEAH!!!
  157.  
  158.      PUSH EAX         < Saves the location
  159.      ..........
  160.  
  161.      This is the end. Act as you did before, changing this occurrence of
  162.      LEA EAX,[EBP-14] in a LEA EAX,[EBP-28], in order to move again inside
  163.      EAX the correct code), then search and replace these bytes in
  164.      TL32V20.DLL.
  165.  
  166.      Try again to run the program..... it WORKS!!!!!!!!
  167.  
  168.      To be really sure, do the following:
  169.  
  170.      1) Save your patched *.dll
  171.      2) clean from the registry all the entries which refer to GeoBoy
  172.      3) delete the file .TSF inside the GeoBoy directory and
  173.      4) reinstall the whole program anew
  174.  
  175.      Now simply copy your patched DLL over the original one and run GeoBoy.
  176.      Enter whatever you want, it says "Ok,registered"... Exit, run again
  177.      and again and again for ever... you won't see anymore the timelimit
  178.      screen!
  179.  
  180.                                         Done by Xoanon/PiNNACLE in May 1997
  181.