-
Notifications
You must be signed in to change notification settings - Fork 5
/
TRACE_Tool_Cmp_master.cpp
239 lines (183 loc) · 7.78 KB
/
TRACE_Tool_Cmp_master.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/*
DENUVO_Profiler v0.3
--------------------
CRACKLAB, ELF
--------------------
Tiberium reversing
********************
2011 - 2024
*/
#include "stdafx.h"
#include "12.h"
#include "TRACE_Tool_Cmp_master.h"
#include "afxdialogex.h"
// äèàëîãîâîå îêíî CTRACE_Tool_Cmp_master
IMPLEMENT_DYNAMIC(CTRACE_Tool_Cmp_master, CDialogEx)
CTRACE_Tool_Cmp_master::CTRACE_Tool_Cmp_master(CWnd* pParent /*=NULL*/)
: CDialogEx(CTRACE_Tool_Cmp_master::IDD, pParent)
{
LAMP_Get_ready_combo1 = false;
LAMP_Get_ready_combo2 = false;
vmp2_Info_stack1 = NULL;
vmp2_Info_stack2 = NULL;
memset(&Compare_two_result, 0, sizeof(Compare_two_result));
}
CTRACE_Tool_Cmp_master::~CTRACE_Tool_Cmp_master()
{
codedef_check_free_allocatedif(vmp2_Info_stack1);
codedef_check_free_allocatedif(vmp2_Info_stack2);
}
void CTRACE_Tool_Cmp_master::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO_TRACE1, m_COMBO_trace1);
DDX_Control(pDX, IDC_COMBO_TRACE2, m_COMBO_trace2);
DDX_Control(pDX, IDC_LAMP_TRACE1_READY, m_LAMP_TRACE1_READY);
DDX_Control(pDX, IDC_LAMP_TRACE1_READY2, m_LAMP_TRACE2_READY);
DDX_Control(pDX, IDC_TRACE_identical_to_first_diff, m_list_identical);
DDX_Control(pDX, IDC_TRACE_different_2nd_trace, m_list_diff2);
DDX_Control(pDX, IDC_TRACE_different_1st_trace, m_list_diff1);
DDX_Control(pDX, IDC_EDIT_CALLS_COUNT_UNTIL_FIRST_DIFF, m_edit_calls_count_until_first_different);
}
BEGIN_MESSAGE_MAP(CTRACE_Tool_Cmp_master, CDialogEx)
ON_CBN_EDITCHANGE(IDC_COMBO_TRACE1, &CTRACE_Tool_Cmp_master::OnEditchangeComboTrace1)
ON_CBN_SELCHANGE(IDC_COMBO_TRACE1, &CTRACE_Tool_Cmp_master::OnSelchangeComboTrace1)
ON_CBN_SELCHANGE(IDC_COMBO_TRACE2, &CTRACE_Tool_Cmp_master::OnSelchangeComboTrace2)
ON_CBN_EDITCHANGE(IDC_COMBO_TRACE2, &CTRACE_Tool_Cmp_master::OnEditchangeComboTrace2)
END_MESSAGE_MAP()
// îáðàáîò÷èêè ñîîáùåíèé CTRACE_Tool_Cmp_master
BOOL CTRACE_Tool_Cmp_master::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: Äîáàâèòü äîïîëíèòåëüíóþ èíèöèàëèçàöèþ
Fill_comboBox();
m_list_identical.InsertColumn(0,L"Addr",0,90,-1);
m_list_identical.InsertColumn(1,L"Type",0,170,-1);
m_list_identical.InsertColumn(2,L"Count",0,60,-1);
m_list_diff1.InsertColumn(0,L"Addr",0,90,-1);
m_list_diff1.InsertColumn(1,L"Type",0,170,-1);
m_list_diff1.InsertColumn(2,L"Count",0,60,-1);
m_list_diff2.InsertColumn(0,L"Addr",0,90,-1);
m_list_diff2.InsertColumn(1,L"Type",0,170,-1);
m_list_diff2.InsertColumn(2,L"Count",0,60,-1);
return TRUE; // return TRUE unless you set the focus to a control
// Èñêëþ÷åíèå: ñòðàíèöà ñâîéñòâ OCX äîëæíà âîçâðàùàòü çíà÷åíèå FALSE
}
void CTRACE_Tool_Cmp_master::GUI_UPDATE_AFTER_FILL_PROFILE()
{
if(vmp2_Info_stack1 != NULL)
m_LAMP_TRACE1_READY.SetBitmap(LAMP_TRUE);
else
m_LAMP_TRACE1_READY.SetBitmap(LAMP_FALSE);
if(vmp2_Info_stack2 != NULL)
m_LAMP_TRACE2_READY.SetBitmap(LAMP_TRUE);
else
m_LAMP_TRACE2_READY.SetBitmap(LAMP_FALSE);
if(vmp2_Info_stack2 != NULL && vmp2_Info_stack1 != NULL)
{
m_list_identical.DeleteAllItems();
m_list_diff1.DeleteAllItems();
m_list_diff2.DeleteAllItems();
::SetWindowTextW(m_edit_calls_count_until_first_different.m_hWnd, TS_DEF_NULL);
if (DH_PROFILE_SPIRUN7_compare_vmp2_containers(vmp2_Info_stack1,vmp2_Info_stack2, &Compare_two_result) == NULL)
Fill_compare_lists();
}
}
bool CTRACE_Tool_Cmp_master::Fill_comboBox()
{
UINT i = DH_Get_Current_hunt_profile_ALL_FILE_CONTAINERS(PROFILE_TYPE_TRACE_VMP2_LOG, &TRACE_file_lists[0]);
if(i==0)
{return false;}
m_COMBO_trace1.ResetContent();
m_COMBO_trace2.ResetContent();
do
{i--;m_COMBO_trace1.AddString(&TRACE_file_lists[i].FileName[0]);m_COMBO_trace2.AddString(&TRACE_file_lists[i].FileName[0]);}while(i != 0);
return true;
}
void CTRACE_Tool_Cmp_master::Fill_compare_lists()
{
TCHAR stack_buff[64];
register SERVICE_COUNT ii_fill = Compare_two_result.Equal_hahelds_count;
do //do equal list
{
itoa_16_fast(Compare_two_result.Equal_hahelds[ii_fill].Hanhled_addr, &stack_buff[0]);
m_list_identical.InsertItem(0,&stack_buff[0]);
m_list_identical.SetItemText(0,1,Compare_two_result.Equal_hahelds[ii_fill].Type_string);
itoa_10_fast(Compare_two_result.Equal_hahelds[ii_fill].How_count, &stack_buff[0]);
m_list_identical.SetItemText(0,2,&stack_buff[0]);
}while(ii_fill--);
ii_fill = Compare_two_result.Different_hahelds_1_count;
do //do diff ¹1 list
{
itoa_16_fast(Compare_two_result.Different_hahelds_1[ii_fill].Hanhled_addr, &stack_buff[0]);
m_list_diff1.InsertItem(0,&stack_buff[0]);
m_list_diff1.SetItemText(0,1,Compare_two_result.Different_hahelds_1[ii_fill].Type_string);
itoa_10_fast(Compare_two_result.Different_hahelds_1[ii_fill].How_count, &stack_buff[0]);
m_list_diff1.SetItemText(0,2,&stack_buff[0]);
}while(ii_fill--);
ii_fill = Compare_two_result.Different_hahelds_2_count;
do //do diff ¹2 list
{
itoa_16_fast(Compare_two_result.Different_hahelds_2[ii_fill].Hanhled_addr, &stack_buff[0]);
m_list_diff2.InsertItem(0,&stack_buff[0]);
m_list_diff2.SetItemText(0,1,Compare_two_result.Different_hahelds_2[ii_fill].Type_string);
itoa_10_fast(Compare_two_result.Different_hahelds_2[ii_fill].How_count, &stack_buff[0]);
m_list_diff2.SetItemText(0,2,&stack_buff[0]);
}while(ii_fill--);
itoa_10_fast(Compare_two_result.Equal_hahelds_until_first_different, &stack_buff[0]);
::SetWindowTextW(m_edit_calls_count_until_first_different.m_hWnd, &stack_buff[0]);
}
void CTRACE_Tool_Cmp_master::OnEditchangeComboTrace1()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
TCHAR filename[PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN];
ULONG c = ::GetWindowText(m_COMBO_trace1.m_hWnd, &filename[0], PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN);
if(c == NULL)
return;
Get_ready_combo1_filename(&filename[0]);
GUI_UPDATE_AFTER_FILL_PROFILE();
}
void CTRACE_Tool_Cmp_master::OnSelchangeComboTrace1()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
TCHAR filename[PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN];
unsigned long cs = m_COMBO_trace1.GetCurSel();
if (cs!=-1) {m_COMBO_trace1.GetLBText(::SendMessage(m_COMBO_trace1.m_hWnd, CB_GETCURSEL, 0, 0),&filename[0]);}
Get_ready_combo1_filename(&filename[0]);
GUI_UPDATE_AFTER_FILL_PROFILE();
}
void CTRACE_Tool_Cmp_master::Get_ready_combo1_filename(TCHAR* filename1)
{
ULONG readsize;
codedef_check_free_allocatedif(vmp2_Info_stack1);
vmp2_Info_stack1 = (pSPIRUN7_TRACELOG_VMP2_INFO_STACK)DH_Read_Current_hunt_profile_CONTAINER(PROFILE_TYPE_TRACE_VMP2_LOG,filename1,PROFILE_READ_ALL, &readsize);
if(vmp2_Info_stack1 == NULL)
return;
}
void CTRACE_Tool_Cmp_master::Get_ready_combo2_filename(TCHAR* filename2)
{
ULONG readsize;
codedef_check_free_allocatedif(vmp2_Info_stack2);
vmp2_Info_stack2 = (pSPIRUN7_TRACELOG_VMP2_INFO_STACK)DH_Read_Current_hunt_profile_CONTAINER(PROFILE_TYPE_TRACE_VMP2_LOG,filename2,PROFILE_READ_ALL, &readsize);
if(vmp2_Info_stack2 == NULL)
return;
}
void CTRACE_Tool_Cmp_master::OnSelchangeComboTrace2()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
TCHAR filename2[PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN];
unsigned long cs = m_COMBO_trace2.GetCurSel();
if (cs!=-1) {m_COMBO_trace2.GetLBText(::SendMessage(m_COMBO_trace2.m_hWnd, CB_GETCURSEL, 0, 0),&filename2[0]);}
Get_ready_combo2_filename(&filename2[0]);
GUI_UPDATE_AFTER_FILL_PROFILE();
}
void CTRACE_Tool_Cmp_master::OnEditchangeComboTrace2()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
TCHAR filename2[PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN];
ULONG c = ::GetWindowText(m_COMBO_trace2.m_hWnd, &filename2[0], PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN);
if(c == NULL)
return;
Get_ready_combo2_filename(&filename2[0]);
GUI_UPDATE_AFTER_FILL_PROFILE();
}