Thread: I hope it's usefull.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    16

    I hope it's usefull.

    I am new to programming an this is a password file generator i made. I don't know how big it is i stopped it at 75GBs.
    Code:
     
     #include <stdio.h>
    
    int main()
    {
      FILE *f;
      char a[95]="abcdefghijklmnopqrstuvwuxyzABCDEFGHIJKLMNOPQRSTUVWXY`Z1234567890-=[];',./~!@#$%^&*()_+{}|:<>?";
      char c;
      int b[8];
    
      f=fopen( "password.txt", "w" );
      printf( "Are you sure you wan't to make this file its almost 20GB?(y/n)\n" );
      printf( ">>" );
      scanf( "%c", &c );
      switch ( c ) {
       case 'y':
        for ( b[1] = 0; b[1] < 95; b[1]++ ) {
         for ( b[2] = 0; b[2] < 95; b[2]++ ) {
          for ( b[3] = 0; b[3] < 95; b[3]++ ) {
           for ( b[4] = 0; b[4] < 95; b[4]++ ) {
            for ( b[5] = 0; b[5] < 95; b[5]++ ) {
             for ( b[6] = 0; b[6] < 95; b[6]++ ) {
              for ( b[7] = 0; b[7] < 95; b[7]++ ) {
               for ( b[0] = 0; b[0] < 95; b[0]++ ) {
                fprintf( f, "%c%c%c%c%c%c%c%c\n", a[b[1]], a[b[2]], a[b[3]], a[b[4]], a[b[5]], a[b[6]], a[b[7]],a[b[0]] );
               }
              }
             }
            }
           }
          }
         }
        }
        break;
       case 'n':
        printf( "Good bye.\n" );
        break;
       default:
        break;
      }
      return 0;
    }
    Last edited by devildog561; 12-12-2011 at 08:34 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why FD_WRITE is usefull on select()?
    By Andaluz in forum Linux Programming
    Replies: 7
    Last Post: 07-01-2010, 10:02 AM
  2. Is this usefull? {}
    By mikahell in forum C++ Programming
    Replies: 13
    Last Post: 08-14-2006, 03:08 PM
  3. Usefull.h file, ExitWindows, Fullscreen...
    By Yuri in forum C++ Programming
    Replies: 10
    Last Post: 08-15-2005, 07:51 AM
  4. Usefull Library
    By Thantos in forum Networking/Device Communication
    Replies: 0
    Last Post: 03-04-2004, 09:49 PM
  5. First (semi) usefull program. Big accomplishment for me.
    By imortal in forum C++ Programming
    Replies: 1
    Last Post: 05-03-2003, 12:07 PM