-
Notifications
You must be signed in to change notification settings - Fork 5
/
VMDlg.cpp
1122 lines (928 loc) · 43.9 KB
/
VMDlg.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
DENUVO_Profiler v0.3
--------------------
CRACKLAB, ELF
--------------------
Tiberium reversing
********************
2011 - 2024
*/
#include "stdafx.h"
#include "12.h"
#include "VMDlg.h"
#include "afxdialogex.h"
#include "VM_Tool_Create_Profiles.h"
#include "ENGINE/ENGINE_MAP_operations.h"
#include "BEA/BeaEngine.h" //BEA ENGINE
// CVMDlg dialog
IMPLEMENT_DYNAMIC(CVMDlg, CDialogEx)
CVMDlg::CVMDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(CVMDlg::IDD, pParent)
{
LOCK_VM_PROFILE_stack = NULL;
Is_checl_only_selected_vm_profile = false;
}
CVMDlg::~CVMDlg()
{
codedef_check_free_allocatedif(LOCK_VM_PROFILE_stack);
}
void CVMDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST1, m_list);
DDX_Control(pDX, IDC_LIST_VM_ENUM, m_list_vms_records);
DDX_Control(pDX, IDC_EDIT_VM_HANDLES_COUNT, m_EDIT_info_vm_count_consist_of);
DDX_Control(pDX, IDC_EDIT_VM_SUPPLY15, m_EDIT_info_VM_supply15_adress);
DDX_Control(pDX, IDC_EDIT_VM_VER, m_EDIT_info_VM_version);
DDX_Control(pDX, IDC_SELECT_VM_RECORD, m_BUTTON_Select_VM_record);
DDX_Control(pDX, IDC_EDIT_SEL_HANHELD_ADDRES, m_EDIT_info_HANHELD_ADDRES);
DDX_Control(pDX, IDC_EDIT_SEL_HANHELD_NUMBER, m_EDIT_info_HANHELD_NUM);
// DDX_Control(pDX, IDC_EDIT_VM_HANDLES_DUPLICATE_VS_INFUC, m_EDIT_info_vm_count_consist_of);
DDX_Control(pDX, IDC_CHECK_EXCLUDE_DUPLICATE_IN_TABLE, m_CHECK_exclude_duplicate_handles);
DDX_Control(pDX, IDC_EDIT_SEL_HANHELD_JUMPOUTs_COUNT, m_EDIT_info_JUMPOUTs_count);
DDX_Control(pDX, IDC_EDIT_SEL_HANHELD_CRITADDR_COUNT2, m_EDIT_info_crit_addr_count);
DDX_Control(pDX, IDC_EDIT_VM_RESERVED_STACK_SIZE, m_EDIT_info_stack_reserved_bytes);
DDX_Control(pDX, IDC_EDIT_VM_RESERVED_CONTEXT_SITE, m_EDIT_info_context_site);
DDX_Control(pDX, IDC_EDIT_SEARCH_OBJECT, m_EDIT_SEARCH_object);
DDX_Control(pDX, IDC_CHECK_SEARCH_ONLY_SELECTED_VM_PROFILE, m_CHECK_Search_only_selected_vm_profile);
DDX_Control(pDX, IDC_EDIT_SEARCH_COUNT, m_EDIT_search_objects_count);
DDX_Control(pDX, IDC_EDIT_SEARCH_COUNT2, m_EDIT_search_objects_SUB_count);
DDX_Control(pDX, IDC_LIST2, m_SEARCH_list);
}
BEGIN_MESSAGE_MAP(CVMDlg, CDialogEx)
// ON_BN_CLICKED(IDC_SUPPLY_OPS, &CVMDlg::OnBnClickedSupplyOps)
// ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST1, &CVMDlg::OnLvnItemchangedList1)
// ON_BN_CLICKED(IDC_ADD_VM_RECORD, &CVMDlg::OnBnClickedAddVmRecord)
// ON_BN_CLICKED(IDC_ACCEPT_ADD_VM_RECORD, &CVMDlg::OnBnClickedAcceptAddVmRecord)
ON_BN_CLICKED(IDC_ADD_VM_RECORD, &CVMDlg::OnBnClickedAddVmRecord)
ON_LBN_SELCHANGE(IDC_LIST_VM_ENUM, &CVMDlg::OnLbnSelchangeListVmEnum)
ON_BN_CLICKED(IDC_SELECT_VM_RECORD, &CVMDlg::OnBnClickedSelectVmRecord)
//ON_NOTIFY(LVN_LINKCLICK, IDC_LIST1, &CVMDlg::OnLinkclickList1)
ON_NOTIFY(NM_CLICK, IDC_LIST1, &CVMDlg::OnClickList1)
ON_BN_CLICKED(IDC_CHECK_EXCLUDE_DUPLICATE_IN_TABLE, &CVMDlg::OnBnClickedCheckExcludeDuplicateInTable)
ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST1, &CVMDlg::OnLvnItemchangedList1)
ON_NOTIFY(NM_RCLICK, IDC_LIST1, &CVMDlg::OnRclickList1)
ON_NOTIFY(LVN_KEYDOWN, IDC_LIST1, &CVMDlg::OnKeydownList1)
ON_EN_CHANGE(IDC_EDIT_SEARCH_OBJECT, &CVMDlg::OnChangeEditSearchObject)
ON_BN_CLICKED(IDC_CHECK_SEARCH_ONLY_SELECTED_VM_PROFILE, &CVMDlg::OnBnClickedCheckSearchOnlySelectedVmProfile)
END_MESSAGE_MAP()
// CVMDlg message handlers
DH_ENUM_FILES_of_PROFILES CVMDlg::VM_file_lists[MAX_CONTAINTER_FILES];
BOOL CVMDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
GUI_UPDATE_AFTER_FILL_PROFILE(Fill_VM_profiles_list());
m_CHECK_exclude_duplicate_handles.SetCheck(BST_CHECKED); //BST_CHECK_exclude_duplicate = false;
BST_CHECK_exclude_duplicate = true;
//m_list.DeleteColumn(5);
m_list.DeleteColumn(4);
m_list.DeleteColumn(3);
m_list.DeleteColumn(2);
m_list.DeleteColumn(1);
m_list.DeleteColumn(0);
m_list.InsertColumn(0, L"Handle", 0, 90, -1);
m_list.InsertColumn(1, L"Cell", 0, 90, -1);
m_list.InsertColumn(2, L"Type", 0, 140, -1);
m_list.InsertColumn(3, L"p-code", 0, 50, -1); //shift
m_list.InsertColumn(4, L"RBP", 0, 50, -1); //shift
//m_list.InsertColumn(5,L"First asm",0,150,-1);
//if (DH_VM_Get_current_profile_data_first(&VM_current_stack))
// {
// }
// ::SetWindowText(m_edit_address_supply.m_hWnd,_T("00000001481BADEA"));
return true;
}
//void CVMDlg::OnBnClickedSupplyOps()
//{
//
// ::GetWindowText(m_edit_address_supply.m_hWnd,&digital_buffer[0],MAX_PATH);
// UINT64 A = wtou64_16_fast(&digital_buffer[0]);
// DH_VM_Inspector__Get_Supply_Deport(HUNT_SUPPLY_HIVE);
//}
//void CVMDlg::OnLvnItemchangedList1(NMHDR *pNMHDR, LRESULT *pResult)
//{
// LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
// // TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
// *pResult = 0;
//}
void CVMDlg::OnBnClickedAddVmRecord()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
CVM_Tool_Create_Profiles VM_tool_create_new_record;
if (VM_tool_create_new_record.DoModal() == 1)
GUI_UPDATE_AFTER_FILL_PROFILE(Fill_VM_profiles_list());
}
bool CVMDlg::Fill_VM_profiles_list(void)
{
size_t i = DH_Get_Current_hunt_profile_ALL_FILE_CONTAINERS(PROFILE_TYPE_VM, &VM_file_lists[0]);
if(i==0)
{return false;}
VM_file_lists_count = i;
::SendMessage(m_list_vms_records.m_hWnd, LB_RESETCONTENT, 0, 0); //m_list_vms_records.ResetContent();
register pDH_ENUM_FILES_of_PROFILES pEnumFileprofile = &VM_file_lists[0];
do
{
::SendMessage(m_list_vms_records.m_hWnd, LB_ADDSTRING, 0, (LPARAM)&pEnumFileprofile->FileName[0]); //m_list_vms_records.AddString(&pEnumFileprofile->FileName[0]);
pEnumFileprofile++;
}while(--i);
return true;
}
bool CVMDlg::Fill_selected_VM_information(WCHAR* VM_NAME)
{
ULONG reta=0;
pVMPX_VM_PROFILE_INFO_STACK Selected_Stack=0;
/////////////////// FILL INFO BLOCK DATA /////////////////////////////////////
Selected_Stack = (pVMPX_VM_PROFILE_INFO_STACK)DH_Read_Current_hunt_profile_CONTAINER(PROFILE_TYPE_VM, VM_NAME,PROFILE_READ_ALL,&reta);
if (!Selected_Stack)
return false;
// VMP version + VM SUPPLY 15 ADDRESS (conditional) //
switch(Selected_Stack->VMPX_version)
{
case VM_TYPE_VMP2: {::SetWindowTextW(m_EDIT_info_VM_version.m_hWnd,TS_VM_TYPE_VMP2); break;}
case VM_TYPE_VMP3: {::SetWindowTextW(m_EDIT_info_VM_version.m_hWnd,TS_VM_TYPE_VMP3); ::SetWindowTextW(m_EDIT_info_VM_supply15_adress.m_hWnd,TS_DEF_NA); break;}
case VM_TYPE_VMX_D4: {::SetWindowTextW(m_EDIT_info_VM_version.m_hWnd, TS_VM_TYPE_D4); ::SetWindowTextW(m_EDIT_info_VM_supply15_adress.m_hWnd, TS_DEF_NA); break; }
case VM_TYPE_VMX_D5: {::SetWindowTextW(m_EDIT_info_VM_version.m_hWnd, TS_VM_TYPE_D5); ::SetWindowTextW(m_EDIT_info_VM_supply15_adress.m_hWnd, TS_DEF_NA); break; }
default: {::SetWindowTextW(m_EDIT_info_VM_version.m_hWnd,TS_VM_TYPE_ANOTHER); ::SetWindowTextW(m_EDIT_info_VM_supply15_adress.m_hWnd,TS_DEF_NA); break;}
}
// VM SUPPLY 15 ADDRESS - VMP2 //
if(Selected_Stack->VMPX_version == VM_TYPE_VMP2)
{
itoa_16_fast((SERVICE_ADDRES)Selected_Stack->supply_15_start_address,&digital_buffer[DIG_BUFFER_0X_SHR]);
::SetWindowTextW(m_EDIT_info_VM_supply15_adress.m_hWnd,&digital_buffer[0]);
}
// VM SUPPLY 15 duplicate hanhelds and infucient - VMP2 //
TCHAR local_dig_buffer[64];
//format (DEC): all_succes_found/count_of_duplicate/count_of_original/identificated/percent
itoa_10_fast((size_t)Selected_Stack->handles_count, &buffer[0]);
itoa_10_fast((size_t)Selected_Stack->duplicate_handles_count, &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
itoa_10_fast(((size_t)Selected_Stack->handles_count - (size_t)Selected_Stack->duplicate_handles_count),&local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
itoa_10_fast(((size_t)Selected_Stack->identeficated_handles_count), &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
if (Selected_Stack->identeficated_handles_count != NULL)
{
itoa_10_fast(((size_t)(Selected_Stack->identeficated_handles_count * 100) / Selected_Stack->handles_count), &local_dig_buffer[0]);
wcscat(&buffer[0], &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_PERCENT);
}
else
{
wcscat(&buffer[0], TS_DEF_NULL_PERCENT);
}
::SetWindowText(m_EDIT_info_vm_count_consist_of.m_hWnd,&buffer[0]);
_ltow(Selected_Stack->Stack_RSP_Different, &buffer[0], 10);
//if(Selected_Stack->Stack_RSP_Different > 0)
//itoa_10_fast((ULONG64)Selected_Stack->Stack_RSP_Different, &buffer[0]);
//else
//itoa_10_fast((ULONG64)-Selected_Stack->Stack_RSP_Different, &buffer[0]);
::SetWindowText(m_EDIT_info_stack_reserved_bytes.m_hWnd, &buffer[0]);
::SetWindowTextA(m_EDIT_info_context_site.m_hWnd, (LPCSTR)&Selected_Stack->RegionSectionInfo.Name[0]);
// comments //
//::SetWindowTextW(m_EDIT_info_VM_comments.m_hWnd,&Selected_Stack->comment[0]);
free(Selected_Stack);
return true;
}
bool CVMDlg::Load_current_VM_profile_and_fill_all_info_blocks(__in WCHAR* VM_NAME, __in LPVOID pParam)
{
CVMDlg *pThis = reinterpret_cast<CVMDlg*>(pParam);
ULONG reta=0;
/////////////////// FILL INFO BLOCK DATA /////////////////////////////////////
if (pThis->LOCK_VM_PROFILE_stack != NULL)
free(pThis->LOCK_VM_PROFILE_stack);
pThis->LOCK_VM_PROFILE_stack = (pVMPX_VM_PROFILE_INFO_STACK)DH_Read_Current_hunt_profile_CONTAINER(PROFILE_TYPE_VM, VM_NAME,PROFILE_READ_ALL,&reta);
if (!pThis->LOCK_VM_PROFILE_stack)
return false;
// VM SUPPLY 15 duplicate hanhelds and infucient - VMP2 //
TCHAR local_dig_buffer[64];
//format (DEC): all_succes_found/count_of_duplicate/count_of_original/identificated/percent
itoa_10_fast((size_t)pThis->LOCK_VM_PROFILE_stack->handles_count, &buffer[0]);
itoa_10_fast((size_t)pThis->LOCK_VM_PROFILE_stack->duplicate_handles_count, &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
itoa_10_fast(((size_t)pThis->LOCK_VM_PROFILE_stack->handles_count - (size_t)pThis->LOCK_VM_PROFILE_stack->duplicate_handles_count), &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
itoa_10_fast(((size_t)pThis->LOCK_VM_PROFILE_stack->identeficated_handles_count), &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
if (pThis->LOCK_VM_PROFILE_stack->identeficated_handles_count != NULL)
{
itoa_10_fast(((size_t)(pThis->LOCK_VM_PROFILE_stack->identeficated_handles_count * 100) / pThis->LOCK_VM_PROFILE_stack->handles_count), &local_dig_buffer[0]);
wcscat(&buffer[0], &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_PERCENT);
}
else
{
wcscat(&buffer[0], TS_DEF_NULL_PERCENT);
}
::SetWindowText(pThis->m_EDIT_info_vm_count_consist_of.m_hWnd, &buffer[0]);
// VMP version + VM SUPPLY 15 ADDRESS (conditional) //
switch(pThis->LOCK_VM_PROFILE_stack->VMPX_version)
{
case VM_TYPE_VMP2: {::SetWindowText(pThis->m_EDIT_info_VM_version.m_hWnd,TS_VM_TYPE_VMP2); break;}
case VM_TYPE_VMP3: {::SetWindowText(pThis->m_EDIT_info_VM_version.m_hWnd,TS_VM_TYPE_VMP3); ::SetWindowTextW(pThis->m_EDIT_info_VM_supply15_adress.m_hWnd,TS_DEF_NA); break;}
default: {::SetWindowTextW(pThis->m_EDIT_info_VM_version.m_hWnd,TS_VM_TYPE_ANOTHER); ::SetWindowTextW(pThis->m_EDIT_info_VM_supply15_adress.m_hWnd,TS_DEF_NA); break;}
}
// VM SUPPLY 15 ADDRESS - VMP2 //
if(pThis->LOCK_VM_PROFILE_stack->VMPX_version == VM_TYPE_VMP2)
{
itoa_16_fast((ULONG64)pThis->LOCK_VM_PROFILE_stack->supply_15_start_address,&digital_buffer[DIG_BUFFER_0X_SHR]);
::SetWindowTextW(pThis->m_EDIT_info_VM_supply15_adress.m_hWnd,&digital_buffer[0]);
}
_ltow(pThis->LOCK_VM_PROFILE_stack->Stack_RSP_Different, &buffer[0], 10);
::SetWindowTextW(pThis->m_EDIT_info_stack_reserved_bytes.m_hWnd, &buffer[0]);
::SetWindowTextA(pThis->m_EDIT_info_context_site.m_hWnd, (LPCSTR)&pThis->LOCK_VM_PROFILE_stack->RegionSectionInfo.Name[0]);
// comments //
//::SetWindowTextW(m_EDIT_info_VM_comments.m_hWnd,&LOCK_VM_PROFILE_stack->comment[0]);
/////////////////// parse HANHEDL struct /////////////////////////////////////
if(pThis->LOCK_VM_PROFILE_stack->handles_count == NULL)
return false;
pThis->m_list.DeleteAllItems();
TCHAR dst_byte_buffer[CHAR_MAX];
register size_t i = pThis->LOCK_VM_PROFILE_stack->handles_count;
i--;
register pHANHELD fpHANHELD = (pHANHELD)((SERVICE_ADDRES)pThis->LOCK_VM_PROFILE_stack + pThis->LOCK_VM_PROFILE_stack->ofs_1Containt_handler);
fpHANHELD--;
do
{
fpHANHELD++;
if(pThis->BST_CHECK_exclude_duplicate == true)
{
if(fpHANHELD->is_duplicate_hanheld_in_supply15 == true)
continue;
}
itoa_16_fast((ULONG64)fpHANHELD->HANDELD_Primary_Addres,&digital_buffer[DIG_BUFFER_0X_SHR]);
pThis->m_list.InsertItem(0,&digital_buffer[0]);
itoa_16_fast((ULONG64)fpHANHELD->Cell_Addres,&digital_buffer[DIG_BUFFER_0X_SHR]);
pThis->m_list.SetItemText(0,1,&digital_buffer[0]);
//itoa_16_fast((ULONG64)LOCK_VM_PROFILE_stack->Containt_handler[i].HANDELD_type,&dst_byte_buffer[0]);
//m_list.SetItemText(0,2,&dst_byte_buffer[0]);
//HANHELD_TYPE_VM_ENTER, HANHELD_TYPE_VM_EXIT, HANHELD_TYPE_CALL, HANHELD_TYPE_RDTSC, HANHELD_TYPE_XOR_byte_from_addres, HANHELD_TYPE_MOV_reg_memreg, HANHELD_TYPE_MOV_memreg_reg
TCHAR* HANHELD_type_str = DH_VM_HANHELD_type_to_string(fpHANHELD->HANDELD_type);
if (HANHELD_type_str)
pThis->m_list.SetItemText(0,2,HANHELD_type_str);
_ltow(fpHANHELD->PCODE_Shift,&dst_byte_buffer[0],10);
pThis->m_list.SetItemText(0,3,&dst_byte_buffer[0]);
_ltow(fpHANHELD->stack_RBP_Shift,&dst_byte_buffer[0],10);
pThis->m_list.SetItemText(0,4,&dst_byte_buffer[0]);
//quick_ASCII_to_UNICODE((BYTE*)&fpHANHELD->hanheld_dissasm_first_insruction[0],&dst_byte_buffer[0]);
//m_list.SetItemText(0,5,(LPCTSTR)&dst_byte_buffer[0]);
/*
LVITEMA lvi;
lvi.iItem = 0;
lvi.iSubItem = 4;
lvi.pszText = (LPSTR) &LOCK_VM_PROFILE_stack->Containt_handler[i].hanheld_dissasm_first_insruction[0];
::SendMessageA(m_hWnd, LVM_SETITEMTEXTA, NULL, (LPARAM)&lvi);*/
}while(i--);
return true;
}
bool CVMDlg::Load_current_VM_profile_and_fill_all_info_blocks__manual_hanheld_show(__in WCHAR* VM_NAME, __in LPVOID pParam, __in pHANHELD* ppHanheldStack_start, __in SERVICE_COUNT Stack_count)
{
CVMDlg *pThis = reinterpret_cast<CVMDlg*>(pParam);
ULONG reta = 0;
/////////////////// FILL INFO BLOCK DATA /////////////////////////////////////
if (pThis->LOCK_VM_PROFILE_stack != NULL)
free(pThis->LOCK_VM_PROFILE_stack);
pThis->LOCK_VM_PROFILE_stack = (pVMPX_VM_PROFILE_INFO_STACK)DH_Read_Current_hunt_profile_CONTAINER(PROFILE_TYPE_VM, VM_NAME, PROFILE_READ_ALL, &reta);
if (!pThis->LOCK_VM_PROFILE_stack)
return false;
// VM SUPPLY 15 duplicate hanhelds and infucient - VMP2 //
TCHAR local_dig_buffer[64];
//format (DEC): all_succes_found/count_of_duplicate/count_of_original/identificated/percent
itoa_10_fast((size_t)pThis->LOCK_VM_PROFILE_stack->handles_count, &buffer[0]);
itoa_10_fast((size_t)pThis->LOCK_VM_PROFILE_stack->duplicate_handles_count, &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
itoa_10_fast(((size_t)pThis->LOCK_VM_PROFILE_stack->handles_count - (size_t)pThis->LOCK_VM_PROFILE_stack->duplicate_handles_count), &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
itoa_10_fast(((size_t)pThis->LOCK_VM_PROFILE_stack->identeficated_handles_count), &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
wcscat(&buffer[0], &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_DIV_UNIT);
if (pThis->LOCK_VM_PROFILE_stack->identeficated_handles_count != NULL)
{
itoa_10_fast(((size_t)(pThis->LOCK_VM_PROFILE_stack->identeficated_handles_count * 100) / pThis->LOCK_VM_PROFILE_stack->handles_count), &local_dig_buffer[0]);
wcscat(&buffer[0], &local_dig_buffer[0]);
wcscat(&buffer[0], TS_DEF_PERCENT);
}
else
{
wcscat(&buffer[0], TS_DEF_NULL_PERCENT);
}
::SetWindowText(pThis->m_EDIT_info_vm_count_consist_of.m_hWnd, &buffer[0]);
// VMP version + VM SUPPLY 15 ADDRESS (conditional) //
switch (pThis->LOCK_VM_PROFILE_stack->VMPX_version)
{
case VM_TYPE_VMP2: {::SetWindowText(pThis->m_EDIT_info_VM_version.m_hWnd, TS_VM_TYPE_VMP2); break; }
case VM_TYPE_VMP3: {::SetWindowText(pThis->m_EDIT_info_VM_version.m_hWnd, TS_VM_TYPE_VMP3); ::SetWindowTextW(pThis->m_EDIT_info_VM_supply15_adress.m_hWnd, TS_DEF_NA); break; }
default: {::SetWindowTextW(pThis->m_EDIT_info_VM_version.m_hWnd, TS_VM_TYPE_ANOTHER); ::SetWindowTextW(pThis->m_EDIT_info_VM_supply15_adress.m_hWnd, TS_DEF_NA); break; }
}
// VM SUPPLY 15 ADDRESS - VMP2 //
if (pThis->LOCK_VM_PROFILE_stack->VMPX_version == VM_TYPE_VMP2)
{
itoa_16_fast((ULONG64)pThis->LOCK_VM_PROFILE_stack->supply_15_start_address, &digital_buffer[DIG_BUFFER_0X_SHR]);
::SetWindowTextW(pThis->m_EDIT_info_VM_supply15_adress.m_hWnd, &digital_buffer[0]);
}
_ltow(pThis->LOCK_VM_PROFILE_stack->Stack_RSP_Different, &buffer[0], 10);
::SetWindowTextW(pThis->m_EDIT_info_stack_reserved_bytes.m_hWnd, &buffer[0]);
::SetWindowTextA(pThis->m_EDIT_info_context_site.m_hWnd, (LPCSTR)&pThis->LOCK_VM_PROFILE_stack->RegionSectionInfo.Name[0]);
// comments //
//::SetWindowTextW(m_EDIT_info_VM_comments.m_hWnd,&LOCK_VM_PROFILE_stack->comment[0]);
/////////////////// parse HANHEDL struct /////////////////////////////////////
if (pThis->LOCK_VM_PROFILE_stack->handles_count == NULL)
return false;
pThis->m_list.DeleteAllItems();
TCHAR dst_byte_buffer[CHAR_MAX];
register size_t i = Stack_count;
ppHanheldStack_start--;
do
{
ppHanheldStack_start++;
if (*ppHanheldStack_start == 0)
continue;
register pHANHELD fpHANHELD = *ppHanheldStack_start;
if (pThis->BST_CHECK_exclude_duplicate == true)
{
if (fpHANHELD->is_duplicate_hanheld_in_supply15 == true)
continue;
}
itoa_16_fast((ULONG64)fpHANHELD->HANDELD_Primary_Addres, &digital_buffer[DIG_BUFFER_0X_SHR]);
pThis->m_list.InsertItem(0, &digital_buffer[0]);
itoa_16_fast((ULONG64)fpHANHELD->Cell_Addres, &digital_buffer[DIG_BUFFER_0X_SHR]);
pThis->m_list.SetItemText(0, 1, &digital_buffer[0]);
TCHAR* HANHELD_type_str = DH_VM_HANHELD_type_to_string(fpHANHELD->HANDELD_type);
if (HANHELD_type_str)
pThis->m_list.SetItemText(0, 2, HANHELD_type_str);
_ltow(fpHANHELD->PCODE_Shift, &dst_byte_buffer[0], 10);
pThis->m_list.SetItemText(0, 3, &dst_byte_buffer[0]);
_ltow(fpHANHELD->stack_RBP_Shift, &dst_byte_buffer[0], 10);
pThis->m_list.SetItemText(0, 4, &dst_byte_buffer[0]);
} while (--i);
return true;
}
void CVMDlg::OnLbnSelchangeListVmEnum()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
WCHAR text_data[PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN];
if (!GUI_GET_VM_RECORD_SELECTED_FILENAME(&text_data[0]))
return;
Fill_selected_VM_information(&text_data[0]);
}
void CVMDlg::OnBnClickedSelectVmRecord()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
WCHAR text_data[PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN];
if (!GUI_GET_VM_RECORD_SELECTED_FILENAME(&text_data[0]))
return;
Load_current_VM_profile_and_fill_all_info_blocks(&text_data[0], this);
GUI_Switch_LISTS(true, this);
}
void CVMDlg::GUI_UPDATE_AFTER_FILL_PROFILE(bool Fill_result)
{
::EnableWindow(m_BUTTON_Select_VM_record.m_hWnd, Fill_result);
UpdateWindow();
}
UINT CVMDlg::GUI_GET_VM_RECORD_SELECTED_FILENAME(__out WCHAR* FileName)
{
UINT csl = m_list_vms_records.GetCurSel();
if((HANDLE)csl == INVALID_HANDLE_VALUE)
return 0;
if (m_list_vms_records.GetTextLen(csl) > PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN)
return 0;
LOCK_VM_PROFILE_filename_len = m_list_vms_records.GetText(csl, &LOCK_VM_PROFILE_filename[0]);
wcscpy(FileName, &LOCK_VM_PROFILE_filename[0]);
return LOCK_VM_PROFILE_filename_len;
}
void CVMDlg::OnClickList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
WCHAR text_data[G_ADDRES_STRING_UNICODE_MAX_LEN];
POSITION sel_pos = m_list.GetFirstSelectedItemPosition();
if(sel_pos == (POSITION)-1 || sel_pos == NULL)
return;
sel_pos--; //real item id
m_list.GetItemText((int)sel_pos,0, &text_data[0],MAX_PATH);
::SetWindowTextW(m_EDIT_info_HANHELD_ADDRES.m_hWnd, &text_data[0]);
itoa_10_fast((int)sel_pos,&text_data[0]);
::SetWindowTextW(m_EDIT_info_HANHELD_NUM.m_hWnd, &text_data[0]);
ULONG item_wtext_len = m_list.GetItemText((int)sel_pos,1, &buffer[0],MAX_PATH);
register pHANHELD fpHANHELD = 0;
if (item_wtext_len > 0)
{
fpHANHELD = Find_selected_hanheld_in_current_VM_stack(&buffer[0], item_wtext_len);
if (fpHANHELD == NULL)
return;
itoa_10_fast(fpHANHELD->critical_jumpouts_array_count,&text_data[0]);
::SetWindowTextW(m_EDIT_info_JUMPOUTs_count.m_hWnd, &text_data[0]);
itoa_10_fast(fpHANHELD->determine_address_array_count,&text_data[0]);
::SetWindowTextW(m_EDIT_info_crit_addr_count.m_hWnd, &text_data[0]);
}
*pResult = 0;
}
void CVMDlg::OnBnClickedCheckExcludeDuplicateInTable()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
if (m_CHECK_exclude_duplicate_handles.GetCheck() == BST_CHECKED)
BST_CHECK_exclude_duplicate = true;
else
BST_CHECK_exclude_duplicate = false;
}
void CVMDlg::OnLvnItemchangedList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
*pResult = 0;
}
void CVMDlg::OnRclickList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
POSITION sel_pos = m_list.GetFirstSelectedItemPosition();
if(sel_pos == (POSITION)-1 || sel_pos == NULL)
return;
POINT cursor_point;
::GetCursorPos(&cursor_point);
CMenu menu;
menu.CreatePopupMenu();
menu.AppendMenu(MF_STRING|MF_POPUP, nBaseId+1, _T("(Only this) Add type determine instructions to path inspector"));
menu.AppendMenu(MF_SEPARATOR, nBaseId+2, _T("..."));
menu.AppendMenu(MF_STRING|MF_POPUP, nBaseId+3, _T("(All VMs) Add all -= read/write _DS=- to path inspector"));
menu.AppendMenu(MF_STRING|MF_POPUP, nBaseId+4, _T("(All VMs) Add all -= _radn (RDTSC)=- to path inspector"));
menu.AppendMenu(MF_STRING|MF_POPUP, nBaseId+5, _T("(All VMs) Add all -= _CRC check=- to path inspector"));
menu.AppendMenu(MF_SEPARATOR, nBaseId+6, _T("..."));
menu.AppendMenu(MF_STRING|MF_POPUP, nBaseId+7, _T("(All VMs) Add all hanhelds tables to path inspector"));
register ULONG menusel = TrackPopupMenuEx(menu, TPM_LEFTALIGN|TPM_RIGHTBUTTON|TPM_RETURNCMD, cursor_point.x, cursor_point.y,m_hWnd,NULL);
switch(menusel)
{
case nBaseId+1:{
/*
ULONG item_wtext_len = m_list.GetItemText((int)--sel_pos,1, &buffer[0],MAX_PATH);
if (item_wtext_len > 0)
{
ULONG array_i = Find_selected_hanheld_in_current_VM_stack(&buffer[0], item_wtext_len);
if (array_i == NULL)
break;
DH_PATCH_Add_new_vmp_execute_address_patch(&LOCK_VM_PROFILE_stack->Containt_handler[array_i].determine_type_addres_array[9],
&LOCK_VM_PROFILE_stack->Containt_handler[array_i].determine_type_addres_array__HANHELD_in_AddrPool_ID[9],
&LOCK_VM_PROFILE_stack->name[0],
array_i,
LOCK_VM_PROFILE_stack->Containt_handler[array_i].HANDELD_type, PATCH_OWNER_VM_INSIDE_EXECUTE);
} */
break;}
case nBaseId+3:{AddPatchInspectorOps_AllVM_readwriteDS(); break;}
case nBaseId+4:{AddPatchInspectorOps_AllVM_randRDTSC(); break;}
case nBaseId+5:{AddPatchInspectorOps_AllVM_CRC_check(); break;}
}
menu.DestroyMenu();
*pResult = 0;
}
pHANHELD CVMDlg::Find_selected_hanheld_in_current_VM_stack(WCHAR* wchar_hanheld_addres, ULONG wtext_len)
{
register SERVICE_ADDRES list_cell_addres = _wcstoui64(wchar_hanheld_addres,NULL, 16);
if (list_cell_addres == NULL)
return NULL;
if (LOCK_VM_PROFILE_stack->handles_count == NULL)
return NULL;
register size_t i = LOCK_VM_PROFILE_stack->handles_count;
register pHANHELD fpHANHELD = (pHANHELD)((SERVICE_ADDRES)LOCK_VM_PROFILE_stack + LOCK_VM_PROFILE_stack->ofs_1Containt_handler);
do
{
if(list_cell_addres == (SERVICE_ADDRES)fpHANHELD->Cell_Addres)
return fpHANHELD;
fpHANHELD++;
}while (i--);
return NULL;
}
void CVMDlg::OnKeydownList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLVKEYDOWN pLVKeyDow = reinterpret_cast<LPNMLVKEYDOWN>(pNMHDR);
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
POSITION sel_pos = m_list.GetFirstSelectedItemPosition();
if(sel_pos == (POSITION)-1 || sel_pos == NULL)
return;
switch (pLVKeyDow->wVKey)
{
case VK_UP: {OnClickList1(pNMHDR,pResult); break;}
case VK_DOWN: {OnClickList1(pNMHDR,pResult); break;}
}
*pResult = 0;
}
void CVMDlg::AddPatchInspectorOps_AllVM_readwriteDS()
{
register SERVICE_COUNT i = DH_Get_Current_hunt_profile_ALL_FILE_CONTAINERS(PROFILE_TYPE_VM, &VM_file_lists[0]);
if(i==0)
return;
/*
register pVMPX_VM_PROFILE_INFO_STACK Operation_vmp2_stack;
DWORD reta = NULL;
register SERVICE_COUNT hanheld_ii;
do
{
Operation_vmp2_stack = (pVMPX_VM_PROFILE_INFO_STACK)DH_Read_Current_hunt_profile_CONTAINER(PROFILE_TYPE_VM, &VM_file_lists[i].FileName[0],PROFILE_READ_ALL,&reta);
if(Operation_vmp2_stack == NULL)
continue;
hanheld_ii = VM_HANDLES_MAX_COUNT;
do
{
switch(Operation_vmp2_stack->Containt_handler[hanheld_ii].HANDELD_type)
{
case HANHELD_TYPE_MOV_memreg64_reg8_DS:
case HANHELD_TYPE_MOV_memreg64_reg16_DS:
case HANHELD_TYPE_MOV_memreg64_reg32_DS:
case HANHELD_TYPE_MOV_memreg64_reg64_DS:
case HANHELD_TYPE_MOV_reg8_memreg64_DS:
case HANHELD_TYPE_MOV_reg16_memreg64_DS:
case HANHELD_TYPE_MOV_reg32_memreg64_DS:
case HANHELD_TYPE_MOV_reg64_memreg64_DS:
DH_PATCH_Add_new_vmp_execute_address_patch(&Operation_vmp2_stack->Containt_handler[hanheld_ii].determine_type_addres_array[9],
&Operation_vmp2_stack->Containt_handler[hanheld_ii].determine_type_addres_array__HANHELD_in_AddrPool_ID[9],
&Operation_vmp2_stack->name[0],
hanheld_ii,
Operation_vmp2_stack->Containt_handler[hanheld_ii].HANDELD_type, PATCH_OWNER_VM_INSIDE_EXECUTE);
}//end switch
}while(hanheld_ii--);//do - while
DH_PATCH_Add_new_vmp_DATA_address_patch((SERVICE_ADDRES)Operation_vmp2_stack->r12_supply_15_start_address, sizeof(CELL_ADDRES)*LIMIT_HANDLES_ON_SUPPLY, &Operation_vmp2_stack->name[0],PATCH_OWNER_VM_SUPPLY15_DATA); //DATA - cover SUPPLY15
DH_PATCH_Add_new_vmp_DATA_address_patch((SERVICE_ADDRES)Operation_vmp2_stack->Containt_handler[0].HANDELD_Primary_Addres, sizeof(CELL_ADDRES)*LIMIT_HANDLES_ON_SUPPLY, &Operation_vmp2_stack->name[0],PATCH_OWNER_VM_COVERAGE); //DATA - cover hanhleds addreses
free(Operation_vmp2_stack);
}while(i--);
*/
}
void CVMDlg::AddPatchInspectorOps_AllVM_randRDTSC()
{
register SERVICE_COUNT i = DH_Get_Current_hunt_profile_ALL_FILE_CONTAINERS(PROFILE_TYPE_VM, &VM_file_lists[0]);
if(i==0)
return;
register pVMPX_VM_PROFILE_INFO_STACK Operation_vmp2_stack;
DWORD reta = NULL;
/*
register SERVICE_COUNT hanheld_ii;
do
{
Operation_vmp2_stack = (pVMPX_VM_PROFILE_INFO_STACK)DH_Read_Current_hunt_profile_CONTAINER(PROFILE_TYPE_VM, &VM_file_lists[i].FileName[0],PROFILE_READ_ALL,&reta);
if(Operation_vmp2_stack == NULL)
continue;
hanheld_ii = VM_HANDLES_MAX_COUNT;
do
{
switch(Operation_vmp2_stack->Containt_handler[hanheld_ii].HANDELD_type)
{
case HANHELD_TYPE_RDTSC:
DH_PATCH_Add_new_vmp_execute_address_patch(&Operation_vmp2_stack->Containt_handler[hanheld_ii].determine_type_addres_array[9],
&Operation_vmp2_stack->Containt_handler[hanheld_ii].determine_type_addres_array__HANHELD_in_AddrPool_ID[9],
&Operation_vmp2_stack->name[0],
hanheld_ii,
Operation_vmp2_stack->Containt_handler[hanheld_ii].HANDELD_type,PATCH_OWNER_VM_INSIDE_EXECUTE);
}//end switch
}while(hanheld_ii--);//do - while
free(Operation_vmp2_stack);
}while(i--);
*/
}
void CVMDlg::AddPatchInspectorOps_AllVM_CRC_check()
{
register SERVICE_COUNT i = DH_Get_Current_hunt_profile_ALL_FILE_CONTAINERS(PROFILE_TYPE_VM, &VM_file_lists[0]);
if(i==0)
return;
register pVMPX_VM_PROFILE_INFO_STACK Operation_vmp2_stack;
DWORD reta = NULL;
/*
register SERVICE_COUNT hanheld_ii;
do
{
Operation_vmp2_stack = (pVMPX_VM_PROFILE_INFO_STACK)DH_Read_Current_hunt_profile_CONTAINER(PROFILE_TYPE_VM, &VM_file_lists[i].FileName[0],PROFILE_READ_ALL,&reta);
if(Operation_vmp2_stack == NULL)
continue;
hanheld_ii = VM_HANDLES_MAX_COUNT;
do
{
switch(Operation_vmp2_stack->Containt_handler[hanheld_ii].HANDELD_type)
{
case HANHELD_TYPE_XOR_byte_from_memreg64:
DH_PATCH_Add_new_vmp_execute_address_patch(&Operation_vmp2_stack->Containt_handler[hanheld_ii].determine_type_addres_array[9],
&Operation_vmp2_stack->Containt_handler[hanheld_ii].determine_type_addres_array__HANHELD_in_AddrPool_ID[9],
&Operation_vmp2_stack->name[0],
hanheld_ii,
Operation_vmp2_stack->Containt_handler[hanheld_ii].HANDELD_type,PATCH_OWNER_VM_INSIDE_EXECUTE);
}//end switch
}while(hanheld_ii--);//do - while
free(Operation_vmp2_stack);
}while(i--);
*/
}
void CVMDlg::OnChangeEditSearchObject()
{
TCHAR dig_buf[64];
size_t f = ::GetWindowText(m_EDIT_SEARCH_object.m_hWnd, &dig_buf[0], 64);
if (f == 0) //ôèëüòð ¹1
{
::SetWindowText(m_EDIT_search_objects_count.m_hWnd, TS_DEF_NA);
::SetWindowText(m_EDIT_search_objects_SUB_count.m_hWnd, TS_DEF_NA);
return;
}
//ïîïûòêà îïðåäåëèòü êàê òèï
SERVICE_TYPE prep_hanheld_type = DH_VM_HANHELD_string_To_type(&dig_buf[0]);
if (prep_hanheld_type == NULL)
{
//îïðåäåëÿåì, êàê àäðåñ
SERVICE_ADDRES pObject_text_addres_wcstoul = _wcstoui64(&dig_buf[0], NULL, 16);
if (pObject_text_addres_wcstoul == NULL || pObject_text_addres_wcstoul <= 0xFF)
return;
}
//êîððåêòíî îïðåäåëåíû ââåäåííûå äàííûå
DWORD TID = NULL;
::CreateRemoteThreadEx(DH_Current_process_fast_handle, NULL, NULL, (LPTHREAD_START_ROUTINE)SearchObject_Ops, this, NULL, NULL, &TID);
}
void CVMDlg::SearchObject_Ops(LPVOID pParam)
{
CVMDlg *pThis = reinterpret_cast<CVMDlg*>(pParam);
TCHAR dig_buf[64];
::SendMessage(pThis->m_SEARCH_list.m_hWnd, LVM_DELETEALLITEMS, 0, 0L); //pThis->m_SEARCH_list.DeleteAllItems();
::SendMessage(pThis->m_SEARCH_list.m_hWnd, LVM_DELETECOLUMN, 5, 0); //pThis->m_SEARCH_list.DeleteColumn(5);
::SendMessage(pThis->m_SEARCH_list.m_hWnd, LVM_DELETECOLUMN, 4, 0);
::SendMessage(pThis->m_SEARCH_list.m_hWnd, LVM_DELETECOLUMN, 3, 0);
::SendMessage(pThis->m_SEARCH_list.m_hWnd, LVM_DELETECOLUMN, 2, 0);
::SendMessage(pThis->m_SEARCH_list.m_hWnd, LVM_DELETECOLUMN, 1, 0);
::SendMessage(pThis->m_SEARCH_list.m_hWnd, LVM_DELETECOLUMN, 0, 0);
size_t f = ::GetWindowText(pThis->m_EDIT_SEARCH_object.m_hWnd, &dig_buf[0], 64);
if (f == 0) //ôèëüòð ¹1
{
::SetWindowText(pThis->m_EDIT_search_objects_count.m_hWnd, TS_DEF_NA);
::SetWindowText(pThis->m_EDIT_search_objects_SUB_count.m_hWnd, TS_DEF_NA);
return;
}
::EnableWindow(pThis->m_EDIT_SEARCH_object.m_hWnd, false);
register pVM_THREADWORK__OBJECT_SEARCH pf_object_threadwork;
if (!pThis->Is_checl_only_selected_vm_profile)
pf_object_threadwork = DH_VM_Search_Object_in_containters_MT(&pThis->VM_file_lists[0], pThis->VM_file_lists_count, &dig_buf[0]);
else
{
if (pThis->LOCK_VM_PROFILE_filename_len == 0)
{
::EnableWindow(pThis->m_EDIT_SEARCH_object.m_hWnd, true);
return;
}
DH_ENUM_FILES_of_PROFILES One_Enum_file;
wcscpy(&One_Enum_file.FileName[0], &pThis->LOCK_VM_PROFILE_filename[0]);
pf_object_threadwork = DH_VM_Search_Object_in_containters_MT(&One_Enum_file, 1, &dig_buf[0]);
}
if (pf_object_threadwork == NULL)
{
::SetWindowText(pThis->m_EDIT_search_objects_count.m_hWnd, TS_DEF_NA);
::SetWindowText(pThis->m_EDIT_search_objects_SUB_count.m_hWnd, TS_DEF_NA);
::EnableWindow(pThis->m_EDIT_SEARCH_object.m_hWnd, true);
return;
}
if (pf_object_threadwork->TA_Total_VM_Profiles_found_count == NULL)
{
DH_VM_ThreadWork_Object_found_ClearSet(pf_object_threadwork);
::SendMessage(pThis->m_SEARCH_list.m_hWnd, LVM_DELETEALLITEMS, 0, 0L);
::SetWindowText(pThis->m_EDIT_search_objects_count.m_hWnd, TS_DEF_NULL);
::SetWindowText(pThis->m_EDIT_search_objects_SUB_count.m_hWnd, TS_DEF_NULL);
::EnableWindow(pThis->m_EDIT_SEARCH_object.m_hWnd, true);
return;
}
//ÇÀÏÎËÍÅÍÈÅ ÒÀÁËÈÖÛ ÍÀÉÄÅÍÍÛÕ ÇÍÀ×ÅÍÈÉ
itoa_10_fast(pf_object_threadwork->TA_Total_VM_Profiles_found_count, &dig_buf[0]);
::SetWindowText(pThis->m_EDIT_search_objects_count.m_hWnd, &dig_buf[0]);
itoa_10_fast(pf_object_threadwork->TA_Total_HANHELDS__in_VM_Profiles_found_count, &dig_buf[0]);
::SetWindowText(pThis->m_EDIT_search_objects_SUB_count.m_hWnd, &dig_buf[0]);
//ÏÐÎÖÅÑÑ ÏÎÊÀÇÀ ÐÅÇÓËÜÒÀÒÎÂ (GUI)
switch(pf_object_threadwork->TA_Total_VM_Profiles_found_count) //ñêîëüêî VM ïðîôèëåé áûëî íàéäåíî
{
case 0:
{
DH_VM_ThreadWork_Object_found_ClearSet(pf_object_threadwork);
return;
break;}
case 1: //òîëüêî îäèí êîíòåêñò - íàõîäèì è âûáèðàåì (Select) ÷åðåç VM_file_lists
{
switch (pf_object_threadwork->TA_Total_HANHELDS__in_VM_Profiles_found_count) //ñêîëüêî ÕÅÍÄËÎÂ áûëî íàéäåíî â VM ïðîôèëÿõ
{
case 0:
{
//ÏÐÎÑÒÎ ÇÀÌÅÍÈÒÜ ÒÅÊÓÙÈÉ ÎÒÊÐÛÒÛÉ (SELECT) VM ÏÐÎÔÈËÜ
register size_t i_profiles = MAX_CONTAINTER_FILES;
register pDH_VM_FOUND_RESULT fpVM_found_result = &pf_object_threadwork->VM_Found_result[0];
register pDH_ENUM_FILES_of_PROFILES fpEnumFiles = &pThis->VM_file_lists[0];
//ïåðå÷èñëÿåì òîëüêî VM_ïðîôèëè
fpVM_found_result--;
fpEnumFiles--;
do
{
fpVM_found_result++; //VM_Profiles inc
fpEnumFiles++; //VM file lists
if (fpVM_found_result->pVM_Success_found_VM_profile == NULL)
continue;
Load_current_VM_profile_and_fill_all_info_blocks(&fpEnumFiles->FileName[0], pThis);
GUI_Switch_LISTS(true, pThis);
long fa = pThis->m_list_vms_records.GetCount();
if (fa <= 0)
break;
TCHAR text_buff[PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN];
do
{
::SendMessage(pThis->m_list_vms_records.m_hWnd, LB_GETTEXT, fa, (LPARAM)&text_buff[0]);
if (wcsicmp(&fpEnumFiles->FileName[0], &text_buff[0]))
continue;
// pThis->m_list_vms_records.SetSel(fa, true);
::SendMessage(pThis->m_list_vms_records.m_hWnd, LB_SETCURSEL, TRUE, (LPARAM)fa); //pThis->m_list_vms_records.SetSel(fa, true);
break;
} while (--fa);
break;
} while (--i_profiles);
break;}
default:
{
//ÇÀÌÅÍÈÒÜ ÒÅÊÓÙÈÉ ÎÒÊÐÛÒÛÉ (SELECT) VM ÏÐÎÔÈËÜ È ÏÎÊÀÇÀÒÜ ÕÅÍÄËÛ
register size_t i_profiles = MAX_CONTAINTER_FILES;
register pDH_VM_FOUND_RESULT fpVM_found_result = &pf_object_threadwork->VM_Found_result[0];
register pDH_ENUM_FILES_of_PROFILES fpEnumFiles = &pThis->VM_file_lists[0];
//ïåðå÷èñëÿåì òîëüêî VM_ïðîôèëè
fpVM_found_result--;
fpEnumFiles--;
do
{
fpVM_found_result++; //VM_Profiles inc
fpEnumFiles++; //VM file lists
if (fpVM_found_result->pVM_Success_found_VM_profile == NULL)
continue;
Load_current_VM_profile_and_fill_all_info_blocks__manual_hanheld_show(&fpEnumFiles->FileName[0], pThis, &fpVM_found_result->pFoundHanheld[0], fpVM_found_result->Found_hanheld_stack_count);
GUI_Switch_LISTS(true, pThis);
long fa = pThis->m_list_vms_records.GetCount();
if (fa <= 0)
break;
TCHAR text_buff[PROFILE_nfo_MAX_CONTAINER_FILENAME_LEN];
do
{
::SendMessage(pThis->m_list_vms_records.m_hWnd, LB_GETTEXT, fa, (LPARAM)&text_buff[0]);
if (wcsicmp(&fpEnumFiles->FileName[0], &text_buff[0]))
continue;
// pThis->m_list_vms_records.SetSel(fa, true);
::SendMessage(pThis->m_list_vms_records.m_hWnd, LB_SETCURSEL, TRUE, (LPARAM)fa); //pThis->m_list_vms_records.SetSel(fa, true);
break;
} while (--fa);
break;
} while (--i_profiles);
break; }
}//end switch (pf_object_threadwork->TA_Total_HANHELDS__in_VM_Profiles_found_count)
break;}
default: //ìíîæåñòâåííàÿ âûáîðêà
{
__assume(pf_object_threadwork->TA_Total_VM_Profiles_found_count>1);
switch (pf_object_threadwork->TA_Total_HANHELDS__in_VM_Profiles_found_count) //ñêîëüêî ÕÅÍÄËÎÂ áûëî íàéäåíî â VM ïðîôèëÿõ
{
case 0:
{
pThis->m_SEARCH_list.InsertColumn(0, L"VM Profile", 0, 100, -1);
pThis->m_SEARCH_list.InsertColumn(1, L"Found data type", 0, 120, -1);
pThis->m_SEARCH_list.InsertColumn(2, L"Supply15", 0, 110, -1);
pThis->m_SEARCH_list.InsertColumn(3, L"VM version", 0, 110, -1);
pThis->m_SEARCH_list.InsertColumn(4, L"Stack reserve", 0, 110, -1);
pThis->m_SEARCH_list.InsertColumn(5, L"Ident hanhles", 0, 100, -1);
register size_t i_Succes_found = pf_object_threadwork->TA_Total_VM_Profiles_found_count;
register size_t i_profiles = MAX_FOUND_HANHELDS;
register pDH_VM_FOUND_RESULT fpVM_found_result = &pf_object_threadwork->VM_Found_result[0];
//ïåðå÷èñëÿåì òîëüêî VM_ïðîôèëè
fpVM_found_result--;
do
{
fpVM_found_result++; //VM_Profiles inc
if (fpVM_found_result->pVM_Success_found_VM_profile == NULL)
continue;
//set "VM Profile" name (0)
pThis->m_SEARCH_list.InsertItem(0, &fpVM_found_result->pVM_Success_found_VM_profile->vm_name[0]);
//set "Found data type" name (1)
pThis->m_SEARCH_list.SetItemText(0, 1, DH_VM_FOUND_RESULT_type_to_string(fpVM_found_result->Found_target_type[0]));
//set VM version + suplly15 (3) (2)
switch (fpVM_found_result->pVM_Success_found_VM_profile->VMPX_version)
{
case VM_TYPE_VMP2: {pThis->m_SEARCH_list.SetItemText(0, 3, TS_VM_TYPE_VMP2);
itoa_16_fast((size_t)fpVM_found_result->pVM_Success_found_VM_profile->supply_15_start_address, &dig_buf[0]);
pThis->m_SEARCH_list.SetItemText(0, 2, &dig_buf[0]);
break; }
case VM_TYPE_VMP3: {pThis->m_SEARCH_list.SetItemText(0, 3, TS_VM_TYPE_VMP3); pThis->m_SEARCH_list.SetItemText(0, 2, TS_DEF_NA); break; }
case VM_TYPE_VMX_D4: {pThis->m_SEARCH_list.SetItemText(0, 3, TS_VM_TYPE_D4); pThis->m_SEARCH_list.SetItemText(0, 2, TS_DEF_NA); break; }
case VM_TYPE_VMX_D5: {pThis->m_SEARCH_list.SetItemText(0, 3, TS_VM_TYPE_D5); pThis->m_SEARCH_list.SetItemText(0, 2, TS_DEF_NA); break; }
default: {pThis->m_SEARCH_list.SetItemText(0, 3, TS_VM_TYPE_ANOTHER); itoa_16_fast((size_t)fpVM_found_result->pVM_Success_found_VM_profile->supply_15_start_address, &dig_buf[0]);
pThis->m_SEARCH_list.SetItemText(0, 2, &dig_buf[0]);
break; }
}
//set "Stack reserve" (4)
_ltow(fpVM_found_result->pVM_Success_found_VM_profile->Stack_RSP_Different, &dig_buf[0], 10);
//itoa_10_fast((size_t)fpVM_found_result->pVM_Success_found_VM_profile->Stack_RSP_Different, &dig_buf[0]);
pThis->m_SEARCH_list.SetItemText(0, 4, &dig_buf[0]);
//set "Handles count" (5)
itoa_10_fast((size_t)fpVM_found_result->pVM_Success_found_VM_profile->handles_count, &dig_buf[0]);
pThis->m_SEARCH_list.SetItemText(0, 5, &dig_buf[0]);
if (--i_Succes_found == 0)
break;