-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathСDLC_Lic_Files.cpp
170 lines (133 loc) · 4.87 KB
/
СDLC_Lic_Files.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
/*
DENUVO_Profiler v0.3
--------------------
CRACKLAB, ELF
--------------------
Tiberium reversing
********************
2011 - 2024
*/
#include "stdafx.h"
#include "12.h"
#include "ÑDLC_Lic_Files.h"
#include "afxdialogex.h"
// äèàëîãîâîå îêíî ÑDLC_Lic_Files
IMPLEMENT_DYNAMIC(ÑDLC_Lic_Files, CDialogEx)
ÑDLC_Lic_Files::ÑDLC_Lic_Files(CWnd* pParent /*=NULL*/)
: CDialogEx(ÑDLC_Lic_Files::IDD, pParent)
{
pFileinfoStack = NULL;
CurrentFileDecodeInfo = NULL;
pCurSelDLC_Info = NULL;
}
ÑDLC_Lic_Files::~ÑDLC_Lic_Files()
{
if(pFileinfoStack)
free(pFileinfoStack);
if(CurrentFileDecodeInfo)
free(CurrentFileDecodeInfo);
if (pCurSelDLC_Info != NULL)
free(pCurSelDLC_Info);
}
void ÑDLC_Lic_Files::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_FILELIST1, m_FILELIST);
// DDX_Control(pDX, IDC_EDIT_SECRET_TABLE, m_EDIT_SECRET_TABLE);
DDX_Control(pDX, IDC_EDIT_VAVLE_STEAM_LIC_COUNT2, m_EDIT_STEAM_LIC_COUNT);
DDX_Control(pDX, IDC_EDIT_EA_ORIGIN_LIC_COUNT, m_EDIT_ORIGIN_LIC_COUNT);
DDX_Control(pDX, IDC_EDIT_XML_CONTAINTER, m_EDIT_XML_CONTAINER);
DDX_Control(pDX, IDC_X_TABLE_LIST1, m_LIST_X_TABLE);
DDX_Control(pDX, IDC_EDIT_DWORDS_COUNT, m_EDIT_XTABLE_DWORD_count);
DDX_Control(pDX, IDC_EDIT_ENTROPY, m_EDIT_ENTROPY);
}
BEGIN_MESSAGE_MAP(ÑDLC_Lic_Files, CDialogEx)
ON_LBN_SELCHANGE(IDC_FILELIST1, &ÑDLC_Lic_Files::OnSelchangeFilelist1)
ON_LBN_SELCHANGE(IDC_FILELIST1, &ÑDLC_Lic_Files::OnLbnSelchangeFilelist1)
END_MESSAGE_MAP()
// îáðàáîò÷èêè ñîîáùåíèé ÑDLC_Lic_Files
BOOL ÑDLC_Lic_Files::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: Äîáàâèòü äîïîëíèòåëüíóþ èíèöèàëèçàöèþ
Fill_DLC_licence_list();
return TRUE; // return TRUE unless you set the focus to a control
// Èñêëþ÷åíèå: ñòðàíèöà ñâîéñòâ OCX äîëæíà âîçâðàùàòü çíà÷åíèå FALSE
}
void ÑDLC_Lic_Files::Fill_DLC_licence_list(void)
{
TCHAR DigBuf[64];
pFileinfoStack = DH_Licence_Get_DLC_licence_filestack(true, true);
if(!pFileinfoStack)
return;
register size_t i = pFileinfoStack->NumofFoundFiles;
if(!i)
return;
register pLIC_DLC_FILE fpFileInfoUnit = &pFileinfoStack->FileUnit[0]; //fp
::SendMessage(m_FILELIST.m_hWnd, LB_RESETCONTENT, 0, 0); //m_FILELIST.ResetContent();
do
{
::SendMessage(m_FILELIST.m_hWnd, LB_ADDSTRING, 0, (LPARAM)&fpFileInfoUnit->FileFIND_DAT.cFileName[0]); //m_FILELIST.AddString(&fpFileInfoUnit->FileFIND_DAT.cFileName[0]);
fpFileInfoUnit++;
}while(--i);
itoa_10_fast(pFileinfoStack->EA_ORIGIN_licence, &DigBuf[0]);
::SetWindowText(m_EDIT_ORIGIN_LIC_COUNT.m_hWnd, &DigBuf[0]);
itoa_10_fast(pFileinfoStack->Vavle_Steam_licence, &DigBuf[0]);
::SetWindowText(m_EDIT_STEAM_LIC_COUNT.m_hWnd, &DigBuf[0]);
return;
}
void ÑDLC_Lic_Files::OnSelchangeFilelist1()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
register size_t i = m_FILELIST.GetCurSel();
if(i == CB_ERR)
return;
if(pFileinfoStack->NumofFoundFiles == NULL)
return;
if(pCurSelDLC_Info != NULL)
free(pCurSelDLC_Info);
m_LIST_X_TABLE.ResetContent();
::SetWindowText(m_EDIT_ENTROPY.m_hWnd, TS_DEF_NULL);
::SetWindowText(m_EDIT_XTABLE_DWORD_count.m_hWnd, TS_DEF_NULL);
TCHAR dig_buf[80];
WCHAR GetText[MAX_PATH];
m_FILELIST.GetText(i, &GetText[0]);
i = pFileinfoStack->NumofFoundFiles;
register pLIC_DLC_FILE fpFileInfoUnit = &pFileinfoStack->FileUnit[0]; //fp
fpFileInfoUnit--;
do
{
fpFileInfoUnit++;
if (wcsicmp(&GetText[0], &fpFileInfoUnit->FileFIND_DAT.cFileName[0]))
continue;
pCurSelDLC_Info = DH_Licence_Decode_Licence_data_from_file(&fpFileInfoUnit->FileFIND_DAT.cFileName[0], fpFileInfoUnit->DLC_TYPE);
if (!pCurSelDLC_Info)
{
::SetWindowText(m_EDIT_ENTROPY.m_hWnd, TS_DEF_NULL);
::SetWindowText(m_EDIT_XTABLE_DWORD_count.m_hWnd, TS_DEF_NULL);
::SetWindowText(m_EDIT_XML_CONTAINER.m_hWnd, TS_DEF_NA);
break;
}
::SetWindowTextA(m_EDIT_XML_CONTAINER.m_hWnd, &pCurSelDLC_Info->XML_DATA[0]);
if(pCurSelDLC_Info->X_TABLE_DWORDs_count == NULL)
break;
register size_t j = pCurSelDLC_Info->X_TABLE_DWORDs_count;
register LPDWORD fpXTABLE_DWORD = &pCurSelDLC_Info->X_TABLE[1]; //skip table info DWORD
itoa_10_fast(j, &dig_buf[0]);
::SetWindowText(m_EDIT_XTABLE_DWORD_count.m_hWnd, &dig_buf[0]);
if(j > 1000) //too loooooong table
break;
swprintf(&dig_buf[0],L"%.7lf",pCurSelDLC_Info->X_TABLE_entropy);
::SetWindowText(m_EDIT_ENTROPY.m_hWnd, &dig_buf[0]);
do
{
itoa_16_fast(*fpXTABLE_DWORD++, &dig_buf[0]);
::SendMessage(m_LIST_X_TABLE.m_hWnd, LB_ADDSTRING, 0, (LPARAM)&dig_buf[0]); //m_LIST_X_TABLE.AddString(&dig_buf[0]);
}while(--j);
break;
}while(--i); //end cycle
}
void ÑDLC_Lic_Files::OnLbnSelchangeFilelist1()
{
// TODO: äîáàâüòå ñâîé êîä îáðàáîò÷èêà óâåäîìëåíèé
}