//SWWD.CPP  v1.0
//by Phractal
//This little scrap of code is a program that is used to aid you in your
//wardialing efforts. If you scan manually, which seems to be the safest
//way nowadays, it's tedius to write out everynumber down so you remember
//what is special about that number, be it a PBX, outdial, VMB, carrier,
//loop, or some weird mystery tones, or even the clandestine DATU line.
//
//The syntax is this
//"NPA-EXHANGE" "FIRST FOUR NUMBERS" "LAST FOUR NUMBERS"
//So, if you wanted to record what you found when scanning 1-800 555 0001
//thru 1-800 555 9999 you would type in:
//800-555 0000 9999
//another ex. 512 374 5500 thru  512 374 5599, you would input
//512-374 5500 5599
//
//After running the program, all the numbers should be ready for you in a
//list format in scan.txt in whatever directory you ran this from.
//
//SHOULD WORK ON ALL OS's, EVEN THE REALLY CRAPPY ONES
//
//Remember, this is C++, not C, if using unix, use g++ to compile, not gcc.
//
//Also, this has a bug, if you are scanning lets say 0000 thry 9999, don't
//type in 0000, type 0001. It tends not to like entruies that end in zero.
//
//It also doesn't like scans that are like 0501 thru 0599 and 0801 thru 0899
//Anyone is open to contribute to this program, as long as I maintain credit
//for original program.
#include <iostream.h>
#include <stdlib.h>
#include <fstream.h>

int main()
{
char*    npa;
int c,c1,c2;
ofstream outStream("scan.txt"); //saved to whatever dir you run this from!

outStream<<"***************** War Dial Sheetz0r ******************"<<endl;
cout<<"***************** War Dial Sheetz0r ******************"<<endl;
cout<<"Enter the following seperated by spaces"<<endl;
cout<<"  -the NPA and exhange (eg. 800-555)"<<endl;
cout<<"  -the first combo of digits to start scanning(eg. 0001)"<<endl;
cout<<"  -the last combo of digits to finish scanning(eg. 9999)"<<endl;
cin>>npa;
cin>>c1;
cin>>c2;

for(c=c1;c<=c2;c++)
{
    if(c<1000)
    {
        if(c<100)
        {
            if(c<10)
            {
            outStream<<npa<<" "<<"000"<<c<<endl;
            }
        else
        outStream<<npa<<" "<<"00"<<c<<endl;
        }
    else
    outStream<<npa<<" "<<"0"<<c<<endl;
    }
   
    else
    outStream<<npa<<" "<<c<<endl;
}

return 0;
}

