home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / crackunx.txt / Sources / crack.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-25  |  1.8 KB  |  76 lines

  1. /*
  2.  * This program is copyright Alec Muffett 1991 except for some portions of
  3.  * code in "crack-fcrypt.c" which are copyright Robert Baldwin, Icarus Sparry
  4.  * and Alec Muffett.  The author(s) disclaims all responsibility or liability
  5.  * with respect to it's usage or its effect upon hardware or computer
  6.  * systems, and maintain copyright as set out in the "LICENCE" document which
  7.  * accompanies distributions of Crack v4.0 and upwards.
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include <ctype.h>
  12. #include <pwd.h>
  13. #include <signal.h>
  14.  
  15. #include "conf.h"
  16.  
  17. #define STRINGSIZE    256
  18.  
  19. #ifdef DEVELOPMENT_VERSION
  20. #define BUILTIN_CLEAR
  21. #undef BRAINDEAD6
  22. #define CRACK_UNAME
  23. #endif
  24.  
  25. extern void Trim ();
  26. extern char *Reverse ();
  27. extern char *Uppercase ();
  28. extern char *Lowercase ();
  29. extern char *Clone ();
  30. extern char *Mangle ();
  31. extern int gethostname ();
  32.  
  33. #ifdef FAST_TOCASE
  34. #define CRACK_TOUPPER(x)    (toupper(x))
  35. #define CRACK_TOLOWER(x)    (tolower(x))
  36. #else
  37. #define CRACK_TOUPPER(x)    (islower(x) ? toupper(x) : (x))
  38. #define CRACK_TOLOWER(x)    (isupper(x) ? tolower(x) : (x))
  39. #endif
  40.  
  41. #ifdef FCRYPT
  42. #define crypt(a,b)        fcrypt(a,b)
  43. #endif
  44.  
  45. #ifdef INDEX_NOT_STRCHR
  46. #define strchr(a,b)         index(a,b)
  47. #endif
  48.  
  49. struct USER
  50. {
  51.     struct USER *next;        /* next users with different salt */
  52.     struct USER *across;    /* line of users with same salt */
  53.     char *filename;        /* where we got it from */
  54.     char *passwd_txt;        /* plaintext of password */
  55.     struct passwd passwd;    /* ...guess... */
  56.     int done;            /* bool flag */
  57. };
  58.  
  59. struct DICT
  60. {
  61.     struct DICT *next;        /* simple linked list */
  62.     char word[1];        /* ...<snigger>... */
  63. };
  64.  
  65. /* include lyrics of "perfect circle" by R.E.M. at this point */
  66.  
  67. struct RULE
  68. {
  69.     struct RULE *next;
  70.     char *rule;
  71. };
  72.  
  73. #define STRCMP(x,y)        ( *(x) == *(y) ? strcmp((x),(y)) : -1 )
  74.  
  75. #include "crack-glob.h"
  76.