home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1995-02-08 | 21.8 KB | [TEXT/MPCC] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Wed Feb 8 15:46:53 1995, modified Wed Feb 8 15:46:53 1995, creator 'MPCC', type ASCII, 21587 bytes "crack-pwc.c" , at 0x54d3 410 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPCC] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 63 72 61 63 6b 2d | 70 77 63 2e 63 00 00 00 |..crack-|pwc.c...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 43 | 43 01 00 00 00 00 00 00 |.TEXTMPC|C.......|
|00000050| 00 00 00 00 00 54 53 00 | 00 01 9a ab 5e de 3d ab |.....TS.|....^.=.|
|00000060| 5e de 3d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |^.=.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 16 f5 00 00 |........|........|
|00000080| 2f 2a 0d 20 2a 20 54 68 | 69 73 20 70 72 6f 67 72 |/*. * Th|is progr|
|00000090| 61 6d 20 69 73 20 63 6f | 70 79 72 69 67 68 74 20 |am is co|pyright |
|000000a0| 41 6c 65 63 20 4d 75 66 | 66 65 74 74 20 31 39 39 |Alec Muf|fett 199|
|000000b0| 31 20 65 78 63 65 70 74 | 20 66 6f 72 20 73 6f 6d |1 except| for som|
|000000c0| 65 20 70 6f 72 74 69 6f | 6e 73 20 6f 66 0d 20 2a |e portio|ns of. *|
|000000d0| 20 63 6f 64 65 20 69 6e | 20 22 63 72 61 63 6b 2d | code in| "crack-|
|000000e0| 66 63 72 79 70 74 2e 63 | 22 20 77 68 69 63 68 20 |fcrypt.c|" which |
|000000f0| 61 72 65 20 63 6f 70 79 | 72 69 67 68 74 20 52 6f |are copy|right Ro|
|00000100| 62 65 72 74 20 42 61 6c | 64 77 69 6e 2c 20 49 63 |bert Bal|dwin, Ic|
|00000110| 61 72 75 73 20 53 70 61 | 72 72 79 0d 20 2a 20 61 |arus Spa|rry. * a|
|00000120| 6e 64 20 41 6c 65 63 20 | 4d 75 66 66 65 74 74 2e |nd Alec |Muffett.|
|00000130| 20 20 54 68 65 20 61 75 | 74 68 6f 72 28 73 29 20 | The au|thor(s) |
|00000140| 64 69 73 63 6c 61 69 6d | 73 20 61 6c 6c 20 72 65 |disclaim|s all re|
|00000150| 73 70 6f 6e 73 69 62 69 | 6c 69 74 79 20 6f 72 20 |sponsibi|lity or |
|00000160| 6c 69 61 62 69 6c 69 74 | 79 0d 20 2a 20 77 69 74 |liabilit|y. * wit|
|00000170| 68 20 72 65 73 70 65 63 | 74 20 74 6f 20 69 74 27 |h respec|t to it'|
|00000180| 73 20 75 73 61 67 65 20 | 6f 72 20 69 74 73 20 65 |s usage |or its e|
|00000190| 66 66 65 63 74 20 75 70 | 6f 6e 20 68 61 72 64 77 |ffect up|on hardw|
|000001a0| 61 72 65 20 6f 72 20 63 | 6f 6d 70 75 74 65 72 0d |are or c|omputer.|
|000001b0| 20 2a 20 73 79 73 74 65 | 6d 73 2c 20 61 6e 64 20 | * syste|ms, and |
|000001c0| 6d 61 69 6e 74 61 69 6e | 20 63 6f 70 79 72 69 67 |maintain| copyrig|
|000001d0| 68 74 20 61 73 20 73 65 | 74 20 6f 75 74 20 69 6e |ht as se|t out in|
|000001e0| 20 74 68 65 20 22 4c 49 | 43 45 4e 43 45 22 20 64 | the "LI|CENCE" d|
|000001f0| 6f 63 75 6d 65 6e 74 20 | 77 68 69 63 68 0d 20 2a |ocument |which. *|
|00000200| 20 61 63 63 6f 6d 70 61 | 6e 69 65 73 20 64 69 73 | accompa|nies dis|
|00000210| 74 72 69 62 75 74 69 6f | 6e 73 20 6f 66 20 43 72 |tributio|ns of Cr|
|00000220| 61 63 6b 20 76 34 2e 30 | 20 61 6e 64 20 75 70 77 |ack v4.0| and upw|
|00000230| 61 72 64 73 2e 0d 20 2a | 0d 20 2a 0d 20 2a 20 4d |ards.. *|. *. * M|
|00000240| 6f 64 64 65 64 20 46 65 | 62 20 39 35 20 62 79 20 |odded Fe|b 95 by |
|00000250| 5f 73 6f 6d 65 6f 6e 65 | 5f 20 66 6f 72 20 6d 61 |_someone|_ for ma|
|00000260| 63 20 76 65 72 73 69 6f | 6e 2e 2e 20 2a 2f 0d 0d |c versio|n.. */..|
|00000270| 0d 23 69 6e 63 6c 75 64 | 65 20 22 63 72 61 63 6b |.#includ|e "crack|
|00000280| 2e 68 22 0d 23 69 6e 63 | 6c 75 64 65 20 3c 75 6e |.h".#inc|lude <un|
|00000290| 69 78 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |ix.h>.#i|nclude <|
|000002a0| 73 74 64 69 6f 2e 68 3e | 0d 0d 0d 23 64 65 66 69 |stdio.h>|...#defi|
|000002b0| 6e 65 20 44 4f 54 46 49 | 4c 45 53 49 5a 45 09 31 |ne DOTFI|LESIZE.1|
|000002c0| 30 32 34 0d 23 64 65 66 | 69 6e 65 20 57 4f 52 44 |024.#def|ine WORD|
|000002d0| 53 54 41 43 4b 53 49 5a | 45 09 35 31 32 0d 23 64 |STACKSIZ|E.512.#d|
|000002e0| 65 66 69 6e 65 20 54 48 | 45 41 4c 45 52 54 20 31 |efine TH|EALERT 1|
|000002f0| 33 30 0d 23 64 65 66 69 | 6e 65 20 4e 49 4c 09 09 |30.#defi|ne NIL..|
|00000300| 30 4c 0d 23 64 65 66 69 | 6e 65 20 70 61 73 73 77 |0L.#defi|ne passw|
|00000310| 64 6e 61 6d 65 20 22 70 | 61 73 73 77 64 22 0d 0d |dname "p|asswd"..|
|00000320| 65 78 74 65 72 6e 20 76 | 6f 69 64 20 4c 6f 67 28 |extern v|oid Log(|
|00000330| 29 3b 0d 65 78 74 65 72 | 6e 20 63 68 61 72 20 2a |);.exter|n char *|
|00000340| 66 63 72 79 70 74 28 29 | 3b 0d 65 78 74 65 72 6e |fcrypt()|;.extern|
|00000350| 20 69 6e 74 20 53 75 66 | 66 69 78 28 29 3b 0d 65 | int Suf|fix();.e|
|00000360| 78 74 65 72 6e 20 73 74 | 72 75 63 74 20 44 49 43 |xtern st|ruct DIC|
|00000370| 54 20 2a 53 6f 72 74 44 | 69 63 74 28 29 3b 0d 65 |T *SortD|ict();.e|
|00000380| 78 74 65 72 6e 20 76 6f | 69 64 20 50 72 69 6e 74 |xtern vo|id Print|
|00000390| 47 75 65 73 73 28 29 3b | 0d 65 78 74 65 72 6e 20 |Guess();|.extern |
|000003a0| 76 6f 69 64 20 69 6e 69 | 74 5f 64 65 73 20 28 29 |void ini|t_des ()|
|000003b0| 3b 0d 65 78 74 65 72 6e | 20 69 6e 74 20 47 65 74 |;.extern| int Get|
|000003c0| 50 6f 69 6e 74 28 29 3b | 0d 65 78 74 65 72 6e 20 |Point();|.extern |
|000003d0| 69 6e 74 20 53 65 74 50 | 6f 69 6e 74 28 29 3b 0d |int SetP|oint();.|
|000003e0| 65 78 74 65 72 6e 20 76 | 6f 69 64 20 49 6e 69 74 |extern v|oid Init|
|000003f0| 4d 61 63 28 29 3b 0d 65 | 78 74 65 72 6e 20 76 6f |Mac();.e|xtern vo|
|00000400| 69 64 09 64 6f 5f 6d 65 | 6e 75 28 29 3b 0d 65 78 |id.do_me|nu();.ex|
|00000410| 74 65 72 6e 20 48 61 6e | 64 6c 65 45 76 65 6e 74 |tern Han|dleEvent|
|00000420| 28 29 3b 0d 65 78 74 65 | 72 6e 20 69 6e 69 74 46 |();.exte|rn initF|
|00000430| 6f 72 65 67 72 6f 75 6e | 64 28 29 3b 0d 65 78 74 |oregroun|d();.ext|
|00000440| 65 72 6e 20 63 6c 6f 73 | 65 46 6f 72 65 67 72 6f |ern clos|eForegro|
|00000450| 75 6e 64 28 29 3b 0d 65 | 78 74 65 72 6e 20 53 79 |und();.e|xtern Sy|
|00000460| 73 4c 6f 67 28 29 3b 0d | 65 78 74 65 72 6e 20 53 |sLog();.|extern S|
|00000470| 68 6f 77 41 62 6f 75 74 | 28 29 3b 0d 0d 2f 2a 0d |howAbout|();../*.|
|00000480| 20 2a 20 63 72 61 63 6b | 2d 70 77 63 2e 63 20 2d | * crack|-pwc.c -|
|00000490| 20 61 6e 20 6f 70 74 69 | 6d 69 73 65 64 20 70 61 | an opti|mised pa|
|000004a0| 73 73 77 6f 72 64 20 63 | 72 61 63 6b 65 72 2e 20 |ssword c|racker. |
|000004b0| 28 63 29 20 41 44 45 20 | 4d 75 66 66 65 74 74 2c |(c) ADE |Muffett,|
|000004c0| 20 46 65 62 20 31 39 39 | 32 2e 20 49 66 0d 20 2a | Feb 199|2. If. *|
|000004d0| 20 74 68 69 73 20 77 6f | 6e 27 74 20 62 72 65 61 | this wo|n't brea|
|000004e0| 6b 20 79 6f 75 72 20 70 | 61 73 73 77 6f 72 64 20 |k your p|assword |
|000004f0| 66 69 6c 65 2c 20 69 74 | 27 73 20 75 6e 6c 69 6b |file, it|'s unlik|
|00000500| 65 6c 79 20 74 68 61 74 | 20 61 6e 79 74 68 69 6e |ely that| anythin|
|00000510| 67 20 65 6c 73 65 0d 20 | 2a 20 77 69 6c 6c 2e 0d |g else. |* will..|
|00000520| 20 2a 2f 0d 0d 2f 2a 20 | 74 72 61 70 20 61 20 73 | */../* |trap a s|
|00000530| 69 67 6e 61 6c 20 6f 6e | 20 73 68 75 74 64 6f 77 |ignal on| shutdow|
|00000540| 6e 20 2a 2f 0d 0d 76 6f | 69 64 0d 43 61 74 63 68 |n */..vo|id.Catch|
|00000550| 54 45 52 4d 20 28 29 0d | 7b 0d 20 20 20 20 2f 2a |TERM ().|{. /*|
|00000560| 20 62 75 72 79 20 6d 61 | 67 6e 65 74 73 20 2a 2f | bury ma|gnets */|
|00000570| 0d 20 20 20 20 4c 6f 67 | 20 28 22 43 61 75 67 68 |. Log| ("Caugh|
|00000580| 74 20 61 20 53 49 47 54 | 45 52 4d 21 20 43 6f 6d |t a SIGT|ERM! Com|
|00000590| 6d 69 74 69 6e 67 20 73 | 75 69 63 69 64 65 2e 2e |miting s|uicide..|
|000005a0| 2e 5c 6e 22 29 3b 0d 20 | 20 20 20 2f 2a 20 73 77 |.\n");. | /* sw|
|000005b0| 61 6c 6c 6f 77 20 74 68 | 65 20 72 61 70 74 75 72 |allow th|e raptur|
|000005c0| 65 20 2a 2f 0d 20 20 20 | 20 4c 6f 67 20 28 22 3c |e */. | Log ("<|
|000005d0| 61 72 67 68 21 3e 5c 6e | 22 29 3b 0d 20 20 20 20 |argh!>\n|");. |
|000005e0| 2f 2a 20 6c 65 74 27 73 | 20 67 61 74 68 65 72 20 |/* let's| gather |
|000005f0| 66 65 61 74 68 65 72 73 | 20 2a 2f 0d 20 20 20 2f |feathers| */. /|
|00000600| 2a 20 73 79 6e 63 20 28 | 29 3b 20 2a 2f 0d 20 20 |* sync (|); */. |
|00000610| 20 20 2f 2a 20 64 6f 6e | 27 74 20 66 61 6c 6c 20 | /* don|'t fall |
|00000620| 6f 6e 20 6d 65 20 2a 2f | 0d 20 20 20 20 65 78 69 |on me */|. exi|
|00000630| 74 20 28 30 29 3b 0d 20 | 20 20 20 2f 2a 20 27 46 |t (0);. | /* 'F|
|00000640| 61 6c 6c 20 6f 6e 20 4d | 65 27 20 62 79 20 52 2e |all on M|e' by R.|
|00000650| 45 2e 4d 2e 20 2a 2f 0d | 7d 0d 2f 2a 20 6a 75 6d |E.M. */.|}./* jum|
|00000660| 70 20 27 3a 27 20 73 65 | 70 61 72 61 74 65 64 20 |p ':' se|parated |
|00000670| 66 69 65 6c 64 73 20 69 | 6e 20 61 6e 20 69 6e 70 |fields i|n an inp|
|00000680| 75 74 20 2a 2f 0d 0d 63 | 68 61 72 20 2a 0d 50 57 |ut */..c|har *.PW|
|00000690| 53 6b 69 70 20 28 70 29 | 0d 20 20 20 20 72 65 67 |Skip (p)|. reg|
|000006a0| 69 73 74 65 72 20 63 68 | 61 72 20 2a 70 3b 0d 7b |ister ch|ar *p;.{|
|000006b0| 0d 20 20 20 20 77 68 69 | 6c 65 20 28 2a 70 20 26 |. whi|le (*p &|
|000006c0| 26 20 2a 70 20 21 3d 20 | 27 3a 27 29 0d 20 20 20 |& *p != |':'). |
|000006d0| 20 7b 0d 09 70 2b 2b 3b | 0d 20 20 20 20 7d 0d 20 | {..p++;|. }. |
|000006e0| 20 20 20 69 66 20 28 2a | 70 29 0d 20 20 20 20 7b | if (*|p). {|
|000006f0| 0d 09 2a 70 2b 2b 20 3d | 20 27 5c 30 27 3b 0d 20 |..*p++ =| '\0';. |
|00000700| 20 20 20 7d 0d 20 20 20 | 20 72 65 74 75 72 6e 20 | }. | return |
|00000710| 28 70 29 3b 0d 7d 0d 0d | 63 68 61 72 20 2a 0d 41 |(p);.}..|char *.A|
|00000720| 72 63 68 69 76 65 20 28 | 6d 79 77 6f 72 64 29 0d |rchive (|myword).|
|00000730| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 63 68 61 | regi|ster cha|
|00000740| 72 20 2a 6d 79 77 6f 72 | 64 3b 0d 7b 0d 20 20 20 |r *mywor|d;.{. |
|00000750| 20 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 69 3b | registe|r int i;|
|00000760| 0d 20 20 20 20 72 65 67 | 69 73 74 65 72 20 73 74 |. reg|ister st|
|00000770| 72 75 63 74 20 44 49 43 | 54 20 2a 70 74 72 3b 0d |ruct DIC|T *ptr;.|
|00000780| 20 20 20 20 73 74 61 74 | 69 63 20 73 74 72 75 63 | stat|ic struc|
|00000790| 74 20 44 49 43 54 20 2a | 61 72 63 68 5f 72 6f 6f |t DICT *|arch_roo|
|000007a0| 74 3b 0d 0d 20 20 20 20 | 66 6f 72 20 28 70 74 72 |t;.. |for (ptr|
|000007b0| 20 3d 20 61 72 63 68 5f | 72 6f 6f 74 3b 20 70 74 | = arch_|root; pt|
|000007c0| 72 3b 20 70 74 72 20 3d | 20 70 74 72 20 2d 3e 20 |r; ptr =| ptr -> |
|000007d0| 6e 65 78 74 29 0d 20 20 | 20 20 7b 0d 09 69 66 20 |next). | {..if |
|000007e0| 28 21 53 54 52 43 4d 50 | 20 28 70 74 72 20 2d 3e |(!STRCMP| (ptr ->|
|000007f0| 20 77 6f 72 64 2c 20 6d | 79 77 6f 72 64 29 29 0d | word, m|yword)).|
|00000800| 09 7b 0d 09 20 20 20 20 | 72 65 74 75 72 6e 20 28 |.{.. |return (|
|00000810| 70 74 72 20 2d 3e 20 77 | 6f 72 64 29 3b 0d 09 7d |ptr -> w|ord);..}|
|00000820| 0d 20 20 20 20 7d 0d 0d | 20 20 20 20 69 20 3d 20 |. }..| i = |
|00000830| 73 74 72 6c 65 6e 20 28 | 6d 79 77 6f 72 64 29 3b |strlen (|myword);|
|00000840| 0d 0d 20 20 20 20 70 74 | 72 20 3d 20 28 73 74 72 |.. pt|r = (str|
|00000850| 75 63 74 20 44 49 43 54 | 20 2a 29 20 6d 61 6c 6c |uct DICT| *) mall|
|00000860| 6f 63 20 28 73 69 7a 65 | 6f 66 20 28 73 74 72 75 |oc (size|of (stru|
|00000870| 63 74 20 44 49 43 54 29 | 20 2b 20 69 29 3b 0d 0d |ct DICT)| + i);..|
|00000880| 20 20 20 20 69 66 20 28 | 70 74 72 29 0d 20 20 20 | if (|ptr). |
|00000890| 20 7b 0d 09 73 74 72 63 | 70 79 20 28 70 74 72 20 | {..strc|py (ptr |
|000008a0| 2d 3e 20 77 6f 72 64 2c | 20 6d 79 77 6f 72 64 29 |-> word,| myword)|
|000008b0| 3b 0d 09 70 74 72 20 2d | 3e 20 77 6f 72 64 5b 69 |;..ptr -|> word[i|
|000008c0| 5d 20 3d 20 27 5c 30 27 | 3b 0d 09 70 74 72 20 2d |] = '\0'|;..ptr -|
|000008d0| 3e 20 6e 65 78 74 20 3d | 20 61 72 63 68 5f 72 6f |> next =| arch_ro|
|000008e0| 6f 74 3b 0d 09 61 72 63 | 68 5f 72 6f 6f 74 20 3d |ot;..arc|h_root =|
|000008f0| 20 70 74 72 3b 0d 20 20 | 20 20 7d 20 65 6c 73 65 | ptr;. | } else|
|00000900| 0d 20 20 20 20 7b 0d 09 | 4c 6f 67 20 28 22 41 72 |. {..|Log ("Ar|
|00000910| 63 68 69 76 65 2f 6d 61 | 6c 6c 6f 63 28 29 20 66 |chive/ma|lloc() f|
|00000920| 61 69 6c 65 64 21 20 46 | 61 74 61 6c 20 6c 61 63 |ailed! F|atal lac|
|00000930| 6b 20 6f 66 20 6d 65 6d | 6f 72 79 21 5c 6e 22 29 |k of mem|ory!\n")|
|00000940| 3b 0d 09 65 78 69 74 20 | 28 31 29 3b 0d 20 20 20 |;..exit |(1);. |
|00000950| 20 7d 0d 0d 20 20 20 20 | 72 65 74 75 72 6e 20 28 | }.. |return (|
|00000960| 70 74 72 20 2d 3e 20 77 | 6f 72 64 29 3b 0d 7d 0d |ptr -> w|ord);.}.|
|00000970| 2f 2a 20 70 61 72 73 65 | 20 61 6e 64 20 73 74 6f |/* parse| and sto|
|00000980| 72 65 20 61 20 70 61 73 | 73 77 6f 72 64 20 65 6e |re a pas|sword en|
|00000990| 74 72 79 20 2a 2f 0d 0d | 73 74 72 75 63 74 20 55 |try */..|struct U|
|000009a0| 53 45 52 20 2a 0d 50 61 | 72 73 65 20 28 62 75 66 |SER *.Pa|rse (buf|
|000009b0| 66 65 72 29 0d 20 20 20 | 20 72 65 67 69 73 74 65 |fer). | registe|
|000009c0| 72 20 63 68 61 72 20 2a | 62 75 66 66 65 72 3b 0d |r char *|buffer;.|
|000009d0| 7b 0d 20 20 20 20 72 65 | 67 69 73 74 65 72 20 63 |{. re|gister c|
|000009e0| 68 61 72 20 2a 70 3b 0d | 20 20 20 20 72 65 67 69 |har *p;.| regi|
|000009f0| 73 74 65 72 20 73 74 72 | 75 63 74 20 55 53 45 52 |ster str|uct USER|
|00000a00| 20 2a 72 65 74 76 61 6c | 3b 0d 0d 20 20 20 20 72 | *retval|;.. r|
|00000a10| 65 74 76 61 6c 20 3d 20 | 28 73 74 72 75 63 74 20 |etval = |(struct |
|00000a20| 55 53 45 52 20 2a 29 20 | 6d 61 6c 6c 6f 63 20 28 |USER *) |malloc (|
|00000a30| 73 69 7a 65 6f 66 20 28 | 73 74 72 75 63 74 20 55 |sizeof (|struct U|
|00000a40| 53 45 52 29 29 3b 0d 0d | 20 20 20 20 69 66 20 28 |SER));..| if (|
|00000a50| 21 72 65 74 76 61 6c 29 | 0d 20 20 20 20 7b 0d 09 |!retval)|. {..|
|00000a60| 4c 6f 67 20 28 22 50 61 | 72 73 65 2f 6d 61 6c 6c |Log ("Pa|rse/mall|
|00000a70| 6f 63 28 29 20 66 61 69 | 6c 65 64 21 20 46 61 74 |oc() fai|led! Fat|
|00000a80| 61 6c 20 6c 61 63 6b 20 | 6f 66 20 6d 65 6d 6f 72 |al lack |of memor|
|00000a90| 79 21 5c 6e 22 29 3b 0d | 09 65 78 69 74 20 28 31 |y!\n");.|.exit (1|
|00000aa0| 29 3b 0d 20 20 20 20 7d | 0d 20 20 20 20 72 65 74 |);. }|. ret|
|00000ab0| 76 61 6c 20 2d 3e 20 6e | 65 78 74 20 3d 20 72 65 |val -> n|ext = re|
|00000ac0| 74 76 61 6c 20 2d 3e 20 | 61 63 72 6f 73 73 20 3d |tval -> |across =|
|00000ad0| 20 4e 55 4c 4c 3b 0d 20 | 20 20 20 72 65 74 76 61 | NULL;. | retva|
|00000ae0| 6c 20 2d 3e 20 70 61 73 | 73 77 64 5f 74 78 74 20 |l -> pas|swd_txt |
|00000af0| 3d 20 4e 55 4c 4c 3b 0d | 20 20 20 20 72 65 74 76 |= NULL;.| retv|
|00000b00| 61 6c 20 2d 3e 20 64 6f | 6e 65 20 3d 20 30 3b 0d |al -> do|ne = 0;.|
|00000b10| 20 20 20 20 54 72 69 6d | 20 28 62 75 66 66 65 72 | Trim| (buffer|
|00000b20| 29 3b 0d 0d 20 20 20 20 | 70 20 3d 20 50 57 53 6b |);.. |p = PWSk|
|00000b30| 69 70 20 28 62 75 66 66 | 65 72 29 3b 0d 20 20 20 |ip (buff|er);. |
|00000b40| 20 72 65 74 76 61 6c 20 | 2d 3e 20 70 61 73 73 77 | retval |-> passw|
|00000b50| 64 2e 70 77 5f 6e 61 6d | 65 20 3d 20 41 72 63 68 |d.pw_nam|e = Arch|
|00000b60| 69 76 65 20 28 62 75 66 | 66 65 72 29 3b 0d 20 20 |ive (buf|fer);. |
|00000b70| 20 20 70 20 3d 20 43 6c | 6f 6e 65 20 28 70 29 3b | p = Cl|one (p);|
|00000b80| 0d 20 20 20 20 69 66 20 | 28 21 70 29 0d 20 20 20 |. if |(!p). |
|00000b90| 20 7b 0d 09 4c 6f 67 20 | 28 22 50 61 72 73 65 2f | {..Log |("Parse/|
|00000ba0| 43 6c 6f 6e 65 28 29 20 | 66 61 69 6c 65 64 21 20 |Clone() |failed! |
|00000bb0| 46 61 74 61 6c 20 6c 61 | 63 6b 20 6f 66 20 6d 65 |Fatal la|ck of me|
|00000bc0| 6d 6f 72 79 21 5c 6e 22 | 29 3b 0d 09 65 78 69 74 |mory!\n"|);..exit|
|00000bd0| 20 28 31 29 3b 0d 20 20 | 20 20 7d 0d 20 20 20 20 | (1);. | }. |
|00000be0| 0d 20 20 2f 2a 20 20 72 | 65 74 76 61 6c 20 2d 3e |. /* r|etval ->|
|00000bf0| 20 70 61 73 73 77 64 2e | 70 77 5f 6e 61 6d 65 20 | passwd.|pw_name |
|00000c00| 3d 20 70 3b 20 2a 2f 0d | 0d 2f 2a 20 20 20 20 70 |= p; */.|./* p|
|00000c10| 20 3d 20 50 57 53 6b 69 | 70 20 28 70 29 3b 20 2a | = PWSki|p (p); *|
|00000c20| 2f 0d 20 20 20 20 72 65 | 74 76 61 6c 20 2d 3e 20 |/. re|tval -> |
|00000c30| 70 61 73 73 77 64 2e 70 | 77 5f 70 61 73 73 77 64 |passwd.p|w_passwd|
|00000c40| 20 3d 20 70 3b 0d 0d 20 | 20 20 20 70 20 3d 20 50 | = p;.. | p = P|
|00000c50| 57 53 6b 69 70 20 28 70 | 29 3b 0d 20 20 20 20 72 |WSkip (p|);. r|
|00000c60| 65 74 76 61 6c 20 2d 3e | 20 70 61 73 73 77 64 2e |etval ->| passwd.|
|00000c70| 70 77 5f 75 69 64 20 3d | 20 61 74 6f 69 20 28 70 |pw_uid =| atoi (p|
|00000c80| 29 3b 0d 0d 20 20 20 20 | 70 20 3d 20 50 57 53 6b |);.. |p = PWSk|
|00000c90| 69 70 20 28 70 29 3b 0d | 20 20 20 20 72 65 74 76 |ip (p);.| retv|
|00000ca0| 61 6c 20 2d 3e 20 70 61 | 73 73 77 64 2e 70 77 5f |al -> pa|sswd.pw_|
|00000cb0| 67 69 64 20 3d 20 61 74 | 6f 69 20 28 70 29 3b 0d |gid = at|oi (p);.|
|00000cc0| 0d 20 20 20 20 70 20 3d | 20 50 57 53 6b 69 70 20 |. p =| PWSkip |
|00000cd0| 28 70 29 3b 0d 20 20 20 | 20 72 65 74 76 61 6c 20 |(p);. | retval |
|00000ce0| 2d 3e 20 70 61 73 73 77 | 64 2e 70 77 5f 67 65 63 |-> passw|d.pw_gec|
|00000cf0| 6f 73 20 3d 20 70 3b 0d | 0d 20 20 20 20 70 20 3d |os = p;.|. p =|
|00000d00| 20 50 57 53 6b 69 70 20 | 28 70 29 3b 0d 20 20 20 | PWSkip |(p);. |
|00000d10| 20 72 65 74 76 61 6c 20 | 2d 3e 20 70 61 73 73 77 | retval |-> passw|
|00000d20| 64 2e 70 77 5f 64 69 72 | 20 3d 20 70 3b 0d 0d 20 |d.pw_dir| = p;.. |
|00000d30| 20 20 20 70 20 3d 20 50 | 57 53 6b 69 70 20 28 70 | p = P|WSkip (p|
|00000d40| 29 3b 0d 20 20 20 20 72 | 65 74 76 61 6c 20 2d 3e |);. r|etval ->|
|00000d50| 20 70 61 73 73 77 64 2e | 70 77 5f 73 68 65 6c 6c | passwd.|pw_shell|
|00000d60| 20 3d 20 70 3b 0d 0d 20 | 20 20 20 72 65 74 75 72 | = p;.. | retur|
|00000d70| 6e 20 28 72 65 74 76 61 | 6c 29 3b 0d 7d 0d 2f 2a |n (retva|l);.}./*|
|00000d80| 20 6c 6f 61 64 20 70 72 | 65 2d 66 6f 72 6d 61 74 | load pr|e-format|
|00000d90| 74 65 64 20 70 61 73 73 | 77 6f 72 64 20 65 6e 74 |ted pass|word ent|
|00000da0| 72 69 65 73 20 6f 66 66 | 20 73 74 64 69 6e 20 69 |ries off| stdin i|
|00000db0| 6e 74 6f 20 6c 69 6e 6b | 65 64 20 6c 69 73 74 20 |nto link|ed list |
|00000dc0| 2a 2f 0d 0d 69 6e 74 0d | 4c 6f 61 64 44 61 74 61 |*/..int.|LoadData|
|00000dd0| 20 28 29 0d 7b 0d 20 20 | 20 20 69 6e 74 20 69 3b | ().{. | int i;|
|00000de0| 0d 20 20 20 20 63 68 61 | 72 20 2a 70 74 72 3b 0d |. cha|r *ptr;.|
|00000df0| 20 20 20 20 63 68 61 72 | 20 73 61 6c 74 5b 32 5d | char| salt[2]|
|00000e00| 3b 0d 20 20 20 20 63 68 | 61 72 20 62 75 66 66 65 |;. ch|ar buffe|
|00000e10| 72 5b 53 54 52 49 4e 47 | 53 49 5a 45 5d 3b 0d 20 |r[STRING|SIZE];. |
|00000e20| 20 20 20 6c 6f 6e 67 20 | 69 6e 74 20 6e 75 6d 6c | long |int numl|
|00000e30| 69 6e 65 73 3b 0d 20 20 | 20 20 6c 6f 6e 67 20 69 |ines;. | long i|
|00000e40| 6e 74 20 6e 75 6d 65 6e | 74 72 69 65 73 3b 0d 20 |nt numen|tries;. |
|00000e50| 20 20 20 72 65 67 69 73 | 74 65 72 20 73 74 72 75 | regis|ter stru|
|00000e60| 63 74 20 55 53 45 52 20 | 2a 6e 65 77 5f 65 6c 65 |ct USER |*new_ele|
|00000e70| 6d 65 6e 74 3b 0d 20 20 | 20 20 72 65 67 69 73 74 |ment;. | regist|
|00000e80| 65 72 20 73 74 72 75 63 | 74 20 55 53 45 52 20 2a |er struc|t USER *|
|00000e90| 63 75 72 72 65 6e 74 5f | 6c 69 6e 65 3b 0d 09 46 |current_|line;..F|
|00000ea0| 49 4c 45 20 2a 70 61 73 | 73 77 64 66 69 6c 65 3b |ILE *pas|swdfile;|
|00000eb0| 0d 09 53 74 72 32 35 35 | 20 62 61 64 70 61 73 73 |..Str255| badpass|
|00000ec0| 77 64 20 3d 20 22 20 45 | 72 72 6f 72 3a 20 20 43 |wd = " E|rror: C|
|00000ed0| 61 6e 27 74 20 6f 70 65 | 6e 20 70 61 73 73 77 64 |an't ope|n passwd|
|00000ee0| 20 66 69 6c 65 2e 22 3b | 0d 0d 20 20 20 20 6e 75 | file.";|.. nu|
|00000ef0| 6d 6c 69 6e 65 73 20 3d | 20 30 4c 3b 0d 20 20 20 |mlines =| 0L;. |
|00000f00| 20 6e 75 6d 65 6e 74 72 | 69 65 73 20 3d 20 30 4c | numentr|ies = 0L|
|00000f10| 3b 0d 20 20 20 20 63 75 | 72 72 65 6e 74 5f 6c 69 |;. cu|rrent_li|
|00000f20| 6e 65 20 3d 20 4e 55 4c | 4c 3b 0d 20 20 20 20 73 |ne = NUL|L;. s|
|00000f30| 61 6c 74 5b 30 5d 20 3d | 20 73 61 6c 74 5b 31 5d |alt[0] =| salt[1]|
|00000f40| 20 3d 20 27 2a 27 3b 0d | 09 0d 09 0d 09 69 66 20 | = '*';.|.....if |
|00000f50| 28 21 28 70 61 73 73 77 | 64 66 69 6c 65 20 3d 20 |(!(passw|dfile = |
|00000f60| 66 6f 70 65 6e 20 28 70 | 61 73 73 77 64 6e 61 6d |fopen (p|asswdnam|
|00000f70| 65 2c 20 22 72 22 29 29 | 29 0d 20 20 20 20 7b 0d |e, "r"))|). {.|
|00000f80| 09 4c 6f 67 20 28 22 45 | 72 72 6f 72 3a 20 63 61 |.Log ("E|rror: ca|
|00000f90| 6e 6e 6f 74 20 6f 70 65 | 6e 20 70 61 73 73 77 64 |nnot ope|n passwd|
|00000fa0| 20 66 69 6c 65 5c 6e 22 | 29 3b 0d 09 50 61 72 61 | file\n"|);..Para|
|00000fb0| 6d 54 65 78 74 28 62 61 | 64 70 61 73 73 77 64 2c |mText(ba|dpasswd,|
|00000fc0| 20 4e 49 4c 2c 20 4e 49 | 4c 2c 20 4e 49 4c 29 3b | NIL, NI|L, NIL);|
|00000fd0| 0d 09 41 6c 65 72 74 20 | 28 54 48 45 41 4c 45 52 |..Alert |(THEALER|
|00000fe0| 54 2c 20 4e 49 4c 29 3b | 0d 09 65 78 69 74 28 31 |T, NIL);|..exit(1|
|00000ff0| 29 3b 0d 20 20 20 20 7d | 0d 0d 0d 20 20 20 20 77 |);. }|... w|
|00001000| 68 69 6c 65 20 28 66 67 | 65 74 73 20 28 62 75 66 |hile (fg|ets (buf|
|00001010| 66 65 72 2c 20 53 54 52 | 49 4e 47 53 49 5a 45 2c |fer, STR|INGSIZE,|
|00001020| 20 70 61 73 73 77 64 66 | 69 6c 65 29 29 0d 20 20 | passwdf|ile)). |
|00001030| 20 20 7b 0d 09 69 66 20 | 28 21 2a 62 75 66 66 65 | {..if |(!*buffe|
|00001040| 72 20 7c 7c 20 69 73 73 | 70 61 63 65 20 28 2a 62 |r || iss|pace (*b|
|00001050| 75 66 66 65 72 29 29 0d | 09 7b 0d 09 20 20 20 20 |uffer)).|.{.. |
|00001060| 63 6f 6e 74 69 6e 75 65 | 3b 0d 09 7d 0d 09 6e 65 |continue|;..}..ne|
|00001070| 77 5f 65 6c 65 6d 65 6e | 74 20 3d 20 50 61 72 73 |w_elemen|t = Pars|
|00001080| 65 20 28 62 75 66 66 65 | 72 29 3b 0d 09 70 74 72 |e (buffe|r);..ptr|
|00001090| 20 3d 20 6e 65 77 5f 65 | 6c 65 6d 65 6e 74 20 2d | = new_e|lement -|
|000010a0| 3e 20 70 61 73 73 77 64 | 2e 70 77 5f 70 61 73 73 |> passwd|.pw_pass|
|000010b0| 77 64 3b 0d 09 6e 65 77 | 5f 65 6c 65 6d 65 6e 74 |wd;..new|_element|
|000010c0| 20 2d 3e 20 66 69 6c 65 | 6e 61 6d 65 20 3d 20 70 | -> file|name = p|
|000010d0| 61 73 73 77 64 6e 61 6d | 65 3b 0d 0d 09 69 66 20 |asswdnam|e;...if |
|000010e0| 28 21 70 74 72 5b 30 5d | 29 0d 09 7b 0d 09 20 20 |(!ptr[0]|)..{.. |
|000010f0| 20 20 4c 6f 67 20 28 22 | 57 61 72 6e 69 6e 67 21 | Log ("|Warning!|
|00001100| 20 25 73 20 28 25 73 20 | 69 6e 20 25 73 29 20 68 | %s (%s |in %s) h|
|00001110| 61 73 20 61 20 4e 55 4c | 4c 20 70 61 73 73 77 6f |as a NUL|L passwo|
|00001120| 72 64 21 5c 6e 22 2c 0d | 09 09 20 6e 65 77 5f 65 |rd!\n",.|.. new_e|
|00001130| 6c 65 6d 65 6e 74 20 2d | 3e 20 70 61 73 73 77 64 |lement -|> passwd|
|00001140| 2e 70 77 5f 6e 61 6d 65 | 2c 0d 09 09 20 6e 65 77 |.pw_name|,... new|
|00001150| 5f 65 6c 65 6d 65 6e 74 | 20 2d 3e 20 70 61 73 73 |_element| -> pass|
|00001160| 77 64 2e 70 77 5f 73 68 | 65 6c 6c 2c 0d 09 09 20 |wd.pw_sh|ell,... |
|00001170| 6e 65 77 5f 65 6c 65 6d | 65 6e 74 20 2d 3e 20 66 |new_elem|ent -> f|
|00001180| 69 6c 65 6e 61 6d 65 29 | 3b 0d 09 20 20 20 20 63 |ilename)|;.. c|
|00001190| 6f 6e 74 69 6e 75 65 3b | 0d 09 7d 0d 09 69 66 20 |ontinue;|..}..if |
|000011a0| 28 73 74 72 63 68 72 20 | 28 70 74 72 2c 20 27 2a |(strchr |(ptr, '*|
|000011b0| 27 29 20 7c 7c 0d 09 20 | 20 20 20 73 74 72 63 68 |') ||.. | strch|
|000011c0| 72 20 28 70 74 72 2c 20 | 27 21 27 29 20 7c 7c 0d |r (ptr, |'!') ||.|
|000011d0| 09 20 20 20 20 73 74 72 | 63 68 72 20 28 70 74 72 |. str|chr (ptr|
|000011e0| 2c 20 27 20 27 29 29 0d | 09 7b 0d 09 20 20 20 20 |, ' ')).|.{.. |
|000011f0| 4c 6f 67 20 28 22 55 73 | 65 72 20 25 73 20 28 69 |Log ("Us|er %s (i|
|00001200| 6e 20 25 73 29 20 68 61 | 73 20 61 20 6c 6f 63 6b |n %s) ha|s a lock|
|00001210| 65 64 20 70 61 73 73 77 | 6f 72 64 3a 2d 20 25 73 |ed passw|ord:- %s|
|00001220| 5c 6e 22 2c 0d 09 09 20 | 6e 65 77 5f 65 6c 65 6d |\n",... |new_elem|
|00001230| 65 6e 74 20 2d 3e 20 70 | 61 73 73 77 64 2e 70 77 |ent -> p|asswd.pw|
|00001240| 5f 6e 61 6d 65 2c 0d 09 | 09 20 6e 65 77 5f 65 6c |_name,..|. new_el|
|00001250| 65 6d 65 6e 74 20 2d 3e | 20 66 69 6c 65 6e 61 6d |ement ->| filenam|
|00001260| 65 2c 0d 09 09 20 6e 65 | 77 5f 65 6c 65 6d 65 6e |e,... ne|w_elemen|
|00001270| 74 20 2d 3e 20 70 61 73 | 73 77 64 2e 70 77 5f 70 |t -> pas|swd.pw_p|
|00001280| 61 73 73 77 64 29 3b 0d | 09 20 20 20 20 63 6f 6e |asswd);.|. con|
|00001290| 74 69 6e 75 65 3b 0d 09 | 7d 0d 09 69 20 3d 20 73 |tinue;..|}..i = s|
|000012a0| 74 72 6c 65 6e 20 28 70 | 74 72 29 3b 0d 09 0d 09 |trlen (p|tr);....|
|000012b0| 69 66 20 28 69 20 3c 20 | 31 33 29 0d 09 7b 0d 09 |if (i < |13)..{..|
|000012c0| 20 20 20 20 4c 6f 67 20 | 28 22 55 73 65 72 20 25 | Log |("User %|
|000012d0| 73 20 28 69 6e 20 25 73 | 29 20 68 61 73 20 61 20 |s (in %s|) has a |
|000012e0| 73 68 6f 72 74 20 70 77 | 5f 70 61 73 73 77 64 20 |short pw|_passwd |
|000012f0| 66 69 65 6c 64 20 2d 20 | 73 6b 69 70 70 69 6e 67 |field - |skipping|
|00001300| 2e 5c 6e 22 2c 0d 09 09 | 20 6e 65 77 5f 65 6c 65 |.\n",...| new_ele|
|00001310| 6d 65 6e 74 20 2d 3e 20 | 70 61 73 73 77 64 2e 70 |ment -> |passwd.p|
|00001320| 77 5f 6e 61 6d 65 2c 0d | 09 09 20 6e 65 77 5f 65 |w_name,.|.. new_e|
|00001330| 6c 65 6d 65 6e 74 20 2d | 3e 20 66 69 6c 65 6e 61 |lement -|> filena|
|00001340| 6d 65 29 3b 0d 09 20 20 | 20 20 63 6f 6e 74 69 6e |me);.. | contin|
|00001350| 75 65 3b 0d 09 7d 0d 09 | 69 66 20 28 69 20 3e 20 |ue;..}..|if (i > |
|00001360| 31 33 29 0d 09 7b 0d 09 | 20 20 20 20 4c 6f 67 20 |13)..{..| Log |
|00001370| 28 22 55 73 65 72 20 25 | 73 20 28 69 6e 20 25 73 |("User %|s (in %s|
|00001380| 29 20 68 61 73 20 61 20 | 6c 6f 6e 67 20 70 77 5f |) has a |long pw_|
|00001390| 70 61 73 73 77 64 20 66 | 69 65 6c 64 20 2d 20 74 |passwd f|ield - t|
|000013a0| 72 75 6e 63 61 74 69 6e | 67 2e 5c 6e 22 2c 0d 09 |runcatin|g.\n",..|
|000013b0| 09 20 6e 65 77 5f 65 6c | 65 6d 65 6e 74 20 2d 3e |. new_el|ement ->|
|000013c0| 20 70 61 73 73 77 64 2e | 70 77 5f 6e 61 6d 65 2c | passwd.|pw_name,|
|000013d0| 0d 09 09 20 6e 65 77 5f | 65 6c 65 6d 65 6e 74 20 |... new_|element |
|000013e0| 2d 3e 20 66 69 6c 65 6e | 61 6d 65 29 3b 0d 09 20 |-> filen|ame);.. |
|000013f0| 20 20 20 70 74 72 5b 31 | 33 5d 20 3d 20 27 5c 30 | ptr[1|3] = '\0|
|00001400| 27 3b 0d 09 7d 0d 09 6e | 75 6d 65 6e 74 72 69 65 |';..}..n|umentrie|
|00001410| 73 2b 2b 3b 0d 0d 09 69 | 66 20 28 70 74 72 5b 30 |s++;...i|f (ptr[0|
|00001420| 5d 20 3d 3d 20 73 61 6c | 74 5b 30 5d 20 26 26 20 |] == sal|t[0] && |
|00001430| 70 74 72 5b 31 5d 20 3d | 3d 20 73 61 6c 74 5b 31 |ptr[1] =|= salt[1|
|00001440| 5d 29 0d 09 7b 0d 09 20 | 20 20 20 6e 65 77 5f 65 |])..{.. | new_e|
|00001450| 6c 65 6d 65 6e 74 20 2d | 3e 20 61 63 72 6f 73 73 |lement -|> across|
|00001460| 20 3d 20 63 75 72 72 65 | 6e 74 5f 6c 69 6e 65 3b | = curre|nt_line;|
|00001470| 0d 09 20 20 20 20 63 75 | 72 72 65 6e 74 5f 6c 69 |.. cu|rrent_li|
|00001480| 6e 65 20 3d 20 6e 65 77 | 5f 65 6c 65 6d 65 6e 74 |ne = new|_element|
|00001490| 3b 0d 09 7d 20 65 6c 73 | 65 0d 09 7b 0d 09 20 20 |;..} els|e..{.. |
|000014a0| 20 20 69 66 20 28 63 75 | 72 72 65 6e 74 5f 6c 69 | if (cu|rrent_li|
|000014b0| 6e 65 29 0d 09 20 20 20 | 20 7b 0d 09 09 63 75 72 |ne).. | {...cur|
|000014c0| 72 65 6e 74 5f 6c 69 6e | 65 20 2d 3e 20 6e 65 78 |rent_lin|e -> nex|
|000014d0| 74 20 3d 20 75 73 65 72 | 72 6f 6f 74 3b 0d 09 20 |t = user|root;.. |
|000014e0| 20 20 20 7d 0d 09 20 20 | 20 20 75 73 65 72 72 6f | }.. | userro|
|000014f0| 6f 74 20 3d 20 63 75 72 | 72 65 6e 74 5f 6c 69 6e |ot = cur|rent_lin|
|00001500| 65 3b 0d 09 20 20 20 20 | 63 75 72 72 65 6e 74 5f |e;.. |current_|
|00001510| 6c 69 6e 65 20 3d 20 6e | 65 77 5f 65 6c 65 6d 65 |line = n|ew_eleme|
|00001520| 6e 74 3b 0d 09 20 20 20 | 20 6e 75 6d 6c 69 6e 65 |nt;.. | numline|
|00001530| 73 2b 2b 3b 0d 09 20 20 | 20 20 73 61 6c 74 5b 30 |s++;.. | salt[0|
|00001540| 5d 20 3d 20 70 74 72 5b | 30 5d 3b 0d 09 20 20 20 |] = ptr[|0];.. |
|00001550| 20 73 61 6c 74 5b 31 5d | 20 3d 20 70 74 72 5b 31 | salt[1]| = ptr[1|
|00001560| 5d 3b 0d 09 7d 0d 20 20 | 20 20 7d 0d 0d 20 20 20 |];..}. | }.. |
|00001570| 20 69 66 20 28 63 75 72 | 72 65 6e 74 5f 6c 69 6e | if (cur|rent_lin|
|00001580| 65 29 09 09 2f 2a 20 6c | 61 73 74 20 6f 6e 65 20 |e)../* l|ast one |
|00001590| 74 65 6e 64 73 20 74 6f | 20 68 61 6e 67 20 61 62 |tends to| hang ab|
|000015a0| 6f 75 74 20 2a 2f 0d 20 | 20 20 20 7b 0d 09 63 75 |out */. | {..cu|
|000015b0| 72 72 65 6e 74 5f 6c 69 | 6e 65 20 2d 3e 20 6e 65 |rrent_li|ne -> ne|
|000015c0| 78 74 20 3d 20 75 73 65 | 72 72 6f 6f 74 3b 0d 09 |xt = use|rroot;..|
|000015d0| 75 73 65 72 72 6f 6f 74 | 20 3d 20 63 75 72 72 65 |userroot| = curre|
|000015e0| 6e 74 5f 6c 69 6e 65 3b | 0d 09 6e 75 6d 6c 69 6e |nt_line;|..numlin|
|000015f0| 65 73 2b 2b 3b 0d 20 20 | 20 20 7d 0d 20 20 20 20 |es++;. | }. |
|00001600| 2d 2d 6e 75 6d 6c 69 6e | 65 73 3b 0d 0d 20 20 20 |--numlin|es;.. |
|00001610| 20 69 66 20 28 6e 75 6d | 65 6e 74 72 69 65 73 29 | if (num|entries)|
|00001620| 0d 20 20 20 20 7b 0d 09 | 4c 6f 67 20 28 22 4c 6f |. {..|Log ("Lo|
|00001630| 61 64 65 64 20 25 6c 64 | 20 70 61 73 73 77 6f 72 |aded %ld| passwor|
|00001640| 64 20 65 6e 74 72 69 65 | 73 20 77 69 74 68 20 25 |d entrie|s with %|
|00001650| 6c 64 20 64 69 66 66 65 | 72 65 6e 74 20 73 61 6c |ld diffe|rent sal|
|00001660| 74 73 3a 20 25 6c 64 25 | 25 5c 6e 22 2c 0d 09 20 |ts: %ld%|%\n",.. |
|00001670| 20 20 20 20 6e 75 6d 65 | 6e 74 72 69 65 73 2c 0d | nume|ntries,.|
|00001680| 09 20 20 20 20 20 6e 75 | 6d 6c 69 6e 65 73 2c 0d |. nu|mlines,.|
|00001690| 09 20 20 20 20 20 28 28 | 6e 75 6d 6c 69 6e 65 73 |. ((|numlines|
|000016a0| 20 2a 20 31 30 30 29 20 | 2f 20 6e 75 6d 65 6e 74 | * 100) |/ nument|
|000016b0| 72 69 65 73 29 29 3b 0d | 20 20 20 20 7d 20 65 6c |ries));.| } el|
|000016c0| 73 65 0d 20 20 20 20 7b | 0d 09 4c 6f 67 20 28 22 |se. {|..Log ("|
|000016d0| 4e 6f 20 69 6e 70 75 74 | 20 73 75 70 70 6c 69 65 |No input| supplie|
|000016e0| 64 3a 20 65 76 65 72 79 | 74 68 69 6e 67 20 72 65 |d: every|thing re|
|000016f0| 6d 6f 76 65 64 20 62 79 | 20 66 65 65 64 62 61 63 |moved by| feedbac|
|00001700| 6b 20 3f 5c 6e 22 29 3b | 0d 20 20 20 20 7d 0d 20 |k ?\n");|. }. |
|00001710| 20 20 20 72 65 74 75 72 | 6e 20 28 6e 75 6d 65 6e | retur|n (numen|
|00001720| 74 72 69 65 73 29 3b 0d | 66 63 6c 6f 73 65 28 70 |tries);.|fclose(p|
|00001730| 61 73 73 77 64 66 69 6c | 65 29 3b 0d 7d 0d 2f 2a |asswdfil|e);.}./*|
|00001740| 20 61 6e 64 20 6c 6f 61 | 64 20 72 75 6c 65 73 20 | and loa|d rules |
|00001750| 66 72 6f 6d 20 61 20 73 | 74 61 6e 64 61 72 64 20 |from a s|tandard |
|00001760| 66 69 6c 65 20 69 6e 74 | 6f 20 61 20 73 69 6d 69 |file int|o a simi|
|00001770| 6c 61 72 20 6c 69 73 74 | 20 2a 2f 0d 0d 69 6e 74 |lar list| */..int|
|00001780| 0d 4c 6f 61 64 52 75 6c | 65 73 20 28 66 69 6c 65 |.LoadRul|es (file|
|00001790| 2c 20 72 6f 6f 74 70 6f | 73 29 0d 20 20 20 20 63 |, rootpo|s). c|
|000017a0| 68 61 72 20 2a 66 69 6c | 65 3b 0d 20 20 20 20 73 |har *fil|e;. s|
|000017b0| 74 72 75 63 74 20 52 55 | 4c 45 20 2a 2a 72 6f 6f |truct RU|LE **roo|
|000017c0| 74 70 6f 73 3b 0d 7b 0d | 20 20 20 20 46 49 4c 45 |tpos;.{.| FILE|
|000017d0| 20 2a 66 70 3b 0d 20 20 | 20 20 69 6e 74 20 6e 75 | *fp;. | int nu|
|000017e0| 6d 72 75 6c 65 73 3b 0d | 20 20 20 20 73 74 72 75 |mrules;.| stru|
|000017f0| 63 74 20 52 55 4c 45 20 | 66 65 6e 63 65 70 6f 73 |ct RULE |fencepos|
|00001800| 74 3b 0d 20 20 20 20 72 | 65 67 69 73 74 65 72 20 |t;. r|egister |
|00001810| 73 74 72 75 63 74 20 52 | 55 4c 45 20 2a 61 64 64 |struct R|ULE *add|
|00001820| 69 6e 74 6f 3b 0d 20 20 | 20 20 72 65 67 69 73 74 |into;. | regist|
|00001830| 65 72 20 73 74 72 75 63 | 74 20 52 55 4c 45 20 2a |er struc|t RULE *|
|00001840| 73 63 72 61 74 63 68 3b | 0d 20 20 20 20 63 68 61 |scratch;|. cha|
|00001850| 72 20 62 75 66 66 65 72 | 5b 53 54 52 49 4e 47 53 |r buffer|[STRINGS|
|00001860| 49 5a 45 5d 3b 0d 20 20 | 20 20 53 74 72 32 35 35 |IZE];. | Str255|
|00001870| 20 62 61 64 72 75 6c 65 | 66 69 6c 65 20 3d 20 22 | badrule|file = "|
|00001880| 20 43 61 6e 27 74 20 6f | 70 65 6e 20 72 75 6c 65 | Can't o|pen rule|
|00001890| 66 69 6c 65 2e 22 3b 0d | 0d 20 20 20 20 69 66 20 |file.";.|. if |
|000018a0| 28 21 28 66 70 20 3d 20 | 66 6f 70 65 6e 20 28 66 |(!(fp = |fopen (f|
|000018b0| 69 6c 65 2c 20 22 72 22 | 29 29 29 0d 20 20 20 20 |ile, "r"|))). |
|000018c0| 7b 0d 09 4c 6f 67 20 28 | 22 63 61 6e 6e 6f 74 20 |{..Log (|"cannot |
|000018d0| 6f 70 65 6e 20 72 75 6c | 65 66 69 6c 65 20 25 73 |open rul|efile %s|
|000018e0| 5c 6e 22 2c 20 66 69 6c | 65 29 3b 0d 09 50 61 72 |\n", fil|e);..Par|
|000018f0| 61 6d 54 65 78 74 28 62 | 61 64 72 75 6c 65 66 69 |amText(b|adrulefi|
|00001900| 6c 65 2c 20 4e 49 4c 2c | 20 4e 49 4c 2c 20 4e 49 |le, NIL,| NIL, NI|
|00001910| 4c 29 3b 0d 09 41 6c 65 | 72 74 20 28 54 48 45 41 |L);..Ale|rt (THEA|
|00001920| 4c 45 52 54 2c 20 4e 49 | 4c 29 3b 0d 09 72 65 74 |LERT, NI|L);..ret|
|00001930| 75 72 6e 20 28 2d 31 29 | 3b 0d 20 20 20 20 7d 0d |urn (-1)|;. }.|
|00001940| 20 20 20 20 6e 75 6d 72 | 75 6c 65 73 20 3d 20 30 | numr|ules = 0|
|00001950| 3b 0d 20 20 20 20 61 64 | 64 69 6e 74 6f 20 3d 20 |;. ad|dinto = |
|00001960| 26 66 65 6e 63 65 70 6f | 73 74 3b 0d 20 20 20 20 |&fencepo|st;. |
|00001970| 61 64 64 69 6e 74 6f 20 | 2d 3e 20 6e 65 78 74 20 |addinto |-> next |
|00001980| 3d 20 28 73 74 72 75 63 | 74 20 52 55 4c 45 20 2a |= (struc|t RULE *|
|00001990| 29 20 30 3b 0d 0d 20 20 | 20 20 77 68 69 6c 65 20 |) 0;.. | while |
|000019a0| 28 66 67 65 74 73 20 28 | 62 75 66 66 65 72 2c 20 |(fgets (|buffer, |
|000019b0| 53 54 52 49 4e 47 53 49 | 5a 45 2c 20 66 70 29 29 |STRINGSI|ZE, fp))|
|000019c0| 0d 20 20 20 20 7b 0d 09 | 54 72 69 6d 20 28 62 75 |. {..|Trim (bu|
|000019d0| 66 66 65 72 29 3b 0d 0d | 09 69 66 20 28 21 62 75 |ffer);..|.if (!bu|
|000019e0| 66 66 65 72 5b 30 5d 20 | 7c 7c 20 62 75 66 66 65 |ffer[0] ||| buffe|
|000019f0| 72 5b 30 5d 20 3d 3d 20 | 27 23 27 29 0d 09 7b 0d |r[0] == |'#')..{.|
|00001a00| 09 20 20 20 20 63 6f 6e | 74 69 6e 75 65 3b 0d 09 |. con|tinue;..|
|00001a10| 7d 0d 09 73 63 72 61 74 | 63 68 20 3d 20 28 73 74 |}..scrat|ch = (st|
|00001a20| 72 75 63 74 20 52 55 4c | 45 20 2a 29 20 6d 61 6c |ruct RUL|E *) mal|
|00001a30| 6c 6f 63 20 28 73 69 7a | 65 6f 66 20 28 73 74 72 |loc (siz|eof (str|
|00001a40| 75 63 74 20 52 55 4c 45 | 29 29 3b 0d 0d 09 69 66 |uct RULE|));...if|
|00001a50| 20 28 21 73 63 72 61 74 | 63 68 29 0d 09 7b 0d 09 | (!scrat|ch)..{..|
|00001a60| 20 20 20 20 4c 6f 67 20 | 28 22 4c 6f 61 64 52 75 | Log |("LoadRu|
|00001a70| 6c 65 73 2f 6d 61 6c 6c | 6f 63 28 29 20 66 61 69 |les/mall|oc() fai|
|00001a80| 6c 65 64 21 20 46 61 74 | 61 6c 20 6c 61 63 6b 20 |led! Fat|al lack |
|00001a90| 6f 66 20 6d 65 6d 6f 72 | 79 21 5c 6e 22 29 3b 0d |of memor|y!\n");.|
|00001aa0| 09 20 20 20 20 65 78 69 | 74 20 28 31 29 3b 0d 09 |. exi|t (1);..|
|00001ab0| 7d 0d 09 73 63 72 61 74 | 63 68 20 2d 3e 20 72 75 |}..scrat|ch -> ru|
|00001ac0| 6c 65 20 3d 20 43 6c 6f | 6e 65 20 28 62 75 66 66 |le = Clo|ne (buff|
|00001ad0| 65 72 29 3b 0d 0d 09 69 | 66 20 28 21 73 63 72 61 |er);...i|f (!scra|
|00001ae0| 74 63 68 20 2d 3e 20 72 | 75 6c 65 29 0d 09 7b 0d |tch -> r|ule)..{.|
|00001af0| 09 20 20 20 20 4c 6f 67 | 20 28 22 4c 6f 61 64 52 |. Log| ("LoadR|
|00001b00| 75 6c 65 73 2f 43 6c 6f | 6e 65 28 29 20 66 61 69 |ules/Clo|ne() fai|
|00001b10| 6c 65 64 21 20 46 61 74 | 61 6c 20 6c 61 63 6b 20 |led! Fat|al lack |
|00001b20| 6f 66 20 6d 65 6d 6f 72 | 79 21 5c 6e 22 29 3b 0d |of memor|y!\n");.|
|00001b30| 09 20 20 20 20 65 78 69 | 74 20 28 31 29 3b 0d 09 |. exi|t (1);..|
|00001b40| 7d 0d 09 73 63 72 61 74 | 63 68 20 2d 3e 20 6e 65 |}..scrat|ch -> ne|
|00001b50| 78 74 20 3d 20 28 73 74 | 72 75 63 74 20 52 55 4c |xt = (st|ruct RUL|
|00001b60| 45 20 2a 29 20 30 3b 0d | 09 61 64 64 69 6e 74 6f |E *) 0;.|.addinto|
|00001b70| 20 2d 3e 20 6e 65 78 74 | 20 3d 20 73 63 72 61 74 | -> next| = scrat|
|00001b80| 63 68 3b 0d 09 61 64 64 | 69 6e 74 6f 20 3d 20 73 |ch;..add|into = s|
|00001b90| 63 72 61 74 63 68 3b 0d | 09 6e 75 6d 72 75 6c 65 |cratch;.|.numrule|
|00001ba0| 73 2b 2b 3b 0d 20 20 20 | 20 7d 0d 0d 20 20 20 20 |s++;. | }.. |
|00001bb0| 66 63 6c 6f 73 65 20 28 | 66 70 29 3b 0d 20 20 20 |fclose (|fp);. |
|00001bc0| 20 4c 6f 67 20 28 22 4c | 6f 61 64 65 64 20 25 64 | Log ("L|oaded %d|
|00001bd0| 20 72 75 6c 65 73 20 66 | 72 6f 6d 20 27 25 73 27 | rules f|rom '%s'|
|00001be0| 2e 5c 6e 22 2c 20 6e 75 | 6d 72 75 6c 65 73 2c 20 |.\n", nu|mrules, |
|00001bf0| 66 69 6c 65 29 3b 0d 20 | 20 20 20 2a 72 6f 6f 74 |file);. | *root|
|00001c00| 70 6f 73 20 3d 20 66 65 | 6e 63 65 70 6f 73 74 2e |pos = fe|ncepost.|
|00001c10| 6e 65 78 74 3b 0d 20 20 | 20 20 72 65 74 75 72 6e |next;. | return|
|00001c20| 20 28 6e 75 6d 72 75 6c | 65 73 29 3b 0d 7d 0d 2f | (numrul|es);.}./|
|00001c30| 2a 20 6c 6f 61 64 20 61 | 20 64 69 63 74 69 6f 6e |* load a| diction|
|00001c40| 61 72 79 20 69 6e 74 6f | 20 61 20 6c 69 6e 6b 65 |ary into| a linke|
|00001c50| 64 20 6c 69 73 74 2c 20 | 61 6e 64 20 73 6f 72 74 |d list, |and sort|
|00001c60| 20 69 74 20 2a 2f 0d 0d | 6c 6f 6e 67 20 69 6e 74 | it */..|long int|
|00001c70| 0d 4c 6f 61 64 44 69 63 | 74 20 28 66 69 6c 65 2c |.LoadDic|t (file,|
|00001c80| 20 72 75 6c 65 2c 20 63 | 6f 6e 74 64 69 63 74 29 | rule, c|ontdict)|
|00001c90| 0d 20 20 20 20 63 68 61 | 72 20 2a 66 69 6c 65 3b |. cha|r *file;|
|00001ca0| 0d 20 20 20 20 63 68 61 | 72 20 2a 72 75 6c 65 3b |. cha|r *rule;|
|00001cb0| 0d 20 20 20 20 69 6e 74 | 20 63 6f 6e 74 64 69 63 |. int| contdic|
|00001cc0| 74 3b 0d 7b 0d 20 20 20 | 20 69 6e 74 20 69 3b 0d |t;.{. | int i;.|
|00001cd0| 20 20 20 20 69 6e 74 20 | 6d 65 6d 66 69 6c 6c 65 | int |memfille|
|00001ce0| 64 3b 0d 20 20 20 20 6c | 6f 6e 67 20 69 6e 74 20 |d;. l|ong int |
|00001cf0| 6e 65 6c 65 6d 3b 0d 20 | 20 20 20 6c 6f 6e 67 20 |nelem;. | long |
|00001d00| 69 6e 74 20 72 65 6a 65 | 63 74 65 64 3b 0d 20 20 |int reje|cted;. |
|00001d10| 20 20 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 | regist|er char |
|00001d20| 2a 6d 61 6e 67 6c 65 3b | 0d 20 20 20 20 72 65 67 |*mangle;|. reg|
|00001d30| 69 73 74 65 72 20 73 74 | 72 75 63 74 20 44 49 43 |ister st|ruct DIC|
|00001d40| 54 20 2a 73 63 72 61 74 | 63 68 3b 0d 20 20 20 20 |T *scrat|ch;. |
|00001d50| 63 68 61 72 20 70 69 70 | 65 62 75 66 66 5b 53 54 |char pip|ebuff[ST|
|00001d60| 52 49 4e 47 53 49 5a 45 | 5d 3b 0d 0d 20 20 20 20 |RINGSIZE|];.. |
|00001d70| 73 74 61 74 69 63 20 46 | 49 4c 45 20 2a 66 70 3b |static F|ILE *fp;|
|00001d80| 0d 20 20 20 20 63 68 61 | 72 20 62 75 66 66 65 72 |. cha|r buffer|
|00001d90| 5b 53 54 52 49 4e 47 53 | 49 5a 45 5d 3b 0d 20 20 |[STRINGS|IZE];. |
|00001da0| 20 20 53 74 72 32 35 35 | 20 62 61 64 66 69 6c 65 | Str255| badfile|
|00001db0| 20 3d 20 22 20 47 6f 74 | 20 61 20 66 69 6c 65 20 | = " Got| a file |
|00001dc0| 65 72 72 6f 72 2e 20 20 | 44 69 63 74 69 6f 6e 61 |error. |Dictiona|
|00001dd0| 72 79 20 72 65 6c 61 74 | 65 64 2e 22 3b 0d 0d 20 |ry relat|ed.";.. |
|00001de0| 20 20 20 69 66 20 28 63 | 6f 6e 74 64 69 63 74 20 | if (c|ontdict |
|00001df0| 26 26 20 66 70 29 0d 20 | 20 20 20 7b 0d 09 67 6f |&& fp). | {..go|
|00001e00| 74 6f 20 66 69 6c 65 73 | 5f 6f 70 65 6e 3b 0d 20 |to files|_open;. |
|00001e10| 20 20 20 7d 0d 20 20 20 | 20 0d 0d 20 20 20 20 7b | }. | .. {|
|00001e20| 0d 09 70 69 70 65 62 75 | 66 66 5b 30 5d 20 3d 20 |..pipebu|ff[0] = |
|00001e30| 27 5c 30 27 3b 0d 09 69 | 66 20 28 21 28 66 70 20 |'\0';..i|f (!(fp |
|00001e40| 3d 20 66 6f 70 65 6e 20 | 28 66 69 6c 65 2c 20 22 |= fopen |(file, "|
|00001e50| 72 22 29 29 29 0d 09 7b | 0d 09 20 20 20 20 50 61 |r")))..{|.. Pa|
|00001e60| 72 61 6d 54 65 78 74 28 | 62 61 64 66 69 6c 65 2c |ramText(|badfile,|
|00001e70| 20 4e 49 4c 2c 20 4e 49 | 4c 2c 20 4e 49 4c 29 3b | NIL, NI|L, NIL);|
|00001e80| 0d 09 09 41 6c 65 72 74 | 20 28 54 48 45 41 4c 45 |...Alert| (THEALE|
|00001e90| 52 54 2c 20 4e 49 4c 29 | 3b 0d 09 20 20 20 20 72 |RT, NIL)|;.. r|
|00001ea0| 65 74 75 72 6e 20 28 30 | 29 3b 0d 09 7d 0d 20 20 |eturn (0|);..}. |
|00001eb0| 20 20 7d 0d 0d 20 20 66 | 69 6c 65 73 5f 6f 70 65 | }.. f|iles_ope|
|00001ec0| 6e 3a 0d 0d 20 20 20 20 | 6e 65 6c 65 6d 20 3d 20 |n:.. |nelem = |
|00001ed0| 30 3b 0d 20 20 20 20 72 | 65 6a 65 63 74 65 64 20 |0;. r|ejected |
|00001ee0| 3d 20 30 3b 0d 20 20 20 | 20 6d 65 6d 66 69 6c 6c |= 0;. | memfill|
|00001ef0| 65 64 20 3d 20 30 3b 0d | 20 20 20 20 64 69 63 74 |ed = 0;.| dict|
|00001f00| 72 6f 6f 74 20 3d 20 28 | 73 74 72 75 63 74 20 44 |root = (|struct D|
|00001f10| 49 43 54 20 2a 29 20 30 | 3b 0d 0d 20 20 20 20 4c |ICT *) 0|;.. L|
|00001f20| 6f 67 20 28 22 25 73 20 | 72 75 6c 65 20 27 25 73 |og ("%s |rule '%s|
|00001f30| 27 20 74 6f 20 66 69 6c | 65 20 27 25 73 27 5c 6e |' to fil|e '%s'\n|
|00001f40| 22 2c 0d 09 20 63 6f 6e | 74 64 69 63 74 20 3f 20 |",.. con|tdict ? |
|00001f50| 22 43 6f 6e 74 69 6e 75 | 69 6e 67 22 20 3a 20 22 |"Continu|ing" : "|
|00001f60| 41 70 70 6c 79 69 6e 67 | 22 2c 0d 09 20 72 75 6c |Applying|",.. rul|
|00001f70| 65 2c 0d 09 20 66 69 6c | 65 29 3b 0d 0d 20 20 20 |e,.. fil|e);.. |
|00001f80| 20 77 68 69 6c 65 20 28 | 66 67 65 74 73 20 28 62 | while (|fgets (b|
|00001f90| 75 66 66 65 72 2c 20 53 | 54 52 49 4e 47 53 49 5a |uffer, S|TRINGSIZ|
|00001fa0| 45 2c 20 66 70 29 29 0d | 20 20 20 20 7b 0d 09 54 |E, fp)).| {..T|
|00001fb0| 72 69 6d 20 28 62 75 66 | 66 65 72 29 3b 0d 0d 09 |rim (buf|fer);...|
|00001fc0| 69 66 20 28 21 62 75 66 | 66 65 72 5b 30 5d 20 7c |if (!buf|fer[0] ||
|00001fd0| 7c 20 62 75 66 66 65 72 | 5b 30 5d 20 3d 3d 20 27 || buffer|[0] == '|
|00001fe0| 23 27 29 0d 09 7b 0d 09 | 20 20 20 20 63 6f 6e 74 |#')..{..| cont|
|00001ff0| 69 6e 75 65 3b 0d 09 7d | 0d 09 6d 61 6e 67 6c 65 |inue;..}|..mangle|
|00002000| 20 3d 20 4d 61 6e 67 6c | 65 20 28 62 75 66 66 65 | = Mangl|e (buffe|
|00002010| 72 2c 20 72 75 6c 65 29 | 3b 0d 0d 09 69 66 20 28 |r, rule)|;...if (|
|00002020| 21 6d 61 6e 67 6c 65 29 | 0d 09 7b 0d 09 20 20 20 |!mangle)|..{.. |
|00002030| 20 72 65 6a 65 63 74 65 | 64 2b 2b 3b 0d 0d 09 20 | rejecte|d++;... |
|00002040| 20 20 20 69 66 20 28 76 | 65 72 62 6f 73 65 5f 62 | if (v|erbose_b|
|00002050| 6f 6f 6c 29 0d 09 20 20 | 20 20 7b 0d 09 09 4c 6f |ool).. | {...Lo|
|00002060| 67 20 28 22 52 65 6a 65 | 63 74 65 64 20 27 25 73 |g ("Reje|cted '%s|
|00002070| 27 20 64 75 65 20 74 6f | 20 72 75 6c 65 20 73 70 |' due to| rule sp|
|00002080| 65 63 73 2e 5c 6e 22 2c | 20 62 75 66 66 65 72 29 |ecs.\n",| buffer)|
|00002090| 3b 0d 09 20 20 20 20 7d | 0d 09 20 20 20 20 63 6f |;.. }|.. co|
|000020a0| 6e 74 69 6e 75 65 3b 0d | 09 7d 0d 09 69 66 20 28 |ntinue;.|.}..if (|
|000020b0| 64 69 63 74 72 6f 6f 74 | 20 26 26 20 21 73 74 72 |dictroot| && !str|
|000020c0| 6e 63 6d 70 20 28 6d 61 | 6e 67 6c 65 2c 20 64 69 |ncmp (ma|ngle, di|
|000020d0| 63 74 72 6f 6f 74 20 2d | 3e 20 77 6f 72 64 2c 20 |ctroot -|> word, |
|000020e0| 70 77 6c 65 6e 67 74 68 | 29 29 0d 09 7b 0d 09 20 |pwlength|))..{.. |
|000020f0| 20 20 20 72 65 6a 65 63 | 74 65 64 2b 2b 3b 0d 0d | rejec|ted++;..|
|00002100| 09 20 20 20 20 69 66 20 | 28 76 65 72 62 6f 73 65 |. if |(verbose|
|00002110| 5f 62 6f 6f 6c 29 0d 09 | 20 20 20 20 7b 0d 09 09 |_bool)..| {...|
|00002120| 4c 6f 67 20 28 22 52 65 | 6a 65 63 74 65 64 20 27 |Log ("Re|jected '|
|00002130| 25 73 27 3b 20 64 75 70 | 6c 69 63 61 74 65 64 20 |%s'; dup|licated |
|00002140| 74 6f 20 25 64 20 63 68 | 61 72 73 2e 5c 6e 22 2c |to %d ch|ars.\n",|
|00002150| 20 62 75 66 66 65 72 2c | 0d 09 09 20 20 20 20 20 | buffer,|... |
|00002160| 70 77 6c 65 6e 67 74 68 | 29 3b 0d 09 20 20 20 20 |pwlength|);.. |
|00002170| 7d 0d 09 20 20 20 20 63 | 6f 6e 74 69 6e 75 65 3b |}.. c|ontinue;|
|00002180| 0d 09 7d 0d 09 69 20 3d | 20 73 74 72 6c 65 6e 20 |..}..i =| strlen |
|00002190| 28 6d 61 6e 67 6c 65 29 | 3b 0d 0d 09 69 66 20 28 |(mangle)|;...if (|
|000021a0| 69 20 3e 20 70 77 6c 65 | 6e 67 74 68 29 0d 09 7b |i > pwle|ngth)..{|
|000021b0| 0d 09 20 20 20 20 69 20 | 3d 20 70 77 6c 65 6e 67 |.. i |= pwleng|
|000021c0| 74 68 3b 0d 09 7d 0d 09 | 73 63 72 61 74 63 68 20 |th;..}..|scratch |
|000021d0| 3d 20 28 73 74 72 75 63 | 74 20 44 49 43 54 20 2a |= (struc|t DICT *|
|000021e0| 29 20 6d 61 6c 6c 6f 63 | 20 28 73 69 7a 65 6f 66 |) malloc| (sizeof|
|000021f0| 20 28 73 74 72 75 63 74 | 20 44 49 43 54 29 20 2b | (struct| DICT) +|
|00002200| 20 69 29 3b 0d 0d 09 69 | 66 20 28 21 73 63 72 61 | i);...i|f (!scra|
|00002210| 74 63 68 29 0d 09 7b 0d | 09 20 20 20 20 4c 6f 67 |tch)..{.|. Log|
|00002220| 20 28 22 4c 6f 61 64 44 | 69 63 74 2f 6d 61 6c 6c | ("LoadD|ict/mall|
|00002230| 6f 63 28 29 20 66 61 69 | 6c 65 64 21 20 53 68 61 |oc() fai|led! Sha|
|00002240| 6d 65 66 75 6c 20 6c 61 | 63 6b 20 6f 66 20 6d 65 |meful la|ck of me|
|00002250| 6d 6f 72 79 21 5c 6e 22 | 29 3b 0d 09 20 20 20 20 |mory!\n"|);.. |
|00002260| 6d 65 6d 66 69 6c 6c 65 | 64 20 3d 20 31 3b 0d 09 |memfille|d = 1;..|
|00002270| 20 20 20 20 67 6f 74 6f | 20 77 6f 72 64 73 5f 6c | goto| words_l|
|00002280| 6f 61 64 65 64 3b 0d 09 | 7d 0d 09 73 74 72 6e 63 |oaded;..|}..strnc|
|00002290| 70 79 20 28 73 63 72 61 | 74 63 68 20 2d 3e 20 77 |py (scra|tch -> w|
|000022a0| 6f 72 64 2c 20 6d 61 6e | 67 6c 65 2c 20 69 29 3b |ord, man|gle, i);|
|000022b0| 0d 09 73 63 72 61 74 63 | 68 20 2d 3e 20 77 6f 72 |..scratc|h -> wor|
|000022c0| 64 5b 69 5d 20 3d 20 27 | 5c 30 27 3b 0d 09 73 63 |d[i] = '|\0';..sc|
|000022d0| 72 61 74 63 68 20 2d 3e | 20 6e 65 78 74 20 3d 20 |ratch ->| next = |
|000022e0| 64 69 63 74 72 6f 6f 74 | 3b 0d 09 64 69 63 74 72 |dictroot|;..dictr|
|000022f0| 6f 6f 74 20 3d 20 73 63 | 72 61 74 63 68 3b 0d 09 |oot = sc|ratch;..|
|00002300| 6e 65 6c 65 6d 2b 2b 3b | 0d 0d 09 69 66 20 28 76 |nelem++;|...if (v|
|00002310| 65 72 62 6f 73 65 5f 62 | 6f 6f 6c 29 0d 09 7b 0d |erbose_b|ool)..{.|
|00002320| 09 20 20 20 20 4c 6f 67 | 20 28 22 4c 6f 61 64 65 |. Log| ("Loade|
|00002330| 64 20 27 25 73 27 20 61 | 73 20 27 25 73 27 20 75 |d '%s' a|s '%s' u|
|00002340| 73 69 6e 67 20 27 25 73 | 27 5c 6e 22 2c 20 62 75 |sing '%s|'\n", bu|
|00002350| 66 66 65 72 2c 0d 09 09 | 20 73 63 72 61 74 63 68 |ffer,...| scratch|
|00002360| 20 2d 3e 20 77 6f 72 64 | 2c 20 72 75 6c 65 29 3b | -> word|, rule);|
|00002370| 0d 09 7d 0d 20 20 20 20 | 7d 0d 0d 2f 2a 20 20 4e |..}. |}../* N|
|00002380| 4f 20 50 49 50 45 53 20 | 4f 4e 20 4d 41 43 21 21 |O PIPES |ON MAC!!|
|00002390| 20 2a 2f 0d 2f 2a 0d 20 | 20 20 20 69 66 20 28 70 | */./*. | if (p|
|000023a0| 69 70 65 62 75 66 66 5b | 30 5d 29 0d 20 20 20 20 |ipebuff[|0]). |
|000023b0| 7b 0d 09 70 63 6c 6f 73 | 65 20 28 66 70 29 3b 0d |{..pclos|e (fp);.|
|000023c0| 20 20 20 20 7d 20 65 6c | 73 65 0d 20 20 20 20 7b | } el|se. {|
|000023d0| 0d 2a 2f 09 66 63 6c 6f | 73 65 20 28 66 70 29 3b |.*/.fclo|se (fp);|
|000023e0| 0d 20 20 2f 2a 20 20 7d | 0d 2a 2f 0d 0d 0d 20 20 |. /* }|.*/... |
|000023f0| 20 20 66 70 20 3d 20 28 | 46 49 4c 45 20 2a 29 20 | fp = (|FILE *) |
|00002400| 30 3b 0d 0d 20 20 77 6f | 72 64 73 5f 6c 6f 61 64 |0;.. wo|rds_load|
|00002410| 65 64 3a 0d 0d 20 20 20 | 20 69 66 20 28 6e 65 6c |ed:.. | if (nel|
|00002420| 65 6d 20 3d 3d 20 30 29 | 0d 20 20 20 20 7b 0d 09 |em == 0)|. {..|
|00002430| 72 65 74 75 72 6e 20 28 | 30 29 3b 0d 20 20 20 20 |return (|0);. |
|00002440| 7d 0d 20 20 20 20 4c 6f | 67 20 28 22 52 65 6a 65 |}. Lo|g ("Reje|
|00002450| 63 74 65 64 20 25 6c 64 | 20 77 6f 72 64 73 20 6f |cted %ld| words o|
|00002460| 6e 20 6c 6f 61 64 69 6e | 67 2c 20 25 6c 64 20 77 |n loadin|g, %ld w|
|00002470| 6f 72 64 73 20 6c 65 66 | 74 20 74 6f 20 73 6f 72 |ords lef|t to sor|
|00002480| 74 5c 6e 22 2c 0d 09 20 | 72 65 6a 65 63 74 65 64 |t\n",.. |rejected|
|00002490| 2c 20 6e 65 6c 65 6d 29 | 3b 0d 0d 20 20 20 20 64 |, nelem)|;.. d|
|000024a0| 69 63 74 72 6f 6f 74 20 | 3d 20 28 73 74 72 75 63 |ictroot |= (struc|
|000024b0| 74 20 44 49 43 54 20 2a | 29 20 53 6f 72 74 44 69 |t DICT *|) SortDi|
|000024c0| 63 74 20 28 64 69 63 74 | 72 6f 6f 74 2c 20 6e 65 |ct (dict|root, ne|
|000024d0| 6c 65 6d 29 3b 0d 0d 20 | 20 20 20 69 66 20 28 6d |lem);.. | if (m|
|000024e0| 65 6d 66 69 6c 6c 65 64 | 29 0d 20 20 20 20 7b 0d |emfilled|). {.|
|000024f0| 09 6e 65 6c 65 6d 20 3d | 20 2d 6e 65 6c 65 6d 3b |.nelem =| -nelem;|
|00002500| 0d 20 20 20 20 7d 0d 20 | 20 20 20 72 65 74 75 72 |. }. | retur|
|00002510| 6e 20 28 6e 65 6c 65 6d | 29 3b 09 09 2f 2a 20 6e |n (nelem|);../* n|
|00002520| 6f 74 20 73 74 72 69 63 | 74 20 6e 75 6d 62 65 72 |ot stric|t number|
|00002530| 20 61 6e 79 6d 6f 72 65 | 2e 2e 2e 20 2a 2f 0d 7d | anymore|... */.}|
|00002540| 0d 2f 2a 20 6c 6f 73 65 | 20 74 68 65 20 63 75 72 |./* lose| the cur|
|00002550| 72 65 6e 74 20 64 69 63 | 74 69 6f 6e 61 72 79 20 |rent dic|tionary |
|00002560| 2a 2f 0d 0d 69 6e 74 0d | 44 72 6f 70 44 69 63 74 |*/..int.|DropDict|
|00002570| 20 28 29 0d 7b 0d 20 20 | 20 20 72 65 67 69 73 74 | ().{. | regist|
|00002580| 65 72 20 73 74 72 75 63 | 74 20 44 49 43 54 20 2a |er struc|t DICT *|
|00002590| 73 63 72 61 74 63 68 31 | 3b 0d 20 20 20 20 72 65 |scratch1|;. re|
|000025a0| 67 69 73 74 65 72 20 73 | 74 72 75 63 74 20 44 49 |gister s|truct DI|
|000025b0| 43 54 20 2a 73 63 72 61 | 74 63 68 32 3b 0d 0d 20 |CT *scra|tch2;.. |
|000025c0| 20 20 20 73 63 72 61 74 | 63 68 31 20 3d 20 64 69 | scrat|ch1 = di|
|000025d0| 63 74 72 6f 6f 74 3b 0d | 20 20 20 20 77 68 69 6c |ctroot;.| whil|
|000025e0| 65 20 28 73 63 72 61 74 | 63 68 31 29 0d 20 20 20 |e (scrat|ch1). |
|000025f0| 20 7b 0d 09 73 63 72 61 | 74 63 68 32 20 3d 20 73 | {..scra|tch2 = s|
|00002600| 63 72 61 74 63 68 31 20 | 2d 3e 20 6e 65 78 74 3b |cratch1 |-> next;|
|00002610| 0d 09 66 72 65 65 20 28 | 73 63 72 61 74 63 68 31 |..free (|scratch1|
|00002620| 29 3b 0d 09 73 63 72 61 | 74 63 68 31 20 3d 20 73 |);..scra|tch1 = s|
|00002630| 63 72 61 74 63 68 32 3b | 0d 20 20 20 20 7d 0d 20 |cratch2;|. }. |
|00002640| 20 20 20 72 65 74 75 72 | 6e 20 28 30 29 3b 0d 7d | retur|n (0);.}|
|00002650| 0d 2f 2a 0d 20 2a 20 77 | 72 69 74 65 20 61 20 66 |./*. * w|rite a f|
|00002660| 65 65 64 62 61 63 6b 20 | 66 69 6c 65 20 69 66 20 |eedback |file if |
|00002670| 74 68 65 72 65 20 69 73 | 20 61 6e 79 74 68 69 6e |there is| anythin|
|00002680| 67 20 74 6f 20 73 61 76 | 65 20 2d 20 72 65 74 75 |g to sav|e - retu|
|00002690| 72 6e 20 6e 75 6d 62 65 | 72 0d 20 2a 20 75 6e 63 |rn numbe|r. * unc|
|000026a0| 72 61 63 6b 65 64 20 75 | 73 65 72 73 0d 20 2a 2f |racked u|sers. */|
|000026b0| 0d 0d 69 6e 74 0d 46 65 | 65 64 42 61 63 6b 20 28 |..int.Fe|edBack (|
|000026c0| 6c 6f 67 5f 6e 6f 74 64 | 6f 6e 65 29 0d 20 20 20 |log_notd|one). |
|000026d0| 20 69 6e 74 20 6c 6f 67 | 5f 6e 6f 74 64 6f 6e 65 | int log|_notdone|
|000026e0| 3b 0d 7b 0d 20 20 20 20 | 72 65 67 69 73 74 65 72 |;.{. |register|
|000026f0| 20 46 49 4c 45 20 2a 66 | 70 3b 0d 20 20 20 20 73 | FILE *f|p;. s|
|00002700| 74 61 74 69 63 20 63 68 | 61 72 20 66 6d 74 5b 5d |tatic ch|ar fmt[]|
|00002710| 20 3d 20 22 25 73 3a 25 | 73 3a 25 73 3a 25 73 5c | = "%s:%|s:%s:%s\|
|00002720| 6e 22 3b 0d 20 20 20 20 | 72 65 67 69 73 74 65 72 |n";. |register|
|00002730| 20 73 74 72 75 63 74 20 | 55 53 45 52 20 2a 68 65 | struct |USER *he|
|00002740| 61 64 3b 0d 20 20 20 20 | 72 65 67 69 73 74 65 72 |ad;. |register|
|00002750| 20 73 74 72 75 63 74 20 | 55 53 45 52 20 2a 61 72 | struct |USER *ar|
|00002760| 6d 3b 0d 20 20 20 20 69 | 6e 74 20 64 6f 6e 65 3b |m;. i|nt done;|
|00002770| 0d 20 20 20 20 69 6e 74 | 20 6e 6f 74 64 6f 6e 65 |. int| notdone|
|00002780| 3b 0d 20 20 20 20 53 74 | 72 32 35 35 20 62 61 64 |;. St|r255 bad|
|00002790| 66 65 65 64 62 61 63 6b | 20 3d 20 22 20 45 72 72 |feedback| = " Err|
|000027a0| 6f 72 20 6f 70 65 6e 69 | 6e 67 20 46 65 65 64 62 |or openi|ng Feedb|
|000027b0| 61 63 6b 20 46 69 6c 65 | 20 66 6f 72 20 77 72 69 |ack File| for wri|
|000027c0| 74 69 6e 67 22 3b 0d 0d | 20 20 20 20 6e 6f 74 64 |ting";..| notd|
|000027d0| 6f 6e 65 20 3d 20 64 6f | 6e 65 20 3d 20 30 3b 0d |one = do|ne = 0;.|
|000027e0| 0d 20 20 20 20 69 66 20 | 28 76 65 72 62 6f 73 65 |. if |(verbose|
|000027f0| 5f 62 6f 6f 6c 29 0d 20 | 20 20 20 7b 0d 09 4c 6f |_bool). | {..Lo|
|00002800| 67 20 28 22 53 77 65 65 | 70 69 6e 67 20 64 61 74 |g ("Swee|ping dat|
|00002810| 61 20 6c 6f 6f 6b 69 6e | 67 20 66 6f 72 20 66 65 |a lookin|g for fe|
|00002820| 65 64 62 61 63 6b 2e 5c | 6e 22 29 3b 0d 20 20 20 |edback.\|n");. |
|00002830| 20 7d 0d 20 20 20 20 66 | 70 20 3d 20 28 46 49 4c | }. f|p = (FIL|
|00002840| 45 20 2a 29 20 30 3b 0d | 0d 20 20 20 20 66 6f 72 |E *) 0;.|. for|
|00002850| 20 28 68 65 61 64 20 3d | 20 75 73 65 72 72 6f 6f | (head =| userroo|
|00002860| 74 3b 20 68 65 61 64 3b | 20 68 65 61 64 20 3d 20 |t; head;| head = |
|00002870| 68 65 61 64 20 2d 3e 20 | 6e 65 78 74 29 0d 20 20 |head -> |next). |
|00002880| 20 20 7b 0d 09 66 6f 72 | 20 28 61 72 6d 20 3d 20 | {..for| (arm = |
|00002890| 68 65 61 64 3b 20 61 72 | 6d 3b 20 61 72 6d 20 3d |head; ar|m; arm =|
|000028a0| 20 61 72 6d 20 2d 3e 20 | 61 63 72 6f 73 73 29 0d | arm -> |across).|
|000028b0| 09 7b 0d 09 20 20 20 20 | 69 66 20 28 61 72 6d 20 |.{.. |if (arm |
|000028c0| 2d 3e 20 64 6f 6e 65 29 | 0d 09 20 20 20 20 7b 0d |-> done)|.. {.|
|000028d0| 09 09 64 6f 6e 65 2b 2b | 3b 0d 09 09 2f 2a 20 68 |..done++|;.../* h|
|000028e0| 6f 72 72 69 62 6c 65 20 | 6c 69 74 74 6c 65 20 68 |orrible |little h|
|000028f0| 61 63 6b 2c 20 76 69 6c | 65 2c 20 73 69 63 6b 2c |ack, vil|e, sick,|
|00002900| 20 49 20 6c 6f 76 65 20 | 69 74 20 2a 2f 0d 09 09 | I love |it */...|
|00002910| 69 66 20 28 21 66 70 29 | 0d 09 09 7b 0d 09 09 20 |if (!fp)|...{... |
|00002920| 20 20 20 69 66 20 28 21 | 28 66 70 20 3d 20 66 6f | if (!|(fp = fo|
|00002930| 70 65 6e 20 28 66 65 65 | 64 62 61 63 6b 66 69 6c |pen (fee|dbackfil|
|00002940| 65 2c 20 22 77 22 29 29 | 29 0d 09 09 20 20 20 20 |e, "w"))|)... |
|00002950| 7b 0d 09 09 09 50 61 72 | 61 6d 54 65 78 74 28 62 |{....Par|amText(b|
|00002960| 61 64 66 65 65 64 62 61 | 63 6b 2c 20 4e 49 4c 2c |adfeedba|ck, NIL,|
|00002970| 20 4e 49 4c 2c 20 4e 49 | 4c 29 3b 0d 09 09 09 41 | NIL, NI|L);....A|
|00002980| 6c 65 72 74 20 28 54 48 | 45 41 4c 45 52 54 2c 20 |lert (TH|EALERT, |
|00002990| 4e 49 4c 29 3b 0d 09 09 | 09 72 65 74 75 72 6e 20 |NIL);...|.return |
|000029a0| 28 2d 31 29 3b 0d 09 09 | 20 20 20 20 7d 0d 09 09 |(-1);...| }...|
|000029b0| 20 20 20 20 69 66 20 28 | 76 65 72 62 6f 73 65 5f | if (|verbose_|
|000029c0| 62 6f 6f 6c 29 0d 09 09 | 20 20 20 20 7b 0d 09 09 |bool)...| {...|
|000029d0| 09 4c 6f 67 20 28 22 46 | 65 65 64 62 61 63 6b 20 |.Log ("F|eedback |
|000029e0| 66 69 6c 65 20 6f 70 65 | 6e 65 64 20 66 6f 72 20 |file ope|ned for |
|000029f0| 77 72 69 74 69 6e 67 2e | 5c 6e 22 29 3b 0d 09 09 |writing.|\n");...|
|00002a00| 20 20 20 20 7d 0d 09 09 | 7d 0d 09 09 66 70 72 69 | }...|}...fpri|
|00002a10| 6e 74 66 20 28 66 70 2c | 20 66 6d 74 2c 20 66 65 |ntf (fp,| fmt, fe|
|00002a20| 65 64 62 61 63 6b 5f 73 | 74 72 69 6e 67 2c 0d 09 |edback_s|tring,..|
|00002a30| 09 09 20 61 72 6d 20 2d | 3e 20 70 61 73 73 77 64 |.. arm -|> passwd|
|00002a40| 2e 70 77 5f 70 61 73 73 | 77 64 2c 20 22 59 22 2c |.pw_pass|wd, "Y",|
|00002a50| 20 61 72 6d 20 2d 3e 20 | 70 61 73 73 77 64 5f 74 | arm -> |passwd_t|
|00002a60| 78 74 29 3b 0d 09 20 20 | 20 20 7d 20 65 6c 73 65 |xt);.. | } else|
|00002a70| 0d 09 20 20 20 20 7b 0d | 09 09 6e 6f 74 64 6f 6e |.. {.|..notdon|
|00002a80| 65 2b 2b 3b 0d 09 09 69 | 66 20 28 6c 6f 67 5f 6e |e++;...i|f (log_n|
|00002a90| 6f 74 64 6f 6e 65 29 0d | 09 09 7b 0d 09 09 20 20 |otdone).|..{... |
|00002aa0| 20 20 69 66 20 28 21 66 | 70 29 09 2f 2a 20 61 6e | if (!f|p)./* an|
|00002ab0| 64 20 61 67 61 69 6e 20 | 21 21 21 20 68 65 68 65 |d again |!!! hehe|
|00002ac0| 68 65 68 65 68 65 68 65 | 68 20 2a 2f 0d 09 09 20 |hehehehe|h */... |
|00002ad0| 20 20 20 7b 0d 09 09 09 | 69 66 20 28 21 28 66 70 | {....|if (!(fp|
|00002ae0| 20 3d 20 66 6f 70 65 6e | 20 28 66 65 65 64 62 61 | = fopen| (feedba|
|00002af0| 63 6b 66 69 6c 65 2c 20 | 22 77 22 29 29 29 0d 09 |ckfile, |"w")))..|
|00002b00| 09 09 7b 0d 09 09 09 20 | 20 20 20 50 61 72 61 6d |..{.... | Param|
|00002b10| 54 65 78 74 28 62 61 64 | 66 65 65 64 62 61 63 6b |Text(bad|feedback|
|00002b20| 2c 20 4e 49 4c 2c 20 4e | 49 4c 2c 20 4e 49 4c 29 |, NIL, N|IL, NIL)|
|00002b30| 3b 0d 09 09 09 09 41 6c | 65 72 74 20 28 54 48 45 |;.....Al|ert (THE|
|00002b40| 41 4c 45 52 54 2c 20 4e | 49 4c 29 3b 0d 09 09 09 |ALERT, N|IL);....|
|00002b50| 20 20 20 20 72 65 74 75 | 72 6e 20 28 2d 31 29 3b | retu|rn (-1);|
|00002b60| 0d 09 09 09 7d 0d 09 09 | 09 69 66 20 28 76 65 72 |....}...|.if (ver|
|00002b70| 62 6f 73 65 5f 62 6f 6f | 6c 29 0d 09 09 09 7b 0d |bose_boo|l)....{.|
|00002b80| 09 09 09 20 20 20 20 4c | 6f 67 20 28 22 46 65 65 |... L|og ("Fee|
|00002b90| 64 62 61 63 6b 20 66 69 | 6c 65 20 6f 70 65 6e 65 |dback fi|le opene|
|00002ba0| 64 20 66 6f 72 20 77 72 | 69 74 69 6e 67 2e 5c 6e |d for wr|iting.\n|
|00002bb0| 22 29 3b 0d 09 09 09 7d | 0d 09 09 20 20 20 20 7d |");....}|... }|
|00002bc0| 0d 09 09 20 20 20 20 2f | 2a 20 49 20 74 68 69 6e |... /|* I thin|
|00002bd0| 6b 20 49 27 6d 20 67 6f | 69 6e 67 20 73 6c 69 67 |k I'm go|ing slig|
|00002be0| 68 74 6c 79 20 77 61 72 | 70 65 64 20 2a 2f 0d 09 |htly war|ped */..|
|00002bf0| 09 20 20 20 20 66 70 72 | 69 6e 74 66 20 28 66 70 |. fpr|intf (fp|
|00002c00| 2c 20 66 6d 74 2c 20 66 | 65 65 64 62 61 63 6b 5f |, fmt, f|eedback_|
|00002c10| 73 74 72 69 6e 67 2c 0d | 09 09 09 20 20 20 20 20 |string,.|... |
|00002c20| 61 72 6d 20 2d 3e 20 70 | 61 73 73 77 64 2e 70 77 |arm -> p|asswd.pw|
|00002c30| 5f 70 61 73 73 77 64 2c | 20 22 4e 22 2c 20 22 22 |_passwd,| "N", ""|
|00002c40| 29 3b 0d 09 09 7d 0d 09 | 20 20 20 20 7d 0d 0d 09 |);...}..| }...|
|00002c50| 7d 0d 20 20 20 20 7d 0d | 20 20 20 20 69 66 20 28 |}. }.| if (|
|00002c60| 66 70 29 0d 20 20 20 20 | 7b 0d 09 66 63 6c 6f 73 |fp). |{..fclos|
|00002c70| 65 20 28 66 70 29 3b 0d | 09 4c 6f 67 20 28 22 43 |e (fp);.|.Log ("C|
|00002c80| 6c 6f 73 69 6e 67 20 66 | 65 65 64 62 61 63 6b 20 |losing f|eedback |
|00002c90| 66 69 6c 65 2e 5c 6e 22 | 29 3b 0d 20 20 20 20 7d |file.\n"|);. }|
|00002ca0| 0d 20 20 20 20 4c 6f 67 | 20 28 22 46 65 65 64 42 |. Log| ("FeedB|
|00002cb0| 61 63 6b 3a 20 25 64 20 | 75 73 65 72 73 20 64 6f |ack: %d |users do|
|00002cc0| 6e 65 2c 20 25 64 20 75 | 73 65 72 73 20 6c 65 66 |ne, %d u|sers lef|
|00002cd0| 74 20 74 6f 20 63 72 61 | 63 6b 2e 5c 6e 22 2c 20 |t to cra|ck.\n", |
|00002ce0| 64 6f 6e 65 2c 20 6e 6f | 74 64 6f 6e 65 29 3b 0d |done, no|tdone);.|
|00002cf0| 20 20 20 20 72 65 74 75 | 72 6e 20 28 6e 6f 74 64 | retu|rn (notd|
|00002d00| 6f 6e 65 29 3b 0d 7d 0d | 2f 2a 20 74 72 79 20 61 |one);.}.|/* try a|
|00002d10| 20 63 68 61 69 6e 20 6f | 66 20 75 73 65 72 73 20 | chain o|f users |
|00002d20| 77 69 74 68 20 74 68 65 | 20 73 61 6d 65 20 73 61 |with the| same sa|
|00002d30| 6c 74 20 2a 2f 0d 0d 69 | 6e 74 0d 54 72 79 4d 61 |lt */..i|nt.TryMa|
|00002d40| 6e 79 55 73 65 72 73 20 | 28 65 70 74 72 2c 20 67 |nyUsers |(eptr, g|
|00002d50| 75 65 73 73 29 09 2f 2a | 20 72 65 74 75 72 6e 73 |uess)./*| returns|
|00002d60| 20 30 20 69 66 20 61 6c | 6c 20 64 6f 6e 65 20 74 | 0 if al|l done t|
|00002d70| 68 69 73 20 63 68 61 69 | 6e 20 2a 2f 0d 20 20 20 |his chai|n */. |
|00002d80| 20 72 65 67 69 73 74 65 | 72 20 73 74 72 75 63 74 | registe|r struct|
|00002d90| 20 55 53 45 52 20 2a 65 | 70 74 72 3b 0d 20 20 20 | USER *e|ptr;. |
|00002da0| 20 63 68 61 72 20 2a 67 | 75 65 73 73 3b 0d 7b 0d | char *g|uess;.{.|
|00002db0| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 69 6e 74 | regi|ster int|
|00002dc0| 20 72 65 74 76 61 6c 3b | 0d 20 20 20 20 63 68 61 | retval;|. cha|
|00002dd0| 72 20 67 75 65 73 73 5f | 63 72 79 70 74 65 64 5b |r guess_|crypted[|
|00002de0| 53 54 52 49 4e 47 53 49 | 5a 45 5d 3b 0d 0d 20 20 |STRINGSI|ZE];.. |
|00002df0| 20 20 69 66 20 28 65 70 | 74 72 20 2d 3e 20 64 6f | if (ep|tr -> do|
|00002e00| 6e 65 20 26 26 20 21 65 | 70 74 72 20 2d 3e 20 61 |ne && !e|ptr -> a|
|00002e10| 63 72 6f 73 73 29 0d 20 | 20 20 20 7b 0d 09 72 65 |cross). | {..re|
|00002e20| 74 75 72 6e 20 28 30 29 | 3b 0d 20 20 20 20 7d 0d |turn (0)|;. }.|
|00002e30| 20 20 20 20 73 74 72 63 | 70 79 20 28 67 75 65 73 | strc|py (gues|
|00002e40| 73 5f 63 72 79 70 74 65 | 64 2c 20 63 72 79 70 74 |s_crypte|d, crypt|
|00002e50| 20 28 67 75 65 73 73 2c | 20 65 70 74 72 20 2d 3e | (guess,| eptr ->|
|00002e60| 20 70 61 73 73 77 64 2e | 70 77 5f 70 61 73 73 77 | passwd.|pw_passw|
|00002e70| 64 29 29 3b 0d 0d 20 20 | 20 20 72 65 74 76 61 6c |d));.. | retval|
|00002e80| 20 3d 20 30 3b 0d 0d 20 | 20 20 20 77 68 69 6c 65 | = 0;.. | while|
|00002e90| 20 28 65 70 74 72 29 0d | 20 20 20 20 7b 0d 09 69 | (eptr).| {..i|
|00002ea0| 66 20 28 76 65 72 62 6f | 73 65 5f 62 6f 6f 6c 29 |f (verbo|se_bool)|
|00002eb0| 0d 09 7b 0d 09 20 20 20 | 20 4c 6f 67 20 28 22 54 |..{.. | Log ("T|
|00002ec0| 72 79 69 6e 67 20 27 25 | 73 27 20 6f 6e 20 25 73 |rying '%|s' on %s|
|00002ed0| 20 66 72 6f 6d 20 6c 69 | 6e 65 20 25 73 5c 6e 22 | from li|ne %s\n"|
|00002ee0| 2c 0d 09 09 20 67 75 65 | 73 73 2c 0d 09 09 20 65 |,... gue|ss,... e|
|00002ef0| 70 74 72 20 2d 3e 20 70 | 61 73 73 77 64 2e 70 77 |ptr -> p|asswd.pw|
|00002f00| 5f 6e 61 6d 65 2c 0d 09 | 09 20 65 70 74 72 20 2d |_name,..|. eptr -|
|00002f10| 3e 20 66 69 6c 65 6e 61 | 6d 65 29 3b 0d 09 7d 0d |> filena|me);..}.|
|00002f20| 09 69 66 20 28 21 65 70 | 74 72 20 2d 3e 20 64 6f |.if (!ep|tr -> do|
|00002f30| 6e 65 20 26 26 20 21 53 | 54 52 43 4d 50 20 28 67 |ne && !S|TRCMP (g|
|00002f40| 75 65 73 73 5f 63 72 79 | 70 74 65 64 2c 20 65 70 |uess_cry|pted, ep|
|00002f50| 74 72 20 2d 3e 20 70 61 | 73 73 77 64 2e 70 77 5f |tr -> pa|sswd.pw_|
|00002f60| 70 61 73 73 77 64 29 29 | 0d 09 7b 0d 09 20 20 20 |passwd))|..{.. |
|00002f70| 20 50 72 69 6e 74 47 75 | 65 73 73 20 28 65 70 74 | PrintGu|ess (ept|
|00002f80| 72 2c 20 67 75 65 73 73 | 29 3b 0d 09 7d 0d 09 72 |r, guess|);..}..r|
|00002f90| 65 74 76 61 6c 20 2b 3d | 20 28 21 28 65 70 74 72 |etval +=| (!(eptr|
|00002fa0| 20 2d 3e 20 64 6f 6e 65 | 29 29 3b 0d 09 65 70 74 | -> done|));..ept|
|00002fb0| 72 20 3d 20 65 70 74 72 | 20 2d 3e 20 61 63 72 6f |r = eptr| -> acro|
|00002fc0| 73 73 3b 0d 20 20 20 20 | 7d 0d 0d 20 20 20 20 72 |ss;. |}.. r|
|00002fd0| 65 74 75 72 6e 20 28 72 | 65 74 76 61 6c 29 3b 0d |eturn (r|etval);.|
|00002fe0| 7d 0d 2f 2a 20 74 72 79 | 20 61 20 77 6f 72 64 20 |}./* try| a word |
|00002ff0| 6f 6e 20 61 6e 20 69 6e | 64 69 76 69 64 75 61 6c |on an in|dividual|
|00003000| 20 2a 2f 0d 0d 69 6e 74 | 0d 54 72 79 4f 6e 65 55 | */..int|.TryOneU|
|00003010| 73 65 72 20 28 65 70 74 | 72 2c 20 67 75 65 73 73 |ser (ept|r, guess|
|00003020| 29 09 2f 2a 20 72 65 74 | 75 72 6e 73 20 6e 6f 6e |)./* ret|urns non|
|00003030| 2d 6e 75 6c 6c 20 6f 6e | 20 67 75 65 73 73 65 64 |-null on| guessed|
|00003040| 20 75 73 65 72 20 2a 2f | 0d 20 20 20 20 72 65 67 | user */|. reg|
|00003050| 69 73 74 65 72 20 73 74 | 72 75 63 74 20 55 53 45 |ister st|ruct USE|
|00003060| 52 20 2a 65 70 74 72 3b | 0d 20 20 20 20 72 65 67 |R *eptr;|. reg|
|00003070| 69 73 74 65 72 20 63 68 | 61 72 20 2a 67 75 65 73 |ister ch|ar *gues|
|00003080| 73 3b 0d 7b 0d 20 20 20 | 20 69 66 20 28 21 67 75 |s;.{. | if (!gu|
|00003090| 65 73 73 20 7c 7c 20 21 | 2a 67 75 65 73 73 20 7c |ess || !|*guess ||
|000030a0| 7c 20 65 70 74 72 20 2d | 3e 20 64 6f 6e 65 29 0d || eptr -|> done).|
|000030b0| 20 20 20 20 7b 0d 09 72 | 65 74 75 72 6e 20 28 30 | {..r|eturn (0|
|000030c0| 29 3b 0d 20 20 20 20 7d | 0d 20 20 20 20 69 66 20 |);. }|. if |
|000030d0| 28 76 65 72 62 6f 73 65 | 5f 62 6f 6f 6c 29 0d 20 |(verbose|_bool). |
|000030e0| 20 20 20 7b 0d 09 4c 6f | 67 20 28 22 54 72 79 69 | {..Lo|g ("Tryi|
|000030f0| 6e 67 20 27 25 73 27 20 | 6f 6e 20 25 73 20 66 72 |ng '%s' |on %s fr|
|00003100| 6f 6d 20 25 73 5c 6e 22 | 2c 0d 09 20 20 20 20 20 |om %s\n"|,.. |
|00003110| 67 75 65 73 73 2c 0d 09 | 20 20 20 20 20 65 70 74 |guess,..| ept|
|00003120| 72 20 2d 3e 20 70 61 73 | 73 77 64 2e 70 77 5f 6e |r -> pas|swd.pw_n|
|00003130| 61 6d 65 2c 0d 09 20 20 | 20 20 20 65 70 74 72 20 |ame,.. | eptr |
|00003140| 2d 3e 20 66 69 6c 65 6e | 61 6d 65 29 3b 0d 20 20 |-> filen|ame);. |
|00003150| 20 20 7d 0d 20 20 20 20 | 69 66 20 28 73 74 72 63 | }. |if (strc|
|00003160| 6d 70 20 28 63 72 79 70 | 74 20 28 67 75 65 73 73 |mp (cryp|t (guess|
|00003170| 2c 20 65 70 74 72 20 2d | 3e 20 70 61 73 73 77 64 |, eptr -|> passwd|
|00003180| 2e 70 77 5f 70 61 73 73 | 77 64 29 2c 0d 09 09 65 |.pw_pass|wd),...e|
|00003190| 70 74 72 20 2d 3e 20 70 | 61 73 73 77 64 2e 70 77 |ptr -> p|asswd.pw|
|000031a0| 5f 70 61 73 73 77 64 29 | 29 0d 20 20 20 20 7b 0d |_passwd)|). {.|
|000031b0| 09 72 65 74 75 72 6e 20 | 28 30 29 3b 0d 20 20 20 |.return |(0);. |
|000031c0| 20 7d 0d 20 20 20 20 50 | 72 69 6e 74 47 75 65 73 | }. P|rintGues|
|000031d0| 73 20 28 65 70 74 72 2c | 20 67 75 65 73 73 29 3b |s (eptr,| guess);|
|000031e0| 0d 0d 20 20 20 20 72 65 | 74 75 72 6e 20 28 31 29 |.. re|turn (1)|
|000031f0| 3b 0d 7d 0d 2f 2a 20 66 | 72 6f 6e 74 65 6e 64 20 |;.}./* f|rontend |
|00003200| 74 6f 20 54 72 79 4f 6e | 65 55 73 65 72 28 29 20 |to TryOn|eUser() |
|00003210| 74 6f 20 73 61 76 65 20 | 68 61 73 73 6c 65 20 2a |to save |hassle *|
|00003220| 2f 0d 0d 69 6e 74 0d 57 | 6f 72 64 54 72 79 20 28 |/..int.W|ordTry (|
|00003230| 65 6e 74 72 79 5f 70 74 | 72 2c 20 67 75 65 73 73 |entry_pt|r, guess|
|00003240| 29 0d 20 20 20 20 72 65 | 67 69 73 74 65 72 20 73 |). re|gister s|
|00003250| 74 72 75 63 74 20 55 53 | 45 52 20 2a 65 6e 74 72 |truct US|ER *entr|
|00003260| 79 5f 70 74 72 3b 0d 20 | 20 20 20 72 65 67 69 73 |y_ptr;. | regis|
|00003270| 74 65 72 20 63 68 61 72 | 20 2a 67 75 65 73 73 3b |ter char| *guess;|
|00003280| 0d 7b 0d 20 20 20 20 73 | 74 72 75 63 74 20 52 55 |.{. s|truct RU|
|00003290| 4c 45 20 2a 72 75 6c 65 | 70 74 72 3b 0d 20 20 20 |LE *rule|ptr;. |
|000032a0| 20 72 65 67 69 73 74 65 | 72 20 63 68 61 72 20 2a | registe|r char *|
|000032b0| 6d 61 6e 67 6c 65 3b 0d | 0d 20 20 20 20 69 66 20 |mangle;.|. if |
|000032c0| 28 21 67 75 65 73 73 5b | 30 5d 20 7c 7c 20 21 67 |(!guess[|0] || !g|
|000032d0| 75 65 73 73 5b 31 5d 29 | 0d 20 20 20 20 7b 0d 09 |uess[1])|. {..|
|000032e0| 72 65 74 75 72 6e 20 28 | 30 29 3b 0d 20 20 20 20 |return (|0);. |
|000032f0| 7d 0d 20 20 20 20 66 6f | 72 20 28 72 75 6c 65 70 |}. fo|r (rulep|
|00003300| 74 72 20 3d 20 67 65 63 | 6f 73 72 6f 6f 74 3b 20 |tr = gec|osroot; |
|00003310| 72 75 6c 65 70 74 72 3b | 20 72 75 6c 65 70 74 72 |ruleptr;| ruleptr|
|00003320| 20 3d 20 72 75 6c 65 70 | 74 72 20 2d 3e 20 6e 65 | = rulep|tr -> ne|
|00003330| 78 74 29 0d 20 20 20 20 | 7b 0d 09 69 66 20 28 6d |xt). |{..if (m|
|00003340| 61 6e 67 6c 65 20 3d 20 | 4d 61 6e 67 6c 65 20 28 |angle = |Mangle (|
|00003350| 67 75 65 73 73 2c 20 72 | 75 6c 65 70 74 72 20 2d |guess, r|uleptr -|
|00003360| 3e 20 72 75 6c 65 29 29 | 0d 09 7b 0d 09 20 20 20 |> rule))|..{.. |
|00003370| 20 69 66 20 28 54 72 79 | 4f 6e 65 55 73 65 72 20 | if (Try|OneUser |
|00003380| 28 65 6e 74 72 79 5f 70 | 74 72 2c 20 6d 61 6e 67 |(entry_p|tr, mang|
|00003390| 6c 65 29 29 0d 09 20 20 | 20 20 7b 0d 09 09 72 65 |le)).. | {...re|
|000033a0| 74 75 72 6e 20 28 31 29 | 3b 0d 09 20 20 20 20 7d |turn (1)|;.. }|
|000033b0| 0d 09 7d 0d 20 20 20 20 | 7d 0d 20 20 20 20 72 65 |..}. |}. re|
|000033c0| 74 75 72 6e 20 28 30 29 | 3b 0d 7d 0d 2f 2a 20 53 |turn (0)|;.}./* S|
|000033d0| 70 65 63 69 61 6c 20 6d | 61 6e 69 70 75 6c 61 74 |pecial m|anipulat|
|000033e0| 69 6f 6e 73 20 66 6f 72 | 20 74 68 65 20 47 45 43 |ions for| the GEC|
|000033f0| 4f 53 20 66 69 65 6c 64 | 20 61 6e 64 20 64 6f 74 |OS field| and dot|
|00003400| 66 69 6c 65 73 20 2a 2f | 0d 0d 69 6e 74 0d 50 61 |files */|..int.Pa|
|00003410| 72 73 65 42 75 66 66 65 | 72 20 28 65 6e 74 72 79 |rseBuffe|r (entry|
|00003420| 5f 70 74 72 2c 20 62 75 | 66 66 65 72 2c 20 61 64 |_ptr, bu|ffer, ad|
|00003430| 76 61 6e 63 65 64 29 0d | 20 20 20 20 72 65 67 69 |vanced).| regi|
|00003440| 73 74 65 72 20 73 74 72 | 75 63 74 20 55 53 45 52 |ster str|uct USER|
|00003450| 20 2a 65 6e 74 72 79 5f | 70 74 72 3b 0d 20 20 20 | *entry_|ptr;. |
|00003460| 20 63 68 61 72 20 2a 62 | 75 66 66 65 72 3b 0d 20 | char *b|uffer;. |
|00003470| 20 20 20 69 6e 74 20 61 | 64 76 61 6e 63 65 64 3b | int a|dvanced;|
|00003480| 0d 7b 0d 20 20 20 20 69 | 6e 74 20 77 6f 72 64 63 |.{. i|nt wordc|
|00003490| 6f 75 6e 74 3b 0d 20 20 | 20 20 72 65 67 69 73 74 |ount;. | regist|
|000034a0| 65 72 20 69 6e 74 20 69 | 3b 0d 20 20 20 20 72 65 |er int i|;. re|
|000034b0| 67 69 73 74 65 72 20 69 | 6e 74 20 6a 3b 0d 20 20 |gister i|nt j;. |
|000034c0| 20 20 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 | regist|er char |
|000034d0| 2a 70 74 72 3b 0d 20 20 | 20 20 63 68 61 72 20 6a |*ptr;. | char j|
|000034e0| 75 6e 6b 5b 53 54 52 49 | 4e 47 53 49 5a 45 5d 3b |unk[STRI|NGSIZE];|
|000034f0| 0d 20 20 20 20 63 68 61 | 72 20 2a 77 6f 72 64 73 |. cha|r *words|
|00003500| 5b 57 4f 52 44 53 54 41 | 43 4b 53 49 5a 45 5d 3b |[WORDSTA|CKSIZE];|
|00003510| 0d 0d 20 20 20 20 2f 2a | 20 7a 61 70 20 61 6c 6c |.. /*| zap all|
|00003520| 20 70 75 6e 63 74 75 61 | 74 69 6f 6e 20 2a 2f 0d | punctua|tion */.|
|00003530| 20 20 20 20 66 6f 72 20 | 28 70 74 72 20 3d 20 62 | for |(ptr = b|
|00003540| 75 66 66 65 72 3b 20 2a | 70 74 72 3b 20 70 74 72 |uffer; *|ptr; ptr|
|00003550| 2b 2b 29 0d 20 20 20 20 | 7b 0d 09 69 66 20 28 69 |++). |{..if (i|
|00003560| 73 70 75 6e 63 74 20 28 | 2a 70 74 72 29 20 7c 7c |spunct (|*ptr) |||
|00003570| 20 69 73 73 70 61 63 65 | 20 28 2a 70 74 72 29 29 | isspace| (*ptr))|
|00003580| 0d 09 7b 0d 09 20 20 20 | 20 2a 70 74 72 20 3d 20 |..{.. | *ptr = |
|00003590| 27 20 27 3b 0d 09 7d 0d | 20 20 20 20 7d 0d 0d 20 |' ';..}.| }.. |
|000035a0| 20 20 20 2f 2a 20 62 72 | 65 61 6b 20 75 70 20 61 | /* br|eak up a|
|000035b0| 6c 6c 20 69 6e 64 69 76 | 69 64 75 61 6c 20 77 6f |ll indiv|idual wo|
|000035c0| 72 64 73 20 2a 2f 0d 20 | 20 20 20 77 6f 72 64 63 |rds */. | wordc|
|000035d0| 6f 75 6e 74 20 3d 20 30 | 3b 0d 20 20 20 20 70 74 |ount = 0|;. pt|
|000035e0| 72 20 3d 20 62 75 66 66 | 65 72 3b 0d 20 20 20 20 |r = buff|er;. |
|000035f0| 77 68 69 6c 65 20 28 2a | 70 74 72 29 0d 20 20 20 |while (*|ptr). |
|00003600| 20 7b 0d 09 77 68 69 6c | 65 20 28 2a 70 74 72 20 | {..whil|e (*ptr |
|00003610| 26 26 20 69 73 73 70 61 | 63 65 20 28 2a 70 74 72 |&& isspa|ce (*ptr|
|00003620| 29 29 0d 09 7b 0d 09 20 | 20 20 20 70 74 72 2b 2b |))..{.. | ptr++|
|00003630| 3b 0d 09 7d 0d 0d 09 69 | 66 20 28 2a 70 74 72 29 |;..}...i|f (*ptr)|
|00003640| 0d 09 7b 0d 09 20 20 20 | 20 77 6f 72 64 73 5b 77 |..{.. | words[w|
|00003650| 6f 72 64 63 6f 75 6e 74 | 2b 2b 5d 20 3d 20 70 74 |ordcount|++] = pt|
|00003660| 72 3b 0d 09 20 20 20 20 | 69 66 20 28 77 6f 72 64 |r;.. |if (word|
|00003670| 63 6f 75 6e 74 20 3e 3d | 20 57 4f 52 44 53 54 41 |count >=| WORDSTA|
|00003680| 43 4b 53 49 5a 45 29 0d | 09 20 20 20 20 7b 0d 09 |CKSIZE).|. {..|
|00003690| 09 4c 6f 67 20 28 22 50 | 61 72 73 65 42 75 66 66 |.Log ("P|arseBuff|
|000036a0| 65 72 3a 20 41 62 6f 72 | 74 3a 20 53 74 61 63 6b |er: Abor|t: Stack|
|000036b0| 20 46 75 6c 6c 20 21 5c | 6e 22 29 3b 0d 09 09 72 | Full !\|n");...r|
|000036c0| 65 74 75 72 6e 20 28 30 | 29 3b 0d 09 20 20 20 20 |eturn (0|);.. |
|000036d0| 7d 0d 09 7d 0d 09 77 68 | 69 6c 65 20 28 2a 70 74 |}..}..wh|ile (*pt|
|000036e0| 72 20 26 26 20 21 69 73 | 73 70 61 63 65 20 28 2a |r && !is|space (*|
|000036f0| 70 74 72 29 29 0d 09 7b | 0d 09 20 20 20 20 70 74 |ptr))..{|.. pt|
|00003700| 72 2b 2b 3b 0d 09 7d 0d | 0d 09 69 66 20 28 2a 70 |r++;..}.|..if (*p|
|00003710| 74 72 29 0d 09 7b 0d 09 | 20 20 20 20 2a 28 70 74 |tr)..{..| *(pt|
|00003720| 72 2b 2b 29 20 3d 20 27 | 5c 30 27 3b 0d 09 7d 0d |r++) = '|\0';..}.|
|00003730| 20 20 20 20 7d 0d 0d 20 | 20 20 20 77 6f 72 64 73 | }.. | words|
|00003740| 5b 77 6f 72 64 63 6f 75 | 6e 74 5d 20 3d 20 28 63 |[wordcou|nt] = (c|
|00003750| 68 61 72 20 2a 29 20 30 | 3b 0d 0d 20 20 20 20 2f |har *) 0|;.. /|
|00003760| 2a 20 74 72 79 20 61 6c | 6c 20 74 68 65 20 77 6f |* try al|l the wo|
|00003770| 72 64 73 20 69 6e 64 69 | 76 69 64 75 61 6c 6c 79 |rds indi|vidually|
|00003780| 20 2a 2f 0d 20 20 20 20 | 69 66 20 28 76 65 72 62 | */. |if (verb|
|00003790| 6f 73 65 5f 62 6f 6f 6c | 29 0d 20 20 20 20 7b 0d |ose_bool|). {.|
|000037a0| 09 4c 6f 67 20 28 22 54 | 72 79 69 6e 67 20 69 6e |.Log ("T|rying in|
|000037b0| 64 69 76 69 64 75 61 6c | 20 77 6f 72 64 73 5c 6e |dividual| words\n|
|000037c0| 22 29 3b 0d 20 20 20 20 | 7d 0d 20 20 20 20 66 6f |");. |}. fo|
|000037d0| 72 20 28 69 20 3d 20 30 | 3b 20 69 20 3c 20 77 6f |r (i = 0|; i < wo|
|000037e0| 72 64 63 6f 75 6e 74 3b | 20 69 2b 2b 29 0d 20 20 |rdcount;| i++). |
|000037f0| 20 20 7b 0d 09 69 66 20 | 28 57 6f 72 64 54 72 79 | {..if |(WordTry|
|00003800| 20 28 65 6e 74 72 79 5f | 70 74 72 2c 20 77 6f 72 | (entry_|ptr, wor|
|00003810| 64 73 5b 69 5d 29 29 0d | 09 7b 0d 09 20 20 20 20 |ds[i])).|.{.. |
|00003820| 72 65 74 75 72 6e 20 28 | 31 29 3b 0d 09 7d 0d 20 |return (|1);..}. |
|00003830| 20 20 20 7d 0d 0d 20 20 | 20 20 69 66 20 28 21 61 | }.. | if (!a|
|00003840| 64 76 61 6e 63 65 64 29 | 0d 20 20 20 20 7b 0d 09 |dvanced)|. {..|
|00003850| 72 65 74 75 72 6e 20 28 | 30 29 3b 0d 20 20 20 20 |return (|0);. |
|00003860| 7d 0d 20 20 20 20 2f 2a | 20 74 72 79 20 70 61 69 |}. /*| try pai|
|00003870| 72 69 6e 67 73 20 6f 66 | 20 77 6f 72 64 73 20 2a |rings of| words *|
|00003880| 2f 0d 20 20 20 20 69 66 | 20 28 76 65 72 62 6f 73 |/. if| (verbos|
|00003890| 65 5f 62 6f 6f 6c 29 0d | 20 20 20 20 7b 0d 09 4c |e_bool).| {..L|
|000038a0| 6f 67 20 28 22 54 72 79 | 69 6e 67 20 70 61 69 72 |og ("Try|ing pair|
|000038b0| 65 64 20 77 6f 72 64 73 | 5c 6e 22 29 3b 0d 20 20 |ed words|\n");. |
|000038c0| 20 20 7d 0d 20 20 20 20 | 66 6f 72 20 28 6a 20 3d | }. |for (j =|
|000038d0| 20 31 3b 20 6a 20 3c 20 | 77 6f 72 64 63 6f 75 6e | 1; j < |wordcoun|
|000038e0| 74 3b 20 6a 2b 2b 29 0d | 20 20 20 20 7b 0d 09 66 |t; j++).| {..f|
|000038f0| 6f 72 20 28 69 20 3d 20 | 30 3b 20 69 20 3c 20 6a |or (i = |0; i < j|
|00003900| 3b 20 69 2b 2b 29 0d 09 | 7b 0d 09 20 20 20 20 2f |; i++)..|{.. /|
|00003910| 2a 20 53 6b 69 70 20 69 | 6e 69 74 69 61 6c 73 20 |* Skip i|nitials |
|00003920| 66 6f 72 20 6e 65 78 74 | 20 70 61 73 73 20 2a 2f |for next| pass */|
|00003930| 0d 09 20 20 20 20 69 66 | 20 28 21 77 6f 72 64 73 |.. if| (!words|
|00003940| 5b 69 5d 5b 31 5d 20 7c | 7c 20 21 77 6f 72 64 73 |[i][1] ||| !words|
|00003950| 5b 6a 5d 5b 31 5d 29 0d | 09 20 20 20 20 7b 0d 09 |[j][1]).|. {..|
|00003960| 09 63 6f 6e 74 69 6e 75 | 65 3b 0d 09 20 20 20 20 |.continu|e;.. |
|00003970| 7d 0d 09 20 20 20 20 73 | 74 72 63 70 79 20 28 6a |}.. s|trcpy (j|
|00003980| 75 6e 6b 2c 20 77 6f 72 | 64 73 5b 69 5d 29 3b 0d |unk, wor|ds[i]);.|
|00003990| 09 20 20 20 20 73 74 72 | 63 61 74 20 28 6a 75 6e |. str|cat (jun|
|000039a0| 6b 2c 20 77 6f 72 64 73 | 5b 6a 5d 29 3b 0d 0d 09 |k, words|[j]);...|
|000039b0| 20 20 20 20 69 66 20 28 | 57 6f 72 64 54 72 79 20 | if (|WordTry |
|000039c0| 28 65 6e 74 72 79 5f 70 | 74 72 2c 20 6a 75 6e 6b |(entry_p|tr, junk|
|000039d0| 29 29 0d 09 20 20 20 20 | 7b 0d 09 09 72 65 74 75 |)).. |{...retu|
|000039e0| 72 6e 20 28 31 29 3b 0d | 09 20 20 20 20 7d 0d 09 |rn (1);.|. }..|
|000039f0| 20 20 20 20 73 74 72 63 | 70 79 20 28 6a 75 6e 6b | strc|py (junk|
|00003a00| 2c 20 77 6f 72 64 73 5b | 6a 5d 29 3b 0d 09 20 20 |, words[|j]);.. |
|00003a10| 20 20 73 74 72 63 61 74 | 20 28 6a 75 6e 6b 2c 20 | strcat| (junk, |
|00003a20| 77 6f 72 64 73 5b 69 5d | 29 3b 0d 0d 09 20 20 20 |words[i]|);... |
|00003a30| 20 69 66 20 28 57 6f 72 | 64 54 72 79 20 28 65 6e | if (Wor|dTry (en|
|00003a40| 74 72 79 5f 70 74 72 2c | 20 6a 75 6e 6b 29 29 0d |try_ptr,| junk)).|
|00003a50| 09 20 20 20 20 7b 0d 09 | 09 72 65 74 75 72 6e 20 |. {..|.return |
|00003a60| 28 31 29 3b 0d 09 20 20 | 20 20 7d 0d 09 7d 0d 20 |(1);.. | }..}. |
|00003a70| 20 20 20 7d 0d 0d 20 20 | 20 20 2f 2a 20 74 72 79 | }.. | /* try|
|00003a80| 20 69 6e 69 74 69 61 6c | 73 20 2b 20 77 6f 72 64 | initial|s + word|
|00003a90| 73 20 2a 2f 0d 20 20 20 | 20 69 66 20 28 76 65 72 |s */. | if (ver|
|00003aa0| 62 6f 73 65 5f 62 6f 6f | 6c 29 0d 20 20 20 20 7b |bose_boo|l). {|
|00003ab0| 0d 09 4c 6f 67 20 28 22 | 54 72 79 69 6e 67 20 69 |..Log ("|Trying i|
|00003ac0| 6e 69 74 69 61 6c 27 65 | 64 20 77 6f 72 64 73 5c |nitial'e|d words\|
|00003ad0| 6e 22 29 3b 0d 20 20 20 | 20 7d 0d 20 20 20 20 66 |n");. | }. f|
|00003ae0| 6f 72 20 28 6a 20 3d 20 | 31 3b 20 6a 20 3c 20 77 |or (j = |1; j < w|
|00003af0| 6f 72 64 63 6f 75 6e 74 | 3b 20 6a 2b 2b 29 0d 20 |ordcount|; j++). |
|00003b00| 20 20 20 7b 0d 09 66 6f | 72 20 28 69 20 3d 20 30 | {..fo|r (i = 0|
|00003b10| 3b 20 69 20 3c 20 6a 3b | 20 69 2b 2b 29 0d 09 7b |; i < j;| i++)..{|
|00003b20| 0d 09 20 20 20 20 6a 75 | 6e 6b 5b 30 5d 20 3d 20 |.. ju|nk[0] = |
|00003b30| 77 6f 72 64 73 5b 69 5d | 5b 30 5d 3b 0d 09 20 20 |words[i]|[0];.. |
|00003b40| 20 20 6a 75 6e 6b 5b 30 | 5d 20 3d 20 43 52 41 43 | junk[0|] = CRAC|
|00003b50| 4b 5f 54 4f 55 50 50 45 | 52 20 28 6a 75 6e 6b 5b |K_TOUPPE|R (junk[|
|00003b60| 30 5d 29 3b 0d 09 20 20 | 20 20 73 74 72 63 70 79 |0]);.. | strcpy|
|00003b70| 20 28 6a 75 6e 6b 20 2b | 20 31 2c 20 77 6f 72 64 | (junk +| 1, word|
|00003b80| 73 5b 6a 5d 29 3b 0d 09 | 20 20 20 20 69 66 20 28 |s[j]);..| if (|
|00003b90| 57 6f 72 64 54 72 79 20 | 28 65 6e 74 72 79 5f 70 |WordTry |(entry_p|
|00003ba0| 74 72 2c 20 6a 75 6e 6b | 29 29 0d 09 20 20 20 20 |tr, junk|)).. |
|00003bb0| 7b 0d 09 09 72 65 74 75 | 72 6e 20 28 31 29 3b 0d |{...retu|rn (1);.|
|00003bc0| 09 20 20 20 20 7d 0d 09 | 7d 0d 20 20 20 20 7d 0d |. }..|}. }.|
|00003bd0| 0d 20 20 20 20 72 65 74 | 75 72 6e 20 28 30 29 3b |. ret|urn (0);|
|00003be0| 0d 7d 0d 2f 2a 20 72 75 | 6e 20 6f 76 65 72 20 70 |.}./* ru|n over p|
|00003bf0| 61 73 73 77 6f 72 64 20 | 65 6e 74 72 69 65 73 20 |assword |entries |
|00003c00| 6c 6f 6f 6b 69 6e 67 20 | 66 6f 72 20 70 61 73 73 |looking |for pass|
|00003c10| 77 6f 72 64 73 20 2a 2f | 0d 0d 76 6f 69 64 0d 50 |words */|..void.P|
|00003c20| 61 73 73 31 20 28 29 0d | 7b 0d 20 20 20 20 73 74 |ass1 ().|{. st|
|00003c30| 72 75 63 74 20 55 53 45 | 52 20 2a 68 65 61 64 3b |ruct USE|R *head;|
|00003c40| 0d 20 20 20 20 63 68 61 | 72 20 6a 75 6e 6b 5b 44 |. cha|r junk[D|
|00003c50| 4f 54 46 49 4c 45 53 49 | 5a 45 5d 3b 0d 20 20 20 |OTFILESI|ZE];. |
|00003c60| 20 72 65 67 69 73 74 65 | 72 20 73 74 72 75 63 74 | registe|r struct|
|00003c70| 20 55 53 45 52 20 2a 74 | 68 69 73 3b 0d 0d 23 69 | USER *t|his;..#i|
|00003c80| 66 64 65 66 20 43 52 41 | 43 4b 5f 44 4f 54 46 49 |fdef CRA|CK_DOTFI|
|00003c90| 4c 45 53 0d 23 69 66 64 | 65 66 20 43 52 41 43 4b |LES.#ifd|ef CRACK|
|00003ca0| 5f 44 4f 54 53 41 4e 45 | 0d 23 69 6e 63 6c 75 64 |_DOTSANE|.#includ|
|00003cb0| 65 20 3c 73 79 73 2f 74 | 79 70 65 73 2e 68 3e 0d |e <sys/t|ypes.h>.|
|00003cc0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 73 74 |#include| <sys/st|
|00003cd0| 61 74 2e 68 3e 0d 20 20 | 20 20 73 74 72 75 63 74 |at.h>. | struct|
|00003ce0| 20 73 74 61 74 20 73 62 | 3b 0d 23 65 6e 64 69 66 | stat sb|;.#endif|
|00003cf0| 09 2f 2a 20 43 52 41 43 | 4b 5f 44 4f 54 53 41 4e |./* CRAC|K_DOTSAN|
|00003d00| 45 20 2a 2f 0d 20 20 20 | 20 69 6e 74 20 69 3b 0d |E */. | int i;.|
|00003d10| 20 20 20 20 69 6e 74 20 | 6a 3b 0d 20 20 20 20 46 | int |j;. F|
|00003d20| 49 4c 45 20 2a 66 70 3b | 0d 20 20 20 20 63 68 61 |ILE *fp;|. cha|
|00003d30| 72 20 66 69 6c 65 6e 61 | 6d 65 5b 53 54 52 49 4e |r filena|me[STRIN|
|00003d40| 47 53 49 5a 45 5d 3b 0d | 20 20 20 20 73 74 61 74 |GSIZE];.| stat|
|00003d50| 69 63 20 63 68 61 72 20 | 2a 64 6f 74 66 69 6c 65 |ic char |*dotfile|
|00003d60| 73 5b 5d 20 3d 0d 20 20 | 20 20 7b 0d 09 22 2e 70 |s[] =. | {..".p|
|00003d70| 6c 61 6e 22 2c 0d 09 22 | 2e 70 72 6f 6a 65 63 74 |lan",.."|.project|
|00003d80| 22 2c 0d 09 22 2e 73 69 | 67 6e 61 74 75 72 65 22 |",..".si|gnature"|
|00003d90| 2c 0d 09 28 63 68 61 72 | 20 2a 29 20 30 0d 20 20 |,..(char| *) 0. |
|00003da0| 20 20 7d 3b 0d 23 65 6e | 64 69 66 09 2f 2a 20 43 | };.#en|dif./* C|
|00003db0| 52 41 43 4b 5f 44 4f 54 | 46 49 4c 45 53 20 2a 2f |RACK_DOT|FILES */|
|00003dc0| 0d 0d 09 46 6f 72 65 43 | 6f 6c 6f 72 28 63 79 61 |...ForeC|olor(cya|
|00003dd0| 6e 43 6f 6c 6f 72 29 3b | 0d 20 20 20 20 4c 6f 67 |nColor);|. Log|
|00003de0| 20 28 22 53 74 61 72 74 | 69 6e 67 20 70 61 73 73 | ("Start|ing pass|
|00003df0| 20 31 20 2d 20 70 61 73 | 73 77 6f 72 64 20 69 6e | 1 - pas|sword in|
|00003e00| 66 6f 72 6d 61 74 69 6f | 6e 5c 6e 22 29 3b 0d 0d |formatio|n\n");..|
|00003e10| 20 20 20 20 66 6f 72 20 | 28 68 65 61 64 20 3d 20 | for |(head = |
|00003e20| 75 73 65 72 72 6f 6f 74 | 3b 20 68 65 61 64 3b 20 |userroot|; head; |
|00003e30| 68 65 61 64 20 3d 20 68 | 65 61 64 20 2d 3e 20 6e |head = h|ead -> n|
|00003e40| 65 78 74 29 0d 20 20 20 | 20 7b 0d 09 66 6f 72 20 |ext). | {..for |
|00003e50| 28 74 68 69 73 20 3d 20 | 68 65 61 64 3b 20 74 68 |(this = |head; th|
|00003e60| 69 73 3b 20 74 68 69 73 | 20 3d 20 74 68 69 73 20 |is; this| = this |
|00003e70| 2d 3e 20 61 63 72 6f 73 | 73 29 0d 09 7b 0d 09 20 |-> acros|s)..{.. |
|00003e80| 20 20 20 73 74 72 63 70 | 79 20 28 6a 75 6e 6b 2c | strcp|y (junk,|
|00003e90| 20 74 68 69 73 20 2d 3e | 20 70 61 73 73 77 64 2e | this ->| passwd.|
|00003ea0| 70 77 5f 67 65 63 6f 73 | 29 3b 0d 0d 09 20 20 20 |pw_gecos|);... |
|00003eb0| 20 69 66 20 28 57 6f 72 | 64 54 72 79 20 28 74 68 | if (Wor|dTry (th|
|00003ec0| 69 73 2c 20 74 68 69 73 | 20 2d 3e 20 70 61 73 73 |is, this| -> pass|
|00003ed0| 77 64 2e 70 77 5f 6e 61 | 6d 65 29 20 7c 7c 0d 09 |wd.pw_na|me) ||..|
|00003ee0| 09 50 61 72 73 65 42 75 | 66 66 65 72 20 28 74 68 |.ParseBu|ffer (th|
|00003ef0| 69 73 2c 20 6a 75 6e 6b | 2c 20 31 29 29 0d 09 20 |is, junk|, 1)).. |
|00003f00| 20 20 20 7b 0d 09 09 63 | 6f 6e 74 69 6e 75 65 3b | {...c|ontinue;|
|00003f10| 0d 09 20 20 20 20 7d 0d | 23 69 66 64 65 66 20 43 |.. }.|#ifdef C|
|00003f20| 52 41 43 4b 5f 44 4f 54 | 46 49 4c 45 53 0d 09 20 |RACK_DOT|FILES.. |
|00003f30| 20 20 20 66 6f 72 20 28 | 69 20 3d 20 30 3b 20 64 | for (|i = 0; d|
|00003f40| 6f 74 66 69 6c 65 73 5b | 69 5d 3b 20 69 2b 2b 29 |otfiles[|i]; i++)|
|00003f50| 0d 09 20 20 20 20 7b 0d | 09 09 73 70 72 69 6e 74 |.. {.|..sprint|
|00003f60| 66 20 28 66 69 6c 65 6e | 61 6d 65 2c 20 22 25 73 |f (filen|ame, "%s|
|00003f70| 2f 25 73 22 2c 20 74 68 | 69 73 20 2d 3e 20 70 61 |/%s", th|is -> pa|
|00003f80| 73 73 77 64 2e 70 77 5f | 64 69 72 2c 20 64 6f 74 |sswd.pw_|dir, dot|
|00003f90| 66 69 6c 65 73 5b 69 5d | 29 3b 0d 23 69 66 64 65 |files[i]|);.#ifde|
|00003fa0| 66 20 43 52 41 43 4b 5f | 44 4f 54 53 41 4e 45 0d |f CRACK_|DOTSANE.|
|00003fb0| 09 09 69 66 20 28 73 74 | 61 74 20 28 66 69 6c 65 |..if (st|at (file|
|00003fc0| 6e 61 6d 65 2c 20 26 73 | 62 29 20 3c 20 30 29 0d |name, &s|b) < 0).|
|00003fd0| 09 09 7b 0d 09 09 20 20 | 20 20 63 6f 6e 74 69 6e |..{... | contin|
|00003fe0| 75 65 3b 0d 09 09 7d 0d | 09 09 69 66 20 28 28 21 |ue;...}.|..if ((!|
|00003ff0| 28 73 62 2e 73 74 5f 6d | 6f 64 65 20 26 20 53 5f |(sb.st_m|ode & S_|
|00004000| 49 46 52 45 47 29 29 0d | 23 69 66 64 65 66 20 53 |IFREG)).|#ifdef S|
|00004010| 5f 49 46 53 4f 43 4b 0d | 09 09 20 20 20 20 7c 7c |_IFSOCK.|.. |||
|00004020| 20 28 28 73 62 2e 73 74 | 5f 6d 6f 64 65 20 26 20 | ((sb.st|_mode & |
|00004030| 53 5f 49 46 53 4f 43 4b | 29 20 3d 3d 20 53 5f 49 |S_IFSOCK|) == S_I|
|00004040| 46 53 4f 43 4b 29 0d 23 | 65 6e 64 69 66 09 2f 2a |FSOCK).#|endif./*|
|00004050| 20 53 5f 49 46 53 4f 43 | 4b 20 2a 2f 0d 09 09 20 | S_IFSOC|K */... |
|00004060| 20 20 20 29 0d 09 09 7b | 0d 09 09 20 20 20 20 63 | )...{|... c|
|00004070| 6f 6e 74 69 6e 75 65 3b | 0d 09 09 7d 0d 23 65 6e |ontinue;|...}.#en|
|00004080| 64 69 66 09 2f 2a 20 43 | 52 41 43 4b 5f 44 4f 54 |dif./* C|RACK_DOT|
|00004090| 53 41 4e 45 20 2a 2f 0d | 0d 09 09 69 66 20 28 21 |SANE */.|...if (!|
|000040a0| 28 66 70 20 3d 20 66 6f | 70 65 6e 20 28 66 69 6c |(fp = fo|pen (fil|
|000040b0| 65 6e 61 6d 65 2c 20 22 | 72 22 29 29 29 0d 09 09 |ename, "|r")))...|
|000040c0| 7b 0d 09 09 20 20 20 20 | 63 6f 6e 74 69 6e 75 65 |{... |continue|
|000040d0| 3b 0d 09 09 7d 0d 09 09 | 6a 20 3d 20 66 72 65 61 |;...}...|j = frea|
|000040e0| 64 20 28 6a 75 6e 6b 2c | 20 31 2c 20 44 4f 54 46 |d (junk,| 1, DOTF|
|000040f0| 49 4c 45 53 49 5a 45 2c | 20 66 70 29 3b 0d 09 09 |ILESIZE,| fp);...|
|00004100| 66 63 6c 6f 73 65 20 28 | 66 70 29 3b 0d 0d 09 09 |fclose (|fp);....|
|00004110| 69 66 20 28 6a 20 3c 3d | 20 32 29 0d 09 09 7b 0d |if (j <=| 2)...{.|
|00004120| 09 09 20 20 20 20 63 6f | 6e 74 69 6e 75 65 3b 0d |.. co|ntinue;.|
|00004130| 09 09 7d 0d 09 09 6a 75 | 6e 6b 5b 6a 20 2d 20 31 |..}...ju|nk[j - 1|
|00004140| 5d 20 3d 20 27 5c 30 27 | 3b 09 2f 2a 20 64 65 66 |] = '\0'|;./* def|
|00004150| 69 6e 69 74 65 20 74 65 | 72 6d 69 6e 61 74 6f 72 |inite te|rminator|
|00004160| 20 2a 2f 0d 0d 09 09 69 | 66 20 28 76 65 72 62 6f | */....i|f (verbo|
|00004170| 73 65 5f 62 6f 6f 6c 29 | 0d 09 09 7b 0d 09 09 20 |se_bool)|...{... |
|00004180| 20 20 20 4c 6f 67 20 28 | 22 44 4f 54 46 49 4c 45 | Log (|"DOTFILE|
|00004190| 53 3a 20 43 68 65 63 6b | 69 6e 67 20 25 64 20 62 |S: Check|ing %d b|
|000041a0| 79 74 65 73 20 6f 66 20 | 25 73 5c 6e 22 2c 20 6a |ytes of |%s\n", j|
|000041b0| 2c 20 66 69 6c 65 6e 61 | 6d 65 29 3b 0d 09 09 7d |, filena|me);...}|
|000041c0| 0d 09 09 69 66 20 28 50 | 61 72 73 65 42 75 66 66 |...if (P|arseBuff|
|000041d0| 65 72 20 28 74 68 69 73 | 2c 20 6a 75 6e 6b 2c 20 |er (this|, junk, |
|000041e0| 30 29 29 0d 09 09 7b 0d | 09 09 20 20 20 20 63 6f |0))...{.|.. co|
|000041f0| 6e 74 69 6e 75 65 3b 0d | 09 09 7d 0d 09 20 20 20 |ntinue;.|..}.. |
|00004200| 20 7d 0d 23 65 6e 64 69 | 66 09 2f 2a 20 43 52 41 | }.#endi|f./* CRA|
|00004210| 43 4b 5f 44 4f 54 46 49 | 4c 45 53 20 2a 2f 0d 09 |CK_DOTFI|LES */..|
|00004220| 7d 0d 20 20 20 20 7d 0d | 20 20 20 20 72 65 74 75 |}. }.| retu|
|00004230| 72 6e 3b 0d 7d 0d 0d 76 | 6f 69 64 0d 50 61 73 73 |rn;.}..v|oid.Pass|
|00004240| 32 20 28 64 69 63 74 66 | 69 6c 65 29 0d 20 20 20 |2 (dictf|ile). |
|00004250| 20 63 68 61 72 20 2a 64 | 69 63 74 66 69 6c 65 3b | char *d|ictfile;|
|00004260| 0d 7b 0d 20 20 20 20 69 | 6e 74 20 70 6f 69 6e 74 |.{. i|nt point|
|00004270| 75 73 65 72 3b 0d 20 20 | 20 20 73 74 72 75 63 74 |user;. | struct|
|00004280| 20 55 53 45 52 20 2a 68 | 65 61 64 70 74 72 3b 0d | USER *h|eadptr;.|
|00004290| 20 20 20 20 73 74 72 75 | 63 74 20 52 55 4c 45 20 | stru|ct RULE |
|000042a0| 2a 72 75 6c 65 70 74 72 | 3b 0d 20 20 20 20 73 74 |*ruleptr|;. st|
|000042b0| 72 75 63 74 20 44 49 43 | 54 20 2a 64 69 63 74 70 |ruct DIC|T *dictp|
|000042c0| 74 72 3b 0d 0d 09 46 6f | 72 65 43 6f 6c 6f 72 28 |tr;...Fo|reColor(|
|000042d0| 63 79 61 6e 43 6f 6c 6f | 72 29 3b 0d 20 20 20 20 |cyanColo|r);. |
|000042e0| 4c 6f 67 20 28 22 53 74 | 61 72 74 69 6e 67 20 70 |Log ("St|arting p|
|000042f0| 61 73 73 20 32 20 2d 20 | 64 69 63 74 69 6f 6e 61 |ass 2 - |dictiona|
|00004300| 72 79 20 77 6f 72 64 73 | 5c 6e 22 29 3b 0d 20 20 |ry words|\n");. |
|00004310| 20 20 68 65 61 64 70 74 | 72 20 3d 20 28 73 74 72 | headpt|r = (str|
|00004320| 75 63 74 20 55 53 45 52 | 20 2a 29 20 30 3b 0d 20 |uct USER| *) 0;. |
|00004330| 20 20 20 72 75 6c 65 70 | 74 72 20 3d 20 28 73 74 | rulep|tr = (st|
|00004340| 72 75 63 74 20 52 55 4c | 45 20 2a 29 20 30 3b 0d |ruct RUL|E *) 0;.|
|00004350| 0d 20 20 20 20 2f 2a 20 | 63 68 65 63 6b 20 69 66 |. /* |check if|
|00004360| 20 77 65 20 61 72 65 20 | 72 65 63 6f 76 65 72 69 | we are |recoveri|
|00004370| 6e 67 20 66 72 6f 6d 20 | 61 20 63 72 61 73 68 20 |ng from |a crash |
|00004380| 2a 2f 0d 20 20 20 20 69 | 66 20 28 72 65 63 6f 76 |*/. i|f (recov|
|00004390| 65 72 5f 62 6f 6f 6c 29 | 0d 20 20 20 20 7b 0d 09 |er_bool)|. {..|
|000043a0| 72 65 63 6f 76 65 72 5f | 62 6f 6f 6c 20 3d 20 30 |recover_|bool = 0|
|000043b0| 3b 09 2f 2a 20 73 77 69 | 74 63 68 20 6f 66 66 20 |;./* swi|tch off |
|000043c0| 2a 2f 0d 0d 09 66 6f 72 | 20 28 72 75 6c 65 70 74 |*/...for| (rulept|
|000043d0| 72 20 3d 20 72 75 6c 65 | 72 6f 6f 74 3b 0d 09 20 |r = rule|root;.. |
|000043e0| 20 20 20 20 72 75 6c 65 | 70 74 72 20 26 26 20 73 | rule|ptr && s|
|000043f0| 74 72 63 6d 70 20 28 72 | 75 6c 65 70 74 72 20 2d |trcmp (r|uleptr -|
|00004400| 3e 20 72 75 6c 65 2c 20 | 6f 6c 64 5f 72 75 6c 65 |> rule, |old_rule|
|00004410| 29 3b 0d 09 20 20 20 20 | 20 72 75 6c 65 70 74 72 |);.. | ruleptr|
|00004420| 20 3d 20 72 75 6c 65 70 | 74 72 20 2d 3e 20 6e 65 | = rulep|tr -> ne|
|00004430| 78 74 29 3b 0d 0d 09 69 | 66 20 28 21 72 75 6c 65 |xt);...i|f (!rule|
|00004440| 70 74 72 29 0d 09 7b 0d | 09 20 20 20 20 4c 6f 67 |ptr)..{.|. Log|
|00004450| 20 28 22 46 61 74 61 6c | 3a 20 52 61 6e 20 6f 66 | ("Fatal|: Ran of|
|00004460| 66 20 65 6e 64 20 6f 66 | 20 6c 69 73 74 20 6c 6f |f end of| list lo|
|00004470| 6f 6b 69 6e 67 20 66 6f | 72 20 72 75 6c 65 20 27 |oking fo|r rule '|
|00004480| 25 73 27 5c 6e 22 2c 0d | 09 09 20 6f 6c 64 5f 72 |%s'\n",.|.. old_r|
|00004490| 75 6c 65 29 3b 0d 09 20 | 20 20 20 65 78 69 74 20 |ule);.. | exit |
|000044a0| 28 31 29 3b 0d 09 7d 0d | 09 66 6f 72 20 28 68 65 |(1);..}.|.for (he|
|000044b0| 61 64 70 74 72 20 3d 20 | 75 73 65 72 72 6f 6f 74 |adptr = |userroot|
|000044c0| 3b 2f 2a 20 73 6b 69 70 | 20 72 69 67 68 74 20 6e |;/* skip| right n|
|000044d0| 75 6d 62 65 72 20 6f 66 | 20 75 73 65 72 73 20 2a |umber of| users *|
|000044e0| 2f 0d 09 20 20 20 20 20 | 68 65 61 64 70 74 72 20 |/.. |headptr |
|000044f0| 26 26 20 6f 6c 64 5f 75 | 73 65 72 6e 75 6d 2d 2d |&& old_u|sernum--|
|00004500| 3b 0d 09 20 20 20 20 20 | 68 65 61 64 70 74 72 20 |;.. |headptr |
|00004510| 3d 20 68 65 61 64 70 74 | 72 20 2d 3e 20 6e 65 78 |= headpt|r -> nex|
|00004520| 74 29 3b 0d 0d 09 69 66 | 20 28 21 68 65 61 64 70 |t);...if| (!headp|
|00004530| 74 72 29 0d 09 7b 0d 09 | 20 20 20 20 4c 6f 67 20 |tr)..{..| Log |
|00004540| 28 22 46 61 74 61 6c 3a | 20 52 61 6e 20 6f 66 66 |("Fatal:| Ran off|
|00004550| 20 65 6e 64 20 6f 66 20 | 6c 69 73 74 20 6c 6f 6f | end of |list loo|
|00004560| 6b 69 6e 67 20 66 6f 72 | 20 75 73 65 72 20 27 25 |king for| user '%|
|00004570| 73 27 5c 6e 22 2c 0d 09 | 09 20 6f 6c 64 5f 75 73 |s'\n",..|. old_us|
|00004580| 65 72 6e 61 6d 65 29 3b | 0d 09 20 20 20 20 65 78 |ername);|.. ex|
|00004590| 69 74 20 28 31 29 3b 0d | 09 7d 0d 20 20 20 20 7d |it (1);.|.}. }|
|000045a0| 0d 20 20 20 20 2f 2a 20 | 73 74 61 72 74 20 69 74 |. /* |start it|
|000045b0| 65 72 61 74 69 6e 67 20 | 68 65 72 65 20 2a 2f 0d |erating |here */.|
|000045c0| 20 20 20 20 66 6f 72 20 | 28 72 75 6c 65 70 74 72 | for |(ruleptr|
|000045d0| 20 3d 20 28 72 75 6c 65 | 70 74 72 20 3f 20 72 75 | = (rule|ptr ? ru|
|000045e0| 6c 65 70 74 72 20 3a 20 | 72 75 6c 65 72 6f 6f 74 |leptr : |ruleroot|
|000045f0| 29 3b 0d 09 20 72 75 6c | 65 70 74 72 3b 0d 09 20 |);.. rul|eptr;.. |
|00004600| 72 75 6c 65 70 74 72 20 | 3d 20 72 75 6c 65 70 74 |ruleptr |= rulept|
|00004610| 72 20 2d 3e 20 6e 65 78 | 74 29 0d 20 20 20 20 7b |r -> nex|t). {|
|00004620| 0d 09 6c 6f 6e 67 20 69 | 6e 74 20 72 76 61 6c 3b |..long i|nt rval;|
|00004630| 0d 09 69 6e 74 20 63 6f | 6e 74 69 6e 75 65 5f 64 |..int co|ntinue_d|
|00004640| 69 63 74 3b 0d 0d 09 63 | 6f 6e 74 69 6e 75 65 5f |ict;...c|ontinue_|
|00004650| 64 69 63 74 20 3d 20 30 | 3b 0d 0d 20 20 20 20 20 |dict = 0|;.. |
|00004660| 20 6c 6f 61 64 5f 64 69 | 63 74 3a 0d 09 72 76 61 | load_di|ct:..rva|
|00004670| 6c 20 3d 20 4c 6f 61 64 | 44 69 63 74 20 28 64 69 |l = Load|Dict (di|
|00004680| 63 74 66 69 6c 65 2c 20 | 72 75 6c 65 70 74 72 20 |ctfile, |ruleptr |
|00004690| 2d 3e 20 72 75 6c 65 2c | 20 63 6f 6e 74 69 6e 75 |-> rule,| continu|
|000046a0| 65 5f 64 69 63 74 29 3b | 0d 0d 09 69 66 20 28 72 |e_dict);|...if (r|
|000046b0| 76 61 6c 20 3d 3d 20 30 | 29 0d 09 7b 0d 09 20 20 |val == 0|)..{.. |
|000046c0| 20 20 4c 6f 67 20 28 22 | 4f 6f 70 73 21 20 49 20 | Log ("|Oops! I |
|000046d0| 67 6f 74 20 61 6e 20 65 | 6d 70 74 79 20 64 69 63 |got an e|mpty dic|
|000046e0| 74 69 6f 6e 61 72 79 21 | 20 53 6b 69 70 70 69 6e |tionary!| Skippin|
|000046f0| 67 20 72 75 6c 65 20 27 | 25 73 27 21 5c 6e 22 2c |g rule '|%s'!\n",|
|00004700| 0d 09 09 20 72 75 6c 65 | 70 74 72 20 2d 3e 20 72 |... rule|ptr -> r|
|00004710| 75 6c 65 29 3b 0d 09 20 | 20 20 20 63 6f 6e 74 69 |ule);.. | conti|
|00004720| 6e 75 65 3b 0d 09 7d 0d | 09 70 6f 69 6e 74 75 73 |nue;..}.|.pointus|
|00004730| 65 72 20 3d 20 30 3b 0d | 0d 09 2f 2a 20 69 74 65 |er = 0;.|../* ite|
|00004740| 72 61 74 65 20 61 6c 6c | 20 74 68 65 20 75 73 65 |rate all| the use|
|00004750| 72 73 20 2a 2f 0d 09 66 | 6f 72 20 28 68 65 61 64 |rs */..f|or (head|
|00004760| 70 74 72 20 3d 20 28 68 | 65 61 64 70 74 72 20 3f |ptr = (h|eadptr ?|
|00004770| 20 68 65 61 64 70 74 72 | 20 3a 20 75 73 65 72 72 | headptr| : userr|
|00004780| 6f 6f 74 29 3b 0d 09 20 | 20 20 20 20 68 65 61 64 |oot);.. | head|
|00004790| 70 74 72 3b 0d 09 20 20 | 20 20 20 68 65 61 64 70 |ptr;.. | headp|
|000047a0| 74 72 20 3d 20 68 65 61 | 64 70 74 72 20 2d 3e 20 |tr = hea|dptr -> |
|000047b0| 6e 65 78 74 29 0d 09 7b | 0d 09 20 20 20 20 53 65 |next)..{|.. Se|
|000047c0| 74 50 6f 69 6e 74 20 28 | 64 69 63 74 66 69 6c 65 |tPoint (|dictfile|
|000047d0| 2c 0d 09 09 20 20 20 20 | 20 20 72 75 6c 65 70 74 |,... | rulept|
|000047e0| 72 20 2d 3e 20 72 75 6c | 65 2c 0d 09 09 20 20 20 |r -> rul|e,... |
|000047f0| 20 20 20 70 6f 69 6e 74 | 75 73 65 72 2b 2b 2c 0d | point|user++,.|
|00004800| 09 09 20 20 20 20 20 20 | 68 65 61 64 70 74 72 20 |.. |headptr |
|00004810| 2d 3e 20 70 61 73 73 77 | 64 2e 70 77 5f 6e 61 6d |-> passw|d.pw_nam|
|00004820| 65 29 3b 0d 0d 09 20 20 | 20 20 2f 2a 20 69 74 65 |e);... | /* ite|
|00004830| 72 61 74 65 20 61 6c 6c | 20 74 68 65 20 77 6f 72 |rate all| the wor|
|00004840| 64 73 20 2a 2f 0d 09 20 | 20 20 20 66 6f 72 20 28 |ds */.. | for (|
|00004850| 64 69 63 74 70 74 72 20 | 3d 20 64 69 63 74 72 6f |dictptr |= dictro|
|00004860| 6f 74 3b 0d 09 09 20 64 | 69 63 74 70 74 72 3b 0d |ot;... d|ictptr;.|
|00004870| 09 09 20 64 69 63 74 70 | 74 72 20 3d 20 64 69 63 |.. dictp|tr = dic|
|00004880| 74 70 74 72 20 2d 3e 20 | 6e 65 78 74 29 0d 09 20 |tptr -> |next).. |
|00004890| 20 20 20 7b 0d 09 09 2f | 2a 20 73 6b 69 70 20 72 | {.../|* skip r|
|000048a0| 65 70 65 61 74 65 64 20 | 77 6f 72 64 73 2e 2e 2e |epeated |words...|
|000048b0| 20 2a 2f 0d 09 09 69 66 | 20 28 21 54 72 79 4d 61 | */...if| (!TryMa|
|000048c0| 6e 79 55 73 65 72 73 20 | 28 68 65 61 64 70 74 72 |nyUsers |(headptr|
|000048d0| 2c 20 64 69 63 74 70 74 | 72 20 2d 3e 20 77 6f 72 |, dictpt|r -> wor|
|000048e0| 64 29 29 0d 09 09 7b 0d | 09 09 20 20 20 20 62 72 |d))...{.|.. br|
|000048f0| 65 61 6b 3b 0d 09 09 7d | 0d 09 20 20 20 20 7d 0d |eak;...}|.. }.|
|00004900| 09 7d 0d 0d 09 2f 2a 20 | 66 72 65 65 20 75 70 20 |.}.../* |free up |
|00004910| 6d 65 6d 6f 72 79 20 2a | 2f 0d 09 44 72 6f 70 44 |memory *|/..DropD|
|00004920| 69 63 74 20 28 29 3b 0d | 0d 09 2f 2a 20 77 72 69 |ict ();.|../* wri|
|00004930| 74 65 20 66 65 65 64 62 | 61 63 6b 20 66 69 6c 65 |te feedb|ack file|
|00004940| 20 2a 2f 0d 09 69 66 20 | 28 21 46 65 65 64 42 61 | */..if |(!FeedBa|
|00004950| 63 6b 20 28 30 29 29 0d | 09 7b 0d 09 20 20 20 20 |ck (0)).|.{.. |
|00004960| 4c 6f 67 20 28 22 46 65 | 65 64 42 61 63 6b 3a 20 |Log ("Fe|edBack: |
|00004970| 41 6c 6c 20 55 73 65 72 | 73 20 41 72 65 20 43 72 |All User|s Are Cr|
|00004980| 61 63 6b 65 64 21 20 42 | 6c 6f 6f 64 79 20 48 65 |acked! B|loody He|
|00004990| 6c 6c 21 5c 6e 22 29 3b | 0d 09 20 20 20 20 72 65 |ll!\n");|.. re|
|000049a0| 74 75 72 6e 3b 0d 09 7d | 0d 09 2f 2a 20 6f 6e 20 |turn;..}|../* on |
|000049b0| 6e 65 78 74 20 70 61 73 | 73 2c 20 73 74 61 72 74 |next pas|s, start|
|000049c0| 20 66 72 6f 6d 20 74 6f | 70 20 6f 66 20 75 73 65 | from to|p of use|
|000049d0| 72 20 6c 69 73 74 20 2a | 2f 0d 09 68 65 61 64 70 |r list *|/..headp|
|000049e0| 74 72 20 3d 20 28 73 74 | 72 75 63 74 20 55 53 45 |tr = (st|ruct USE|
|000049f0| 52 20 2a 29 20 30 3b 0d | 0d 09 2f 2a 20 64 69 64 |R *) 0;.|../* did|
|00004a00| 20 77 65 20 52 45 41 4c | 4c 59 20 66 69 6e 69 73 | we REAL|LY finis|
|00004a10| 68 20 74 68 69 73 20 64 | 69 63 74 69 6f 6e 61 72 |h this d|ictionar|
|00004a20| 79 20 3f 20 2a 2f 0d 09 | 69 66 20 28 72 76 61 6c |y ? */..|if (rval|
|00004a30| 20 3c 20 30 29 0d 09 7b | 0d 09 20 20 20 20 63 6f | < 0)..{|.. co|
|00004a40| 6e 74 69 6e 75 65 5f 64 | 69 63 74 20 3d 20 31 3b |ntinue_d|ict = 1;|
|00004a50| 0d 09 20 20 20 20 67 6f | 74 6f 20 6c 6f 61 64 5f |.. go|to load_|
|00004a60| 64 69 63 74 3b 0d 09 7d | 0d 20 20 20 20 7d 0d 7d |dict;..}|. }.}|
|00004a70| 0d 0d 0d 76 6f 69 64 20 | 44 6f 49 74 20 28 29 0d |...void |DoIt ().|
|00004a80| 7b 0d 0d 20 20 20 20 69 | 6e 74 20 69 3b 0d 20 20 |{.. i|nt i;. |
|00004a90| 20 20 74 69 6d 65 5f 74 | 20 74 3b 0d 20 20 20 20 | time_t| t;. |
|00004aa0| 69 6e 74 20 75 65 72 72 | 3b 0d 20 20 20 20 46 49 |int uerr|;. FI|
|00004ab0| 4c 45 20 2a 66 70 3b 0d | 09 53 74 72 32 35 35 20 |LE *fp;.|.Str255 |
|00004ac0| 62 61 64 72 65 63 6f 76 | 65 72 20 3d 20 22 20 53 |badrecov|er = " S|
|00004ad0| 6f 72 72 79 2c 20 43 6f | 75 6c 64 6e 27 74 20 6f |orry, Co|uldn't o|
|00004ae0| 70 65 6e 20 52 65 63 6f | 76 65 72 20 46 69 6c 65 |pen Reco|ver File|
|00004af0| 20 66 6f 72 20 72 65 61 | 64 69 6e 67 2e 22 3b 0d | for rea|ding.";.|
|00004b00| 0d 0d 69 66 20 28 72 65 | 63 6f 76 65 72 5f 62 6f |..if (re|cover_bo|
|00004b10| 6f 6c 20 3d 3d 20 31 29 | 20 7b 20 0d 20 20 20 20 |ol == 1)| { . |
|00004b20| 20 20 20 20 73 74 72 63 | 70 79 20 28 69 6e 70 75 | strc|py (inpu|
|00004b30| 74 5f 66 69 6c 65 2c 20 | 72 65 63 6f 76 65 72 5f |t_file, |recover_|
|00004b40| 66 69 6c 65 29 3b 0d 09 | 20 20 20 20 69 66 20 28 |file);..| if (|
|00004b50| 28 66 70 3d 66 6f 70 65 | 6e 20 28 69 6e 70 75 74 |(fp=fope|n (input|
|00004b60| 5f 66 69 6c 65 2c 20 22 | 72 22 29 29 20 3d 3d 20 |_file, "|r")) == |
|00004b70| 4e 55 4c 4c 29 0d 09 20 | 20 20 20 7b 0d 09 20 20 |NULL).. | {.. |
|00004b80| 20 20 50 61 72 61 6d 54 | 65 78 74 28 62 61 64 72 | ParamT|ext(badr|
|00004b90| 65 63 6f 76 65 72 2c 20 | 4e 49 4c 2c 20 4e 49 4c |ecover, |NIL, NIL|
|00004ba0| 2c 20 4e 49 4c 29 3b 0d | 09 09 41 6c 65 72 74 20 |, NIL);.|..Alert |
|00004bb0| 28 54 48 45 41 4c 45 52 | 54 2c 20 4e 49 4c 29 3b |(THEALER|T, NIL);|
|00004bc0| 0d 09 09 65 78 69 74 20 | 28 31 29 3b 0d 09 20 20 |...exit |(1);.. |
|00004bd0| 20 20 7d 0d 09 20 20 20 | 20 65 6c 73 65 20 66 63 | }.. | else fc|
|00004be0| 6c 6f 73 65 28 66 70 29 | 3b 0d 09 7d 0d 0d 20 0d |lose(fp)|;..}.. .|
|00004bf0| 69 66 20 28 66 6f 72 65 | 67 72 6f 75 6e 64 5f 62 |if (fore|ground_b|
|00004c00| 6f 6f 6c 29 0d 09 69 6e | 69 74 46 6f 72 65 67 72 |ool)..in|itForegr|
|00004c10| 6f 75 6e 64 28 29 3b 0d | 09 09 0d 20 20 20 20 74 |ound();.|... t|
|00004c20| 69 6d 65 20 28 26 74 29 | 3b 0d 20 20 20 20 46 6f |ime (&t)|;. Fo|
|00004c30| 72 65 43 6f 6c 6f 72 28 | 62 6c 75 65 43 6f 6c 6f |reColor(|blueColo|
|00004c40| 72 29 3b 0d 09 4c 6f 67 | 20 28 22 5b 20 2d 20 2d |r);..Log| ("[ - -|
|00004c50| 20 2d 20 2d 20 2d 20 2d | 20 2d 20 2d 20 2d 20 2d | - - - -| - - - -|
|00004c60| 20 2d 20 2d 20 2d 20 2d | 20 2d 20 2d 20 2d 20 2d | - - - -| - - - -|
|00004c70| 20 2d 20 2d 20 2d 20 2d | 20 2d 20 2d 20 2d 20 2d | - - - -| - - - -|
|00004c80| 20 2d 20 2d 20 2d 20 2d | 20 2d 20 5d 5c 6e 22 29 | - - - -| - ]\n")|
|00004c90| 3b 0d 09 46 6f 72 65 43 | 6f 6c 6f 72 28 62 6c 75 |;..ForeC|olor(blu|
|00004ca0| 65 43 6f 6c 6f 72 29 3b | 0d 20 20 20 20 4c 6f 67 |eColor);|. Log|
|00004cb0| 20 28 22 43 72 61 63 6b | 20 76 25 73 3a 20 54 68 | ("Crack| v%s: Th|
|00004cc0| 65 20 50 61 73 73 77 6f | 72 64 20 43 72 61 63 6b |e Passwo|rd Crack|
|00004cd0| 65 72 2c 20 28 63 29 20 | 41 6c 65 63 20 44 2e 45 |er, (c) |Alec D.E|
|00004ce0| 2e 20 4d 75 66 66 65 74 | 74 2c 20 31 39 39 32 5c |. Muffet|t, 1992\|
|00004cf0| 6e 22 2c 0d 09 20 76 65 | 72 73 69 6f 6e 29 3b 0d |n",.. ve|rsion);.|
|00004d00| 09 46 6f 72 65 43 6f 6c | 6f 72 28 62 6c 75 65 43 |.ForeCol|or(blueC|
|00004d10| 6f 6c 6f 72 29 3b 0d 09 | 4c 6f 67 20 28 22 4d 61 |olor);..|Log ("Ma|
|00004d20| 63 43 72 61 63 20 2e 30 | 31 20 50 6f 72 74 20 62 |cCrac .0|1 Port b|
|00004d30| 79 20 48 61 6e 73 20 4f | 6c 73 61 2c 20 61 20 4e |y Hans O|lsa, a N|
|00004d40| 6f 72 77 65 67 69 61 6e | 20 20 20 20 20 20 20 20 |orwegian| |
|00004d50| 20 28 63 29 20 4d 61 72 | 20 31 39 39 35 5c 6e 22 | (c) Mar| 1995\n"|
|00004d60| 29 3b 0d 09 46 6f 72 65 | 43 6f 6c 6f 72 28 62 6c |);..Fore|Color(bl|
|00004d70| 75 65 43 6f 6c 6f 72 29 | 3b 0d 09 4c 6f 67 20 28 |ueColor)|;..Log (|
|00004d80| 22 5b 20 2d 20 2d 20 2d | 20 2d 20 2d 20 2d 20 2d |"[ - - -| - - - -|
|00004d90| 20 2d 20 2d 20 2d 20 2d | 20 2d 20 2d 20 2d 20 2d | - - - -| - - - -|
|00004da0| 20 2d 20 2d 20 2d 20 2d | 20 2d 20 2d 20 2d 20 2d | - - - -| - - - -|
|00004db0| 20 2d 20 2d 20 2d 20 2d | 20 2d 20 2d 20 2d 20 2d | - - - -| - - - -|
|00004dc0| 20 5d 5c 6e 22 29 3b 0d | 0d 23 69 66 64 65 66 20 | ]\n");.|.#ifdef |
|00004dd0| 46 43 52 59 50 54 0d 20 | 20 20 20 69 6e 69 74 5f |FCRYPT. | init_|
|00004de0| 64 65 73 20 28 29 3b 0d | 23 65 6e 64 69 66 0d 0d |des ();.|#endif..|
|00004df0| 20 20 20 20 2f 2a 20 51 | 75 69 63 6b 2c 20 76 65 | /* Q|uick, ve|
|00004e00| 72 69 66 79 20 74 68 61 | 74 20 77 65 20 61 72 65 |rify tha|t we are|
|00004e10| 20 73 61 6e 65 20 21 20 | 2a 2f 0d 20 20 69 66 20 | sane ! |*/. if |
|00004e20| 28 73 74 72 63 6d 70 20 | 28 63 72 79 70 74 20 28 |(strcmp |(crypt (|
|00004e30| 22 66 72 65 64 66 72 65 | 64 22 2c 20 22 66 72 65 |"fredfre|d", "fre|
|00004e40| 64 66 72 65 64 22 29 2c | 20 22 66 72 78 57 62 78 |dfred"),| "frxWbx|
|00004e50| 34 49 52 75 42 42 41 22 | 29 29 0d 20 20 20 20 7b |4IRuBBA"|)). {|
|00004e60| 0d 09 4c 6f 67 20 28 22 | 41 20 2a 53 54 52 41 4e |..Log ("|A *STRAN|
|00004e70| 47 45 2a 20 65 72 72 6f | 72 2e 20 20 54 68 65 20 |GE* erro|r. The |
|00004e80| 63 72 79 70 74 20 72 6f | 75 74 69 6e 65 20 69 73 |crypt ro|utine is|
|00004e90| 20 4e 4f 54 20 77 6f 72 | 6b 69 6e 67 2e 20 20 52 | NOT wor|king. R|
|00004ea0| 75 6e 20 74 68 69 73 20 | 6f 6e 5c 6e 22 29 3b 0d |un this |on\n");.|
|00004eb0| 09 4c 6f 67 20 28 22 61 | 6e 6f 74 68 65 72 20 4d |.Log ("a|nother M|
|00004ec0| 61 63 2e 5c 6e 22 29 3b | 0d 09 4c 6f 67 20 28 22 |ac.\n");|..Log ("|
|00004ed0| 54 65 72 6d 69 6e 61 74 | 69 6e 67 2e 2e 2e 5c 6e |Terminat|ing...\n|
|00004ee0| 22 29 3b 0d 09 65 78 69 | 74 20 28 30 29 3b 0d 20 |");..exi|t (0);. |
|00004ef0| 20 20 20 7d 0d 0d 23 69 | 66 6e 64 65 66 20 41 4d | }..#i|fndef AM|
|00004f00| 49 47 41 0d 20 20 20 20 | 73 69 67 6e 61 6c 20 28 |IGA. |signal (|
|00004f10| 53 49 47 54 45 52 4d 2c | 20 43 61 74 63 68 54 45 |SIGTERM,| CatchTE|
|00004f20| 52 4d 29 3b 0d 23 65 6e | 64 69 66 0d 0d 20 20 20 |RM);.#en|dif.. |
|00004f30| 20 4c 6f 67 20 28 22 4c | 6f 61 64 69 6e 67 20 44 | Log ("L|oading D|
|00004f40| 61 74 61 2c 20 68 6f 73 | 74 3d 25 73 5c 6e 22 2c |ata, hos|t=%s\n",|
|00004f50| 20 74 68 69 73 5f 68 6f | 73 74 6e 61 6d 65 29 3b | this_ho|stname);|
|00004f60| 0d 0d 20 20 20 20 69 66 | 20 28 4c 6f 61 64 44 61 |.. if| (LoadDa|
|00004f70| 74 61 20 28 29 20 3c 3d | 20 30 29 0d 20 20 20 20 |ta () <=| 0). |
|00004f80| 7b 0d 09 4c 6f 67 20 28 | 22 4e 6f 74 68 69 6e 67 |{..Log (|"Nothing|
|00004f90| 20 74 6f 20 43 72 61 63 | 6b 2e 20 45 78 69 74 69 | to Crac|k. Exiti|
|00004fa0| 6e 67 2e 2e 2e 5c 6e 22 | 29 3b 0d 09 65 78 69 74 |ng...\n"|);..exit|
|00004fb0| 20 28 30 29 3b 0d 20 20 | 20 20 7d 0d 20 20 20 20 | (0);. | }. |
|00004fc0| 69 66 20 28 4c 6f 61 64 | 52 75 6c 65 73 20 28 72 |if (Load|Rules (r|
|00004fd0| 75 6c 65 66 69 6c 65 2c | 20 26 72 75 6c 65 72 6f |ulefile,| &rulero|
|00004fe0| 6f 74 29 20 3c 20 30 20 | 7c 7c 0d 09 4c 6f 61 64 |ot) < 0 |||..Load|
|00004ff0| 52 75 6c 65 73 20 28 67 | 65 63 6f 73 66 69 6c 65 |Rules (g|ecosfile|
|00005000| 2c 20 26 67 65 63 6f 73 | 72 6f 6f 74 29 20 3c 20 |, &gecos|root) < |
|00005010| 30 29 0d 20 20 20 20 7b | 0d 09 65 78 69 74 20 28 |0). {|..exit (|
|00005020| 31 29 3b 0d 20 20 20 20 | 7d 0d 20 20 20 20 69 66 |1);. |}. if|
|00005030| 20 28 21 72 65 63 6f 76 | 65 72 5f 62 6f 6f 6c 29 | (!recov|er_bool)|
|00005040| 0d 20 20 20 20 7b 0d 09 | 2f 2a 20 57 65 20 61 72 |. {..|/* We ar|
|00005050| 65 20 73 74 61 72 74 69 | 6e 67 20 61 66 72 65 73 |e starti|ng afres|
|00005060| 68 20 21 20 41 68 2c 20 | 74 68 65 20 62 69 72 64 |h ! Ah, |the bird|
|00005070| 73 20 69 6e 20 4d 61 79 | 20 21 20 2a 2f 0d 09 50 |s in May| ! */..P|
|00005080| 61 73 73 31 20 28 29 3b | 0d 0d 09 69 66 20 28 21 |ass1 ();|...if (!|
|00005090| 46 65 65 64 42 61 63 6b | 20 28 30 29 29 0d 09 7b |FeedBack| (0))..{|
|000050a0| 0d 09 20 20 20 20 4c 6f | 67 20 28 22 46 65 65 64 |.. Lo|g ("Feed|
|000050b0| 42 61 63 6b 3a 20 69 6e | 66 6f 72 6d 61 74 69 6f |Back: in|formatio|
|000050c0| 6e 3a 20 61 6c 6c 20 75 | 73 65 72 73 20 61 72 65 |n: all u|sers are|
|000050d0| 20 63 72 61 63 6b 65 64 | 20 61 66 74 65 72 20 67 | cracked| after g|
|000050e0| 65 63 6f 73 20 70 61 73 | 73 5c 6e 22 29 3b 0d 09 |ecos pas|s\n");..|
|000050f0| 20 20 20 20 67 6f 74 6f | 20 66 69 6e 69 73 68 5f | goto| finish_|
|00005100| 63 72 61 63 6b 3b 0d 09 | 7d 0d 20 20 20 20 7d 20 |crack;..|}. } |
|00005110| 65 6c 73 65 0d 20 20 20 | 20 7b 0d 09 69 6e 74 20 |else. | {..int |
|00005120| 72 76 61 6c 3b 0d 0d 09 | 69 66 20 28 72 76 61 6c |rval;...|if (rval|
|00005130| 20 3d 20 47 65 74 50 6f | 69 6e 74 20 28 72 65 63 | = GetPo|int (rec|
|00005140| 6f 76 65 72 5f 66 69 6c | 65 29 29 0d 09 7b 0d 09 |over_fil|e))..{..|
|00005150| 20 20 20 20 4c 6f 67 20 | 28 22 52 65 63 6f 76 65 | Log |("Recove|
|00005160| 72 79 20 66 72 6f 6d 20 | 66 69 6c 65 20 25 73 20 |ry from |file %s |
|00005170| 6e 6f 74 20 70 65 72 6d | 69 74 74 65 64 20 6f 6e |not perm|itted on|
|00005180| 20 74 68 69 73 20 68 6f | 73 74 20 5b 63 6f 64 65 | this ho|st [code|
|00005190| 20 25 64 5d 5c 6e 22 2c | 0d 09 09 20 72 65 63 6f | %d]\n",|... reco|
|000051a0| 76 65 72 5f 66 69 6c 65 | 2c 0d 09 09 20 72 76 61 |ver_file|,... rva|
|000051b0| 6c 29 3b 0d 09 20 20 20 | 20 65 78 69 74 20 28 30 |l);.. | exit (0|
|000051c0| 29 3b 0d 20 20 20 20 20 | 7d 0d 20 20 20 20 20 65 |);. |}. e|
|000051d0| 6c 73 65 0d 20 20 20 20 | 20 20 20 53 79 73 4c 6f |lse. | SysLo|
|000051e0| 67 20 28 22 50 6f 69 6e | 74 20 46 69 6c 65 20 6c |g ("Poin|t File l|
|000051f0| 6f 61 64 65 64 20 73 75 | 63 63 65 73 73 66 75 6c |oaded su|ccessful|
|00005200| 6c 79 2e 20 20 20 20 53 | 65 73 73 69 6f 6e 20 72 |ly. S|ession r|
|00005210| 65 73 74 6f 72 65 64 2e | 22 29 3b 0d 09 7d 0d 09 |estored.|");..}..|
|00005220| 2f 2a 20 53 6f 6d 65 20 | 73 70 6f 64 75 6c 6f 75 |/* Some |spodulou|
|00005230| 73 20 63 72 65 65 70 20 | 70 75 6c 6c 65 64 20 6f |s creep |pulled o|
|00005240| 75 72 20 70 6c 75 67 2e | 2e 2e 20 2a 2f 0d 0d 09 |ur plug.|.. */...|
|00005250| 50 61 73 73 32 20 28 22 | 44 49 43 54 49 4f 4e 41 |Pass2 ("|DICTIONA|
|00005260| 52 59 22 29 3b 0d 0d 20 | 20 20 20 4c 6f 67 20 28 |RY");.. | Log (|
|00005270| 22 54 69 64 79 69 6e 67 | 20 75 70 20 66 69 6c 65 |"Tidying| up file|
|00005280| 73 2e 2e 2e 5c 6e 22 29 | 3b 0d 20 20 20 20 46 65 |s...\n")|;. Fe|
|00005290| 65 64 42 61 63 6b 20 28 | 31 29 3b 0d 0d 20 20 66 |edBack (|1);.. f|
|000052a0| 69 6e 69 73 68 5f 63 72 | 61 63 6b 3a 0d 0d 0d 20 |inish_cr|ack:... |
|000052b0| 20 20 20 75 6e 6c 69 6e | 6b 20 28 70 6f 69 6e 74 | unlin|k (point|
|000052c0| 66 69 6c 65 29 3b 0d 20 | 20 20 20 2f 2a 20 63 6c |file);. | /* cl|
|000052d0| 6f 73 65 20 74 68 65 20 | 77 69 6e 64 6f 77 20 2a |ose the |window *|
|000052e0| 2f 0d 20 20 20 20 4c 6f | 67 20 28 22 44 6f 6e 65 |/. Lo|g ("Done|
|000052f0| 2e 5c 6e 22 29 3b 0d 20 | 20 20 20 69 66 20 28 66 |.\n");. | if (f|
|00005300| 6f 72 65 67 72 6f 75 6e | 64 5f 62 6f 6f 6c 29 0d |oregroun|d_bool).|
|00005310| 20 20 20 20 20 20 63 6c | 6f 73 65 46 6f 72 65 67 | cl|oseForeg|
|00005320| 72 6f 75 6e 64 28 29 3b | 0d 7d 0d 0d 76 6f 69 64 |round();|.}..void|
|00005330| 0d 6d 61 69 6e 20 28 29 | 0d 7b 0d 20 0d 20 2f 2a |.main ()|.{. . /*|
|00005340| 20 53 45 54 54 49 4e 47 | 53 20 2d 20 54 4f 20 41 | SETTING|S - TO A|
|00005350| 56 4f 49 44 20 55 4e 49 | 58 20 46 4c 41 47 53 20 |VOID UNI|X FLAGS |
|00005360| 2a 2f 0d 0d 20 72 65 6d | 6f 74 65 5f 62 6f 6f 6c |*/.. rem|ote_bool|
|00005370| 20 3d 20 30 3b 0d 20 70 | 77 6c 65 6e 67 74 68 20 | = 0;. p|wlength |
|00005380| 3d 20 38 3b 0d 20 0d 20 | 66 6f 72 65 67 72 6f 75 |= 8;. . |foregrou|
|00005390| 6e 64 5f 62 6f 6f 6c 20 | 3d 20 31 3b 20 0d 20 76 |nd_bool |= 1; . v|
|000053a0| 65 72 62 6f 73 65 5f 62 | 6f 6f 6c 20 3d 20 30 3b |erbose_b|ool = 0;|
|000053b0| 0d 20 72 65 63 6f 76 65 | 72 5f 62 6f 6f 6c 20 3d |. recove|r_bool =|
|000053c0| 20 30 3b 0d 0d 20 73 74 | 72 63 70 79 20 28 72 65 | 0;.. st|rcpy (re|
|000053d0| 63 6f 76 65 72 5f 66 69 | 6c 65 2c 20 22 50 6f 69 |cover_fi|le, "Poi|
|000053e0| 6e 74 20 46 69 6c 65 22 | 29 3b 0d 20 73 74 72 63 |nt File"|);. strc|
|000053f0| 70 79 20 28 6f 70 66 69 | 6c 65 2c 20 22 4d 61 63 |py (opfi|le, "Mac|
|00005400| 43 72 61 63 2e 4c 6f 67 | 22 29 3b 0d 20 73 74 72 |Crac.Log|");. str|
|00005410| 63 70 79 20 28 70 6f 69 | 6e 74 66 69 6c 65 2c 20 |cpy (poi|ntfile, |
|00005420| 22 50 6f 69 6e 74 20 46 | 69 6c 65 22 29 3b 0d 20 |"Point F|ile");. |
|00005430| 73 74 72 63 70 79 20 28 | 66 65 65 64 62 61 63 6b |strcpy (|feedback|
|00005440| 66 69 6c 65 2c 20 22 46 | 65 65 64 62 61 63 6b 20 |file, "F|eedback |
|00005450| 46 69 6c 65 22 29 3b 0d | 0d 20 73 74 72 63 70 79 |File");.|. strcpy|
|00005460| 20 28 74 68 69 73 5f 68 | 6f 73 74 6e 61 6d 65 2c | (this_h|ostname,|
|00005470| 20 22 4d 61 63 22 29 3b | 0d 20 70 69 64 20 3d 20 | "Mac");|. pid = |
|00005480| 31 32 33 3b 0d 20 0d 20 | 0d 20 09 49 6e 69 74 4d |123;. . |. .InitM|
|00005490| 61 63 28 29 3b 0d 09 64 | 6f 5f 6d 65 6e 75 28 29 |ac();..d|o_menu()|
|000054a0| 3b 0d 09 53 68 6f 77 41 | 62 6f 75 74 28 29 3b 0d |;..ShowA|bout();.|
|000054b0| 0d 09 0d 09 66 6f 72 20 | 28 3b 3b 29 0d 09 09 48 |....for |(;;)...H|
|000054c0| 61 6e 64 6c 65 45 76 65 | 6e 74 28 29 3b 0d 7d 0d |andleEve|nt();.}.|
|000054d0| 0d 0d 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000054e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000054f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005500| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00005510| 50 74 72 43 6c 65 61 72 | 0b 54 4d 41 64 64 53 65 |PtrClear|.TMAddSe|
|00005520| 61 72 63 68 07 73 70 61 | 72 65 32 34 0f 53 49 6e |arch.spa|re24.SIn|
|00005530| 0b 63 72 61 63 6b 2d 70 | 77 63 2e 63 02 00 00 00 |.crack-p|wc.c....|
|00005540| 50 61 72 74 53 49 54 21 | 00 00 00 00 00 00 00 00 |PartSIT!|........|
|00005550| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00005560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005570| 00 00 ad 36 c9 86 00 00 | 00 00 00 00 01 9a 6f 6e |...6....|......on|
|00005580| 74 50 72 6f 63 65 73 73 | 0f 54 45 55 73 65 53 74 |tProcess|.TEUseSt|
|00005590| 79 6c 65 53 63 72 61 70 | 01 00 1b 4e 65 77 41 6c |yleScrap|...NewAl|
|000055a0| 69 61 73 4d 69 6e 69 6d | 61 6c 46 72 6f 6d 46 75 |iasMinim|alFromFu|
|000055b0| 6c 6c 50 61 74 68 0f 4c | 4d 47 65 74 50 61 69 6e |llPath.L|MGetPain|
|000055c0| 74 57 68 69 74 65 07 44 | 65 6c 43 6f 6d 70 07 2e |tWhite.D|elComp..|
|000055d0| 66 65 72 72 6f 72 01 00 | 0b 4c 4d 53 65 74 53 79 |ferror..|.LMSetSy|
|000055e0| 73 4d 61 70 0f 53 65 74 | 43 6f 6e 74 72 6f 6c 43 |sMap.Set|ControlC|
|000055f0| 6f 6c 6f 72 07 57 69 64 | 65 41 64 64 07 53 49 4f |olor.Wid|eAdd.SIO|
|00005600| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00005610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005620| 00 00 00 00 00 00 00 03 | 00 04 00 57 00 18 01 bf |........|...W....|
|00005630| 02 4d 00 57 00 18 01 bf | 02 4d ab 5e a6 1f 00 00 |.M.W....|.M.^....|
|00005640| 4c d8 00 00 4c d8 00 00 | 4a f6 01 00 00 00 00 04 |L...L...|J.......|
|00005650| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00005660| 00 00 00 46 01 17 79 94 | 16 0a 00 00 00 1c 00 46 |...F..y.|.......F|
|00005670| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00005680| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00005690| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|000056a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+