home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / HTOCRK91.ZIP / HTOCRK91.TXT < prev    next >
Text File  |  1996-06-15  |  30KB  |  610 lines

  1.                      HOW TO CRACK, by +ORC, A TUTORIAL
  2.  
  3. ---------------------------------------------------------------------------
  4.  
  5.                 Lesson 9 (1): How to crack Windows, Hands on
  6.  
  7. ---------------------------------------------------------------------------
  8.  
  9.                             [Winformant][Snap32]
  10.  
  11.                    --------------------------------------
  12.  
  13.   THE [DATA_CONSTRAINT] TRICK - [WINFORMANT 4]
  14.      I have chosen an older windows application for Win 3.1.
  15. (WIN4MANT.EXE, 562271 bytes, Version 1.10, by Joseph B. Albanese;
  16. you'll find it searching the web with the usual tools, see how
  17. to do it at the end of this lesson), in order to show you how to
  18. use a nice little trick, at times really useful in cracking
  19. password protected programs: [data_constraint]. Inside almost all
  20. protection routines, as you have already learned, there is a
  21. moment when on the stack the ECHO of the real, "correct"
  22. passnumber or password appears. The location of this ECHO varies,
  23. but most of the time it'll be in a range of +- 0x90 bytes from
  24. one of the locations where the user input dwells. This is due to
  25. datadump windows constraints inside the tools used by the
  26. protectionists... but this use is bound to diminish... especially
  27. after this lesson :=)
  28.  
  29. [WINFORMANT CRACKING]
  30.  This application is -per se- crappy, I doubt you'll ever use
  31. it... but its curious (and pretty rare) "deactivate" mode is
  32. nevertheless very interesting for us: you can "unregister"
  33. Winformant on the fly if you feel the need to.
  34.  This feature is pretty useful for scholars that like to
  35. investigate password algorithms with valid and invalid codes
  36. without having to reinstall every time to delete a valid code.
  37. For your cracking exercises choose programs that have
  38. "REVERSIBLE" protections (rare) or that can be re-registered a
  39. billion times (more frequent). Programs that keep the valid
  40. registration on *.ini or special files will also do the job: you
  41. just change a couple of lines to "unregister" them.
  42.  The trick of this lesson: [data_constraint], or "password
  43. proximity", bases on the protectionist's need to keep an eye on
  44. the protection "working" when he assembles it. He must "see" the
  45. relationships between USER INPUT NUMBER, USER INPUT TRANSFORMED
  46. and the CORRECT NUMBER ANSWER (in our jargon: the "Bingo"). These
  47. relationships must be constantly checked In order to debug the
  48. protection code. Mostly they will dwell TOGETHER inside a small
  49. stack area, allowing them to be "seen" in the SAME watchwindow.
  50. Most of the time, therefore, the "ECHO" will "materialize"
  51. shortly not very far away from one of the locations of the USER
  52. INPUT. Let's crack:
  53.  
  54. * Fire Winice and then Winformant
  55. * Choose HELP and then choose REGISTRATION
  56. * Fill the registration fields with "+ORC+ORC" as "Registrant"
  57. and "12121212" as "Activation" code (use whatever you fancy).
  58. CTRL+D              ;switch to Winice
  59. :task               ;let's see what's the name of this crap
  60. TaskName  SS:SP StackTop StackBot StackLow TaskDB  hQueue  Events
  61. WINWORD   1AD7:85F2 4A52  8670      7532     1247    122F    0000
  62. PROGMAN   1737:200A 0936  2070      1392     066F    07F7    0000
  63. DISKOMAT *2C5F:6634 1D3C  6AC6      5192     2CB7    2C9F    0000
  64.  
  65. :hwnd DISKOMAT      ;which window is getting the input?
  66. WinHandle   Hqueue  QOwner    Class Name        Window Procedure
  67. 0EB4(0)      2C9F    DISKOMAT  #32769            04A7:9E6B
  68.  0F34(1)     2C9F    DISKOMAT  #32768            USER!BEAR306
  69.  365C(1)     2C9F    DISKOMAT  #32770            2C3F:0BC6
  70.   36BC(2)    2C9F    DISKOMAT  Button            2C3F:1CEA
  71.   3710(2)    2C9F    DISKOMAT  Edit              2C3F:24BE
  72. ... and many more irrelevant windows.
  73.  
  74. Let's pinpoint the code, here the relevant window is the first
  75. "Edit" one, for obvious reasons (more on this later).
  76. :bmsg 3710 wm_gettext           ;set breakpoint
  77. CTRL+D                          ;run the babe until you get:
  78. Break Due to BMSG 3710 WM_GETTEXT C=01
  79.   Hwnd=3710 wParam=0050 lParam=2C5F629A msg=000D WM_GETTEXT
  80. 2C3F:000024BE B82F2C            MOV     AX,2C2F
  81. So! Now we have "pinpointed" the babe (more on "pinpointing"
  82. later). Let's snoop around a little: look at the stack to fetch
  83. your babe's last call (if it does not show immediately, just keep
  84. pinpointing, for instance on GetWindowText() or do a BPRW
  85. diskomat (very useful), and then try and retry the stack...
  86. should this too fail to work, search for your input in memory (in
  87. the 30:0 lffffffff selector, as usual) and breakpoint range on
  88. it with ReadWrite, and then stack, stack, stack... until you get
  89. the "real" list of calls coming from your babe's protection.
  90. :stack              ; let's see
  91. USER(19) at 073F:124C [?] through 073F:1239
  92. CTL3D(02) at 2C3F:0D53 [?] through 2C3F:0D53
  93. DISKOMAT(01) at 2C97:20B9 [?] through 2C97:20B9
  94. DISKOMAT(01) at 2C97:3D94 [?] through 2C97:3D94
  95. DISKOMAT(01) at 2C97:49E2 [?] through 2C97:4918
  96. DISKOMAT(04) at 2C7F:EA20 [?] through 2C7F:EA20
  97. USER(01) at 04A7:19BE [?] through USER!GETWINDOWTEXT
  98. == CTL3D(02) at 2C3F:24BE [?] through 04A7:3A3Cµ
  99.  
  100.  Beautiful stack fishing! Do immediately a BPX on babe:EA20.
  101. 2C7F:EA35 9A25ABA704   CALL   USER!GETWINDOWTEXT
  102. 2C7F:EA3A 8D46AE       LEA    AX,[BP-52]     ;load ptr "+ORC+ORC"
  103. 2C7F:EA3D 16           PUSH   SS   ;save pointer segment
  104. 2C7F:EA3E 50           PUSH   AX   ;save pointer offset
  105. 2C7F:EA3F 9A768D872C   CALL   2C87:8D76; get strlen "ORC+ORC"
  106. 2C7F:EA44 83C404       ADD    SP,+04
  107. 2C7F:EA47 3D2800       CMP    AX,0028
  108. 2C7F:EA4A 762C         JBE    EA78
  109. ...
  110. 2C7F:EA97 8D46AE       LEA    AX,[BP-52]     ;load ptr "+ORC+ORC"
  111. 2C7F:EA9A 16           PUSH   SS     ;various algors on input
  112. 2C7F:EA9B 50           PUSH   AX     ;follow here, we do not
  113. ...                                  ;need to care
  114. 2C7F:EAB2 0F851101     JNE    EBC7
  115. 2C7F:EAB6 8D8E5CFF     LEA    CX,[BP+FF5C]  ;ptr "12121212"
  116. 2C7F:EABA 16           PUSH   SS
  117. 2C7F:EABB 51           PUSH   CX
  118. 2C7F:EABC 9A768D872C   CALL   2C87:8D76 ;get strlen "12121212"
  119. 2C7F:EAC1 83C404       ADD    SP,+04
  120. 2C7F:EAC4 50           PUSH   AX
  121. 2C7F:EAC5 8D865CFF     LEA    AX,[BP+FF5C] ;ptr "12121212" HERE!
  122. 2C7F:EAC9 16           PUSH   SS
  123. 2C7F:EACA 50           PUSH   AX
  124. ...etc, various algors on input follow here
  125.  
  126.   OK, it's enough: now obviously follows the code that
  127. "algorithmize" the number string, and then, somewhere, you'll
  128. have the hideous compare that divides good guys and bad crackers.
  129. You could examine, and crack, and search...
  130.   BUT NOW IT'S THE "MAGIC MOMENT" OF THE ECHO! We know and *feel*
  131. it: The echo must be somewhere... how do we find it? Searching
  132. "12121212" in memory fishes at least 10 different locations...
  133. :s 30:0 lffffffff '12121212'
  134. Pattern Found at 0030:0005AD6A
  135. .... (7 more)
  136. Pattern Found at 0030:80509D6A
  137. Pattern Found at 0030:8145AD6A
  138.  Should we look for all occurrences of string '12121212',
  139. starting with the two at 80000000, dumping +-0x90 around it...
  140. until we find the echo? We could, and it would work, but that's
  141. not zen... that's boring! In other protections these locations
  142. could proliferate on purpose, to deter the casual cracker. There
  143. must be some other way... And lo and behold! YES! There is a
  144. quicker way... THE LAST loading of the numeric input string in
  145. the code (the one after the strlen count) is the "right" one for
  146. our cracking purposes, coz protections follow (mostly) this
  147. pattern (remember: we are inside a "stack-heavy" section of the
  148. code... if you want to crack higher I suggest you read some good
  149. literature about stack working, stack tricks and stack magics
  150. with the Intel processors):
  151.      LOAD NAMEString - COUNT NAMEStringLen
  152.      LOAD NAMEString - TRANSFORM NAMEString
  153.      LOAD CODEString - COUNT CODEStringLen
  154.      LOAD CODEString
  155.                *ECHO must be here*
  156.      TRANSFORM CODEString
  157.                *ECHO must be here*
  158.      COMPARE TRANSFORMED_NAMEString WITH TRANSFORMED_CODEString
  159.  
  160.   This means that at line
  161. 2C7F:EAC5 8D865CFF   LEA  AX,[BP+FF5C]  ;ptr "12121212"
  162. you'll already have your echo somewhere... just dump the memory
  163. around the pointer [BP+FF5C]:
  164. :d 2c5f:61e8   ;these numbers will differ in your computer
  165. 02 62 2F 06 02 00 26 2E-A3 4E A3 4E 01 00 38 30  .b/...&..N.N..80
  166. 33 37 2D 36 34 36 2D 33-38 33 36 00 01 06 02 00  37-646-3836.....
  167. 2F 06 75 62 C3 2E B7 04-F2 24 2F 06 CE 6E 2F 06  /.ub.....$/..n/.
  168. 49 00 5A 00 01 00-04 2C 2F 06 AE 24 36 62 00 00  I.Z......,/..$6b
  169. 74 62 7A 2E B7 04 36 62-01 00 C2 62 2F 2C 26 2E  tbz...6b...b/,&.
  170. 03 01 BA 0F AE 24 5F 02-C9 01 5E 02 BA 01 5F 02  .....$_...^..._.
  171. 31 32 31 32 31 32 31 32-00 0C 00 BC 02 00 00 00  12121212........
  172. 00 49 00 BA 0F-AE 24 F2 24 2F 06 00 00 00 00 00  ....I....$.$/...
  173. AF 17 00 E2 5F-7A 62 FE FF 79 1B BA 0F 00 00 00  ......._zb..y...
  174. 96 0B 01 00 02 4E 00-37 01 8A 62 D2 0F 8F 17 00  .....N..7..b....
  175. 2F 06 00 37 01-98 62 20 10 16 03 2F 06 00 00 00  /.....7..b .../.
  176. C2 62 2B 4F 52 43 2B 4F-52 43 00 0D AE 24 2F 06  .b+ORC+ORC......
  177.  
  178.  Look at this dump: everybody is there! The stack pointers points
  179. in the middle, at string "12121212". 0x50 bytes before it you'll
  180. find our good old ECHO (i.e. the CORRECT passnumber) and 0x50
  181. bytes afterwards you'll see your handle: here "+ORC+ORC".
  182.      It's cracked! The code for my "+ORC+ORC" is 8037-646-3836...
  183. Now begin your assignments: if you rally want to learn cracking:
  184. -    "Unregister" and find anew your own code for your own
  185.      handle. *DO NOT* use serial numbers with any other name
  186.      that your own handle, that's miserable stealing, not
  187.      cracking. I'll begin to punish the serial#_aficionados on
  188.      the Web, coz I like real outlaws, but I detest stupid
  189.      pickpockets.
  190. -    Study the two coding algorithms, the one for the input name
  191.      and the one for the input number, this will be very useful
  192.      for your future cracking sessions.
  193. -    Find the "Compare", i.e. the code that sets the two usual
  194.      flags "good guy, you may move on" and "bad cracker, beggar
  195.      off", and
  196. -    Create a "real" crack for this protection, that will allow
  197.      anybody you think deserves it, with any name and any
  198.      password number, to get through.
  199.  
  200. [CRACKING SNAP 32]
  201.      Snap 32  (SNAP32.EXE 356.352 bytes, 24/11/95,  Version 2.54,
  202. by Greg Kochaniak) is a "snapshot" shareware program for Windows
  203. 95, that allows users to save the screen, parts of it, or a
  204. single window. It's a very common 'try before you buy' program,
  205. limited to 30 days use. You'll find it everywhere on the Web. If
  206. you do not know how to search the Web (poor guy!), learn at the
  207. end of this lesson the correct procedure to find all the files
  208. you need on the Net and get them automatically emailed to you
  209. (that's something you should learn: SEARCHING! It's even more
  210. important than cracking!).
  211.      Snap32 is not very interesting (I don't think I used it more
  212. than a couple of times), but its protection is: in order to (try
  213. to) deter casual crackers it does not compare strings, it
  214. compares a "magic" sum (from Namestring) with another magic sum
  215. (from Numberstring). And:
  216. *    SUMS magics inside the GDI, not inside its own code;
  217. *    USES a look_up table for input validation instead of
  218.      "plain" code;
  219. *    COMPARES the "magic" manipulation from input NUMBER with
  220.      the "magic" manipulation from input NAME.
  221.  
  222.   The cracking procedure for most of these windows programs is
  223. pretty simple and relatively straightforward:
  224.  
  225. 1)   SEE THE NAME OF YOUR BABE AND ITS QUEUE SELECTOR
  226. :task     ;This is the Winice95 command you type after firing
  227. snap32 and getting at the "Enter License" nag window:
  228.  
  229. TaskName SS:SP     StckTp   StckBt  StckLw TaskDB  Hqueue  Events
  230. Snap32   0000:0000 006 AC000 006B0000       270E    D27    0000
  231.  
  232. OK, the babe is Snap32,it's HQUEUE is 0xD27, it's TaskDB is
  233. 0x27OE, orright.
  234.  
  235. 2)   SEE THE MODULES OF YOUR BABE:
  236. :map32 snap32       ;Your command
  237. Owner     Obj Name  Obj#  Address        Size      Type
  238. SNAP32    .text     0001  0137:00401000  00043000  CODE  RO
  239. SNAP32    .rdata    0002  013F:00444000  00002E00  IDATA RO
  240. SNAP32    .data     0003  013F:00447000  00009000  IDATA RW
  241. SNAP32    .idata    0004  013F:00471000  00001C00  IDATA RW
  242. SNAP32    .rsrc     0005  013F:00473000  00001600  IDATA RO
  243. SNAP32    .reloc    0006  013F:00475000  00004C00  IDATA RO
  244.  
  245. OK, so the code is in selector 137:(as usual), and you have there
  246. 43000 bytes of code from 401000 to 401000+43000; the DATA,
  247. ReadWrite and ReadOnly, are in selector 13F: (as usual).
  248.  
  249. 3) SEE THE HANDLE OF THE PROTECTION "NAG" WINDOW
  250. :hwnd snap32             ;Your command
  251. Window Handle  Hqueue  SZ  Qowner   Class Name Window Procedure
  252.  0350(1)       0D27    32  SNAP32   #02071     144F:0560
  253.   0354(2)      0D27    32  SNAP32   #02071     17CF:102E
  254.   ... and many more windows that we do not care of.
  255.  
  256.   OK, so, for our cracking purposes, it's Handle 0x350. Most of
  257. the times the "nag" window you want to crack will be the first
  258. one in the hwnd listing (coz it was the last one to appear).
  259. Watch the number in parentheses that follows the Whandle: (1) is
  260. a mother, (2) are "children" windows. At times you'll find under
  261. "Class Name" something like "Edit" (see before the Winformant
  262. cracking)... SNIFF THERE! At times the "Window Procedure" code
  263. location in a list of more than twenty, will be slightly
  264. different for one or two windows... SNIFF THERE!
  265.  
  266. 4) BREAKPOINT MESSAGE WM_GETTEXT (or any other WM_ that you can
  267. think of in order to "pinpoint" the code of our babe).
  268. "Pinpointing" the code is extremely important in windows
  269. cracking... this idiotic OS moves code, data and stack out and
  270. inside the pages all the time... so you'll keep getting on
  271. "INVALID" sections without a correct pinpointing. Good
  272. Pinpointing points are in general:
  273.   BMSG xxxx WM_GETTEXT   (good for passwords)
  274.   BMSG xxxx WM_COMMAND   (good fro OK buttons)
  275.   BPRW *your babe* TW    (good for tracking)
  276.   u USER!GETWINDOWTEXT   (u and then BPX inside the code)
  277.   u GETDLGITEM           (for the Hwnd of an Item inside a
  278.                          Dialog Box)
  279.   CSIP NOT GDI           (if you have too many interferences)
  280.   u USER!SHOWWINDOW      (bpx with counter occurrence to get to
  281.                          the "right" window)
  282.   u GETSYSTEMTIME        (for "time-crippled" software)
  283. and many others pinpointing points you'll learn. If you are
  284. really desperate for pinpointing, just do a BMSG xxxx WM_MOVE and
  285. then move the nag window, this will always work. Let's go on:
  286.  
  287. :bmsg 350 wm_gettext     ;Your command
  288. OK, so the code is ready to be pinpointed.
  289.  
  290. 5)RUN THE PROGRAM TO THE BREAKPOINT:
  291. CTRL+D                   ;Your command to exit Winice and run
  292.                          until it pops out at breakpoint
  293. OK, now you pop out inside Winice somewhere... (look at the stack
  294. to know where) so the code has been pinpointed.
  295.  
  296. 6) SEARCH THE DATA AREA for your input string (4 Gigabytes from
  297. 30:0... remember that DATA are *always* in 30:0 to 30:FFFFFFFF
  298. and CODE is *always* in 28:0 to 28:FFFFFFFF). In most protection
  299. the "registration_number" string must match the "username"
  300. string, which cannot be constrained, in order to allow users to
  301. choose whatever stupid name they fancy. Some protections requires
  302. fixed symbols inside the "username" string, though... in these
  303. rare eventualities, just apply to the "username" string what
  304. we'll do here with the "registration_number" string. The point
  305. to remember is: begin always with the protection fumbling your
  306. number, crack only if necessary the protection that fumbles your
  307. name. Let's search now.
  308.  
  309. :s 30:0 lffffffff '12121212'  ;Your command
  310.      Pattern Found at 0030:80308612
  311.  
  312. 80000000 is good. Lower era videos, mirrors and BIOS, higher
  313. (around C0000000) you have the OS dustbins... the point to
  314. remember is: investigate always FIRST the 80000000 locations.
  315.  
  316. 7)   BREAKPOINT ON MEMORY RANGE ON THIS STRING.
  317. By the way: prepare a watch window  dex 3 es:di, you'll soon see
  318. how useful such an automated watchwindow is in password cracking.
  319.  
  320. :bpr 30:80308612 30:80308612+8 RW  ;Your command
  321.  
  322. OK Now we'll begin to dig out the relevant parts of the code.
  323. Remember that you must breakpoint *every* copy of the string that
  324. protection generates. A typical copy routine, very frequently
  325. used in windows copy protection schemes, dwells inside
  326. KERNEL!HMEMCPY (+0076):
  327.  
  328. 0117:9E8E 66C1E902      SHR     ECX,02
  329. 0117:9E92 F36766A5      REPZ MOVSD      ;makes a copy in es:di
  330. 0117:9E96 6659          POP     ECX
  331. 0117:9E98 6683E103      AND     ECX,+03
  332. 0117:9E9C F367A4        REPZ MOVSB
  333. 0117:9E9F 33D2          XOR     DX,DX
  334.  
  335. In fact, this piece of copying code is so often used for password
  336. verifications that sometimes you just need to bpx on 0117:9E92
  337. to get the correct stack sequence... but let's, for now, continue
  338. without such little tricks: just keep on BPRring (Breakpoint on
  339. memory range) all copies that protection makes.
  340.  
  341. 8) LET THE BABE RUN, it will breakpoint on all manipulations of
  342. your input string. One of them will lead to the magic.
  343. 8.1.)     VALIDATION phase
  344. There are many routines that check and "validate" your inputs.
  345. The most common ones check that your numbers ARE really numbers,
  346. i.e. in the range 0x30-0x39. Usually this is done with:
  347.           CMP  EAX,+30
  348.           JB   no_number
  349.           CMP  EAX,+39
  350.           JA   no_number
  351. At times the protectionists use TABLES instead... The number
  352. itself is used as a pointer to a "ready made" table where the
  353. relevant magic can be used as a protection. Imagine that a number
  354. 4  in your input points to a code section that throws you
  355. immediately outside the validation routine... or imagine that a
  356. number 7, if found in your input, fetches a magic code that
  357. removes the whole program from your harddisk (or worse): "Ah, ah!
  358. Stupid cracker will never know that he should not have used
  359. number 4... and definitely not number 7! Next time he'll
  360. learn..." Yes, tables have been used for such nasty tricks.
  361. Here the relevant code for the "validation" part of our
  362. protection (still checking my favourite input string '12121212'):
  363. :check_if_valid
  364. 0137:4364AE 8A16       MOV     DL,[ESI] ;load license number
  365. 0137:4364B0 33C0       XOR     EAX,EAX  ;zero AX
  366. 0137:4364B2 668B0451   MOV     AX,[ECX+2*EDX] ;look table for 84
  367. 0137:4364B6 83E008     AND     EAX,+08  ;OK if AND'S TO zero
  368. 0137:4364B9 85C0       TEST    EAX,EAX  ;and therefore
  369. 0137:4364BB 7403       JZ      004364C0 ;go on
  370. 0137:4364BD 46         INC     ESI      ; ready for next number
  371. 0137:4364BE EBCD       JMP     0043648D
  372. :strip_-_&_+_signs
  373. 0137:4364C0 33DB       XOR     EBX,EBX  ;clean BX
  374. 0137:4364C2 8A1E       MOV     BL,[ESI] ;load license number
  375. 0137:4364C4 46         INC     ESI      ;ready for next
  376. 0137:4364C5 8BFB       MOV     EDI,EBX  ;save copy
  377. 0137:4364C7 83FB2D     CMP     EBX,+2D  ;is it a "-"?
  378. 0137:4364CA 7405       JZ      004364D1
  379. 0137:4364CC 83FB2B     CMP     EBX,+2B  ;is it a "+"?
  380.  
  381. 8.2.)     MANIPULATION (summing magic numbers)
  382. Your wisely set breakpoints on memory range for the occurrence
  383. of the string "12121212" will pop you out, inter alia, inside
  384. following piece of code (note how this part of protection dwells
  385. inside GDI, and  NOT inside the code selector of snap32):
  386. 0557:11BD 33C0         XOR  EAX,EAX        ;zero AX
  387. 0557:11BF 66648B06     MOV  AX,FS:[ESI]    ;load number
  388. 0557:11C3 83C602       ADD  ESI,+02        ;point to next
  389. 0557:11C6 66833C4700   CMP  WORD PTR [EDI+2*EAX],+00
  390. 0557:11CB 0F8424010000 JE   000012F5
  391. 0557:11D1 668B0442     MOV  AX,[EDX+2*EAX] ;load from magic table
  392. 0557:11D5 03D8         ADD  EBX,EAX        ;save sum in EBX
  393. 0557:11D7 49           DEC  ECX            ;till we are done
  394. 0557:11D8 75E5         JNZ  000011BF       ;loop along
  395.  
  396. Interesting, isn't it? Protection is using this GDI routine to
  397. create a SUM (through pointers to another table) that depends on
  398. your very input numbers. We are now very near to the crack... can
  399. you *feel* it? If not, prepare yourself a good Martini Vodka!
  400. This is the correct way to do it:
  401.  * Get a "highball" glass;
  402.  * Put some ice cubes inside it (2 or 3);
  403.  * Add Martini Dry (From Martini & Rossi). Fill to 1/3;
  404.  * Add Moskowskaja Wodka (the only real Vodka). Fill to 2/3;
  405.  * Add a zest of lemon (From Malta or Southern France);
  406.  * Add a green "sound" olive (from Italy or Israel);
  407.  * Add Schweppes Indian Tonic. Fill to the brim.
  408. Sit deeper and relax, sip slowly and *feel* where the code of the
  409. protection scheme you are cracking "moves"... It's like a
  410. current... a slow tide. If you still do not believe me, just try
  411. it.
  412.  
  413. We'll now find out where protection stores the "magic" sum (and
  414. now you'll pop out inside the very own snap32 code, this is the
  415. "real" protection part):
  416.  
  417. 8.3.)     The ludicrous "HIDING" of the magic sum
  418. 0137:40437E 83C404       ADD     ESP,+04
  419. 0137:404381 8B4DE8       MOV     ECX,[EBP-18]
  420. 0137:404384 8945F0       MOV     [EBP-10],EAX  ;***HERE!***
  421. 0137:404387 68FF000000   PUSH    000000FF
  422. 0137:40438C 8D8574FBFFFF LEA     EAX,[EBP+FFFFFB74] ;load string
  423. 0137:404392 50    PUSH   EAX                      ;push it
  424. 0137:404393 E886410100   CALL    0041851E         ;manipulate
  425. 0137:404398 8D8574FBFFFF LEA     EAX,[EBP+FFFFFB74] ;load string
  426. 0137:40439E 50    PUSH   EAX                      ;push it
  427. 0137:40439F E88C210300   CALL    00436530         ;manipulate
  428.  
  429. As you can see, the protection is very simple: The "magic" sum
  430. is hidden only two lines before the further manipulations of the
  431. input string. We have found location 137:404384, here, in the
  432. CORRECT way, through bprring of the string that has been
  433. manipulated in the GDI, but actually, we could have found it
  434. quickly just checking superficially what's happening "around" all
  435. manipulations of the input string. Do we really need to follow
  436. all manipulations of our registration_number and eventually also
  437. all manipulation of our username? NO, not at all: we just set a
  438. BPR on the stack location where protection hides the sum [EBP-10]
  439. and we'll see what happens: 90% of these protections just create
  440. two sums, a sum from your username and a sum from your
  441. registration_number... somewhere there will be a compare that
  442. must use this location (or a copy of it... we'll see).
  443.  
  444. 8.4.) COMPARING THE MAGICS FROM THE TWO INPUT STRING
  445. Breakpoint on memory range on the sum location [EBP-10] that you
  446. saw in the previous code and you'll land at this piece of code:
  447. 0137:404412 E82F050000   CALL 00404946
  448. 0137:404417 83C40C       ADD  ESP,+0C
  449. 0137:40441A 3B45F0       CMP  EAX,[EBP-10] ;comp AX & magicsum
  450. 0137:40441D 740F         JZ   0040442E
  451. 0137:40441F 68C0874400   PUSH 004487C0
  452. 0137:404424 E8149E0000   CALL 0040E23D
  453. 0137:404429 83C404       ADD  ESP,+04
  454. 0137:40442C EB5B         JMP  00404489
  455. 0137:40442E 893DA0714400 MOV  [004471A0],EDI
  456. 0137:404434 85FF         TEST EDI,EDI
  457.  
  458. That's it, you have made it! We found the compare between the
  459. "username" magic number (for my "+ORC+ORC" string that's here
  460. 0x7C25621B) in AX (we do not need to know how this landed
  461. there... it's irrelevant!) and the "license_number" '12121212'
  462. (whose magic is here 0x00B8F47C) stored in [pointer-10.] How do
  463. we find now the correct INPUT number for +ORC+ORC? Well, it's
  464. easy...  the "magic number" must be the same... therefore:
  465.  
  466. Cracked=Dec(0x7C25621B)
  467. Cracked=2082824731
  468.  
  469.      That was it. Old Snap32 has been cracked. You could now
  470. prepare a crack in order to distribute this program around
  471. without its simple protection. Good cracked applications should
  472. be given free (i.e. cracked) to all the people that NEED them and
  473. do not have the money to buy them. Don't forget that in this
  474. intolerable society the 0,5% of the citizens own the 56% of the
  475. industrial capital and the 63% of the propaganda machines (data
  476. from US researchers... therefore suspect... the real situation
  477. is probably even worser) effectively conditioning the destiny of
  478. millions of slaves, moronized by television watching. So crack
  479. the applications and give them to the people you care and the
  480. peolple that need them, but for the others... just EXPLAIN
  481. everybody how you did it... this is real help: giving knowledge,
  482. not wares. DO NOT use my handle and my codes to crack this
  483. program, get yours, I gave you mine only as an help for this
  484. cracking lesson. I have showed you the way enough... THIEFS, not
  485. crackers, use the codes that others have found. You are (gonna
  486. be) CRACKERS! Remember it, look straight ahead, crack accurately
  487. and keep your tommy in.
  488.  
  489. HOW TO SEARCH THE INTERNET FOR FILES WITHOUT MOVING A FINGER
  490.   It's amazing: most of the people roaming around inside Internet
  491. DO NOT know how to use effectively the web. I'll be very
  492. altruistic and explain how to fetch the very example of Snap32,
  493. the babe we cracked in this lesson.
  494.  
  495. 1) Choose an archie from this list (I will not explain you what
  496. an archie is, you should know it... if you do not, be ashamed):
  497.      archie.univie.ac.at      131.130.1.23        Austria
  498.      archie.belnet.be         193.190.248.18      Belgium
  499.      archie.funet.fi          128.214.6.102       Finland
  500.      archie.univ-rennes1.fr   129.20.254.2        France
  501.      archie.th-darmstadt.de   130.83.22.1         Germany
  502.      archie.ac.il             132.65.16.8         Israel
  503.      archie.unipi.it          131.114.21.10       Italy
  504.      archie.uninett.no        128.39.2.20         Norway
  505.  
  506. 2) Email a message to your archie:
  507.      To:       archie.univie.ac.at (for instance)
  508.      Subject:                      (nothing on this field)
  509.      Body:     set search sub      (substrings too)
  510.                set maxhits 140     (max 140 hits)
  511.                set maxhitspm 9     (not the same file all over)
  512.                find snap32         (we want this)
  513.  
  514. 3) After a while you'll get (per email) your answer: Here the
  515. answer from the Austrian archie
  516.  
  517. Host ftp.wu-wien.ac.at    (137.208.8.6)
  518.  Last updated 17:48  9 Aug 1995
  519.  Location: /pub/systems/windows.32/misc
  520.   FILE    -rw-r-----  128957 bytes  15:59 16 Jun 1995  snap32.zip
  521. Host space.mit.edu    (18.75.0.10)
  522.  Last updated 00:45  4 Mar 1996
  523.  Location: /pub/mydir
  524.   FILE    -rw-r--r--  407040 bytes  11:55 28 Nov 1995  snap32.exe
  525.  
  526. 4) ftpmail your file (Browsing is no good: too busy and lame).
  527. Again, I will not explain you what an FTPMAIL server is: learn
  528. it by yourself... choose a good one from this list (there are
  529. many more... you'll learn):
  530.    bitftp@vm.gmd.de                           (Germany)
  531.    ftpmail@ieunet.ie                          (Ireland)
  532.    bitftp@plearn.edu.pl                       (Poland)
  533.    ftpmail@ftp.sun.ac.za                      (South Africa)
  534.    ftpmail@ftp.sunet.se                       (Sweden)
  535.    ftpmail@ftp.luth.se                        (Sweden)
  536.    ftpmail@src.doc.ic.ac.uk                   (United Kingdom)
  537.  
  538. To:       ftpmail@ftp.sun.ac.za.   (for instance)
  539. Subject:                           (leave blank)
  540. Body:     open space.mit.edu       (the last occurrence that
  541.                                    the archie sent)
  542.           cd/pub/mydir             (get the correct subdir)
  543.           bin                      (prepare for BINARY)
  544.           get snap32.exe           (I want this)
  545.           quit                     (bye)
  546.  
  547. 5) Your FTPMAIL server will first notice you a receipt:
  548.  
  549. FTP EMAIL response...
  550. ftpmail has received the following job from you:
  551.       reply-to +ORC
  552.       open space.mit.edu +ORC@now.here
  553.       get snap32.exe
  554. ftpmail has queued your job as: 1834131821.5514
  555. Your priority is 1 (0 = highest, 9 = lowest)
  556. Requests to sunsite.doc.ic.ac.uk will be done before other jobs.
  557. There are 14 jobs ahead of this one in the queue.
  558. 4 ftpmail handlers available.
  559. To remove send a message to ftpmail containing just:
  560. delete 1834131821.5514
  561.  
  562. After a while you'll get a second message, with your file
  563. uuencoded inside... everything has been done.
  564. YESSIR! there is absolutely no need to loose time on the WWW,
  565. "surfing" idiotically from a junk site to the next or waiting
  566. hours to download some slow file from an instable server! Wasting
  567. time of your own LIFE, that you could use to read poetry, to make
  568. love, to look at the stars, to sail slowly between the Aegean
  569. islands or to start a nice cracking session. What's the point of
  570. wasting your time when machines can perform all the searches you
  571. need better, more productively and faster than you ever could...
  572. YESSIR! You can get *everything* on the Web, and without paying
  573. your Internet provider more than a couple of dimes... Nice, isn't
  574. it?
  575.  
  576. By now, if you have followed all my lessons, you should be able
  577. to crack relatively quickly "normal" applications. There are some
  578. new projects for 1997: a cracking "university", that will allow
  579. us to prepare for the divine war against Microsoft repulsive
  580. dominion. If you do not have already chosen your handle (your
  581. "cracker" name, that's it), you may consider choosing an handle
  582. with a "+" somewhere inside it or, eventually, add a "+" to your
  583. handle. This sign is used by me and by friends that have studied
  584. and/or contributed. But a "+" in your handle ("official +ORC
  585. cracker") will mean even more:
  586. 1)   allows support from me personally (on a "do ut des" basis)
  587. 2)   allows pupils to identify each other (good for joining
  588.      forces)
  589. 3)   will open you (eventually) the doors to the "higher"
  590.      cracking university I'll set up on the Web in 1997.
  591. (I'm not getting megalomaniac... In reality I only need a "quick"
  592. method to know on which (anonymous) people I can count on for the
  593. next phase).
  594.  
  595. Well, that's it for this lesson, reader. Not all lessons of my
  596. tutorial are on the Web.
  597.      You 'll obtain the missing lessons IF AND ONLY IF you mail
  598. me back (via anon.penet.fi) with some tricks of the trade I may
  599. not know that YOU discovered. Mostly I'll actually know them
  600. already, but if they are really new you'll be given full credit,
  601. and even if they are not, should I judge that you "rediscovered"
  602. them with your work, or that you actually did good work on them,
  603. I'll send you the remaining lessons nevertheless. Your
  604. suggestions and critics on the whole crap I wrote are also
  605. welcomed.
  606.  
  607.                                 E-mail +ORC
  608.  
  609.                         +ORC an526164@anon.penet.fi
  610.