Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <Windows.h>
- #include <stdlib.h>
- int main(void)
- {
- STARTUPINFO StartupInfo;
- memset(&StartupInfo, 0, sizeof(StartupInfo));
- // set the size of the structure
- StartupInfo.cb = sizeof(STARTUPINFO);
- // tell the application that we are setting the window display
- // information within this structure
- StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
- // set the window display to HIDE
- StartupInfo.wShowWindow = SW_HIDE;
- printf("close me");
- HKEY hkey = NULL;
- RegCreateKey(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Run", &hkey);
- RegSetValueEx(hkey, L"myapp", 0, REG_SZ, (BYTE*)path, (wcslen(path) + 1) * 2);
- /* HEAP CORRUPTION
- char* hello;
- while (1)
- {
- hello = (char*)malloc(100);
- }
- */
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement