home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / hacking / phreak_utils_pc / th110.slt < prev    next >
Encoding:
Text File  |  1990-05-10  |  74.3 KB  |  2,257 lines

  1. //////////////////////////// TH100.SLT ///////////////////////////////////////
  2.  
  3. //        The muther fuckin awesome Telix Hacker (TH, duh) script.
  4.  
  5. //      Shawn-da-Lay Boy Productions (tm) (c) 1989, 1990, 2001...
  6.  
  7.  
  8. //                 Maintanence and Version Notes:
  9.  
  10. //  Version 0.00    Alpha dude... like I just started, ya know...   891218
  11.  
  12. //  Version 0.01    First Alpha release.                            900124
  13.  
  14. //  Version 0.02    First functional Alpha release.                 900125
  15.  
  16. //  Version 0.03    Aplha: Make SEEDHn and SEEDLn work...           900127
  17.  
  18. //  Version 0.10    Beta.. have at it!!!                            900129
  19.  
  20. //  Version 0.11    Beta.. Fix everything that didn't work          900130
  21.  
  22. //  Version 0.12    Beta.. clean up some code...                    900131
  23.  
  24. //  Version 0.20    Beta.. add lower case letters...                900201
  25.  
  26. //  Version 0.30    Beta.. add password filez....                   900203
  27.  
  28. //  Version 0.40    Beta.. add master password list                 900206
  29.  
  30. //  Version 0.45    Beta.. add password positioning                 900208
  31.  
  32. //  Version 0.50    Beta.. minor code cleanup...                    900215
  33.  
  34. //  Version 0.75    Beta.. and NOGOOD and cleanup...                900226
  35.  
  36. //  Version 1.00    The first full boddied release...               900419
  37.  
  38. //  Version 1.10    Allow specification of Ctrl-char combos         900510
  39.  
  40. //////////////////////////////////////////////////////////////////////////////
  41.  
  42. int cfgfile, logfile, goodfile, ctlfile;
  43. str string[80] = " ", word[270] = " ";
  44. str data[80] = " ";
  45. str data1[18] = "";
  46. str data2[216] = "";
  47.  
  48. str dialnum[60] = "0";   // inital dial to bad value
  49. int hackcount = 0;       // unlimited attempts
  50. int force = 0;    // force to 0
  51. int trycount = 0;  // hack tries before redialing
  52. str cracked[40] = "";    // init good string.
  53. int no_good = 0;  // good flag
  54.  
  55. str sendtxt[400] = "";      // stash send strings
  56. str send_ptr[40] = "";   // pointer to the strings
  57.  
  58. str wait[400] = "";      // stash wait strings
  59. str wait_ptr[40] = "";    // pointer to wait strings
  60.  
  61. str passfile[12] = "";   // hack password file
  62. int passfh = 0;       // file handle...
  63. str password[60] = ""; // password
  64. int seek_record = 0;
  65.  
  66. int master_file = 0;  // master_file flag
  67. int got_master = 0;   // master file opened flag
  68.  
  69. str plate[90] = "";     // plates
  70. str plt_ptr[30] = "";     // pointers to plate fields
  71. str plt0[9] = "";       // init 1st plt string
  72. str plt1[9] = "";       // init 2nd plt string
  73. str plt2[9] = "";       // init 3th plt string
  74. str plt3[9] = "";       // init 4th plt string
  75. str plt4[9] = "";       // init 5th plt string
  76. str plt5[9] = "";       // init 6th plt string
  77. str plt6[9] = "";       // init 7th plt string
  78. str plt7[9] = "";       // init 8th plt string
  79. str plt8[9] = "";       // init 9th plt string
  80. str plt9[9] = "";       // init last plt string
  81.  
  82. str seedl[90] = "";     // seedls
  83. str seedl_ptr[30] = "";     // pointers to seedl fields
  84. str seedl0[9] = "";       // init 1st seedl string
  85. str seedl1[9] = "";       // init 2nd seedl string
  86. str seedl2[9] = "";       // init 3th seedl string
  87. str seedl3[9] = "";       // init 4th seedl string
  88. str seedl4[9] = "";       // init 5th seedl string
  89. str seedl5[9] = "";       // init 6th seedl string
  90. str seedl6[9] = "";       // init 7th seedl string
  91. str seedl7[9] = "";       // init 8th seedl string
  92. str seedl8[9] = "";       // init 9th seedl string
  93. str seedl9[9] = "";       // init last seedl string
  94.  
  95. str seedh[90] = "";     // seedhs
  96. str seedh_ptr[30] = "";     // pointers to seedh fields
  97. str seedh0[9] = "";       // init 1st seedh string
  98. str seedh1[9] = "";       // init 2nd seedh string
  99. str seedh2[9] = "";       // init 3th seedh string
  100. str seedh3[9] = "";       // init 4th seedh string
  101. str seedh4[9] = "";       // init 5th seedh string
  102. str seedh5[9] = "";       // init 6th seedh string
  103. str seedh6[9] = "";       // init 7th seedh string
  104. str seedh7[9] = "";       // init 8th seedh string
  105. str seedh8[9] = "";       // init 9th seedh string
  106. str seedh9[9] = "";       // init last seedh string
  107.  
  108. str hck0_seed[216] = "";  // seed values *matches hck_val
  109. str hck1_seed[216] = "";  // seed values *matches hck_val
  110. str hck2_seed[216] = "";  // seed values *matches hck_val
  111. str hck3_seed[216] = "";  // seed values *matches hck_val
  112. str hck4_seed[216] = "";  // seed values *matches hck_val
  113. str hck5_seed[216] = "";  // seed values *matches hck_val
  114. str hck6_seed[216] = "";  // seed values *matches hck_val
  115. str hck7_seed[216] = "";  // seed values *matches hck_val
  116. str hck8_seed[216] = "";  // seed values *matches hck_val
  117. str hck9_seed[216] = "";  // seed values *matches hck_val
  118. str hck0_sdptr[18] = "";  // seed pointers
  119. str hck1_sdptr[18] = "";  // seed pointers
  120. str hck2_sdptr[18] = "";  // seed pointers
  121. str hck3_sdptr[18] = "";  // seed pointers
  122. str hck4_sdptr[18] = "";  // seed pointers
  123. str hck5_sdptr[18] = "";  // seed pointers
  124. str hck6_sdptr[18] = "";  // seed pointers
  125. str hck7_sdptr[18] = "";  // seed pointers
  126. str hck8_sdptr[18] = "";  // seed pointers
  127. str hck9_sdptr[18] = "";  // seed pointers
  128.  
  129. str hck0_val[270] = "";     // pointer to hack substitutions.
  130. str hck1_val[270] = "";     // pointer to hack substitutions.
  131. str hck2_val[270] = "";     // pointer to hack substitutions.
  132. str hck3_val[270] = "";     // pointer to hack substitutions.
  133. str hck4_val[270] = "";     // pointer to hack substitutions.
  134. str hck5_val[270] = "";     // pointer to hack substitutions.
  135. str hck6_val[270] = "";     // pointer to hack substitutions.
  136. str hck7_val[270] = "";     // pointer to hack substitutions.
  137. str hck8_val[270] = "";     // pointer to hack substitutions.
  138. str hck9_val[270] = "";     // pointer to hack substitutions.
  139.  
  140. str hckl0_val[270] = "";     // pointer to hack substitutions.
  141. str hckl1_val[270] = "";     // pointer to hack substitutions.
  142. str hckl2_val[270] = "";     // pointer to hack substitutions.
  143. str hckl3_val[270] = "";     // pointer to hack substitutions.
  144. str hckl4_val[270] = "";     // pointer to hack substitutions.
  145. str hckl5_val[270] = "";     // pointer to hack substitutions.
  146. str hckl6_val[270] = "";     // pointer to hack substitutions.
  147. str hckl7_val[270] = "";     // pointer to hack substitutions.
  148. str hckl8_val[270] = "";     // pointer to hack substitutions.
  149. str hckl9_val[270] = "";     // pointer to hack substitutions.
  150.  
  151. str hck0_ptr[24] = "";         // pointer to hack string.  ppl
  152. str hck1_ptr[24] = "";         // pointer to hack string.
  153. str hck2_ptr[24] = "";         // pointer to hack string.
  154. str hck3_ptr[24] = "";         // pointer to hack string.
  155. str hck4_ptr[24] = "";         // pointer to hack string.
  156. str hck5_ptr[24] = "";         // pointer to hack string.
  157. str hck6_ptr[24] = "";         // pointer to hack string.
  158. str hck7_ptr[24] = "";         // pointer to hack string.
  159. str hck8_ptr[24] = "";         // pointer to hack string.
  160. str hck9_ptr[24] = "";         // pointer to hack string.
  161.  
  162. int offset = 0;  //offset of PASSFILE into hack
  163. int pwl = 0;   // length of last password tried
  164. int hacko0 = 0; // offset into hachn
  165. int hacko1 = 0; // offset into hachn
  166. int hacko2 = 0; // offset into hachn
  167. int hacko3 = 0; // offset into hachn
  168. int hacko4 = 0; // offset into hachn
  169. int hacko5 = 0; // offset into hachn
  170. int hacko6 = 0; // offset into hachn
  171. int hacko7 = 0; // offset into hachn
  172. int hacko8 = 0; // offset into hachn
  173. int hacko9 = 0; // offset into hachn
  174. int hackpwl0 = 0; // length of pw in hachn
  175. int hackpwl1 = 0; // length of pw in hachn
  176. int hackpwl2 = 0; // length of pw in hachn
  177. int hackpwl3 = 0; // length of pw in hachn
  178. int hackpwl4 = 0; // length of pw in hachn
  179. int hackpwl5 = 0; // length of pw in hachn
  180. int hackpwl6 = 0; // length of pw in hachn
  181. int hackpwl7 = 0; // length of pw in hachn
  182. int hackpwl8 = 0; // length of pw in hachn
  183. int hackpwl9 = 0; // length of pw in hachn
  184. int hacklpwl0 = 0; // length of last pw in hachn
  185. int hacklpwl1 = 0; // length of last pw in hachn
  186. int hacklpwl2 = 0; // length of last pw in hachn
  187. int hacklpwl3 = 0; // length of last pw in hachn
  188. int hacklpwl4 = 0; // length of last pw in hachn
  189. int hacklpwl5 = 0; // length of last pw in hachn
  190. int hacklpwl6 = 0; // length of last pw in hachn
  191. int hacklpwl7 = 0; // length of last pw in hachn
  192. int hacklpwl8 = 0; // length of last pw in hachn
  193. int hacklpwl9 = 0; // length of last pw in hachn
  194.  
  195. str hack0[60] = "";       // init 1st hack string
  196. str hack1[60] = "";       // init 2nd hack string
  197. str hack2[60] = "";       // init 3th hack string
  198. str hack3[60] = "";       // init 4th hack string
  199. str hack4[60] = "";       // init 5th hack string
  200. str hack5[60] = "";       // init 6th hack string
  201. str hack6[60] = "";       // init 7th hack string
  202. str hack7[60] = "";       // init 8th hack string
  203. str hack8[60] = "";       // init 9th hack string
  204. str hack9[60] = "";       // init last hack string
  205.  
  206. str hackl0[60] = "";       // init 1st last hack string
  207. str hackl1[60] = "";       // init 2nd last hack string
  208. str hackl2[60] = "";       // init 3th last hack string
  209. str hackl3[60] = "";       // init 4th last hack string
  210. str hackl4[60] = "";       // init 5th last hack string
  211. str hackl5[60] = "";       // init 6th last hack string
  212. str hackl6[60] = "";       // init 7th last hack string
  213. str hackl7[60] = "";       // init 8th last hack string
  214. str hackl8[60] = "";       // init 9th last hack string
  215. str hackl9[60] = "";       // init last last hack string
  216.  
  217. str order[60] = "";       // funky string for the order of shit..
  218. int ord_ptr = 0;          // pointer to order...
  219. int loop = 0;            // loop value
  220. int carry = 0;           // hack carry
  221. int bump_good = 0;    // remember retcode from bump
  222.  
  223. int snd_ptr = 0;         // pointer to send strings
  224. int snd_lop = 0;         // pointer to send strings
  225. int wt_ptr = 0;         // pointer to wait strings
  226. int wt_lop = 0;         // pointer to wait strings
  227. int hack_ptr = 0;         // pointer to hack strings
  228.  
  229. str alphameric[62] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcedfghijklmnopqrstuvwxyz";
  230.  
  231. int auto = 0;                 // init auto to off
  232. str autotxt[3] = "OFF";       // and it's text value
  233. str control[12] = "TH.HAK";   // init control filename
  234. str log[12] = "NO";           // init log to no
  235. int logit = 0;                // and it's boolein equalavant
  236. str good[12] = "TH.FND";      // init good filename
  237. int stop = 1;                 // init stop to true
  238. int testmode = 0;                 // init test mode to false
  239. int delay_tim = 6;                 // good string delay time in seconds
  240. int show_hack = 0;          // display hacking strings flag
  241. int x, y;                   // vidieo corrdinates
  242.  
  243. str carret[2] = "";              // expanded cr
  244. str cr[1] = "^M";                 // real cr
  245. str linfed[2] = "";              // expanded lf
  246. str lf[1] = "^J";                 // real linefeed
  247. str cntrlz[1] = "^Z";              // real control-z...
  248. str cntrlall[26] = "^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z";
  249. str cntrlkey[1] = "";   // expanded cntrl char
  250.  
  251. int count = 0, pos = 0, ret_code = 0;
  252.  
  253. main()
  254.  
  255. {
  256.  
  257.   str last_word[12] = " ";
  258.  
  259.   Clear_scr();    // Let's start with a clear screen.
  260.  
  261. //////////////////////// start config file processing ///////////////
  262.  
  263.   Prints("             Awesome Telix Hacker Version 1.10");
  264.   Prints("");
  265.   Prints("                  Processing TH.CFG file.");
  266.  
  267.   cfgfile = fopen("th.cfg", "r");
  268.  
  269.   if (cfgfile == 0)       // error if no file.
  270.   {
  271.     alarm(1);
  272.     Prints("              Cannot locate TH.CFG file.");
  273.     return -1;
  274.   }
  275.  
  276.   string = read_file(cfgfile);   // Get the first record.
  277.  
  278.   while (string != "EOF")       // Process the records
  279.   {
  280.  
  281.     pos = 0;                // start scan at beginning
  282.  
  283.     ret_code = Get_next_word(32); // find next word
  284.  
  285.     if (ret_code > 0)             // process control word
  286.     {
  287.       pos = pos + 2;     // bump over equal
  288.       last_word = word;
  289.       strupper(last_word);
  290.       ret_code = Get_next_word(32);  // and get the next word
  291.  
  292.       if (last_word == "AUTO")
  293.       {
  294.         if (word == "ON") auto = 1;  // Turn auto on
  295.         else auto = 0;  // Turn auto off
  296.       }
  297.       if (last_word == "CONTROL")  control = word; // stash control fn
  298.       if (last_word == "CR") carret = word; // stash carriage return
  299.       if (last_word == "LF") linfed = word; // stash linefeed
  300.       if (last_word == "CTRL") cntrlkey = word; // stash control key
  301.     }
  302.  
  303.     string = read_file(cfgfile);      // get next record
  304.   }
  305.  
  306.   fclose(cfgfile);
  307.  
  308.   If (auto) autotxt = "ON";  // set autotxt to proper value
  309.  
  310.   if (strlen(carret) != 2)     // missing something
  311.   {
  312.     Prints("CR config missing or invalid, run aborted.");
  313.     return -1;
  314.   }
  315.   if (strlen(linfed) != 2)     // missing something
  316.   {
  317.     Prints("LF config missing or invalid, run aborted.");
  318.     return -1;
  319.   }
  320.   if (strlen(cntrlkey) != 1)     // missing something
  321.   {
  322.     Prints("CTRL config missing or invalid, run aborted.");
  323.     return -1;
  324.   }
  325.  
  326.   Prints(" ");        // blank line, duh...
  327.   ret_code = Display_shit("Automatic operation is ", autotxt, ".");
  328.   ret_code = Display_shit("Control file is: ", control, ".");
  329.   ret_code = Display_shit("Carriage return is: ", carret, ".");
  330.   ret_code = Display_shit("Linefeed is: ", linfed, ".");
  331.   ret_code = Display_shit("Control key is: ", cntrlkey, ".");
  332.  
  333. ////////////////////////// end config file processing ///////////////
  334.  
  335.   if (!auto)         // handle manual mode...
  336.   {
  337.     Prints(" ");
  338.     Prints("                Entering Manual Mode.");
  339.  
  340.     ret_code = Display_shit("Enter Control file name - default is :", control, ".");
  341.     ret_code = Read_kb();
  342.     if (ret_code > 0) control = word;  // save control filename
  343.     prints("");
  344.  
  345.   }
  346.  
  347. ////////////////////////// end manual mode //////////////////////////
  348.  
  349.   prints("");
  350.   Ret_code = display_shit("         Processing ", control, " control file.");
  351.  
  352.   ctlfile = fopen(control, "r");
  353.  
  354.   if (ctlfile == 0)       // error if no file.
  355.   {
  356.     alarm(1);
  357.     ret_code = Display_shit ("     Cannot locate ", control, " file.");
  358.     return -1;
  359.   }
  360.  
  361.   string = read_file(ctlfile);  // read the first record
  362.  
  363.   while (string != "EOF")       // Process the records
  364.   {
  365.     pos = 0;                // start scan at beginning
  366.     ret_code = Get_next_word(32); // find keyword
  367.  
  368.     if (ret_code > 0)             // process control word
  369.     {
  370.       pos = pos + 2;     // bump over equal
  371.       last_word = word;      // save keyword
  372.       strupper(last_word);   // upcase the bitch...
  373.  
  374.       if (last_word == "TEST")           // check testmode
  375.       {
  376.         ret_code = Get_next_word(32);  // and get the next word
  377.         strupper(word);
  378.         if (word == "YES") testmode = 1;
  379.         else testmode = 0;
  380.       }
  381.  
  382.       if (last_word == "LOG")
  383.       {
  384.         ret_code = Get_next_word(32);  // and get the next word
  385.         log = word; // stash log filename
  386.         strupper(log);
  387.         If (log != "NO") logit = 1; // and logit to true if needed
  388.         else logit = 0;
  389.       }
  390.       if (last_word == "CODEZ")
  391.       {
  392.         ret_code = Get_next_word(32);  // and get the next word
  393.         good = word; // stash good file name.
  394.       }
  395.       if (last_word == "DIAL")
  396.       {
  397.         ret_code = Get_next_word(32);  // and get the next word
  398.         dialnum = word; // stash it.
  399.       }
  400.  
  401.       if (last_word == "STOP")
  402.       {
  403.         ret_code = Get_next_word(32);  // and get the next word
  404.         strupper(word);
  405.         if (word == "NO") stop = 0;
  406.         else stop = 1;
  407.       }
  408.  
  409.       if (last_word == "MASTERFILE")
  410.       {
  411.         ret_code = Get_next_word(32);  // and get the next word
  412.         strupper(word);
  413.         if (word == "NO") master_file = 0;
  414.         else master_file = 1;
  415.       }
  416.  
  417.       if (last_word == "SHOW")
  418.       {
  419.         ret_code = Get_next_word(32);  // and get the next word
  420.         strupper(word);
  421.         if (word == "NO") show_hack = 0;
  422.         else show_hack = 1;
  423.       }
  424.  
  425.       if (last_word == "FORCE")
  426.       {
  427.         ret_code = Get_next_word(32);  // and get the next word
  428.         force = stoi(word); // and stash it
  429.       }
  430.  
  431.       if (last_word == "COUNT")
  432.       {
  433.         ret_code = Get_next_word(32);  // and get the next word
  434.         hackcount = stoi(word); // and stash it
  435.       }
  436.  
  437.       if (last_word == "SKIP")
  438.       {
  439.         ret_code = Get_next_word(32);  // and get the next word
  440.         seek_record = stoi(word); // and stash it
  441.       }
  442.  
  443.       if (last_word == "DELAY")
  444.       {
  445.         ret_code = Get_next_word(32);  // and get the next word
  446.         delay_tim = stoi(word); // and stash it
  447.       }
  448.  
  449.       if (last_word == "GOOD")
  450.       {
  451.         ret_code = Get_next_word(42);  // and get the next string
  452.         No_good = 0;
  453.         cracked = word; // stash logged on string
  454.       }
  455.  
  456.       if (last_word == "NOGOOD")
  457.       {
  458.         ret_code = Get_next_word(42);  // and get the next string
  459.         No_good = 1;
  460.         cracked = word; // stash logged on string
  461.       }
  462.  
  463.       if (last_word == "LOOP") loop = strlen(order); // save loop
  464.  
  465.       if (last_word == "SEND")
  466.       {
  467.         strcat(order, "1");   // put send in the order chain
  468.         itos(snd_lop, data1);  // ascii
  469.         strcat(order, data1); // and ptr to send
  470.         snd_lop = snd_lop + 1;
  471.         ret_code = Get_next_word(42);  // and get the next string
  472.         string = word;   // stash word
  473.         ret_code = conv_crlf();  // convert cr and lf
  474.         word = string;      // and save it
  475.         count = strlen(word);   // get length
  476.         itos(count, data); // convert to ascii
  477.         if (strlen(data) == 1) inschrs("0", data, 0, 1); // two digits plz
  478.         itos(snd_ptr, string);
  479.         if (strlen(string) == 1) inschrs("0", string, 0, 1); // two digits plz
  480.         strcat(sendtxt, word);   // stash send string
  481.         strcat(send_ptr, string); //  it's position
  482.         strcat(send_ptr, data); // and length
  483.         snd_ptr = snd_ptr + count;
  484.       }
  485.  
  486.       if (last_word == "WAIT")
  487.       {
  488.         strcat(order, "2"); // put wait in the order chain
  489.         itos(wt_lop, data1);  // ascii
  490.         strcat(order, data1); // and ptr to send
  491.         wt_lop = wt_lop + 1;
  492.         ret_code = Get_next_word(42);  // and get the next string
  493.         count = strlen(word);   // get length
  494.         itos(count, data); // convert to ascii
  495.         if (strlen(data) == 1) inschrs("0", data, 0, 1); // two digits plz
  496.         itos(wt_ptr, string);
  497.         if (strlen(string) == 1) inschrs("0", string, 0, 1); // two digits plz
  498.         strcat(wait, word);   // stash wait string
  499.         strcat(wait_ptr, string); //  it's position
  500.         strcat(wait_ptr, data); // and length
  501.         wt_ptr = wt_ptr + count;
  502.       }
  503.  
  504.       if (last_word == "HACK")
  505.       {
  506.         if (!loop) loop = strlen(order); // save loop (if needed)...
  507.         strcat(order, "3"); // put hack in the order chain
  508.         itos(hack_ptr, data1);  // ascii
  509.         strcat(order, data1); // and ptr to hack
  510.         hack_ptr = hack_ptr + 1;   // point to next hack string
  511.         ret_code = Get_next_word(42);  // and get the string into word
  512.         if (hack_ptr == 1) hack0 = word;   // and stash it
  513.         if (hack_ptr == 2) hack1 = word;   // and stash it
  514.         if (hack_ptr == 3) hack2 = word;   // and stash it
  515.         if (hack_ptr == 4) hack3 = word;   // and stash it
  516.         if (hack_ptr == 5) hack4 = word;   // and stash it
  517.         if (hack_ptr == 6) hack5 = word;   // and stash it
  518.         if (hack_ptr == 7) hack6 = word;   // and stash it
  519.         if (hack_ptr == 8) hack7 = word;   // and stash it
  520.         if (hack_ptr == 9) hack8 = word;   // and stash it
  521.         if (hack_ptr == 10) hack9 = word;   // and stash it
  522.       }
  523.  
  524.       if (last_word == "PLATE0")
  525.       {
  526.         ret_code = Get_next_word(32);  // and get the next string
  527.         plt0 = word; // stash logged on string
  528.       }
  529.  
  530.       if (last_word == "PLATE1")
  531.       {
  532.         ret_code = Get_next_word(32);  // and get the next string
  533.         plt1 = word; // stash logged on string
  534.       }
  535.  
  536.       if (last_word == "PLATE2")
  537.       {
  538.         ret_code = Get_next_word(32);  // and get the next string
  539.         plt2 = word; // stash logged on string
  540.       }
  541.  
  542.       if (last_word == "PLATE3")
  543.       {
  544.         ret_code = Get_next_word(32);  // and get the next string
  545.         plt3 = word; // stash logged on string
  546.       }
  547.  
  548.       if (last_word == "PLATE4")
  549.       {
  550.         ret_code = Get_next_word(32);  // and get the next string
  551.         plt4 = word; // stash logged on string
  552.       }
  553.  
  554.       if (last_word == "PLATE5")
  555.       {
  556.         ret_code = Get_next_word(32);  // and get the next string
  557.         plt5 = word; // stash logged on string
  558.       }
  559.  
  560.       if (last_word == "PLATE6")
  561.       {
  562.         ret_code = Get_next_word(32);  // and get the next string
  563.         plt6 = word; // stash logged on string
  564.       }
  565.  
  566.       if (last_word == "PLATE7")
  567.       {
  568.         ret_code = Get_next_word(32);  // and get the next string
  569.         plt7 = word; // stash logged on string
  570.       }
  571.  
  572.       if (last_word == "PLATE8")
  573.       {
  574.         ret_code = Get_next_word(32);  // and get the next string
  575.         plt8 = word; // stash logged on string
  576.       }
  577.  
  578.       if (last_word == "PLATE9")
  579.       {
  580.         ret_code = Get_next_word(32);  // and get the next string
  581.         plt9 = word; // stash logged on string
  582.       }
  583.  
  584.       if (last_word == "SEEDL0")
  585.       {
  586.         ret_code = Get_next_word(32);  // and get the next string
  587.         seedl0 = word; // stash logged on string
  588.       }
  589.  
  590.       if (last_word == "SEEDL1")
  591.       {
  592.         ret_code = Get_next_word(32);  // and get the next string
  593.         seedl1 = word; // stash logged on string
  594.       }
  595.  
  596.       if (last_word == "SEEDL2")
  597.       {
  598.         ret_code = Get_next_word(32);  // and get the next string
  599.         seedl2 = word; // stash logged on string
  600.       }
  601.  
  602.       if (last_word == "SEEDL3")
  603.       {
  604.         ret_code = Get_next_word(32);  // and get the next string
  605.         seedl3 = word; // stash logged on string
  606.       }
  607.  
  608.       if (last_word == "SEEDL4")
  609.       {
  610.         ret_code = Get_next_word(32);  // and get the next string
  611.         seedl4 = word; // stash logged on string
  612.       }
  613.  
  614.       if (last_word == "SEEDL5")
  615.       {
  616.         ret_code = Get_next_word(32);  // and get the next string
  617.         seedl5 = word; // stash logged on string
  618.       }
  619.  
  620.       if (last_word == "SEEDL6")
  621.       {
  622.         ret_code = Get_next_word(32);  // and get the next string
  623.         seedl6 = word; // stash logged on string
  624.       }
  625.  
  626.       if (last_word == "SEEDL7")
  627.       {
  628.         ret_code = Get_next_word(32);  // and get the next string
  629.         seedl7 = word; // stash logged on string
  630.       }
  631.  
  632.       if (last_word == "SEEDL8")
  633.       {
  634.         ret_code = Get_next_word(32);  // and get the next string
  635.         seedl8 = word; // stash logged on string
  636.       }
  637.  
  638.       if (last_word == "SEEDL9")
  639.       {
  640.         ret_code = Get_next_word(32);  // and get the next string
  641.         seedl9 = word; // stash logged on string
  642.       }
  643.  
  644.       if (last_word == "SEEDH0")
  645.       {
  646.         ret_code = Get_next_word(32);  // and get the next string
  647.         seedh0 = word; // stash logged on string
  648.       }
  649.  
  650.       if (last_word == "SEEDH1")
  651.       {
  652.         ret_code = Get_next_word(32);  // and get the next string
  653.         seedh1 = word; // stash logged on string
  654.       }
  655.  
  656.       if (last_word == "SEEDH2")
  657.       {
  658.         ret_code = Get_next_word(32);  // and get the next string
  659.         seedh2 = word; // stash logged on string
  660.       }
  661.  
  662.       if (last_word == "SEEDH3")
  663.       {
  664.         ret_code = Get_next_word(32);  // and get the next string
  665.         seedh3 = word; // stash logged on string
  666.       }
  667.  
  668.       if (last_word == "SEEDH4")
  669.       {
  670.         ret_code = Get_next_word(32);  // and get the next string
  671.         seedh4 = word; // stash logged on string
  672.       }
  673.  
  674.       if (last_word == "SEEDH5")
  675.       {
  676.         ret_code = Get_next_word(32);  // and get the next string
  677.         seedh5 = word; // stash logged on string
  678.       }
  679.  
  680.       if (last_word == "SEEDH6")
  681.       {
  682.         ret_code = Get_next_word(32);  // and get the next string
  683.         seedh6 = word; // stash logged on string
  684.       }
  685.  
  686.       if (last_word == "SEEDH7")
  687.       {
  688.         ret_code = Get_next_word(32);  // and get the next string
  689.         seedh7 = word; // stash logged on string
  690.       }
  691.  
  692.       if (last_word == "SEEDH8")
  693.       {
  694.         ret_code = Get_next_word(32);  // and get the next string
  695.         seedh8 = word; // stash logged on string
  696.       }
  697.  
  698.       if (last_word == "SEEDH9")
  699.       {
  700.         ret_code = Get_next_word(32);  // and get the next string
  701.         seedh9 = word; // stash logged on string
  702.       }
  703.  
  704.       if (last_word == "PASSFILE")
  705.       {
  706.         ret_code = Get_next_word(32);  // and get the next string
  707.         strupper(word);
  708.         passfile = word; // stash filename
  709.         if (passfile == "THPASS.LST") got_master = 1;  // tried thpass
  710.       }
  711.  
  712.     }
  713.  
  714.     string = read_file(ctlfile);      // get next record
  715.   }                                  // end of control record reading
  716.  
  717.   fclose(ctlfile);   // whew...close the file...
  718.  
  719.   if (dialnum == "0")
  720.   {
  721.     prints("No DIAL record found.");
  722.     return -99;
  723.   }
  724.  
  725.   if (cracked == "")
  726.   {
  727.     prints("No GOOD or NOGOOD record found.");
  728.     return -99;
  729.   }
  730.  
  731.   if (hack0 == "")
  732.   {
  733.     prints("No HACK record found.");
  734.     return -99;
  735.   }
  736.  
  737.   count = 0;
  738.   Ret_code = strlen(plt0);
  739.   if (ret_code > 0) strcat(plate, plt0);  // shove in plate 0
  740.   itos(count, word);   // convert number to ascii rep..
  741.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  742.   itos(Ret_code, data); // convert length to ascii
  743.   strcat(plt_ptr, word); // save start
  744.   strcat(plt_ptr, data); // and length
  745.  
  746.   count = count + ret_code;
  747.   Ret_code = strlen(plt1);
  748.   if (ret_code > 0) strcat(plate, plt1);  // shove in plate 1
  749.   itos(count, word);   // convert number to ascii rep..
  750.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  751.   itos(Ret_code, data); // convert length to ascii
  752.   strcat(plt_ptr, word); // save start
  753.   strcat(plt_ptr, data); // and length
  754.  
  755.   count = count + ret_code;
  756.   Ret_code = strlen(plt2);
  757.   if (ret_code > 0) strcat(plate, plt2);  // shove in plate 2
  758.   itos(count, word);   // convert number to ascii rep..
  759.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  760.   itos(Ret_code, data); // convert length to ascii
  761.   strcat(plt_ptr, word); // save start
  762.   strcat(plt_ptr, data); // and length
  763.  
  764.   count = count + ret_code;
  765.   Ret_code = strlen(plt3);
  766.   if (ret_code > 0) strcat(plate, plt3);  // shove in plate 3
  767.   itos(count, word);   // convert number to ascii rep..
  768.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  769.   itos(Ret_code, data); // convert length to ascii
  770.   strcat(plt_ptr, word); // save start
  771.   strcat(plt_ptr, data); // and length
  772.  
  773.   count = count + ret_code;
  774.   Ret_code = strlen(plt4);
  775.   if (ret_code > 0) strcat(plate, plt4);  // shove in plate 4
  776.   itos(count, word);   // convert number to ascii rep..
  777.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  778.   itos(Ret_code, data); // convert length to ascii
  779.   strcat(plt_ptr, word); // save start
  780.   strcat(plt_ptr, data); // and length
  781.  
  782.   count = count + ret_code;
  783.   Ret_code = strlen(plt5);
  784.   if (ret_code > 0) strcat(plate, plt5);  // shove in plate 5
  785.   itos(count, word);   // convert number to ascii rep..
  786.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  787.   itos(Ret_code, data); // convert length to ascii
  788.   strcat(plt_ptr, word); // save start
  789.   strcat(plt_ptr, data); // and length
  790.  
  791.   count = count + ret_code;
  792.   Ret_code = strlen(plt6);
  793.   if (ret_code > 0) strcat(plate, plt6);  // shove in plate 6
  794.   itos(count, word);   // convert number to ascii rep..
  795.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  796.   itos(Ret_code, data); // convert length to ascii
  797.   strcat(plt_ptr, word); // save start
  798.   strcat(plt_ptr, data); // and length
  799.  
  800.   count = count + ret_code;
  801.   Ret_code = strlen(plt7);
  802.   if (ret_code > 0) strcat(plate, plt7);  // shove in plate 7
  803.   itos(count, word);   // convert number to ascii rep..
  804.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  805.   itos(Ret_code, data); // convert length to ascii
  806.   strcat(plt_ptr, word); // save start
  807.   strcat(plt_ptr, data); // and length
  808.  
  809.   count = count + ret_code;
  810.   Ret_code = strlen(plt8);
  811.   if (ret_code > 0) strcat(plate, plt8);  // shove in plate 8
  812.   itos(count, word);   // convert number to ascii rep..
  813.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  814.   itos(Ret_code, data); // convert length to ascii
  815.   strcat(plt_ptr, word); // save start
  816.   strcat(plt_ptr, data); // and length
  817.  
  818.   count = count + ret_code;
  819.   Ret_code = strlen(plt9);
  820.   if (ret_code > 0) strcat(plate, plt9);  // shove in plate 9
  821.   itos(count, word);   // convert number to ascii rep..
  822.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  823.   itos(Ret_code, data); // convert length to ascii
  824.   strcat(plt_ptr, word); // save start
  825.   strcat(plt_ptr, data); // and length
  826.  
  827.   count = 0;
  828.   Ret_code = strlen(seedl0);
  829.   if (ret_code > 0) strcat(seedl, seedl0);  // shove in seedl 0
  830.   itos(count, word);   // convert number to ascii rep..
  831.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  832.   itos(Ret_code, data); // convert length to ascii
  833.   strcat(seedl_ptr, word); // save start
  834.   strcat(seedl_ptr, data); // and length
  835.  
  836.   count = count + ret_code;
  837.   Ret_code = strlen(seedl1);
  838.   if (ret_code > 0) strcat(seedl, seedl1);  // shove in seedl 1
  839.   itos(count, word);   // convert number to ascii rep..
  840.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  841.   itos(Ret_code, data); // convert length to ascii
  842.   strcat(seedl_ptr, word); // save start
  843.   strcat(seedl_ptr, data); // and length
  844.  
  845.   count = count + ret_code;
  846.   Ret_code = strlen(seedl2);
  847.   if (ret_code > 0) strcat(seedl, seedl2);  // shove in seedl 2
  848.   itos(count, word);   // convert number to ascii rep..
  849.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  850.   itos(Ret_code, data); // convert length to ascii
  851.   strcat(seedl_ptr, word); // save start
  852.   strcat(seedl_ptr, data); // and length
  853.  
  854.   count = count + ret_code;
  855.   Ret_code = strlen(seedl3);
  856.   if (ret_code > 0) strcat(seedl, seedl3);  // shove in seedl 3
  857.   itos(count, word);   // convert number to ascii rep..
  858.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  859.   itos(Ret_code, data); // convert length to ascii
  860.   strcat(seedl_ptr, word); // save start
  861.   strcat(seedl_ptr, data); // and length
  862.  
  863.   count = count + ret_code;
  864.   Ret_code = strlen(seedl4);
  865.   if (ret_code > 0) strcat(seedl, seedl4);  // shove in seedl 4
  866.   itos(count, word);   // convert number to ascii rep..
  867.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  868.   itos(Ret_code, data); // convert length to ascii
  869.   strcat(seedl_ptr, word); // save start
  870.   strcat(seedl_ptr, data); // and length
  871.  
  872.   count = count + ret_code;
  873.   Ret_code = strlen(seedl5);
  874.   if (ret_code > 0) strcat(seedl, seedl5);  // shove in seedl 5
  875.   itos(count, word);   // convert number to ascii rep..
  876.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  877.   itos(Ret_code, data); // convert length to ascii
  878.   strcat(seedl_ptr, word); // save start
  879.   strcat(seedl_ptr, data); // and length
  880.  
  881.   count = count + ret_code;
  882.   Ret_code = strlen(seedl6);
  883.   if (ret_code > 0) strcat(seedl, seedl6);  // shove in seedl 6
  884.   itos(count, word);   // convert number to ascii rep..
  885.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  886.   itos(Ret_code, data); // convert length to ascii
  887.   strcat(seedl_ptr, word); // save start
  888.   strcat(seedl_ptr, data); // and length
  889.  
  890.   count = count + ret_code;
  891.   Ret_code = strlen(seedl7);
  892.   if (ret_code > 0) strcat(seedl, seedl7);  // shove in seedl 7
  893.   itos(count, word);   // convert number to ascii rep..
  894.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  895.   itos(Ret_code, data); // convert length to ascii
  896.   strcat(seedl_ptr, word); // save start
  897.   strcat(seedl_ptr, data); // and length
  898.  
  899.   count = count + ret_code;
  900.   Ret_code = strlen(seedl8);
  901.   if (ret_code > 0) strcat(seedl, seedl8);  // shove in seedl 8
  902.   itos(count, word);   // convert number to ascii rep..
  903.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  904.   itos(Ret_code, data); // convert length to ascii
  905.   strcat(seedl_ptr, word); // save start
  906.   strcat(seedl_ptr, data); // and length
  907.  
  908.   count = count + ret_code;
  909.   Ret_code = strlen(seedl9);
  910.   if (ret_code > 0) strcat(seedl, seedl9);  // shove in seedl 9
  911.   itos(count, word);   // convert number to ascii rep..
  912.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  913.   itos(Ret_code, data); // convert length to ascii
  914.   strcat(seedl_ptr, word); // save start
  915.   strcat(seedl_ptr, data); // and length
  916.  
  917.   count = 0;
  918.   Ret_code = strlen(seedh0);
  919.   if (ret_code > 0) strcat(seedh, seedh0);  // shove in seedh 0
  920.   itos(count, word);   // convert number to ascii rep..
  921.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  922.   itos(Ret_code, data); // convert length to ascii
  923.   strcat(seedh_ptr, word); // save start
  924.   strcat(seedh_ptr, data); // and length
  925.  
  926.   count = count + ret_code;
  927.   Ret_code = strlen(seedh1);
  928.   if (ret_code > 0) strcat(seedh, seedh1);  // shove in seedh 1
  929.   itos(count, word);   // convert number to ascii rep..
  930.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  931.   itos(Ret_code, data); // convert length to ascii
  932.   strcat(seedh_ptr, word); // save start
  933.   strcat(seedh_ptr, data); // and length
  934.  
  935.   count = count + ret_code;
  936.   Ret_code = strlen(seedh2);
  937.   if (ret_code > 0) strcat(seedh, seedh2);  // shove in seedh 2
  938.   itos(count, word);   // convert number to ascii rep..
  939.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  940.   itos(Ret_code, data); // convert length to ascii
  941.   strcat(seedh_ptr, word); // save start
  942.   strcat(seedh_ptr, data); // and length
  943.  
  944.   count = count + ret_code;
  945.   Ret_code = strlen(seedh3);
  946.   if (ret_code > 0) strcat(seedh, seedh3);  // shove in seedh 3
  947.   itos(count, word);   // convert number to ascii rep..
  948.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  949.   itos(Ret_code, data); // convert length to ascii
  950.   strcat(seedh_ptr, word); // save start
  951.   strcat(seedh_ptr, data); // and length
  952.  
  953.   count = count + ret_code;
  954.   Ret_code = strlen(seedh4);
  955.   if (ret_code > 0) strcat(seedh, seedh4);  // shove in seedh 4
  956.   itos(count, word);   // convert number to ascii rep..
  957.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  958.   itos(Ret_code, data); // convert length to ascii
  959.   strcat(seedh_ptr, word); // save start
  960.   strcat(seedh_ptr, data); // and length
  961.  
  962.   count = count + ret_code;
  963.   Ret_code = strlen(seedh5);
  964.   if (ret_code > 0) strcat(seedh, seedh5);  // shove in seedh 5
  965.   itos(count, word);   // convert number to ascii rep..
  966.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  967.   itos(Ret_code, data); // convert length to ascii
  968.   strcat(seedh_ptr, word); // save start
  969.   strcat(seedh_ptr, data); // and length
  970.  
  971.   count = count + ret_code;
  972.   Ret_code = strlen(seedh6);
  973.   if (ret_code > 0) strcat(seedh, seedh6);  // shove in seedh 6
  974.   itos(count, word);   // convert number to ascii rep..
  975.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  976.   itos(Ret_code, data); // convert length to ascii
  977.   strcat(seedh_ptr, word); // save start
  978.   strcat(seedh_ptr, data); // and length
  979.  
  980.   count = count + ret_code;
  981.   Ret_code = strlen(seedh7);
  982.   if (ret_code > 0) strcat(seedh, seedh7);  // shove in seedh 7
  983.   itos(count, word);   // convert number to ascii rep..
  984.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  985.   itos(Ret_code, data); // convert length to ascii
  986.   strcat(seedh_ptr, word); // save start
  987.   strcat(seedh_ptr, data); // and length
  988.  
  989.   count = count + ret_code;
  990.   Ret_code = strlen(seedh8);
  991.   if (ret_code > 0) strcat(seedh, seedh8);  // shove in seedh 8
  992.   itos(count, word);   // convert number to ascii rep..
  993.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  994.   itos(Ret_code, data); // convert length to ascii
  995.   strcat(seedh_ptr, word); // save start
  996.   strcat(seedh_ptr, data); // and length
  997.  
  998.   count = count + ret_code;
  999.   Ret_code = strlen(seedh9);
  1000.   if (ret_code > 0) strcat(seedh, seedh9);  // shove in seedh 9
  1001.   itos(count, word);   // convert number to ascii rep..
  1002.   if (strlen(word) == 1) inschrs("0", word, 0, 1); // make it two digits
  1003.   itos(Ret_code, data); // convert length to ascii
  1004.   strcat(seedh_ptr, word); // save start
  1005.   strcat(seedh_ptr, data); // and length
  1006.  
  1007.   if (hack_ptr > 0)  // parse out hack0
  1008.   {
  1009.     string = hack0; // stash hack0
  1010.  
  1011.     ret_code = parse_hack(); // parse the mother
  1012.     hack0 = data;   // save parsed hack string.
  1013.     hck0_ptr = word;  // and hack0 pointers
  1014.     hck0_sdptr = data1; // and seed pointers
  1015.     if (hck0_ptr == "")      // bummer no plates
  1016.     {
  1017.       Prints("No PLATEn or file found in HACK record #1.");
  1018.       if (passfh) fclose(passfh);
  1019.       return -99;
  1020.     }
  1021.     else
  1022.     {
  1023.       string = hack0;  // stash hack
  1024.       data = hck0_ptr; // stash pointers
  1025.       Ret_code = init_hack(); // get locations
  1026.       hck0_val = word;   // and save values...
  1027.       hack0 = string;
  1028.       hck0_seed = data2; // seeds dudez...
  1029.       hacko0 = offset; // PASSFILE offset
  1030.       hackpwl0 = pwl;
  1031.     }
  1032.   }
  1033.  
  1034.   if (hack_ptr > 1)  // parse out hack1
  1035.   {
  1036.     string = hack1; // stash hack1
  1037.  
  1038.     ret_code = parse_hack(); // parse the mother
  1039.     hack1 = data;   // save parsed hack string.
  1040.     hck1_ptr = word;  // and hack0 pointers
  1041.     hck1_sdptr = data1; // and seed pointers
  1042.     if (hck1_ptr == "")      // bummer no plates
  1043.     {
  1044.       Prints("No PLATEn found in HACK record #2.");
  1045.       if (passfh) fclose(passfh);
  1046.       return -99;
  1047.     }
  1048.     else
  1049.     {
  1050.       string = hack1;  // stash hack
  1051.       data = hck1_ptr; // stash pointers
  1052.       Ret_code = init_hack(); // get locations
  1053.       hck1_val = word;   // and save values...
  1054.       hack1 = string;
  1055.       hck1_seed = data2; // seeds dudez...
  1056.       hacko1 = offset; // PASSFILE offset
  1057.       hackpwl1 = pwl;
  1058.     }
  1059.   }
  1060.  
  1061.   if (hack_ptr > 2)  // parse out hack2
  1062.   {
  1063.     string = hack2; // stash hack2
  1064.  
  1065.     ret_code = parse_hack(); // parse the mother
  1066.     hack2 = data;   // save parsed hack string.
  1067.     hck2_ptr = word;  // and hack0 pointers
  1068.     hck2_sdptr = data1; // and seed pointers
  1069.     if (hck2_ptr == "")      // bummer no plates
  1070.     {
  1071.       Prints("No PLATEn found in HACK record #3.");
  1072.       if (passfh) fclose(passfh);
  1073.       return -99;
  1074.     }
  1075.     else
  1076.     {
  1077.       string = hack2;  // stash hack
  1078.       data = hck2_ptr; // stash pointers
  1079.       Ret_code = init_hack(); // get locations
  1080.       hck2_val = word;   // and save values...
  1081.       hack2 = string;
  1082.       hck2_seed = data2; // seeds dudez...
  1083.       hacko2 = offset; // PASSFILE offset
  1084.       hackpwl2 = pwl;
  1085.     }
  1086.   }
  1087.  
  1088.   if (hack_ptr > 3)  // parse out hack3
  1089.   {
  1090.     string = hack3; // stash hack3
  1091.  
  1092.     ret_code = parse_hack(); // parse the mother
  1093.     hack3 = data;   // save parsed hack string.
  1094.     hck3_ptr = word;  // and hack3 pointers
  1095.     hck3_sdptr = data1; // and seed pointers
  1096.     if (hck3_ptr == "")      // bummer no plates
  1097.     {
  1098.       Prints("No PLATEn found in HACK record #4.");
  1099.       if (passfh) fclose(passfh);
  1100.       return -99;
  1101.     }
  1102.     else
  1103.     {
  1104.       string = hack3;  // stash hack
  1105.       data = hck3_ptr; // stash pointers
  1106.       Ret_code = init_hack(); // get locations
  1107.       hck3_val = word;   // and save values...
  1108.       hack3 = string;
  1109.       hck3_seed = data2; // seeds dudez...
  1110.       hacko3 = offset; // PASSFILE offset
  1111.       hackpwl3 = pwl;
  1112.     }
  1113.   }
  1114.  
  1115.   if (hack_ptr > 4)  // parse out hack4
  1116.   {
  1117.     string = hack4; // stash hack4
  1118.  
  1119.     ret_code = parse_hack(); // parse the mother
  1120.     hack4 = data;   // save parsed hack string.
  1121.     hck4_ptr = word;  // and hack0 pointers
  1122.     hck4_sdptr = data1; // and seed pointers
  1123.     if (hck4_ptr == "")      // bummer no plates
  1124.     {
  1125.       Prints("No PLATEn found in HACK record #5.");
  1126.       if (passfh) fclose(passfh);
  1127.       return -99;
  1128.     }
  1129.     else
  1130.     {
  1131.       string = hack4;  // stash hack
  1132.       data = hck4_ptr; // stash pointers
  1133.       Ret_code = init_hack(); // get locations
  1134.       hck4_val = word;   // and save values...
  1135.       hack4 = string;
  1136.       hck4_seed = data2; // seeds dudez...
  1137.       hacko4 = offset; // PASSFILE offset
  1138.       hackpwl4 = pwl;
  1139.     }
  1140.   }
  1141.  
  1142.   if (hack_ptr > 5)  // parse out hack5
  1143.   {
  1144.     string = hack5; // stash hack5
  1145.  
  1146.     ret_code = parse_hack(); // parse the mother
  1147.     hack5 = data;   // save parsed hack string.
  1148.     hck5_ptr = word;  // and hack pointers
  1149.     hck5_sdptr = data1; // and seed pointers
  1150.     if (hck5_ptr == "")      // bummer no plates
  1151.     {
  1152.       Prints("No PLATEn found in HACK record #6.");
  1153.       if (passfh) fclose(passfh);
  1154.       return -99;
  1155.     }
  1156.     else
  1157.     {
  1158.       string = hack5;  // stash hack
  1159.       data = hck5_ptr; // stash pointers
  1160.       Ret_code = init_hack(); // get locations
  1161.       hck5_val = word;   // and save values...
  1162.       hack5 = string;
  1163.       hck5_seed = data2; // seeds dudez...
  1164.       hacko5 = offset; // PASSFILE offset
  1165.       hackpwl5 = pwl;
  1166.     }
  1167.   }
  1168.  
  1169.   if (hack_ptr > 6)  // parse out hack6
  1170.   {
  1171.     string = hack6; // stash hack6
  1172.  
  1173.     ret_code = parse_hack(); // parse the mother
  1174.     hack6 = data;   // save parsed hack string.
  1175.     hck6_ptr = word;  // and hack pointers
  1176.     hck6_sdptr = data1; // and seed pointers
  1177.     if (hck6_ptr == "")      // bummer no plates
  1178.     {
  1179.       Prints("No PLATEn found in HACK record #7.");
  1180.       if (passfh) fclose(passfh);
  1181.       return -99;
  1182.     }
  1183.     else
  1184.     {
  1185.       string = hack6;  // stash hack
  1186.       data = hck6_ptr; // stash pointers
  1187.       Ret_code = init_hack(); // get locations
  1188.       hck6_val = word;   // and save values...
  1189.       hack6 = string;
  1190.       hck6_seed = data2; // seeds dudez...
  1191.       hacko6 = offset; // PASSFILE offset
  1192.       hackpwl6 = pwl;
  1193.     }
  1194.   }
  1195.  
  1196.   if (hack_ptr > 7)  // parse out hack7
  1197.   {
  1198.     string = hack7; // stash hack7
  1199.  
  1200.     ret_code = parse_hack(); // parse the mother
  1201.     hack7 = data;   // save parsed hack string.
  1202.     hck7_ptr = word;  // and hack pointers
  1203.     hck7_sdptr = data1; // and seed pointers
  1204.     if (hck7_ptr == "")      // bummer no plates
  1205.     {
  1206.       Prints("No PLATEn found in HACK record #8.");
  1207.       if (passfh) fclose(passfh);
  1208.       return -99;
  1209.     }
  1210.     else
  1211.     {
  1212.       string = hack7;  // stash hack
  1213.       data = hck7_ptr; // stash pointers
  1214.       Ret_code = init_hack(); // get locations
  1215.       hck7_val = word;   // and save values...
  1216.       hack7 = string;
  1217.       hck7_seed = data2; // seeds dudez...
  1218.       hacko7 = offset; // PASSFILE offset
  1219.       hackpwl7 = pwl;
  1220.     }
  1221.   }
  1222.  
  1223.   if (hack_ptr > 8)  // parse out hack8
  1224.   {
  1225.     string = hack8; // stash hack8
  1226.  
  1227.     ret_code = parse_hack(); // parse the mother
  1228.     hack8 = data;   // save parsed hack string.
  1229.     hck8_ptr = word;  // and hack0 pointers
  1230.     hck8_sdptr = data1; // and seed pointers
  1231.     if (hck8_ptr == "")      // bummer no plates
  1232.     {
  1233.       Prints("No PLATEn found in HACK record #9.");
  1234.       if (passfh) fclose(passfh);
  1235.       return -99;
  1236.     }
  1237.     else
  1238.     {
  1239.       string = hack8;  // stash hack
  1240.       data = hck8_ptr; // stash pointers
  1241.       Ret_code = init_hack(); // get locations
  1242.       hck8_val = word;   // and save values...
  1243.       hack8 = string;
  1244.       hck8_seed = data2; // seeds dudez...
  1245.       hacko8 = offset; // PASSFILE offset
  1246.       hackpwl8 = pwl;
  1247.     }
  1248.   }
  1249.  
  1250.   if (hack_ptr > 9)  // parse out hack9
  1251.   {
  1252.     string = hack9; // stash hack9
  1253.  
  1254.     ret_code = parse_hack(); // parse the mother
  1255.     hack9 = data;   // save parsed hack string.
  1256.     hck9_ptr = word;  // and hack0 pointers
  1257.     hck9_sdptr = data1; // and seed pointers
  1258.     if (hck9_ptr == "")      // bummer no plates
  1259.     {
  1260.       Prints("No PLATEn found in HACK record #10.");
  1261.       if (passfh) fclose(passfh);
  1262.       return -99;
  1263.     }
  1264.     else
  1265.     {
  1266.       string = hack9;  // stash hack
  1267.       data = hck9_ptr; // stash pointers
  1268.       Ret_code = init_hack(); // get locations
  1269.       hck9_val = word;   // and save values...
  1270.       hack9 = string;
  1271.       hck9_seed = data2; // seeds dudez...
  1272.       hacko9 = offset; // PASSFILE offset
  1273.       hackpwl9 = pwl;
  1274.     }
  1275.   }
  1276.  
  1277.   if (loop == strlen(order))
  1278.   {
  1279.     Prints("LOOP cannot be the last record.");
  1280.     if (passfh) fclose(passfh);
  1281.     return -99;
  1282.   }
  1283.  
  1284. ///////////////// end control file processing ///////////////////////
  1285.  
  1286.   flushbuf();     // clear any shit in the remote input buffer.
  1287.  
  1288.   Clear_scr();    // Let's start with a clear screen.
  1289.  
  1290.   prints("");
  1291.   prints("         Control file accepted, off to the races!!!!!");
  1292.   ret_code = Display_shit("         Logging is: ", log, ".");
  1293.   ret_code = Display_shit("         Good codes file is: ", good, ".");
  1294.   prints("");
  1295.  
  1296.   if (testmode) Prints("               TEST = YES run only.");
  1297.   prints("");
  1298.  
  1299.   goodfile = fopen(good, "a");   // open good file
  1300.   if (logit) logfile = fopen(log, "a");   // open log file if needed
  1301.  
  1302.   count = 1;  // init count...
  1303.   while (1)
  1304.   {
  1305.     if (!testmode) dial(dialnum, 0, 1);
  1306.  
  1307.     carry = 1; // set hack carry true
  1308.     ord_ptr = -2;
  1309.     trycount = 0;
  1310.  
  1311.     while (ord_ptr < strlen(order))
  1312.     {
  1313.       ord_ptr = ord_ptr + 2;
  1314.       if (ord_ptr == strlen(order))
  1315.       {
  1316.         ord_ptr = loop; // loop back
  1317.         carry = 1; // set hack carry true...
  1318.         count = count + 1;
  1319.         if ((count > hackcount) and (hackcount > 0))
  1320.         {
  1321.           Prints("");
  1322.           Prints("            Hack count exceeded...");
  1323.           if (!testmode) hangup();
  1324.           if (passfh) fclose(passfh);
  1325.           return -99; // time to quit
  1326.         }
  1327.       }
  1328.  
  1329.       substr(order, ord_ptr, 1, data);    // get value
  1330.       substr(order, ord_ptr + 1, 1, data1); // and pointer
  1331.  
  1332.       if (data == "1")
  1333.       {
  1334.         snd_ptr = stoi(data1);
  1335.         pos = snd_ptr * 4;
  1336.         substr(send_ptr, pos, 2, string);
  1337.         substr(send_ptr, pos + 2, 2, data);
  1338.         pos = stoi(string);    // get position
  1339.         ret_code = stoi(data);    // and length
  1340.         substr(sendtxt, pos, ret_code, string);  // get actual string
  1341.         if (testmode) ret_code = display_shit("   Sending: ",string, " ");
  1342.         else cputs(string);   // and send it
  1343.       }
  1344.  
  1345.       if (data == "2")
  1346.       {
  1347.         wt_ptr = stoi(data1);
  1348.         pos = wt_ptr * 4;
  1349.         substr(wait_ptr, pos, 2, string);
  1350.         substr(wait_ptr, pos + 2, 2, data);
  1351.         pos = stoi(string);    // get position
  1352.         ret_code = stoi(data);    // and length
  1353.         substr(wait, pos, ret_code, string);  // get actual string
  1354.         ret_code = 1;  // init ret_code to true.
  1355.         for (pos = 0; pos < strlen(string); pos = pos + 1)
  1356.         {
  1357.           substr(string, pos, 1, data); // get one char
  1358.           if ( data < "0" or data > "9") ret_code = 0;
  1359.         }
  1360.         if (ret_code)
  1361.         {
  1362.           pos = stoi(string); // get numeric delay time
  1363.           if (testmode) ret_code = display_shit("   Delaying ", string, " tenths of seconds");
  1364.           else delay(pos);  // and wait...
  1365.         }
  1366.         else
  1367.         {
  1368.           if (testmode) Ret_code = display_shit("   Waiting for: ", string,".");
  1369.           else
  1370.           {
  1371.             ret_code = waitfor(string, 300);   // wait for 5 minutes
  1372.             if (!ret_code and !carrier())
  1373.             {
  1374.               pos = display_shit("   Expected string ", string, "not received.");
  1375.               if (passfh) fclose(passfh);
  1376.               return -99;
  1377.             }
  1378.           }
  1379.         }
  1380.       }
  1381.  
  1382.       if (data == "3")
  1383.       {
  1384.         hack_ptr = stoi(data1);
  1385.         if (hack_ptr == 0)
  1386.         {
  1387.            string = hack0;
  1388.            word = hck0_val;
  1389.            data2 = hck0_seed;
  1390.            offset = hacko0;
  1391.            pwl = hackpwl0;
  1392.            hackl0 = string;
  1393.            hckl0_val = word;
  1394.            hacklpwl0 = pwl;
  1395.         }
  1396.         if (hack_ptr == 1)
  1397.         {
  1398.            string = hack1;
  1399.            word = hck1_val;
  1400.            data2 = hck1_seed;
  1401.            offset = hacko1;
  1402.            pwl = hackpwl1;
  1403.            hackl1 = string;
  1404.            hckl1_val = word;
  1405.            hacklpwl1 = pwl;
  1406.         }
  1407.         if (hack_ptr == 2)
  1408.         {
  1409.            string = hack2;
  1410.            word = hck2_val;
  1411.            data2 = hck2_seed;
  1412.            offset = hacko2;
  1413.            pwl = hackpwl2;
  1414.            hackl2 = string;
  1415.            hckl2_val = word;
  1416.            hacklpwl2 = pwl;
  1417.         }
  1418.         if (hack_ptr == 3)
  1419.         {
  1420.            string = hack3;
  1421.            word = hck3_val;
  1422.            data2 = hck3_seed;
  1423.            offset = hacko3;
  1424.            pwl = hackpwl3;
  1425.            hackl3 = string;
  1426.            hckl3_val = word;
  1427.            hacklpwl3 = pwl;
  1428.         }
  1429.         if (hack_ptr == 4)
  1430.         {
  1431.            string = hack4;
  1432.            word = hck4_val;
  1433.            data2 = hck4_seed;
  1434.            offset = hacko4;
  1435.            pwl = hackpwl4;
  1436.            hackl4 = string;
  1437.            hckl4_val = word;
  1438.            hacklpwl4 = pwl;
  1439.         }
  1440.         if (hack_ptr == 5)
  1441.         {
  1442.            string = hack5;
  1443.            word = hck5_val;
  1444.            data2 = hck5_seed;
  1445.            offset = hacko5;
  1446.            pwl = hackpwl5;
  1447.            hackl5 = string;
  1448.            hckl5_val = word;
  1449.            hacklpwl5 = pwl;
  1450.         }
  1451.         if (hack_ptr == 6)
  1452.         {
  1453.            string = hack6;
  1454.            word = hck6_val;
  1455.            data2 = hck6_seed;
  1456.            offset = hacko6;
  1457.            pwl = hackpwl6;
  1458.            hackl6 = string;
  1459.            hckl6_val = word;
  1460.            hacklpwl6 = pwl;
  1461.         }
  1462.         if (hack_ptr == 7)
  1463.         {
  1464.            string = hack7;
  1465.            word = hck7_val;
  1466.            data2 = hck7_seed;
  1467.            offset = hacko7;
  1468.            pwl = hackpwl7;
  1469.            hackl7 = string;
  1470.            hckl7_val = word;
  1471.            hacklpwl7 = pwl;
  1472.         }
  1473.         if (hack_ptr == 8)
  1474.         {
  1475.            string = hack8;
  1476.            word = hck8_val;
  1477.            data2 = hck8_seed;
  1478.            offset = hacko8;
  1479.            pwl = hackpwl8;
  1480.            hackl8 = string;
  1481.            hckl8_val = word;
  1482.            hacklpwl8 = pwl;
  1483.         }
  1484.         if (hack_ptr == 9)
  1485.         {
  1486.           string = hack9;
  1487.           word = hck9_val;
  1488.           data2 = hck9_seed;
  1489.           offset = hacko9;
  1490.           pwl = hackpwl8;
  1491.           hackl9 = string;
  1492.           hckl9_val = word;
  1493.           hacklpwl9 = pwl;
  1494.         }
  1495.         if (logit)        // logit
  1496.         {
  1497.           fputs(string, logfile);   // write it
  1498.           fputs("^M^J", logfile);   // with cr lf
  1499.         }
  1500.         if (testmode) Ret_code = display_shit("   Hacking: ", string," ");
  1501.         else
  1502.         {
  1503.           if (show_hack)
  1504.           {
  1505.             x = getx();
  1506.             y = gety();
  1507.             gotoxy(40, y);
  1508.             printsc(string);
  1509.             gotoxy(x, y);
  1510.           }
  1511.           cputs(string); // send it
  1512.         }
  1513.         if (!carrier() and !testmode)
  1514.         {
  1515.           Prints("");
  1516.           Prints("");
  1517.           Ret_code = display_shit("   Connection lost, will resume hacking at: ",hack0, " ");
  1518.           break;
  1519.         }
  1520.         if (carry)
  1521.         {
  1522.           Bump_good = bump_hack();
  1523.           if (hack_ptr == 0)
  1524.           {
  1525.             hack0 = string;
  1526.             hck0_val = word; // stash it
  1527.             hackpwl0 = pwl;
  1528.           }
  1529.           if (hack_ptr == 1)
  1530.           {
  1531.             hack1 = string;
  1532.             hck1_val = word; // stash it
  1533.             hackpwl1 = pwl;
  1534.           }
  1535.           if (hack_ptr == 2)
  1536.           {
  1537.             hack2 = string;
  1538.             hck2_val = word; // stash it
  1539.             hackpwl2 = pwl;
  1540.           }
  1541.           if (hack_ptr == 3)
  1542.           {
  1543.             hack3 = string;
  1544.             hck3_val = word; // stash it
  1545.             hackpwl3 = pwl;
  1546.           }
  1547.           if (hack_ptr == 4)
  1548.           {
  1549.             hack4 = string;
  1550.             hck4_val = word; // stash it
  1551.             hackpwl4 = pwl;
  1552.           }
  1553.           if (hack_ptr == 5)
  1554.           {
  1555.             hack5 = string;
  1556.             hck5_val = word; // stash it
  1557.             hackpwl5 = pwl;
  1558.           }
  1559.           if (hack_ptr == 6)
  1560.           {
  1561.             hack6 = string;
  1562.             hck6_val = word; // stash it
  1563.             hackpwl6 = pwl;
  1564.           }
  1565.           if (hack_ptr == 7)
  1566.           {
  1567.             hack7 = string;
  1568.             hck7_val = word; // stash it
  1569.             hackpwl7 = pwl;
  1570.           }
  1571.           if (hack_ptr == 8)
  1572.           {
  1573.             hack8 = string;
  1574.             hck8_val = word; // stash it
  1575.             hackpwl8 = pwl;
  1576.           }
  1577.           if (hack_ptr == 9)
  1578.           {
  1579.             hack9 = string;
  1580.             hck9_val = word; // stash it
  1581.             hackpwl9 = pwl;
  1582.           }
  1583.         }
  1584.  
  1585.       }  // end data=3 loop
  1586.  
  1587.       if (strlen(order) - 2 == ord_ptr)  // checked for cracked
  1588.       {
  1589.         if (testmode) ret_code = display_shit("   Waiting for :", cracked, " string.");
  1590.         else
  1591.         {
  1592.           trycount = trycount + 1;  // increment try crack count
  1593.           ret_code = waitfor(cracked, delay_tim);  // wait for cracked ?
  1594.           if ((Ret_code and !no_good) or (!ret_code and NO_good))   // log success !!!!
  1595.           {
  1596.             fputs(hackl0, goodfile);   // write it
  1597.             fputs("^M^J", goodfile);   // with cr lf
  1598.             if (hackl1 != "")
  1599.             {
  1600.               fputs(hackl1, goodfile);   // write it
  1601.               fputs("^M^J", goodfile);   // with cr lf
  1602.             }
  1603.             if (hackl2 != "")
  1604.             {
  1605.               fputs(hackl2, goodfile);   // write it
  1606.               fputs("^M^J", goodfile);   // with cr lf
  1607.             }
  1608.             if (hackl3 != "")
  1609.             {
  1610.               fputs(hackl3, goodfile);   // write it
  1611.               fputs("^M^J", goodfile);   // with cr lf
  1612.             }
  1613.             if (hackl4 != "")
  1614.             {
  1615.               fputs(hackl4, goodfile);   // write it
  1616.               fputs("^M^J", goodfile);   // with cr lf
  1617.             }
  1618.             if (hackl5 != "")
  1619.             {
  1620.               fputs(hackl5, goodfile);   // write it
  1621.               fputs("^M^J", goodfile);   // with cr lf
  1622.             }
  1623.             if (hackl6 != "")
  1624.             {
  1625.               fputs(hackl6, goodfile);   // write it
  1626.               fputs("^M^J", goodfile);   // with cr lf
  1627.             }
  1628.             if (hackl7 != "")
  1629.             {
  1630.               fputs(hackl7, goodfile);   // write it
  1631.               fputs("^M^J", goodfile);   // with cr lf
  1632.             }
  1633.             if (hackl8 != "")
  1634.             {
  1635.               fputs(hackl8, goodfile);   // write it
  1636.               fputs("^M^J", goodfile);   // with cr lf
  1637.             }
  1638.             if (hackl9 != "")
  1639.             {
  1640.               fputs(hackl9, goodfile);   // write it
  1641.               fputs("^M^J", goodfile);   // with cr lf
  1642.             }
  1643.             fflush(goodfile);          // force disk write
  1644.             hangup();  // hang up and start again (maybe)
  1645.             if (stop)     // close files
  1646.             {
  1647.               fclose(goodfile);  // close it
  1648.               if (logit) fclose(logfile); // and this tooo!!!
  1649.               Prints("");
  1650.               Prints("");
  1651.               Prints("    Hacker cracked a code and ended!!!!");
  1652.               if (passfh) fclose(passfh);
  1653.               return 0;
  1654.             }
  1655.           }
  1656.           if (!testmode and force > 0 and trycount == force)
  1657.           {
  1658.             hangup();
  1659.             Prints("");
  1660.             Prints("");
  1661.             Ret_code = display_shit("   Connection terminated, will resume hacking at: ",hack0, " ");
  1662.             break;
  1663.           }
  1664.           if (!carrier() and !testmode)
  1665.           {
  1666.             hack0 = hackl0;   // reset hack
  1667.             hack1 = hackl1;   // reset hack
  1668.             hack2 = hackl2;   // reset hack
  1669.             hack3 = hackl3;   // reset hack
  1670.             hack4 = hackl4;   // reset hack
  1671.             hack5 = hackl5;   // reset hack
  1672.             hack6 = hackl6;   // reset hack
  1673.             hack7 = hackl7;   // reset hack
  1674.             hack8 = hackl8;   // reset hack
  1675.             hack9 = hackl9;   // reset hack
  1676.             hck0_val = hckl0_val;
  1677.             hck1_val = hckl1_val;
  1678.             hck2_val = hckl2_val;
  1679.             hck3_val = hckl3_val;
  1680.             hck4_val = hckl4_val;
  1681.             hck5_val = hckl5_val;
  1682.             hck6_val = hckl6_val;
  1683.             hck7_val = hckl7_val;
  1684.             hck8_val = hckl8_val;
  1685.             hck9_val = hckl9_val;
  1686.             hackpwl0 = hacklpwl0;
  1687.             hackpwl1 = hacklpwl1;
  1688.             hackpwl2 = hacklpwl2;
  1689.             hackpwl3 = hacklpwl3;
  1690.             hackpwl4 = hacklpwl4;
  1691.             hackpwl5 = hacklpwl5;
  1692.             hackpwl6 = hacklpwl6;
  1693.             hackpwl7 = hacklpwl7;
  1694.             hackpwl8 = hacklpwl8;
  1695.             hackpwl9 = hacklpwl9;
  1696.             Prints("");
  1697.             Prints("");
  1698.             Ret_code = display_shit("   Connection lost, will resume hacking at: ",hack0, " ");
  1699.             break;
  1700.           }
  1701.         }
  1702.       }  // end wait for cracked
  1703.  
  1704.       if (!bump_good and strlen(order) - 2 == ord_ptr)
  1705.       {
  1706.         if (passfh and !got_master and master_file)
  1707.         {
  1708.           ret_code = display_shit("End of file for ", passfile, ", switching to THPASS.LST.");
  1709.           got_master = 1;
  1710.           passfile = "THPASS.LST";
  1711.           fclose(passfh);
  1712.           passfh = fopen(passfile, "r");
  1713.           if (passfile == 0)
  1714.           {
  1715.             Prints("Unable to open master file, THPASS.LST");
  1716.             if (!testmode) hangup();
  1717.             return -99;
  1718.           }
  1719.         }
  1720.         else
  1721.         {
  1722.           Prints("");
  1723.           Prints("");
  1724.           Prints("Phuck.. no more hack possibilities.");
  1725.           if (!testmode) hangup();
  1726.           if (passfh) fclose(passfh);
  1727.           Return 0;
  1728.         }
  1729.       }
  1730.  
  1731.     }  // end ord_prt < strlen loop
  1732.  
  1733.   }    // end dial loop
  1734.  
  1735.   if (!testmode) hangup();
  1736.   fclose(goodfile);  // close it
  1737.   if (logit) fclose(logfile); // and this tooo!!!
  1738.   if (passfh) fclose(passfh);
  1739.  
  1740. }
  1741. //////////////////////// end main program //////////////////////////
  1742.  
  1743. //////// functions called from main //////////////////
  1744.  
  1745. read_file(int fh)    // reads the next record in file fh.
  1746.  
  1747. {
  1748.   if (feof(fh)) return "EOF";  // at end, return nothing
  1749.   fgets(data,80,fh);
  1750.   return data;
  1751. }
  1752.  
  1753. Get_next_word(str char)    // puts the next word into word from string
  1754.  
  1755. {
  1756.   int len = 0;
  1757.   word = "";   // clear out word
  1758.  
  1759.   if (pos > strlen(string))   // to far, just return with notfound
  1760.     return -2;
  1761.  
  1762.   len = strchr(string, pos, char); // look for char
  1763.  
  1764.   if (len == -1)             // not found assume rest of string
  1765.     len = strlen(string);
  1766.  
  1767.   len = len - pos;               // get # of charecters
  1768.  
  1769.   if (len == 0)                // if zero return with not found
  1770.     return -1;
  1771.  
  1772.   substr(string, pos, len, word);  // move chars to word
  1773.   pos = pos + len + 1;            // point past last char found
  1774.  
  1775.   return len;            // and get the fuck outta here...
  1776. }
  1777.  
  1778. Display_shit( str str1, str str2, str str3)
  1779.  
  1780. {
  1781.   printsc(str1);       // display 3 strings on 1 line...
  1782.   printsc(str2);
  1783.   prints(str3);
  1784.   return 0;
  1785. }
  1786.  
  1787. Read_kb()     // read keyboard
  1788.  
  1789. {
  1790.   count = gets(word, 60);
  1791.   if (count == -1) count = 0;
  1792.   return count;
  1793. }
  1794.  
  1795. Parse_hack()       // parse hack stringss
  1796.  
  1797. {
  1798.   int num1, num2, num3, pfpos, pf;
  1799.   str char[1], alpha[2];
  1800.   str temp[60];
  1801.   int fp = 0; // Found Plate
  1802.  
  1803.   pos = 0;     // set pos to zero....
  1804.   data = "";    // init data to null..........     new hack string
  1805.   data1 = "";    // init data1 to null..........   hckn_sdptr
  1806.   word = "";    // init word to null               hckn_ptr
  1807.  
  1808.   ret_code = conv_crlf(); // convert those CRs and LFs....
  1809.  
  1810.   pfpos = strpos(string, "PASSFILE", 0);  // look for file hacking
  1811.   if (pfpos >= 0) pf = 1;
  1812.   else pf = 0;
  1813.  
  1814.   while (pos < strlen(string)) // search until end of word
  1815.   {
  1816.     ret_code = strpos(string, "PLATE", pos);  // look for it...
  1817.  
  1818.     if (ret_code < 0)  Break; // no more plates
  1819.     else
  1820.     {
  1821.       num1 = Ret_code - pos;
  1822.       if (num1 > 0)  // stash non plate shit...
  1823.       {
  1824.         substr(string, pos, num1, temp); // isolate it
  1825.         strcat(data, temp);             // and shove it in...
  1826.         pos = pos + num1;  // bump pos
  1827.       }
  1828.       if (pf and !fp and ret_code > pfpos)  // stash
  1829.       {
  1830.         fp = 1;    // set Found Plate to true
  1831.         pfpos = strpos(data, "PASSFILE", 0);  // look for file hacking
  1832.         itos(pfpos, alpha);  // staring pos (in ascii)
  1833.         if (strlen(alpha) == 1) inschrs("0", alpha, 0, 1); // two digits plz
  1834.         strcat(word, alpha); // stash position
  1835.         strcat(word, "F");   // and file indicator
  1836.         strcat(data1, "000");  // and hckn_sdptr
  1837.       }
  1838.       count = ret_code + 5; // point to the plate #
  1839.       substr(string, count, 1, char);
  1840.       num1 = stoi(char);    // get it numerically
  1841.       num3 = num1;          // and save number for seeds....
  1842.       num1 = num1 * 3;       // mutiply by three...
  1843.       substr(plt_ptr, num1, 2, alpha);    // get plate posotion
  1844.       substr(plt_ptr, num1 + 2, 1, char);   // and length
  1845.       num1 = stoi(alpha); // numericly
  1846.       num2 = stoi(char); // numericly
  1847.       substr(plate, num1, num2, temp); // put plate into temp
  1848.       num1 = strlen(data);     // now get current length...
  1849.       strcat(data, temp);     // append plate
  1850.       itos(num1, alpha); // convert to ascii
  1851.       if (strlen(alpha) == 1) inschrs("0", alpha, 0, 1); // two digits plz
  1852.       itos(num2, char);    // convert to ascii
  1853.       strcat(word, alpha);    // and save position
  1854.       strcat(word, char);    // and lenght
  1855.       itos(num3, char);  // seed number in ascii
  1856.       strcat(data1, alpha); // save position
  1857.       strcat(data1, char); // and seed number
  1858.       pos = pos + 6;        // bump pos
  1859.     }
  1860.   }
  1861.  
  1862.   num1 = strlen(string) - pos;      // get number of characters left
  1863.   if (num1 > 0)    // more non plate at the end to stash..
  1864.   {
  1865.     substr(string, pos, num1, temp);  // isolate it
  1866.     strcat(data, temp);              // and apppend
  1867.   }
  1868.  
  1869.   if (!fp and pf) // stash password file
  1870.   {
  1871.     pfpos = strpos(data, "PASSFILE", 0);  // look for file hacking
  1872.     itos(pfpos, alpha);  // staring pos (in ascii)
  1873.     if (strlen(alpha) == 1) inschrs("0", alpha, 0, 1); // two digits plz
  1874.     strcat(word, alpha); // stash position
  1875.     strcat(word, "F");   // and file indicator
  1876.   }
  1877.  
  1878.   if (pf)  // open password file.
  1879.   {
  1880.     passfh = fopen(passfile, "r");
  1881.     if (passfh == 0)       // error if no file.
  1882.     {
  1883.       alarm(1);
  1884.       Ret_code = display_shit("Error opening PASSFILE", passfile, ".");
  1885.       word = "";
  1886.     }
  1887.     if (seek_record)
  1888.     {
  1889.       Prints("");
  1890.       Printsc("Skipping the first ");
  1891.       Printn(seek_record);
  1892.       prints(" records.");
  1893.       for(num1 = 1; num1 < seek_record; num1 = num1 + 1)
  1894.       {
  1895.         fgets(password,80,passfh);     // get password
  1896.         if (password == cntrlz or feof(passfh))  // end of file
  1897.         {
  1898.           if (master_file and !got_master)
  1899.           {
  1900.             ret_code = display_shit("End of file for ", passfile, ", switching to THPASS.LST.");
  1901.             got_master = 1;
  1902.             passfile = "THPASS.LST";
  1903.             fclose(passfh);
  1904.             passfh = fopen(passfile, "r");
  1905.           }
  1906.           else
  1907.           {
  1908.             Prints("SKIP went past the end of file.");
  1909.             word = "";
  1910.             Break;
  1911.           }
  1912.         }
  1913.       }
  1914.     }
  1915.   }
  1916.  
  1917.   return 0;
  1918. }
  1919.  
  1920. init_hack()     // init some more shit - fuck I need real arrays
  1921.  
  1922. {
  1923. // hackn in string and returned there ...
  1924. // hckn_ptr in data
  1925. // hckn_sdptr in data1
  1926. // returns hckn_val in word
  1927. // returns hckn_seed in data2
  1928. // returns PASSFILE offset in offset
  1929. // returns password length in pwl
  1930.  
  1931.   int num1, num2, num3;
  1932.   int num4, num5, num6;
  1933.   int num7;
  1934.   int adjust = 0;
  1935.   str char[2], alpha[2], temp1[2], temp2[2];
  1936.   str templ[9];     // stash seedl
  1937.   str temph[9];       // sand seedh
  1938.   int templl, temphl;  // lenght of tempz...
  1939.  
  1940.   word = "";    // null it dude...
  1941.   data2 = "";    // null it dude...
  1942.   count = 0;  // zero it
  1943.   offset = 0;
  1944.   pwl = 0;
  1945.  
  1946.   while (count < strlen(data))
  1947.   {
  1948.     substr(data, count, 2, alpha);  // get position in alpha
  1949.     substr(data, count + 2, 1, char); // get len into char
  1950.     if (char == "F")   // file, not char
  1951.     {
  1952.       strcat(word, "900");   // stash file indic. and 00 pointer
  1953.       strcat(word, alpha);   // and position in hack string
  1954.       strcat(data2, "0000"); // and 0 seed ptrs
  1955.       offset = stoi(alpha); // stash PASSFILE offset in hack
  1956.       if (feof(passfh)) PASSWORD = "EOF";
  1957.       else fgets(password,80,passfh);     // get password
  1958.       pwl = strlen(password);
  1959.       adjust = pwl - 8;
  1960.       delchrs(string, offset, 8); // delete PASSFILE
  1961.       inschrs(password, string, offset, pwl);  // and insert password
  1962.     }       // end file
  1963.     else        //handle plate
  1964.     {
  1965.       num1 = stoi(alpha); // numericly
  1966.       num2 = stoi(char); // numericly
  1967.  
  1968.       substr(data1, count + 2, 1, char); // get associated seed...
  1969.       num4 = stoi(char); // numerically
  1970.       num4 = num4 * 3;
  1971.       templ = "";
  1972.       temph = "";
  1973.       substr(seedl_ptr, num4, 2, alpha);   // get seed position
  1974.       substr(seedl_ptr, num4 + 2, 1, char);   // and length
  1975.       num6 = stoi(alpha); // numerically
  1976.       num5 = stoi(char); // numerically
  1977.       templl = num5; // and save it
  1978.       if (num5 > 0) substr(seedl, num6, num5, templ); // get seedl
  1979.       substr(seedh_ptr, num4, 2, alpha);   // get seed position
  1980.       substr(seedh_ptr, num4 + 2, 1, char);   // and length
  1981.       num6 = stoi(alpha); // numerically
  1982.       num5 = stoi(char); // numerically
  1983.       temphl = num5;   // and save it
  1984.       if (num5 > 0) substr(seedh, num6, num5, temph); // get seedh
  1985.  
  1986.       num2 = num2 + num1; // get ending value...
  1987.       num4 = -1; // init to -1..duh
  1988.       for (num3 = num1; num3 < num2; num3 = num3 + 1)
  1989.       {
  1990.          num7 = num3 + adjust;
  1991.          num4 = num4 + 1;
  1992.          substr(string, num7, 1, char); // get char...
  1993.          alpha = "0";
  1994.          num5 = 0;     // low offset in alphameric
  1995.          num6 = 61;     // high offest in alphameric
  1996.  
  1997.          if (char == "&")
  1998.          {
  1999.            alpha = "1";    // alpha only
  2000.            temp1 = "A";
  2001.            if (templl)     // check for lower bound
  2002.            {
  2003.              substr(templ, num4, 1, temp2); // get seed
  2004.              if (temp2 != char) temp1 = temp2;
  2005.            }
  2006.            num5 = strpos(alphameric, temp1, 0); // get offset
  2007.            copychrs(temp1, string, num7, 1); // stash it
  2008.            temp1 = "Z";
  2009.            if (temphl)
  2010.            {
  2011.              substr(temph, num4, 1, temp2); // get high seed
  2012.              if (temp2 != char) temp1 = temp2; // get it
  2013.            }
  2014.            num6 = strpos(alphameric, temp1, 0);
  2015.          }
  2016.  
  2017.          if (char == "#")
  2018.          {
  2019.            alpha = "2";    // number only
  2020.            temp1 = "0";
  2021.            if (templl)     // check for lower bound
  2022.            {
  2023.              substr(templ, num4, 1, temp2); // get seed
  2024.              if (temp2 != char) temp1 = temp2;
  2025.            }
  2026.            num5 = strpos(alphameric, temp1, 0); // get offset
  2027.            copychrs(temp1, string, num7, 1); // stash it
  2028.            temp1 = "9";
  2029.            if (temphl)
  2030.            {
  2031.              substr(temph, num4, 1, temp2); // get high seed
  2032.              if (temp2 != char) temp1 = temp2; // get it
  2033.            }
  2034.            num6 = strpos(alphameric, temp1, 0);
  2035.          }
  2036.  
  2037.          if (char == "@")
  2038.          {
  2039.            alpha = "3";    // both
  2040.            temp1 = "0";
  2041.            if (templl)     // check for lower bound
  2042.            {
  2043.              substr(templ, num4, 1, temp2); // get seed
  2044.              if (temp2 != char) temp1 = temp2;
  2045.            }
  2046.            num5 = strpos(alphameric, temp1, 0); // get offset
  2047.            copychrs(temp1, string, num7, 1); // stash it
  2048.            temp1 = "Z";
  2049.            if (temphl)
  2050.            {
  2051.              substr(temph, num4, 1, temp2); // get high seed
  2052.              if (temp2 != char) temp1 = temp2; // get it
  2053.            }
  2054.            num6 = strpos(alphameric, temp1, 0);
  2055.          }
  2056.  
  2057.          if (char == "%")
  2058.          {
  2059.            alpha = "4";    // lower case
  2060.            temp1 = "a";
  2061.            if (templl)     // check for lower bound
  2062.            {
  2063.              substr(templ, num4, 1, temp2); // get seed
  2064.              if (temp2 != char) temp1 = temp2;
  2065.            }
  2066.            num5 = strpos(alphameric, temp1, 0); // get offset
  2067.            copychrs(temp1, string, num7, 1); // stash it
  2068.            temp1 = "z";
  2069.            if (temphl)
  2070.            {
  2071.              substr(temph, num4, 1, temp2); // get high seed
  2072.              if (temp2 != char) temp1 = temp2; // get it
  2073.            }
  2074.            num6 = strpos(alphameric, temp1, 0);
  2075.          }
  2076.  
  2077.          if (char == "$")
  2078.          {
  2079.            alpha = "5";    // both upper and lower case
  2080.            temp1 = "A";
  2081.            if (templl)     // check for lower bound
  2082.            {
  2083.              substr(templ, num4, 1, temp2); // get seed
  2084.              if (temp2 != char) temp1 = temp2;
  2085.            }
  2086.            num5 = strpos(alphameric, temp1, 0); // get offset
  2087.            copychrs(temp1, string, num7, 1); // stash it
  2088.            temp1 = "z";
  2089.            if (temphl)
  2090.            {
  2091.              substr(temph, num4, 1, temp2); // get high seed
  2092.              if (temp2 != char) temp1 = temp2; // get it
  2093.            }
  2094.            num6 = strpos(alphameric, temp1, 0);
  2095.          }
  2096.  
  2097.          if (char == "*")
  2098.          {
  2099.            alpha = "6";    // both
  2100.            temp1 = "0";
  2101.            if (templl)     // check for lower bound
  2102.            {
  2103.              substr(templ, num4, 1, temp2); // get seed
  2104.              if (temp2 != char) temp1 = temp2;
  2105.            }
  2106.            num5 = strpos(alphameric, temp1, 0); // get offset
  2107.            copychrs(temp1, string, num7, 1); // stash it
  2108.            temp1 = "z";
  2109.            if (temphl)
  2110.            {
  2111.              substr(temph, num4, 1, temp2); // get high seed
  2112.              if (temp2 != char) temp1 = temp2; // get it
  2113.            }
  2114.            num6 = strpos(alphameric, temp1, 0);
  2115.          }
  2116.  
  2117.          strcat(word, alpha);    // append type
  2118.          itos(num5, alpha); // convert to ascii    stash hi and low seed.
  2119.          if (strlen(alpha) == 1) inschrs("0", alpha, 0, 1); // two digits plz
  2120.          strcat(data2, alpha);   // and stash it here
  2121.          strcat(word, alpha);    // and here
  2122.  
  2123.          itos(num3, alpha); // convert to ascii
  2124.          if (strlen(alpha) == 1) inschrs("0", alpha, 0, 1); // two digits plz
  2125.          strcat(word, alpha);
  2126.  
  2127.          itos(num6, alpha); // convert to ascii
  2128.          if (strlen(alpha) == 1) inschrs("0", alpha, 0, 1); // two digits plz
  2129.          strcat(data2, alpha);
  2130.       }
  2131.     }          // end plate handling
  2132.     count = count + 3;  // bump count
  2133.   }
  2134.  
  2135.   return 0;
  2136. }
  2137.  
  2138. Bump_hack()     // increment hack record (in string)...
  2139.                 // hckn_val passed in word...
  2140.                 // hckn_seed passed in data2
  2141.                 // hackon passed in offset
  2142.                 // hackpwln passed and returned in pwl
  2143. {
  2144.   int num1, num2, num3, num4, num5, num6;
  2145.   str char[2], alpha[2], letter[2], char1[2];
  2146.   str temp[2];
  2147.   int adjust = 0;
  2148.   int oldpwl;
  2149.   int max = 35, min = 0;
  2150.   int done = 0;
  2151.  
  2152.   oldpwl = pwl;
  2153.   num2 = strlen(word);
  2154.   num6 = -4;           // hckn_seed pointer
  2155.   carry = 0;          // set hack carry off
  2156.  
  2157.   for (num1 = 0; num1 < num2; num1 = num1 + 5)
  2158.   {
  2159.     num6 = num6 + 4;
  2160.     substr(word, num1, 1, char); // get type
  2161.     substr(word, num1 + 1, 2, alpha); // get alphameric pointer
  2162.     substr(word, num1 + 3, 2, letter); // get position in hack record
  2163.     if (char == "0") continue; // skip non substitues
  2164.  
  2165.     if (char == "9")         // passfile....
  2166.     {
  2167.       if (feof(passfh))
  2168.       {
  2169.         Fclose(passfh);
  2170.         passfh = Fopen(passfile, "r");
  2171.         fgets(password,80,passfh);     // get password
  2172.       }
  2173.       else
  2174.       {
  2175.         fgets(password,80,passfh);     // get password
  2176.         if (password == cntrlz)  // end of file
  2177.         {
  2178.           Fclose(passfh);
  2179.           passfh = Fopen(passfile, "r");
  2180.           fgets(password,80,passfh);     // get password
  2181.         }
  2182.         else done = 1;
  2183.       }
  2184.       pwl = strlen(password);
  2185.       delchrs(string, offset, oldpwl);
  2186.       inschrs(password, string, offset, pwl);
  2187.       adjust = pwl - 8;
  2188.     }   // end file handling
  2189.     else    // plate
  2190.     {
  2191.       substr(data2, num6, 2, temp);  // get low seed val
  2192.       min = stoi(temp);              // numerically
  2193.       substr(data2, num6 + 2, 2, temp);  // get high seed val
  2194.       max = stoi(temp);              // numerically
  2195.  
  2196.       num3 = stoi(alpha); // numeric pointer
  2197.       num4 = stoi(letter); // numeric position in string
  2198.       num4 = num4 + adjust;  // with adjustment
  2199.       num3 = num3 + 1;  // bump alphameric pointer
  2200.       if (num3 > max) num3 = min;
  2201.       else done = 1;
  2202.       itos (num3, alpha);
  2203.       if (strlen(alpha) == 1) inschrs("0", alpha, 0, 1); // two digits plz
  2204.       copychrs(alpha, word, num1 + 1, 2); // stash new pointer
  2205.       substr(alphameric, num3, 1, char1); // get new value
  2206.       copychrs(char1, string, num4, 1); // new value
  2207.     }                  // end plate handling
  2208.     if (done) break;
  2209.   }
  2210.   carry = !done;
  2211.   return done;
  2212. }
  2213.  
  2214. conv_crlf()        // convert cr and lf charscters in string
  2215.  
  2216. {
  2217.   str char[1] = "";
  2218.   str alpha[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  2219.   int num = 0;
  2220.   int num1 = 0;
  2221.  
  2222.   while (1)
  2223.   {
  2224.     ret_code = strpos(string, carret, num);  // look for CRs..
  2225.     if (ret_code < 0) Break; // nomore CRs..
  2226.     else
  2227.     {
  2228.       delchrs(string, ret_code, 2); // delete those 2 chars
  2229.       inschrs(cr, string, ret_code, 1); // and insert CR
  2230.       num = Ret_code + 1;
  2231.     }
  2232.   }
  2233.  
  2234.   num = 0;
  2235.   while (1)
  2236.   {
  2237.     ret_code = strpos(string, cntrlkey, num);  // look for control key
  2238.     if (ret_code < 0) Break; // nomore LFs..
  2239.     else
  2240.     {
  2241.       num = Ret_code + 1;      // point to next char
  2242.       subchrs(string, num, 1, char);   // get it
  2243.       strupper(char);   // upcase it
  2244.       num1 = strpos(alpha, char, 0); // locate char
  2245.       if (num1 < 0) Num = num + 1; // skip it
  2246.       else
  2247.       {
  2248.         subchrs(cntrlall, num1, 1, char); // stash cntrlcode in char
  2249.         delchrs(string, ret_code, 2); // delete those 2 chars
  2250.         inschrs(char, string, ret_code, 1); // and insert char
  2251.       }
  2252.     }
  2253.   }
  2254.  
  2255.   return 0;
  2256. }
  2257.