-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindows.h
140 lines (120 loc) · 3.94 KB
/
Windows.h
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
FILE *ft, *fp1, *fs, *fs1, *fv, *fv1;
void create_VBScript()
{
ft = fopen("C:\\script\\vBsript.vbs", "w");
fprintf(ft, "%s\n", "Set WshShell = CreateObject(\"WScript.Shell\")");
fprintf(ft, "%s\n", "WshShell.Run chr(34) & \"C:\\script\\protector.bat\" & chr(34), 0");
fprintf(ft, "%s\n", "Set WshShell = Nothing");
fclose(ft);
}
void create_Batch()
{
fp1 = fopen("C:\\script\\protector.bat.", "w");
fprintf(fp1, "%s\n", "@ECHO OFF\n");
fprintf(fp1,"%s\n", "attrib +h +r +s C:\\Box_Files");
fprintf(fp1, ":loop\n");
fprintf(fp1, "cacls C:\\Box_Files /e /c /d %%username%%\n");
fprintf(fp1, "cls\n");
fprintf(fp1, "timeout /t 1\n");
fprintf(fp1, "goto loop\n");
fprintf(fp1, "ECHO.\n");
fclose(fp1);
}
void Kill_Task()
{
fs = fopen("C:\\script\\KillTM.bat", "w");
fprintf(fs, "%s\n", "@Echo off\n");
fprintf(fs, "set \"params=%%*\"\n");
fprintf(fs, "cd /d \"%%~dp0\" && ( if exist \"%%temp%%\\getadmin.vbs\" del \"%%temp%%\\getadmin.vbs\" ) && fsutil dirty query %%systemdrive%% 1>nul 2>nul || ( echo Set UAC = CreateObject^(\"Shell.Application\"^) : UAC.ShellExecute \"cmd.exe\", \"/k cd \"\"%~sdp0\"\" && %%~s0 %%params%%\", \"\", \"runas\", 1 >> \"%%temp%%\\getadmin.vbs\" && \"%%temp%%\\getadmin.vbs\" && exit /B )\n\n");
fprintf(fs, "REG add HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System /v DisableTaskMgr /t REG_DWORD /d 1 /f\n");
fprintf(fs, "echo.\n");
fclose(fs);
}
void create_VBScript_forTM()
{
fs1 = fopen("C:\\script\\vBsript_4kill.vbs", "w");
fprintf(fs1, "%s\n", "Set WshShell = CreateObject(\"WScript.Shell\")");
fprintf(fs1, "%s\n", "WshShell.Run chr(34) & \"C:\\script\\KillTM.bat\" & chr(34), 0");
fprintf(fs1, "%s\n", "Set WshShell = Nothing");
fclose(fs1);
}
void revive_Task()
{
fv = fopen("C:\\script\\revive_4RTM.bat", "w");
fprintf(fv, "%s\n", "@Echo off\n");
fprintf(fv, "set \"params=%%*\"\n");
fprintf(fv, "cd /d \"%%~dp0\" && ( if exist \"%%temp%%\\getadmin.vbs\" del \"%%temp%%\\getadmin.vbs\" ) && fsutil dirty query %%systemdrive%% 1>nul 2>nul || ( echo Set UAC = CreateObject^(\"Shell.Application\"^) : UAC.ShellExecute \"cmd.exe\", \"/k cd \"\"%~sdp0\"\" && %%~s0 %%params%%\", \"\", \"runas\", 1 >> \"%%temp%%\\getadmin.vbs\" && \"%%temp%%\\getadmin.vbs\" && exit /B )\n\n");
fprintf(fv, "REG add HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System /v DisableTaskMgr /t REG_DWORD /d 0 /f\n");
fprintf(fv, "echo.\n");
fclose(fv);
}
void create_VBScript_for_RevTM()
{
fv1 = fopen("C:\\script\\vBsript_4RTM.vbs", "w");
fprintf(fv1, "%s\n", "Set WshShell = CreateObject(\"WScript.Shell\")");
fprintf(fv1, "%s\n", "WshShell.Run chr(34) & \"C:\\script\\revive_4RTM.bat\" & chr(34), 0");
fprintf(fv1, "%s\n", "Set WshShell = Nothing");
fclose(fv1);
}
//-------
//-------
//-------
//-------
void makeFolder_Name(char *name_OF_file)
{
char str[100];
strcpy(str, "mkdir C:\\");
strcat(str, name_OF_file);
system(str);
}
void makeFile_Name(char *name_OF_file)
{
char str[100];
strcpy(str, "type nul > C:\\script\\");
strcat(str, name_OF_file);
strcat(str, ".txt");
system(str);
}
int hasFileContent(char *name_OF_file)
{ FILE *fq;
int size1;
char str[100], Log[100];
strcpy(str, "type nul > C:\\script\\");
strcat(str, name_OF_file);
strcat(str, ".txt");
fq = fopen(str, "r");
fscanf(fq, "%s", &Log);
fseek(fq, 0, SEEK_END);
size1 = ftell(fq);
fclose(fq);
return size1;
}
void placeMiddle(){
HWND wh = GetConsoleWindow();
// Move window to required position
MoveWindow(wh, 50, 50,1300, 650, TRUE);
}
void write_to_File(char *name, int value)
{
FILE *fp;
char str[100];
strcpy(str, "C:\\script\\");
strcat(str, name);
strcat(str, ".txt");
fp = fopen(str, "w");
fprintf(fp, "%d", value);
fclose(fp);
}
int read_to_File(char *name)
{
FILE *fp;
int tempvalue;
char str[100];
strcpy(str, "C:\\script\\");
strcat(str, name);
strcat(str, ".txt");
fp = fopen("C:\\script\\value.txt", "r");
fscanf(fp, "%d", tempvalue);
fclose(fp);
return tempvalue;
}