reading really big files

This is a discussion on reading really big files within the Windows Programming forums, part of the Platform Specific Boards category; I made a little program that gets all the possible combination of letters 0-9 a-z and A-Z in an 8 ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    81

    reading really big files

    I made a little program that gets all the possible combination of letters 0-9 a-z and A-Z in an 8 character long string. I let it run and print to a file, 4 hrs later i canceled it and the file was 720meg and i want to see what it got to. But i can't read it in and ideas how to do this? If you cant read it in is there any way to get the end of the file maybe just the last 80 characters or so?

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Hmmm... something is wrong with your program - post some code. The problem isn't the file reading functions (unless your computer is really really slow). My compression program for the contest (I'm not sure if it'll get finished...I've been distracted) reads and does some basic manipulates on a file that size in a few seconds.

    1.9 GHz processor, 256 mb RAM, 7200RPM 80GB HD.

    edit: You didn't do this did you?
    Away.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    245
    Get an editor such as UltraEdit, Microsoft Word, etc. They can all read several gigabyte sized files.

  4. #4
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Coldfire, may I enquire as to the reason/need for such a program?
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Guessing passwords perhaps?

    Coldfire:

    Give me a good reason not to close the thread.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I'd usually protest against this kind of thing, but I wont this time.

    Sounds to me like a brute force hacking program. I remember having one a number of years ago, and it used a large file of combination listings to do its job.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  7. #7
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    I was trying to remember the formula for calculating combinations, the nCr type thing. With a-z A-Z and 0-9 we're talking 62/C/8 - from memory, there were an awful lot of factorials in that formula - 62! is a big number.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  8. #8
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    nCr will only give you combinations, not permutations. There are even more if you use nPr.

    EDIT: nPr is the same as Salem's calculation in this case.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  9. #9
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    >>> "AAAAAAAA"

    It was that formula I was trying to remember, the one where every possibly permutation is permissable. I remember the numbers get astronomical very quickly.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  10. #10
    Registered User
    Join Date
    Oct 2001
    Posts
    81
    Coldfire, may I enquire as to the reason/need for such a program?
    i had no real reason for doing it, just got bored and was playing around with arrays and loops and descided to try it, wanted to see how many combinations there were when it finished. I tryed it again with only 4 chars long and took out the capitals and when i opened it in word 2000 i had 16,204 pages.

    The one with 8 chars long i ended up just gettign a file splitter and looking at the last file it generated in the split, so after 5 hrs it only got to the 0003xxxx position. I'm guessing it was around 90,000,000 combinations by that time.

    Give me a good reason not to close the thread.
    if u think someone will use this to make a password cracking program you can close the thread, i see how to get the last few chars now so i can see how far it got.
    Code:
      char eight[] = "00000000";
      char IncLetter[62] = {'0','1','2','3','4','5','6','7','8','9','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','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'};
      int n0,n1,n2,n3,n4,n5,n6,n7;
      for(n0 = 0; n0 < 62; n0++)
      {
        for(n1 = 0; n1 < 62; n1++)
        {
          for(n2 = 0; n2 < 62; n2++)
          {
            for(n3 = 0; n3 < 62; n3++)
            {
              for(n4 = 0; n4 < 62; n4++)
              {
                for(n5 = 0; n5 < 62; n5++)
                {
                  for(n6 = 0; n6 < 62; n6++)
                  {
                    for(n7 = 0; n7 < 62; n7++)
                    {
                      eight[7] = IncLetter[n7];
                      cout << eight << endl;
                    }
                    eight[6] = IncLetter[n6];
                    cout << eight << endl;
                  }
                  eight[5] = IncLetter[n5];
                  cout << eight << endl;
                }
                eight[4] = IncLetter[n4];
                cout << eight << endl;
              }
              eight[3] = IncLetter[n3];
              cout << eight << endl;
            }
            eight[2] = IncLetter[n2];
            cout << eight << endl;
          }
          eight[1] = IncLetter[n1];
          cout << eight << endl;
        }
        eight[0] = IncLetter[n0];
        cout << eight << endl;
      }

  11. #11
    Registered User
    Join Date
    Feb 2004
    Posts
    1
    erm
    you can easily find the number of possible combinations by doing this simple mathematical calculation:

    (size_of_charset ^ length_of_string)

    thats how binary works
    2^8 = 256 possibilities for 8 bits
    'charset' would be 2 (0 and 1) in the case of binary

    no reason to write a program when math does work for you.

    anyway, the program would take days to weeks to do anyway, for an alphanumeric 8char password. you should do your bruteforce research

    [(26+10) ^ 8] = 2821109907456 possibilities
    would take you 6days 10hrs 12mins 58secs to sift through all the combinations at a rate of 5,081,455 codes per second

    good luck
    Last edited by argv[0]; 02-22-2004 at 07:49 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading from files
    By recluse in forum C Programming
    Replies: 25
    Last Post: 12-26-2004, 09:33 AM
  2. Issues reading text files
    By ozzy34 in forum C++ Programming
    Replies: 5
    Last Post: 06-01-2004, 08:15 AM
  3. Reading files
    By Quantrizi in forum C Programming
    Replies: 4
    Last Post: 04-14-2004, 11:15 AM
  4. Reading files with an unkown amount of characters
    By Zahl in forum C++ Programming
    Replies: 13
    Last Post: 10-10-2002, 02:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21