-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFA_dlg.c
More file actions
77 lines (72 loc) · 1.88 KB
/
FA_dlg.c
File metadata and controls
77 lines (72 loc) · 1.88 KB
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
/*****************************************************************************
* File Descrip : FA Dlg Function Wrap
* Create Time :20160221
* Author :RedXu
*****************************************************************************/
#include "FA_def.h"
#include "FA_struct.h"
#include "H3_function.h"
/**
* [FA对话框执行]
* @param dlg [dlg指针]
* @param shown [一般为0]
*/
static void FA_THISCALL FA_DlgExec(struct H3_Dlg* dlg, int shown) {
BYTE* mouse = (BYTE *)FA_GET_PV(DWORD, FA_ADDR_MOUSEMGR);
H3_EnableMouse(mouse, 1);
H3_SetMouseCursor(mouse, 0, 0);
H3_DlgExec(dlg, shown);
}
/**
* [Create Dlg Default VTable]
* @return [VTable]
*/
FA_EXPORT
struct H3_Dlg_VTable* FA_DlgVTableCreate(void) {
struct H3_Dlg_VTable* vt = (struct H3_Dlg_VTable*)H3_Malloc(sizeof(*vt));
struct H3_Dlg_VTable dvtable = {
0x5D2900, // Dctor
0x5FF0A0, // show
0x5FF220, // hide
0x405610,
0x49A230,
0x5FF5E0,
FA_DlgExec, // exec
0x5FFB30,
0x5FFBB0,
0x41B120, // virtual dlgproc
0x5FFCA0,
0x5FFD50,
0x5FFE90,
0x4842C0,
0x41B0F0
};
memcpy(vt, &dvtable, sizeof(*vt));
return vt;
}
/**
* [Create Dlg]
* @param x [x]
* @param y [y]
* @param dx [width]
* @param dy [height]
* @param count [item count]
* @param vt [virtual table]
* @return [dlg]
*/
FA_EXPORT
struct H3_Dlg* FA_DlgCreate(int x, int y, int dx, int dy, int count, struct H3_Dlg_VTable* vt) {
struct H3_Dlg* _dlg = (struct H3_Dlg*)H3_Malloc(0x68);
H3_DlgCtor(_dlg, x, y, dx, dy, 0x12);
//Set VTable
_dlg->vtable = vt;
//Set itemlist
BYTE* _items = (BYTE*)H3_Malloc(count);
_dlg->itemlist.first = _items;
_dlg->itemlist.last = _items;
_dlg->itemlist.end = &_items[count];
//Set Flag
_dlg->ukflag = 0;
_dlg->ukflag2 = FA_GET_PV(DWORD, _items - 4);
return _dlg;
}