当前位置:   article > 正文

植物大战僵尸v1.2---外挂源码_qt 植物大战僵尸外挂 源码 github

qt 植物大战僵尸外挂 源码 github

 

 

 

  1. /*************************************/
  2. //wnd.h
  3. //
  4. /***********************************/
  5. #pragma once
  6. #define WM_GRAYCONTROLES WM_USER+100
  7. #define APP_NAME L"植物大战僵尸修改器 v1.2"
  8. #define WND_W 360
  9. #define WND_H 230
  10. #define IMG_H 55
  11. #define ID_TIMER 1
  12. #define TIMER_SLEEP_TIME 1000
  13. #include <windows.h>
  14. #include <tchar.h>
  15. #include <Commctrl.h>
  16. #include <psapi.h>
  17. #include <process.h>
  18. #pragma comment(lib, "psapi")
  19. #pragma comment(lib, "comctl32.lib")
  20. #pragma comment(linker,"/manifestdependency:\"type='win32'\
  21. name='Microsoft.Windows.Common-Controls' "\
  22. "version='6.0.0.0' \
  23. processorArchitecture='*'\
  24. publicKeyToken='6595b64144ccf1df' \
  25. language='*'\"")
  26. BOOL CALLBACK DlgProc(HWND,UINT,WPARAM,LPARAM);
  27. LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
  28. BOOL EnableDebugPrivilege(HANDLE hProcess);
  29. HWND FindDestWnd();
  30. DWORD GetPIDFromeWnd();
  31. HANDLE OpenProcessWithDbg(DWORD PID);
  32. DWORD GetPIDFromeProcesses(LPCTSTR lpWndName);



 

  1. /*************************************/
  2. //wnd.cpp
  3. //
  4. /***********************************/
  5. #include "Wnd.h"
  6. #include "resource.h"
  7. #include "InjectCode.h"
  8. BOOL g_bWndActive = false;
  9. BOOL EnableDebugPrivilege(HANDLE hProcess)
  10. {
  11. HANDLE hToken;
  12. LUID luid;
  13. TOKEN_PRIVILEGES tp;
  14. //打开令牌环
  15. BOOL bOK = OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,&hToken);
  16. if(!bOK)
  17. return FALSE;
  18. bOK = LookupPrivilegeValue(NULL,SE_SECURITY_NAME,&luid);
  19. if(!bOK)
  20. return FALSE;
  21. tp.PrivilegeCount = 1;
  22. tp.Privileges[0].Luid = luid;
  23. tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
  24. //调整权限
  25. bOK = AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES),NULL,NULL);
  26. if(!bOK)
  27. return FALSE;
  28. CloseHandle(hToken);
  29. return TRUE;
  30. }
  31. int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR lpCmdLine, int nShowCmd)
  32. {
  33. InitCommonControls();
  34. HWND hWnd;
  35. MSG msg;
  36. TCHAR szClsName[] = L"MainWnd";
  37. WNDCLASSEX wcex;
  38. wcex.cbSize = sizeof(WNDCLASSEX);
  39. wcex.hInstance = hInst;
  40. wcex.lpfnWndProc = WndProc;
  41. wcex.cbClsExtra = 0;
  42. wcex.cbWndExtra = 0;
  43. wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
  44. wcex.hbrBackground = (HBRUSH)(COLOR_MENUBAR+1);
  45. wcex.lpszClassName = szClsName;
  46. wcex.lpszMenuName = NULL;
  47. wcex.style = 0;
  48. wcex.hIconSm = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
  49. wcex.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON2));
  50. if(!RegisterClassEx(&wcex))
  51. return 0;
  52. hWnd = CreateWindowEx(
  53. WS_EX_CONTROLPARENT,
  54. szClsName,
  55. APP_NAME,
  56. (WS_CLIPCHILDREN
  57. |WS_CLIPSIBLINGS
  58. |WS_MINIMIZEBOX
  59. |WS_SYSMENU
  60. |WS_CAPTION
  61. |WS_TABSTOP)
  62. &(~WS_MAXIMIZEBOX ),
  63. GetSystemMetrics(SM_CXFULLSCREEN)/2-WND_W/2,
  64. GetSystemMetrics(SM_CYFULLSCREEN)/2-WND_H/2,
  65. WND_W,
  66. WND_H,
  67. NULL,
  68. NULL,
  69. hInst,NULL);
  70. if(!hWnd)
  71. return 0;
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/668411
推荐阅读
相关标签
  

闽ICP备14008679号