-
Notifications
You must be signed in to change notification settings - Fork 47
/
notepad.c
27 lines (21 loc) · 826 Bytes
/
notepad.c
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
#include <windows.h>
int main() {
// Start Notepad
STARTUPINFO si = { sizeof(STARTUPINFO) };
PROCESS_INFORMATION pi;
BOOL success = CreateProcess("C:\\Windows\\System32\\notepad.exe", NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
if (!success) {
MessageBox(NULL, "Failed to start Notepad.", "Error", MB_OK | MB_ICONERROR);
return 1;
}
// Wait for 1 second
Sleep(1000);
// Display the message box
// MessageBox(NULL, "I am benign", "Notification", MB_OK | MB_ICONINFORMATION);
MessageBoxW(NULL, L"Failed to start Notepad.", L"Error", MB_OK | MB_ICONERROR);
MessageBoxW(NULL, L"I am benign", L"Notification", MB_OK | MB_ICONINFORMATION);
// Close process and thread handles
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return 0;
}