forked from robert0825/pc_wechat_hook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdllmain.cpp
82 lines (78 loc) · 3.62 KB
/
dllmain.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "stdafx.h"
#include "resource.h"
#include <Windows.h>
#include "GetUserLists.h"
#include "commctrl.h"
#include <TlHelp32.h>
INT_PTR CALLBACK DialogProc(
_In_ HWND hwndDlg,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
);
void InitListContrl(HWND List);
VOID ThreadProcess(HMODULE hModule);
HWND gUserListView = NULL;
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProcess, hModule, NULL, 0);
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
VOID ThreadProcess(HMODULE hModule)
{
DialogBox(hModule, MAKEINTRESOURCE(MAIN), NULL, &DialogProc);
}
INT_PTR CALLBACK DialogProc(
_In_ HWND hwndDlg,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
)
{
HWND hListView = NULL;
switch (uMsg)
{
case WM_INITDIALOG:
hListView = GetDlgItem(hwndDlg, USER_LISTS);
gUserListView = hListView;
InitListContrl(hListView);
break;
case WM_CLOSE:
EndDialog(hwndDlg,1);
break;
case WM_COMMAND:
if (wParam == HOOK_USER_LISTS) {
MessageBox(NULL,"开始hook","标题",MB_OK);
HookWechatQrcode(hwndDlg, gUserListView,0x420F34);
}
break;
default:
break;
}
return FALSE;
}
void InitListContrl(HWND List)
{
LVCOLUMN pcol = { 0 };
LPCSTR titleBuffer[] = { "wxid","微信账号","微信昵称" };
pcol.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
pcol.fmt = LVCFMT_LEFT;
pcol.cx = 120;
for (int i = 0; i < 3; i++) {
//创建list成员信息
pcol.pszText = (LPSTR)titleBuffer[i];
ListView_InsertColumn(List, i, &pcol);
}
}