home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / CrackMesCbjNet / chiw-artemis.txt < prev    next >
Encoding:
Text File  |  2001-09-21  |  4.3 KB  |  99 lines

  1. Hi this is my first ever tutorial. I've been reversing (attempting) for the last 2 years. I still consider myself a beginner as I don't put much time in reversing or programming. But I thought it time to step out and add to the knowledge of others.
  2.  
  3. Crack:
  4. Artemis crackme by WiLSE from genocidecrew
  5.  
  6.  
  7. Tools:
  8. Spy & Capture Version 2.70 not necessary but very handy)
  9. Softice
  10. Hex editor
  11. (WDasm)
  12.  
  13. When running the prog all that happens is a window with a URL and two buttons. Hmmm, kinda fishy. What's the deal??!! Using the little spy program on the main window, I looked for childprocesses. Hey, two textboxes, yet only one is visible. Using spy set visibility to true. Wow, you did it! So that's the deal; make the textbox visible. Sounds easy.
  14.  
  15. Trying to disassemble only shows that it's PE encrypted with Neolite, too bad. Remember start point  of program 411110 (see later).
  16.  
  17. So I tried to play around with so decryptors I downloaded but had no luck. (I don't really know how to use them) So it's time for good old Softice.
  18.  
  19. Hmmm, program does not break into softice with the loader. In the spy prog we find the handle of the textboxes. So I put a BMSG Handle and rerun the Artemis program. I break into Softice, F12 (many times) till in Artemis code. Interresting, calls to CreateWindowExA.This is what it looks like:
  20.  
  21. 401127    xor eax,eax
  22.     push eax
  23.     push dword ptr [00402136]
  24.     push eax
  25.     push dword ptr [0040213A]
  26.     push 12
  27.     push 000000B4
  28.     push 05
  29.     push 000000AA
  30.     push 50001101    ;<-- Style
  31.     push 00402017    ;<-- Text of the URL
  32.     push 00402044    ;<-- Font info / Static
  33. 401155    call CreateWindowExA
  34.     mov [0040213A],eax    ;<-- Handle of the url textbox
  35.     xor eax,eax
  36.     push eax
  37.     push dword ptr [00402136]
  38.     push eax
  39.     push dword ptr [0040213A]
  40.     push 1E
  41.     push 64
  42.     push 000000BE
  43.     push 000000E1
  44. 40117D    push 40001101    ;<-- Style  >--(Set breakpoint here)--<
  45.     push 00402017    ;<-- Text "Wow, you did it!"
  46.     push 00402044    ;<-- Font info / Static
  47. 40118D    call CreatWindowExA
  48.     mov [00402167],eax    ;<-- Handle of textbox "wow, you did it!"
  49.  
  50. A quick check in the Win32 API reference shows the following
  51.  
  52. HWND CreateWindowEx(
  53.  
  54.     DWORD dwExStyle,        // extended window style
  55.     LPCTSTR lpClassName,    // pointer to registered class name
  56.     LPCTSTR lpWindowName,    // pointer to window name
  57.     DWORD dwStyle,        // window style        <<----    :) :) :)
  58.     int x,            // horizontal position of window
  59.     int y,            // vertical position of window
  60.     int nWidth,            // window width
  61.     int nHeight,        // window height
  62.     HWND hWndParent,        // handle to parent or owner window
  63.     HMENU hMenu,        // handle to menu, or child-window identifier
  64.     HINSTANCE hInstance,    // handle to application instance
  65.     LPVOID lpParam         // pointer to window-creation data
  66.    );
  67.  
  68. Set breakpoint at 40117D -> run prog again.
  69.  
  70. Now change the push from 'push 40001101' to 'push 50001101' (Softice command "a").Continue to run the program. Yes, this is the spot. The textbox is now visible. Now how to change the exe file that we don't need Softice anymore.
  71.  
  72. As it's PE encrypted my first thought was in memory patching yet whatever I tried I just ended up wih page faults. Not the way to go. So this meant going into the decrypt routine. Ahhhh, hatefull. So I set a breakpoint on the beginning of the prog bpx 411110. After a few minutes I found it too hard so remembered many of the tuts I've read and put a bpm on location 40117D as this is the code that the decryptor generates.
  73.  
  74. Run Artemis again, and check what's happening. We break  at 41267D: do a 'd 40117d'
  75.  
  76. 41267D    repz movsb    ;<-- F10 and you see 01 11 move into place
  77. 41267F    pop esi        ;<-- address above 80000000 :)
  78.  
  79. keep pressing F10 till you come to the next code:
  80.  
  81. 4128AF    movsw
  82. 4128B1    movsb 
  83.  
  84. Anyway this moves 00 40 into place from address stored in esi.?? :)
  85.  
  86. So do a 'd esi'. Hmmm, delicious. this is what you should see: 40 68 61 14 1A FA .....
  87.  
  88. After checking the routine a little  more you'll see that it often comes back to this part of the code (data).
  89.  
  90. Now time for the 1 byte patch. Open your hex editor, search for the string '40 68 61 14'. There should only be one reference, change 40 into 50, save, disable your breakpoints and run the patched Artemis, voila. Bingo.
  91.  
  92. Thanks too all you great crackers out there spending time writing tuts that have helped me a lot. I hope to read more as there is always more to learn. Thanks to Fravia through his website I started my interrest in reversing.
  93.  
  94. Yours truly,
  95.  
  96. Chiwaka
  97. chiwaka@ms14.hinet.net.
  98.  
  99.