CWxObject.h 900 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __WX_OBJECT__
  2. #define __WX_OBJECT__
  3. #pragma once
  4. //#include "Injection.h"
  5. class CWxObject
  6. {
  7. public:
  8. CWxObject();
  9. explicit CWxObject(DWORD dwProcId, LPCTSTR lpDynamicLibraryPath);
  10. ~CWxObject();
  11. protected:
  12. // 进程id;
  13. DWORD m_dwWxProcId;
  14. // 进程句柄;
  15. HANDLE m_hWxProcess;
  16. // 进程窗口句柄;
  17. HWND m_hWxWnd;
  18. // 动态库路径;
  19. TCHAR m_szDllPath[MAX_PATH];
  20. // 路径分配的内存;
  21. LPVOID m_lpInjectData;
  22. LPVOID m_lpEjectData;
  23. // 路径长度;
  24. DWORD m_dwPathLen;
  25. // 注入线程句柄;
  26. HANDLE m_hInjectThread;
  27. // 卸载线程句柄;
  28. HANDLE m_hEjectThread;
  29. public:
  30. inline DWORD GetProcId() { return m_dwWxProcId; };
  31. // dll路径和要注入的进程id;
  32. void setInjectionObj(DWORD dwProcId, LPCTSTR lpDynamicLibraryPath);
  33. BOOL InjectDynamicLibrary();
  34. BOOL EjectDynamicLibrary();
  35. BOOL FindWxWnd();
  36. static int CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam);
  37. };
  38. #endif //__WX_OBJECT__