Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Helo

Name: !l/aLOH1Cw2 2010-04-11 14:57

#if !NEW_OPENSSL
#  define our_fcrypt des_fcrypt /* NetBSD, Linux... */
#else
#  define our_fcrypt DES_fcrypt /* Gentoo, OSX... */
#endif

extern char *our_fcrypt(const char *buf,const char *salt, char *ret);

int main()
{
#define BUFSIZE 8192
  int quit=0, i, counts[8], bp;
  char c, buffer[BUFSIZE+32], result[14], salt[3], word[9];
  /* I haven't throughly checked whether all these characters are valid
   * in a tripcode as yet. */
  char table[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

  "0123456789 .!:#/`()_$[]+*{-";

  bp = 0;
  salt[2] = 0;
  for (i=0; i<8; i++)

{
  counts[i] = -1;
  word[i] = 0;
}

  counts[0] = 0;
  word[0] = table[0];

  while (!quit)

{
  salt[0] = word[1];
  salt[1] = word[2];

  our_fcrypt (word, salt, result);

  for (i = 0; (word[i] != 0) && (i < 8); i++)
buffer[bp++] = word[i];
  buffer[bp++] = ' ';

  for (i = 3; i < 13; i++)
buffer[bp++] = result[i];
  buffer[bp++] = '\n';

  if ((bp > BUFSIZE))
{
  write (1, buffer, bp);
  bp = 0;
}

  i = 0;
check:
  counts[i]++;
  c = table[counts[i]];
  word[i] = c;

  if (c == 0)
{
  counts[i] = 0;
  word[i] = table[0];
  i++;
  if (i < 8)
    goto check;
  quit = 1;
}
}

  return 0;

Name: Anonymous 2010-04-11 16:06

This one is particularly fun because it's actually worse than what the average C beginner would write.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List