General discussion for hardware, software and programming shizzle.
Post a reply

File spamemr!

31 Dec 2011, 13:52

Hay guys how are you? Today i've finished my other app, a file spammer :D No, it's not the one that fills your desktop with stuff and slows your pc down till' death. It's an app where you have to insert the extension of the file, and the number of the characters you wish it to have. The main purpose of the app is to create large files with no use. Here's an example.

Code:
What extension do you wish for the file to have? <EX: txt, bin, jar, etc.>
txt
The extension of the file will be: 'txt' Proceeding to the next step...
The file name will be FSPAMMER.txt
How many characters do you wish for the file to have?
483
Preparing spam action...
Spam in progress!
Spam completed!
Press any key to continue . . .

I'll upload the code aswell
Code:
    #include <iostream>
    #include <fstream>

using namespace std;
    string help;
    string extension;
    int randomnumber;
    int numofchar;
    char car;
    string filename = "FSPAMMER.";
    char characters[] = {'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'};

void delay ( int seconds )
{
    clock_t endwait;
    endwait = clock () + seconds * CLOCKS_PER_SEC ;
    while (clock() < endwait) {}
}

int main()
{



    cout << "Welcome to KiralyCraft's file spammer! Enter HELP for detailed information about the use of this program. Enter anything else to continue..."<< endl;
    cin >> help;
    if (help == "HELP")
                        {
                            system("CLS");
                            cout << "Hello there, welcome to the help screen. Well, the use of the current application is to create a file, with the desired extension that will have an specified size according to it's contents. Easy, so let's get started... " << endl;
                            cin >> extension;
                        }

    system("CLS");
    cout << "What extension do you wish for the file to have? <EX: txt, bin, jar, etc.>" << endl;
    cin  >> extension;
    if (extension == "") {filename = "FSPAMMER";}
    cout << "The extension of the file will be: '" << extension << "' Proceeding to the next step..." << endl;
    delay (1);
    filename.insert(filename.length(),extension);
    cout << "The file name will be " << filename << endl;
    ofstream outfile;
    cout << "How many characters do you wish for the file to have?"<< endl;
    cin >> numofchar;
    cout << "Preparing spam action..."<< endl;
    delay (1);
    cout << "Spam in progress!"<< endl;
    outfile.open (filename.c_str(), ofstream::out | ofstream::app);



    for (int i = 0; i < numofchar + 1; i++)
                                            {
                                                randomnumber = rand() % 25 + 1;
                                                car = characters[randomnumber];
                                                outfile << car;
                                            }



    outfile.close();
    cout << "Spam completed!"<< endl;




    system("PAUSE");

}


As the last time you told me im trying to hack you, ill let you compile the code this time. But i cannot help posting a download link aswell.
http://www.mediafire.com/?dan5atbxw1b92r8

Re: File spamemr!

31 Dec 2011, 14:52

Once again there is an update!
Added FileNumber spamming!
Code:
    #include <iostream>
    #include <fstream>

using namespace std;
    string help;
    string extension;
    int randomnumber;
    int numofchar;
    char car;
    string filename = "FSPAMMER.";
    char characters[] = {'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'};

    string FNnamefile;
    string FNnameext;

    int FNnumber;
    int FNchars;
    int FNfilelength;

    string choice;

    string convertInt(int number)
{
    if (number == 0)
        return "0";
    string temp="";
    string returnvalue="";
    while (number>0)
    {
        temp+=number%10+48;
        number/=10;
    }
    for (int i=0;i<temp.length();i++)
        returnvalue+=temp[temp.length()-i-1];
    return returnvalue;
}

void delay ( int seconds )
{
    clock_t endwait;
    endwait = clock () + seconds * CLOCKS_PER_SEC ;
    while (clock() < endwait) {}
}



void filesize() {
    cout << "Welcome to the FileSize spammer! Enter HELP for detailed information about the use of this program. Enter anything else to continue..."<< endl;
    cin >> help;
    if (help == "HELP")
                        {
                            system("CLS");
                            cout << "Hello there, welcome to the help screen. Well, the use of the current application is to create a file, with the desired extension that will have an specified size according to it's contents. Easy, so let's get started... " << endl;
                            cin >> extension;
                        }

    system("CLS");
    cout << "What extension do you wish for the file to have? <EX: txt, bin, jar, etc.>" << endl;
    cin  >> extension;
    if (extension == "") {filename = "FSPAMMER";}
    cout << "The extension of the file will be: '" << extension << "' Proceeding to the next step..." << endl;
    delay (1);
    filename.insert(filename.length(),extension);
    cout << "The file name will be " << filename << endl;
    ofstream outfile;
    cout << "How many characters do you wish for the file to have?"<< endl;
    cin >> numofchar;
    cout << "Preparing spam action..."<< endl;
    delay (1);
    cout << "Spam in progress!"<< endl;
    outfile.open (filename.c_str(), ofstream::out | ofstream::app);



    for (int i = 0; i < numofchar + 1; i++)
                                            {
                                                randomnumber = rand() % 25 + 1;
                                                car = characters[randomnumber];
                                                outfile << car;
                                            }



    outfile.close();
    cout << "Spam completed!"<< endl;




    system("PAUSE");
}
void filenumber()   {
                        cout << "Welcome to the FileNumber spammer!" <<endl;
                        cout << "Please enter the name of the file" <<endl;
                        cin >> FNnamefile;
                        FNfilelength = FNnamefile.length();
                        cout << "Please enter the name of the extension" <<endl;
                        cin >> FNnameext;
                        FNnamefile.insert(FNnamefile.length(),".");
                        FNnamefile.insert(FNnamefile.length(),FNnameext);

                        cout << "Please enter the number of files you wish to be spammed"<<endl;
                        cin >> FNnumber;
                        cout << "Please enter the number of characters each file should have" <<endl;
                        cin >>FNchars;
                            for (int i = 0; i < FNnumber+1; i++)    {
                                                                    ofstream outfile;
                                                                    outfile.open (FNnamefile.c_str(), ofstream::out | ofstream::app);
                                                                    for (int i = 0; i < FNchars + 1; i++)
                                                                                                                {
                                                                                                                    randomnumber = rand() % 25 + 1;
                                                                                                                    car = characters[randomnumber];
                                                                                                                    outfile << car;
                                                                                                                }
                                                                    outfile.close();
                                                                    FNnamefile.insert(FNfilelength,convertInt(i));


                                                                    }
                        cout << "Spam successful" <<endl;
                        system("PAUSE");














                    }


int main()
{

cout << "Welcome to KiralyCraft's file spam application! Please insert FS for FileSize spamming or FN for FileNumber spamming." <<endl;
cin >> choice;
if (choice == "FS") {
    filesize ();
}
if (choice == "FN") {
    filenumber ();
}



}

And once again here is a download link
http://www.mediafire.com/?ay4cmrt7oaaby63

Re: File spamemr!

31 Dec 2011, 19:29

im just going to slap you with http://pastebin.com/

Re: File spamemr!

31 Dec 2011, 21:07

You should try making something useful now. ;D But good projects if you're a beginner I guess. To just make random crap that does random things. :P

Re: File spamemr!

01 Jan 2012, 03:01

Now make it cross-platform ;)

Re: File spamemr!

01 Jan 2012, 15:49

But it's useful, fill up your free space with useless stuff xD

Re: File spamemr!

01 Jan 2012, 15:55

lol
Code:
What extension do you wish for the file to have? <EX: txt, bin, jar, etc.>
txt
The extension of the file will be: 'txt' Proceeding to the next step...
The file name will be FSPAMMER.txt
How many characters do you wish for the file to have?
123456789
The file will have around 120564 KB wich means around 117 MB
Preparing spam action...
Spam in progress!
Spam completed!
Press any key to continue . . .

Re: File spamemr!

01 Jan 2012, 18:25

Now hardcode it to 1.000.000 characters, and make it go in an infinite loop.

Re: File spamemr!

01 Jan 2012, 18:44

It might actually be useful if it would create files with just 0x00 bytes, its a somewhat low-tech variant of cleaning up a virtual machine HDD before compacting. ;)

Re: File spamemr!

01 Jan 2012, 19:28

LifeTimeBLOOD wrote:It might actually be useful if it would create files with just 0x00 bytes, its a somewhat low-tech variant of cleaning up a virtual machine HDD before compacting. ;)

Nice idea, ill take a look on that
Post a reply