Гинератор паролей нужна помощ

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by теща, 25 May 2011.

  1. теща

    теща Экстрасенс

    Joined:
    14 Sep 2005
    Messages:
    2,027
    Likes Received:
    525
    Reputations:
    285
    ты читал что я писал ??? может я не прально выразился повторю ........ программа для создания ПАРОЛЯ ЦЫФРЫ ОТ 1 ДО 9999999999 НЕ БОЛЕЕЕ ........... НУК ЗБАЦАЙ , ЕСТЬ ТАМ ТАКАЯ ФИЧА ИЛИ НЕТ В ТОМ СОФТЕ ??? Я весь гугл раком поставил и скачал все что только существует и яшу тоже в позу поставил , того чего нада не нашел , а ищу я хорошо и быстро!!!
     
  2. ShyRka_coder

    ShyRka_coder Member

    Joined:
    27 Jul 2010
    Messages:
    127
    Likes Received:
    7
    Reputations:
    5
    Щас помогу ТС:) в процесе)
     
  3. not4me

    not4me New Member

    Joined:
    15 Dec 2010
    Messages:
    28
    Likes Received:
    1
    Reputations:
    0
    Code:
    static long startIndex = 0;
    static long endIndex = 0;
    static long averageLengthPerThread = 10000000;
    
    static void Generation(long from, long to)
            {
                char[] arr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".ToCharArray();
    
                string val = "";
    
                long i = (long)from;
                int length = arr.Length;
                string value;
    
                while (true)
                {
                    if (i == to)
                        break;
                    val = "";
                    long celiy_chast = i / length;
                    long ostatok_ot_delenija = i % length;
    
                    //val = val + arr[ostatok_ot_delenija];
                    while (true)
                    {
                        if (celiy_chast < length)
                        {
                            val = arr[celiy_chast] + val;
                            break;
                        }
                        else
                        {
                            val = arr[ostatok_ot_delenija] + val;
                            celiy_chast = celiy_chast / length;
                            ostatok_ot_delenija = celiy_chast % length;
                        }
                    }
                    if (DoLogin(val))
                    {
                        throw new Exception("ok " + val);
                    }
                }
                //return "";
            }
        }
    
    вот мой код, юзай если разберешься ;)

    п.с отцы кто в теме, дайте критику кода.
     
  4. #andrew#

    #andrew# Elder - Старейшина

    Joined:
    24 Aug 2010
    Messages:
    45
    Likes Received:
    7
    Reputations:
    11
    Code:
    #include <iostream>
    #include <fstream>
    #include <vector>
    
    int main()
    {
     std::ofstream fout1("output1.txt");
     std::ofstream fout2("output2.txt");
     std::ofstream fout3("output3.txt");
     long long size = 9999999999;
     for (long long i = 0; i <= size; ++i)
     {
      if (i <= size / 50)
      {
       fout1 << i << std::endl;
      }
      else if (i <= size / 50 * 2)
      {
       fout2 << i << std::endl;
      }
      else if (i <= size / 50 * 3)
      {
       fout3 << i << std::endl;
      }
     }
     return 0;
    }
    вот мой недоделанный код...надо дописать std::eek:fstream fout1("output1.txt"); до 40 если делить на 40 частей и прописать тоже самое в else if
     
    1 person likes this.
  5. теща

    теща Экстрасенс

    Joined:
    14 Sep 2005
    Messages:
    2,027
    Likes Received:
    525
    Reputations:
    285
    ну за код спасиба но я не кодер куда я его засуну ???? разве что в тхт )
     
  6. ShyRka_coder

    ShyRka_coder Member

    Joined:
    27 Jul 2010
    Messages:
    127
    Likes Received:
    7
    Reputations:
    5
    Ну конечно не шедевр но я учусь! Сделано Builder C++ 2010.. Гглавное работает и вроде быстро :)
     
  7. Gar|k

    Gar|k Moderator

    Joined:
    20 Mar 2009
    Messages:
    1,166
    Likes Received:
    266
    Reputations:
    82
    Для *******:
    1. Скачать программу с сайта
    2. Запустить программу выбрать в меню Сервис -> Плагины -> Генератор словарей
    3. В окне (см. рисунок 1) заполнить нужные данные по образцу и в пункте меню Сервис, выбрать Генерировать словарь

    [​IMG]
    Рисунок 1 - Окно "Генератор словарей"​
     
    _________________________
    #27 Gar|k, 25 May 2011
    Last edited by a moderator: 27 May 2011
  8. #andrew#

    #andrew# Elder - Старейшина

    Joined:
    24 Aug 2010
    Messages:
    45
    Likes Received:
    7
    Reputations:
    11
    Code:
    #include <iostream>
    #include <fstream>
    
    int main()
    {
     std::ofstream fout1("output1.txt");
     
     long long size = 9999999999;
     for (long long i = 0; i <= size; ++i)
     {
       fout1<< i << std::endl;
     }
     return 0;
    }
    вот так вроде все!!!все в один тхт распечатается...
     
  9. Ins3t

    Ins3t Харьковчанин

    Joined:
    18 Jul 2009
    Messages:
    939
    Likes Received:
    429
    Reputations:
    139
    если хотите разбивать на файлы - можно поступить примерно следующим образом:

    Code:
    #include <iostream>
    #include <vector>
    #include <fstream>
    
    void passwordsGenerate( std::vector < std::ofstream * > &files, int numberOfPasswords );
    
    int main( int argc, char *argv[] ) {
    
    	std::vector < std::ofstream * > files;
    	files.push_back( new std::ofstream( "1.txt", std::ios::out ) );
    	files.push_back( new std::ofstream( "2.txt", std::ios::out ) );
    	files.push_back( new std::ofstream( "3.txt", std::ios::out ) );
    	files.push_back( new std::ofstream( "4.txt", std::ios::out ) );
    	files.push_back( new std::ofstream( "5.txt", std::ios::out ) );
    
    	passwordsGenerate( files, 666 );
    
    	return 0;
    }
    
    void passwordsGenerate( std::vector< std::ofstream * > &files, int numberOfPasswords ) {
    	int currentPassword = 0;
    	int numbersInOneFile = numberOfPasswords / files.size();
    
    	for( std::vector < std::ofstream * >::iterator currentFile = files.begin(); currentFile != files.end(); ++currentFile )
    		for( int counter = 0; currentPassword <= numberOfPasswords; currentPassword++, counter++ ) {
    			if( counter == numbersInOneFile && numberOfPasswords - currentPassword >= numbersInOneFile )
    				break;
    
    			(*(*currentFile)) << currentPassword << std::endl;
    		}
    }	
    
     
    4 people like this.