SHARE
TWEET

Untitled

a guest Jan 20th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. HKEY hKey;
  2.     char szPath[0x100];
  3.     GetModuleFileName(NULL, szPath, sizeof(szPath));
  4.     RegCreateKeyEx(HKEY_LOCAL_MACHINE,
  5.         "Software\Microsoft\Windows\CurrentVersion\Run",
  6.         NULL,
  7.         "C:\test.exe",
  8.         REG_OPTION_NON_VOLATILE,
  9.         KEY_SET_VALUE,
  10.         NULL,
  11.         &hKey,
  12.         NULL);
  13. if (hKey)
  14. {
  15.     RegSetValueEx(hKey, "Test", NULL, REG_SZ, (LPBYTE)szPath, strlen(szPath));
  16.     RegCloseKey(hKey);
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top