-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
62 lines (57 loc) · 1.55 KB
/
main.cpp
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
/*
* Virenschleuder Verbreitet in vorgegebene Verzeichnisse EICAR Testsignaturen
*
* (c) 2010 Oliver Strauss
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; only GPLv2.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, if not, see http://www.gnu.org/licenses
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ofstream file_write;
ifstream file_read;
string directory;
string temp_text;
cout << "Virenschleuder V1.1 \nOliver Strauss (C) 2010\n";
file_read.open("directory.txt", ios::in);
cout << "Try to read the directory.txt";
if(file_read)
{
while(!file_read.eof())
{
getline(file_read, temp_text);
file_write.open(temp_text.c_str(), ios::out);
if(file_write)
{
cout << "Writing a ''Virus'' to " << temp_text << "\n";
file_write << "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" << endl;
file_write.close();
}
else
{
cout << "Unable to write a file to " << temp_text;
}
}
file_read.close();
}
else
{
cout << "Unable to load the directory.txt file!";
}
cout << "Done\n";
system("PAUSE");
return 0;
}