signed int __thiscall sub_403A00(void *this)
{
v279 = (int)this;
v1 = sub_4037A0();
if ( (_BYTE)v1 )
return 0;
sub_403740(v1);
dword_45C138 = GetTickCount();
v287 = sub_437760();
dword_45C120 = sub_437DC0(v287);
if ( !dword_45C120 )
goto LABEL_261;
v288 = *(_DWORD *)(v287 + 4);
v3 = GetTickCount();
srand(dword_45E370 + v3);
v2 = 0;
do
{
v4 = rand();
v271[v2++] = v4;
dword_45E370 = v4;
}
while ( v2 < 256 );
v5 = GetTickCount();
srand(dword_45E370 + v5);
v6 = 0;
do
{
v7 = rand();
String[v6++] = v7;
dword_45E370 = v7;
}
while ( v6 < 128 );
v8 = GetTickCount();
srand(dword_45E370 + v8);
v9 = 0;
do
{
v10 = rand();
Dstbuf[v9++] = v10;
dword_45E370 = v10;
}
while ( v9 < 128 );
v264 = 0;
sub_43DE80((int)v271, -2145845248, 128, 16392, String);
dword_45E3F4 = sub_43BC30(v288, 0, v271);
if ( dword_45E3F4 )
{
v11 = -1;
}
else
{
sub_43D970((int)v271, -2145845248, -2147483648, Dstbuf);
v12 = sub_43D970((int)Dstbuf, 0, -2147483520, v271);
LOWORD(v12) = v272;
LOWORD(v13) = v273;
v11 = (v13 + (v12 << 8)) & 0xFFFF;
}
dword_45BB7C = v11;
if ( v11 > 1 )
{
v14 = v287;
sub_438150(1);
sub_437D00(v14);
}
else
{
LABEL_261:
dword_45C120 = -2;
dword_45BB7C = 65535;
}
v282 = (void *)((int (*)(void))CCDS_Configure__Instance)();
CCDS_Configure__GetLanguageRC(v282, &lpLibFileName);
v294 = 0;
if ( !mbscmp(lpLibFileName, &Default) )
CString__operator_(&lpLibFileName, "RC_SCH.dll");
v15 = LoadLibraryA(lpLibFileName);
hInstance = v15;
if ( !v15 )
{
AfxMessageBox("Resource file load failed, CDS could't start up!", 0, 0);
LABEL_241:
v294 = -1;
CString___CString(&lpLibFileName);
return 0;
}
CString__MakeUpper(&lpLibFileName);
if ( mbscmp(lpLibFileName, "RC_SCH.DLL") )
*(_DWORD *)(AfxGetModuleState() + 12) = v15;
v16 = StrRCManager__instance();
StrRCManager__LoadRCLibary(v16, v15);
v17 = CFolderFunc__GetCDSDir(&v278);
LOBYTE(v294) = 1;
v18 = operator_(&v277, v17, "resource\\Lang\\");
LOBYTE(v294) = 2;
operator_(&v283, v18, "TemplateLang.txt");
LOBYTE(v294) = 5;
CString___CString(&v277);
LOBYTE(v294) = 4;
CString___CString(&v278);
v259 = (struct WSAData *)((mbscmp(lpLibFileName, "RC_SCH.DLL") != 0) + 1);
v258 = v19;
v292 = &v258;
CString__CString(&v258, &v283);
StrRCManager__LoadDynamicStrLib(v16, v258, v259);
InitCommonControls();
if ( !AfxOleInit() )
{
AfxMessageBox(0x139Eu, 0, 0xFFFFFFFFu);
LOBYTE(v294) = 0;
CString___CString(&v283);
v294 = -1;
CString___CString(&lpLibFileName);
return 0;
}
AfxEnableControlContainer(0);
v21 = CoInitialize(0);
v259 = 0;
if ( v21 < 0 )
{
AfxMessageBox("Failed to initialize COM library.", 0, (unsigned int)v259);
LOBYTE(v294) = 0;
CString___CString(&v283);
v294 = -1;
CString___CString(&lpLibFileName);
return 0;
}
if ( !AfxSocketInit(v259) )
{
AfxMessageBox(0x1394u, 0, 0xFFFFFFFFu);
LOBYTE(v294) = 0;
CString___CString(&v283);
v294 = -1;
CString___CString(&lpLibFileName);
return 0;
}
if ( dword_45C120 != -2 )
{
v23 = GetTickCount();
srand(dword_45E370 + v23);
v22 = 0;
do
{
v24 = rand();
byte_45B960[v22++] = v24;
dword_45E370 = v24;
}
while ( v22 < 180 );
byte_45B961 = 54;
byte_45B96A = -106;
byte_45B977 = -30;
byte_45B980 = 101;
byte_45B98D = -109;
byte_45B996 = -94;
byte_45B9A3 = -95;
byte_45B9AC = -119;
sub_437E30(byte_45B960, &unk_446180);
v26 = GetTickCount();
srand(dword_45E370 + v26);
v25 = 0;
do
{
v27 = rand();
byte_45B744[v25++] = v27;
dword_45E370 = v27;
}
while ( v25 < 180 );
byte_45B745 = 118;
byte_45B74E = -73;
byte_45B75B = 115;
byte_45B764 = 1;
byte_45B771 = -58;
byte_45B77A = 36;
byte_45B787 = 5;
byte_45B790 = 50;
sub_437E30(byte_45B744, &unk_4467C8);
v29 = GetTickCount();
srand(dword_45E370 + v29);
v28 = 0;
do
{
v30 = rand();
byte_45B8AC[v28++] = v30;
dword_45E370 = v30;
}
while ( v28 < 180 );
byte_45B8AD = 33;
byte_45B8B6 = -108;
byte_45B8C3 = -94;
byte_45B8CC = 36;
byte_45B8D9 = 116;
byte_45B8E2 = 53;
byte_45B8EF = 2;
byte_45B8F8 = -1;
sub_437E30(byte_45B8AC, &unk_446198);
}
v31 = v279;
CWinApp__SetRegistryKey(v279, "Hugeland Technologies");
CWinApp__LoadStdProfileSettings(v31, 4);
v292 = operator new(0x98u);
LOBYTE(v294) = 6;
if ( v292 )
v32 = sub_41E4F0(5030, &off_458368, 0, &off_447C28);
else
v32 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v31, v32);
v33 = operator new(0x90u);
v292 = v33;
LOBYTE(v294) = 7;
if ( v33 )
v34 = CMultiDocTemplate__CMultiDocTemplate(
v33,
5025,
&off_458368,
CLayerFrame__classCLayerFrame,
CGSML3View__classCGSML3View);
else
v34 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v31, v34);
v35 = operator new(0x90u);
v292 = v35;
LOBYTE(v294) = 8;
if ( v35 )
v36 = CMultiDocTemplate__CMultiDocTemplate(
v35,
5020,
&off_458368,
CLayerFrame__classCLayerFrame,
CGL23MView__classCGL23MView);
else
v36 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v31, v36);
v37 = operator new(0x90u);
v292 = v37;
LOBYTE(v294) = 9;
if ( v37 )
v38 = CMultiDocTemplate__CMultiDocTemplate(
v37,
5020,
&off_458368,
CLayerFrame__classCLayerFrame,
CGSMRMHEADERView__classCGSMRMHEADERView);
else
v38 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v31, v38);
v39 = operator new(0x90u);
v292 = v39;
LOBYTE(v294) = 10;
if ( v39 )
v40 = CMultiDocTemplate__CMultiDocTemplate(
v39,
5032,
&off_458368,
CLayerFrame__classCLayerFrame,
CGSML2View__classCGSML2View);
else
v40 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v31, v40);
v41 = operator new(0x90u);
v292 = v41;
LOBYTE(v294) = 11;
if ( v41 )
v42 = CMultiDocTemplate__CMultiDocTemplate(
v41,
5033,
&off_458368,
CLayerFrame__classCLayerFrame,
CLLCView__classCLLCView);
else
v42 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v279, v42);
Str = 0;
memset(&v270, 0, 0x104u);
SubStr = 0;
HeaderSum = 0;
memset(&v267, 0, 0x104u);
CFile__CFile(&SystemTime);
v43 = 0;
LOBYTE(v294) = 12;
v288 = 0;
v44 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 13;
v45 = operator_(&CheckSum, v44, "DevMgr.dll");
v259 = 0;
v258 = 32768;
LOBYTE(v294) = 14;
v46 = CString__GetBuffer(v45, 0);
v47 = CFile__Open(&SystemTime, v46, v258, v259);
LOBYTE(v294) = 13;
CString___CString(&CheckSum);
LOBYTE(v294) = 12;
CString___CString(&v290);
if ( v47 )
{
do
{
v48 = CFile__Read(&SystemTime, v262, 1024);
v49 = 0;
if ( v48 )
{
do
v43 += v262[v49++];
while ( v49 < v48 );
}
}
while ( v48 == 1024 );
v288 = v43;
CFile__Close(&SystemTime);
}
LOBYTE(v294) = 4;
CFile___CFile(&SystemTime);
memset(&FindFileData, 0, sizeof(FindFileData));
v51 = CFolderFunc__GetCDSDir(&CheckSum);
LOBYTE(v294) = 15;
v52 = operator_(&v290, v51, "DevMgr.dll");
v259 = (struct WSAData *)&FindFileData;
LOBYTE(v294) = 16;
v53 = (const CHAR *)CString__GetBuffer(v52, 0);
v50 = FindFirstFileA(v53, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 15;
CString___CString(&v290);
LOBYTE(v294) = 4;
CString___CString(&CheckSum);
if ( (char *)v50 + 1 != 0 )
{
FindClose(v50);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&v290, &SystemTime, -1);
v54 = FindFileData.nFileSizeLow + v290 / 10000;
if ( FindFileData.dwFileAttributes & 0x10 )
v54 = 0;
}
else
{
v54 = HeaderSum;
}
srand(v54 + v288);
v258 = rand();
sprintf(&Str, "A%05X", v258);
if ( LoadStringA(hInstance, 1u, &SubStr, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v249 = 0;
v56 = &HeaderSum;
v240 = 0;
HeaderSum = 80;
v231 = &HeaderSum;
}
else
{
if ( strstr(&SubStr, &Str) )
goto LABEL_67;
v259 = 0;
v258 = 0;
v249 = 0;
v55 = &HeaderSum;
v240 = 0;
HeaderSum = 80;
v231 = &HeaderSum;
}
AfxBeginThread(v55, v56, &loc_401020, v231, v240, v249, v258, v259);
LABEL_67:
SubStr = 0;
memset(&v267, 0, 0x104u);
Str = 0;
CheckSum = 0;
memset(&v270, 0, 0x104u);
CFile__CFile(&SystemTime);
v57 = 0;
LOBYTE(v294) = 17;
v288 = 0;
v58 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 18;
v59 = operator_(&HeaderSum, v58, "ViewList.dll");
v259 = 0;
v258 = 32768;
LOBYTE(v294) = 19;
v60 = CString__GetBuffer(v59, 0);
v61 = CFile__Open(&SystemTime, v60, v258, v259);
LOBYTE(v294) = 18;
CString___CString(&HeaderSum);
LOBYTE(v294) = 17;
CString___CString(&v290);
if ( v61 )
{
do
{
v62 = CFile__Read(&SystemTime, v262, 1024);
v63 = 0;
if ( v62 )
{
do
v57 += v262[v63++];
while ( v63 < v62 );
}
}
while ( v62 == 1024 );
v288 = v57;
CFile__Close(&SystemTime);
}
LOBYTE(v294) = 4;
CFile___CFile(&SystemTime);
memset(&FindFileData, 0, sizeof(FindFileData));
v65 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 20;
v66 = operator_(&HeaderSum, v65, "ViewList.dll");
v259 = (struct WSAData *)&FindFileData;
LOBYTE(v294) = 21;
v67 = (const CHAR *)CString__GetBuffer(v66, 0);
v64 = FindFirstFileA(v67, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 20;
CString___CString(&HeaderSum);
LOBYTE(v294) = 4;
CString___CString(&v290);
if ( (char *)v64 + 1 != 0 )
{
FindClose(v64);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&HeaderSum, &SystemTime, -1);
CheckSum = FindFileData.nFileSizeLow + (signed int)HeaderSum / 10000;
if ( FindFileData.dwFileAttributes & 0x10 )
CheckSum = 0;
}
srand(CheckSum + v288);
v258 = rand();
sprintf(&SubStr, "A%05X", v258);
if ( LoadStringA(hInstance, 1u, &Str, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v250 = 0;
v241 = 0;
HeaderSum = 80;
v232 = &HeaderSum;
}
else
{
if ( strstr(&Str, &SubStr) )
goto LABEL_80;
v259 = 0;
v258 = 0;
v250 = 0;
v68 = &HeaderSum;
v241 = 0;
HeaderSum = 80;
v232 = &HeaderSum;
}
AfxBeginThread(v69, v68, &loc_401020, v232, v241, v250, v258, v259);
LABEL_80:
SubStr = 0;
memset(&v267, 0, 0x104u);
Str = 0;
CheckSum = 0;
memset(&v270, 0, 0x104u);
CFile__CFile(&SystemTime);
v70 = 0;
LOBYTE(v294) = 22;
v288 = 0;
v71 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 23;
v72 = operator_(&HeaderSum, v71, "ViewStatusChart.dll");
v259 = 0;
v258 = 32768;
LOBYTE(v294) = 24;
v73 = CString__GetBuffer(v72, 0);
v74 = CFile__Open(&SystemTime, v73, v258, v259);
LOBYTE(v294) = 23;
CString___CString(&HeaderSum);
LOBYTE(v294) = 22;
CString___CString(&v290);
if ( v74 )
{
do
{
v75 = CFile__Read(&SystemTime, v262, 1024);
v76 = 0;
if ( v75 )
{
do
v70 += v262[v76++];
while ( v76 < v75 );
}
}
while ( v75 == 1024 );
v288 = v70;
CFile__Close(&SystemTime);
}
LOBYTE(v294) = 4;
CFile___CFile(&SystemTime);
memset(&FindFileData, 0, sizeof(FindFileData));
v78 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 25;
v79 = operator_(&HeaderSum, v78, "ViewStatusChart.dll");
v259 = (struct WSAData *)&FindFileData;
LOBYTE(v294) = 26;
v80 = (const CHAR *)CString__GetBuffer(v79, 0);
v77 = FindFirstFileA(v80, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 25;
CString___CString(&HeaderSum);
LOBYTE(v294) = 4;
CString___CString(&v290);
if ( (char *)v77 + 1 != 0 )
{
FindClose(v77);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&HeaderSum, &SystemTime, -1);
v81 = FindFileData.nFileSizeLow + (signed int)HeaderSum / 10000;
if ( FindFileData.dwFileAttributes & 0x10 )
v81 = 0;
}
else
{
v81 = CheckSum;
}
srand(v81 + v288);
v258 = rand();
sprintf(&SubStr, "A%05X", v258);
if ( LoadStringA(hInstance, 1u, &Str, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v251 = 0;
v83 = &HeaderSum;
v242 = 0;
HeaderSum = 80;
v233 = &HeaderSum;
}
else
{
if ( strstr(&Str, &SubStr) )
goto LABEL_94;
v259 = 0;
v258 = 0;
v251 = 0;
v82 = &HeaderSum;
v242 = 0;
HeaderSum = 80;
v233 = &HeaderSum;
}
AfxBeginThread(v82, v83, &loc_401020, v233, v242, v251, v258, v259);
LABEL_94:
SubStr = 0;
memset(&v267, 0, 0x104u);
Str = 0;
CheckSum = 0;
memset(&v270, 0, 0x104u);
CFile__CFile(&SystemTime);
v84 = 0;
LOBYTE(v294) = 27;
v288 = 0;
v85 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 28;
v86 = operator_(&HeaderSum, v85, "EvtLogic.dll");
v259 = 0;
v258 = 32768;
LOBYTE(v294) = 29;
v87 = CString__GetBuffer(v86, 0);
v88 = CFile__Open(&SystemTime, v87, v258, v259);
LOBYTE(v294) = 28;
CString___CString(&HeaderSum);
LOBYTE(v294) = 27;
CString___CString(&v290);
if ( v88 )
{
do
{
v89 = CFile__Read(&SystemTime, v262, 1024);
v90 = 0;
if ( v89 )
{
do
v84 += v262[v90++];
while ( v90 < v89 );
}
}
while ( v89 == 1024 );
v288 = v84;
CFile__Close(&SystemTime);
}
LOBYTE(v294) = 4;
CFile___CFile(&SystemTime);
memset(&FindFileData, 0, sizeof(FindFileData));
v92 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 30;
v93 = operator_(&HeaderSum, v92, "EvtLogic.dll");
v259 = (struct WSAData *)&FindFileData;
LOBYTE(v294) = 31;
v94 = (const CHAR *)CString__GetBuffer(v93, 0);
v91 = FindFirstFileA(v94, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 30;
CString___CString(&HeaderSum);
LOBYTE(v294) = 4;
CString___CString(&v290);
if ( (char *)v91 + 1 != 0 )
{
FindClose(v91);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&HeaderSum, &SystemTime, -1);
v95 = FindFileData.nFileSizeLow + (signed int)HeaderSum / 10000;
if ( FindFileData.dwFileAttributes & 0x10 )
v95 = 0;
}
else
{
v95 = CheckSum;
}
srand(v95 + v288);
v258 = rand();
sprintf(&SubStr, "A%05X", v258);
if ( LoadStringA(hInstance, 1u, &Str, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v252 = 0;
v97 = &HeaderSum;
v243 = 0;
HeaderSum = 80;
v234 = &HeaderSum;
}
else
{
if ( strstr(&Str, &SubStr) )
goto LABEL_108;
v259 = 0;
v258 = 0;
v252 = 0;
v96 = &HeaderSum;
v243 = 0;
HeaderSum = 80;
v234 = &HeaderSum;
}
AfxBeginThread(v96, v97, &loc_401020, v234, v243, v252, v258, v259);
LABEL_108:
SubStr = 0;
memset(&v267, 0, 0x104u);
Str = 0;
CheckSum = 0;
memset(&v270, 0, 0x104u);
CFile__CFile(&SystemTime);
v98 = 0;
LOBYTE(v294) = 32;
v288 = 0;
v99 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 33;
v100 = operator_(&HeaderSum, v99, "PostProcessing.dll");
v259 = 0;
v258 = 32768;
LOBYTE(v294) = 34;
v101 = CString__GetBuffer(v100, 0);
v102 = CFile__Open(&SystemTime, v101, v258, v259);
LOBYTE(v294) = 33;
CString___CString(&HeaderSum);
LOBYTE(v294) = 32;
CString___CString(&v290);
if ( v102 )
{
do
{
v103 = CFile__Read(&SystemTime, v262, 1024);
v104 = 0;
if ( v103 )
{
do
v98 += v262[v104++];
while ( v104 < v103 );
}
}
while ( v103 == 1024 );
v288 = v98;
CFile__Close(&SystemTime);
}
LOBYTE(v294) = 4;
CFile___CFile(&SystemTime);
memset(&FindFileData, 0, sizeof(FindFileData));
v106 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 35;
v107 = operator_(&HeaderSum, v106, "PostProcessing.dll");
v259 = (struct WSAData *)&FindFileData;
LOBYTE(v294) = 36;
v108 = (const CHAR *)CString__GetBuffer(v107, 0);
v105 = FindFirstFileA(v108, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 35;
CString___CString(&HeaderSum);
LOBYTE(v294) = 4;
CString___CString(&v290);
if ( (char *)v105 + 1 != 0 )
{
FindClose(v105);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&HeaderSum, &SystemTime, -1);
v109 = FindFileData.nFileSizeLow + (signed int)HeaderSum / 10000;
if ( FindFileData.dwFileAttributes & 0x10 )
v109 = 0;
}
else
{
v109 = CheckSum;
}
srand(v109 + v288);
v258 = rand();
sprintf(&SubStr, "A%05X", v258);
if ( LoadStringA(hInstance, 1u, &Str, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v253 = 0;
v111 = &HeaderSum;
v244 = 0;
HeaderSum = 80;
v235 = &HeaderSum;
}
else
{
if ( strstr(&Str, &SubStr) )
goto LABEL_122;
v259 = 0;
v258 = 0;
v253 = 0;
v110 = &HeaderSum;
v244 = 0;
HeaderSum = 80;
v235 = &HeaderSum;
}
AfxBeginThread(v110, v111, &loc_401020, v235, v244, v253, v258, v259);
LABEL_122:
v112 = operator new(0x90u);
v292 = v112;
LOBYTE(v294) = 37;
if ( v112 )
v113 = CMultiDocTemplate__CMultiDocTemplate(
v112,
5034,
&off_458368,
CLayerFrame__classCLayerFrame,
CGSMRMView__classCGSMRMView);
else
v113 = 0;
v115 = v279;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v279, v113);
v114 = operator new(0x90u);
v292 = v114;
LOBYTE(v294) = 38;
if ( v114 )
v116 = CMultiDocTemplate__CMultiDocTemplate(
v114,
5038,
&off_458368,
CGPSFrame__classCGPSFrame,
CInstrumentView__classCInstrumentView);
else
v116 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v115, v116);
v117 = operator new(0x90u);
v292 = v117;
LOBYTE(v294) = 39;
if ( v117 )
v118 = CMultiDocTemplate__CMultiDocTemplate(
v117,
5028,
&off_458368,
CMapChildFrm__classCMapChildFrm,
CMapView__classCMapView);
else
v118 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v115, v118);
if ( dword_45C120 != -2 )
{
v120 = GetTickCount();
srand(dword_45E370 + v120);
v119 = 0;
do
{
v121 = rand();
byte_45B690[v119++] = v121;
dword_45E370 = v121;
}
while ( v119 < 180 );
byte_45B691 = -30;
byte_45B69A = 110;
byte_45B6A7 = 116;
byte_45B6B0 = 41;
byte_45B6BD = 119;
byte_45B6C6 = 56;
byte_45B6D3 = -44;
byte_45B6DC = 65;
sub_437E30(byte_45B690, &unk_4461C8);
v123 = GetTickCount();
srand(dword_45E370 + v123);
v122 = 0;
do
{
v124 = rand();
byte_45B5DC[v122++] = v124;
dword_45E370 = v124;
}
while ( v122 < 180 );
byte_45B5DD = 38;
byte_45B5E6 = -51;
byte_45B5F3 = -11;
byte_45B5FC = 0;
byte_45B609 = 69;
byte_45B612 = 101;
byte_45B61F = -116;
byte_45B628 = 46;
sub_437E30(byte_45B5DC, &unk_446AB0);
v126 = GetTickCount();
srand(dword_45E370 + v126);
v125 = 0;
do
{
v127 = rand();
byte_45B474[v125++] = v127;
dword_45E370 = v127;
}
while ( v125 < 180 );
byte_45B475 = 93;
byte_45B47E = 98;
byte_45B48B = 33;
byte_45B494 = 0;
byte_45B4A1 = -29;
byte_45B4AA = 19;
byte_45B4B7 = -71;
byte_45B4C0 = -106;
sub_437E30(byte_45B474, &unk_4461F8);
v129 = GetTickCount();
srand(dword_45E370 + v129);
v128 = 0;
do
{
v130 = rand();
byte_45B7F8[v128++] = v130;
dword_45E370 = v130;
}
while ( v128 < 180 );
byte_45B7F9 = 82;
byte_45B802 = 5;
byte_45B80F = 119;
byte_45B818 = 50;
byte_45B825 = 33;
byte_45B82E = -125;
byte_45B83B = 95;
byte_45B844 = -98;
sub_437E30(byte_45B7F8, &unk_4461B0);
v132 = GetTickCount();
srand(dword_45E370 + v132);
v131 = 0;
do
{
v133 = rand();
byte_45BA14[v131++] = v133;
dword_45E370 = v133;
}
while ( v131 < 180 );
byte_45BA15 = 38;
byte_45BA1E = -51;
byte_45BA2B = 0;
byte_45BA34 = 32;
byte_45BA41 = 69;
byte_45BA4A = 101;
byte_45BA57 = -116;
byte_45BA60 = 46;
sub_437E30(byte_45BA14, &unk_4464E0);
v135 = GetTickCount();
srand(dword_45E370 + v135);
v134 = 0;
do
{
v136 = rand();
byte_45BAC8[v134++] = v136;
dword_45E370 = v136;
}
while ( v134 < 180 );
byte_45BAC9 = 56;
byte_45BAD2 = -128;
byte_45BADF = 65;
byte_45BAE8 = 61;
byte_45BAF5 = 98;
byte_45BAFE = 33;
byte_45BB0B = -119;
byte_45BB14 = -69;
sub_437E30(byte_45BAC8, &unk_446168);
v138 = GetTickCount();
srand(dword_45E370 + v138);
v137 = 0;
do
{
v139 = rand();
byte_45B528[v137++] = v139;
dword_45E370 = v139;
}
while ( v137 < 180 );
byte_45B529 = 46;
byte_45B532 = 82;
byte_45B53F = -127;
byte_45B548 = 61;
byte_45B555 = -110;
byte_45B55E = 76;
byte_45B56B = 122;
byte_45B574 = 59;
sub_437E30(byte_45B528, &unk_4461E0);
v115 = v279;
}
v140 = operator new(0x90u);
v292 = v140;
LOBYTE(v294) = 40;
if ( v140 )
v141 = CMultiDocTemplate__CMultiDocTemplate(
v140,
5041,
&off_458368,
CLayerFrame__classCLayerFrame,
CEventView__classCEventView);
else
v141 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v115, v141);
v142 = operator new(0x90u);
v292 = v142;
LOBYTE(v294) = 41;
if ( v142 )
v143 = CMultiDocTemplate__CMultiDocTemplate(
v142,
5045,
&off_458368,
CPacketFrame__classCPacketFrame,
CPacketListView__classCPacketListView);
else
v143 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v115, v143);
v144 = operator new(0x90u);
v292 = v144;
LOBYTE(v294) = 42;
if ( v144 )
v145 = CMultiDocTemplate__CMultiDocTemplate(
v144,
5043,
&off_458368,
CCustStatusViewFrame__classCCustStatusViewFrame,
CCusListView__classCCusListView);
else
v145 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v115, v145);
v146 = operator new(0x90u);
v292 = v146;
LOBYTE(v294) = 43;
if ( v146 )
v147 = CMultiDocTemplate__CMultiDocTemplate(
v146,
5031,
&off_458368,
CCustStatusViewFrame__classCCustStatusViewFrame,
CCusTimeView__classCCusTimeView);
else
v147 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v115, v147);
if ( dword_45C120 != -2 )
{
v149 = 4;
v150 = &unk_45B69B;
v151 = &unk_45BAD3;
v148 = 1;
do
{
if ( !v149 )
break;
v148 = *(_DWORD *)v151 == *(_DWORD *)v150;
v151 = (char *)v151 + 4;
v150 = (char *)v150 + 4;
--v149;
}
while ( v148 );
if ( v148 )
{
if ( dword_45E3F8 )
{
v152 = *(_DWORD *)dword_45E3F8;
v259 = (struct WSAData *)1;
(*(void (__stdcall **)(signed int))v152)(1);
}
}
}
v153 = operator new(0x90u);
v292 = v153;
LOBYTE(v294) = 44;
if ( v153 )
v154 = CMultiDocTemplate__CMultiDocTemplate(
v153,
5047,
&off_458368,
CWmlFrm__classCWmlFrm,
CWAPBrowserView__classCWAPBrowserView);
else
v154 = 0;
LOBYTE(v294) = 4;
CWinApp__AddDocTemplate(v115, v154);
v155 = operator new(0xAB8u);
v292 = v155;
LOBYTE(v294) = 45;
if ( v155 )
v156 = sub_40A240(v155);
else
v156 = 0;
v157 = *(_DWORD *)v156;
v259 = 0;
v258 = 0;
v288 = v156;
LOBYTE(v294) = 4;
if ( !(*(int (__thiscall **)(int, signed int, signed int, _DWORD, _DWORD))(v157 + 192))(v156, 100, 13598720, 0, 0) )
{
LOBYTE(v294) = 0;
CString___CString(&v283);
v294 = -1;
CString___CString(&lpLibFileName);
return 0;
}
v259 = (struct WSAData *)1;
*(_DWORD *)(v115 + 32) = v156;
CWnd__DragAcceptFiles(v156, v259);
CWinApp__EnableShellOpen(v115);
CWinApp__RegisterShellFileTypes(v115, 1);
SubStr = 0;
memset(&v267, 0, 0x104u);
Str = 0;
v287 = 0;
memset(&v270, 0, 0x104u);
CFile__CFile(&SystemTime);
LOBYTE(v294) = 46;
CheckSum = 0;
v158 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 47;
v159 = operator_(&HeaderSum, v158, "ATE.dll");
v259 = 0;
v258 = 32768;
LOBYTE(v294) = 48;
v160 = CString__GetBuffer(v159, 0);
v161 = CFile__Open(&SystemTime, v160, v258, v259);
LOBYTE(v294) = 47;
CString___CString(&HeaderSum);
LOBYTE(v294) = 46;
CString___CString(&v290);
if ( v161 )
{
v162 = CheckSum;
do
{
v163 = CFile__Read(&SystemTime, v262, 1024);
v164 = 0;
if ( v163 )
{
do
v162 += v262[v164++];
while ( v164 < v163 );
}
}
while ( v163 == 1024 );
CheckSum = v162;
CFile__Close(&SystemTime);
}
LOBYTE(v294) = 4;
CFile___CFile(&SystemTime);
memset(&FindFileData, 0, sizeof(FindFileData));
v166 = CFolderFunc__GetCDSDir(&v290);
LOBYTE(v294) = 49;
v167 = operator_(&HeaderSum, v166, "ATE.dll");
v259 = (struct WSAData *)&FindFileData;
LOBYTE(v294) = 50;
v168 = (const CHAR *)CString__GetBuffer(v167, 0);
v165 = FindFirstFileA(v168, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 49;
CString___CString(&HeaderSum);
LOBYTE(v294) = 4;
CString___CString(&v290);
if ( (char *)v165 + 1 != 0 )
{
FindClose(v165);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&HeaderSum, &SystemTime, -1);
v287 = FindFileData.nFileSizeLow + (signed int)HeaderSum / 10000;
if ( FindFileData.dwFileAttributes & 0x10 )
v287 = 0;
}
srand(v287 + CheckSum);
v258 = rand();
sprintf(&SubStr, "A%05X", v258);
if ( LoadStringA(hInstance, 1u, &Str, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v254 = 0;
v245 = 0;
HeaderSum = 80;
v236 = &HeaderSum;
}
else
{
if ( strstr(&Str, &SubStr) )
goto LABEL_189;
v259 = 0;
v258 = 0;
v254 = 0;
v169 = &HeaderSum;
v245 = 0;
HeaderSum = 80;
v236 = &HeaderSum;
}
AfxBeginThread(v170, v169, &loc_401020, v236, v245, v254, v258, v259);
LABEL_189:
v171 = 0;
SubStr = 0;
Str = 0;
memset(&v267, 0, 0x104u);
memset(&v270, 0, 0x104u);
HeaderSum = 0;
CheckSum = 0;
v287 = 0;
v172 = CFolderFunc__GetCDSDir(&v292);
LOBYTE(v294) = 51;
v173 = operator_(&v290, v172, "CellDb.dll");
v259 = (struct WSAData *)&CheckSum;
v258 = (unsigned int)&HeaderSum;
LOBYTE(v294) = 52;
v174 = (const CHAR *)CString__GetBuffer(v173, 0);
v175 = MapFileAndCheckSumA(v174, (PDWORD)v258, (PDWORD)&v259->wVersion);
LOBYTE(v294) = 51;
v289 = v175 == 0;
CString___CString(&v290);
LOBYTE(v294) = 4;
CString___CString(&v292);
if ( v289 )
v287 = CheckSum;
memset(&FindFileData, 0, sizeof(FindFileData));
v177 = CFolderFunc__GetCDSDir(&HeaderSum);
LOBYTE(v294) = 53;
v178 = operator_(&v292, v177, "CellDb.dll");
LOBYTE(v294) = 54;
v259 = (struct WSAData *)&FindFileData;
v179 = (const CHAR *)CString__GetBuffer(v178, 0);
v176 = FindFirstFileA(v179, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 53;
v289 = (char *)v176 + 1 != 0;
CString___CString(&v292);
LOBYTE(v294) = 4;
CString___CString(&HeaderSum);
if ( v289 )
{
FindClose(v176);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&v292, &SystemTime, -1);
v259 = (struct WSAData *)((signed int)v292 / 10000 % 0x361u);
srand((unsigned int)v259);
v180 = rand;
rand();
v171 = rand();
if ( FindFileData.dwFileAttributes & 0x10 )
v171 = 0;
}
else
{
v180 = rand;
}
srand(v171 + v287);
v258 = v180();
sprintf(&SubStr, "D%05X", v258);
if ( LoadStringA(hInstance, 1u, &Str, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v255 = 0;
v246 = 0;
v292 = (void *)80;
v237 = (int *)&v292;
}
else
{
if ( strstr(&Str, &SubStr) )
goto LABEL_200;
v259 = 0;
v258 = 0;
v255 = 0;
v181 = (int *)&v292;
v246 = 0;
v292 = (void *)80;
v237 = (int *)&v292;
}
AfxBeginThread(v182, v181, &loc_401020, v237, v246, v255, v258, v259);
LABEL_200:
SubStr = 0;
memset(&v267, 0, 0x104u);
Str = 0;
CheckSum = 0;
memset(&v270, 0, 0x104u);
CFile__CFile(&SystemTime);
v183 = 0;
LOBYTE(v294) = 55;
v287 = 0;
v184 = CFolderFunc__GetCDSDir(&HeaderSum);
LOBYTE(v294) = 56;
v185 = operator_(&v292, v184, "wpslib.dll");
v259 = 0;
v258 = 32768;
LOBYTE(v294) = 57;
v186 = CString__GetBuffer(v185, 0);
v187 = CFile__Open(&SystemTime, v186, v258, v259);
LOBYTE(v294) = 56;
CString___CString(&v292);
LOBYTE(v294) = 55;
CString___CString(&HeaderSum);
if ( v187 )
{
do
{
v188 = CFile__Read(&SystemTime, v262, 1024);
v189 = 0;
if ( v188 )
{
do
v183 += v262[v189++];
while ( v189 < v188 );
}
}
while ( v188 == 1024 );
v287 = v183;
CFile__Close(&SystemTime);
}
LOBYTE(v294) = 4;
CFile___CFile(&SystemTime);
memset(&FindFileData, 0, sizeof(FindFileData));
v191 = CFolderFunc__GetCDSDir(&HeaderSum);
LOBYTE(v294) = 58;
v192 = operator_(&v292, v191, "wpslib.dll");
v259 = (struct WSAData *)&FindFileData;
LOBYTE(v294) = 59;
v193 = (const CHAR *)CString__GetBuffer(v192, 0);
v190 = FindFirstFileA(v193, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 58;
CString___CString(&v292);
LOBYTE(v294) = 4;
CString___CString(&HeaderSum);
if ( (char *)v190 + 1 != 0 )
{
FindClose(v190);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&v292, &SystemTime, -1);
CheckSum = FindFileData.nFileSizeLow + (signed int)v292 / 10000;
if ( FindFileData.dwFileAttributes & 0x10 )
CheckSum = 0;
}
srand(CheckSum + v287);
v258 = rand();
sprintf(&SubStr, "A%05X", v258, v259);
if ( LoadStringA(hInstance, 1u, &Str, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v256 = 0;
v247 = 0;
v292 = (void *)80;
v238 = (int *)&v292;
}
else
{
if ( strstr(&Str, &SubStr) )
goto LABEL_213;
v259 = 0;
v258 = 0;
v256 = 0;
v194 = (int *)&v292;
v247 = 0;
v292 = (void *)80;
v238 = (int *)&v292;
}
AfxBeginThread(v195, v194, &loc_401020, v238, v247, v256, v258, v259);
LABEL_213:
SubStr = 0;
memset(&v267, 0, 0x104u);
Str = 0;
v196 = 0;
memset(&v270, 0, 0x104u);
CFile__CFile(&SystemTime);
LOBYTE(v294) = 60;
v287 = 0;
v197 = CFolderFunc__GetCDSDir(&HeaderSum);
LOBYTE(v294) = 61;
v198 = operator_(&v292, v197, "frame.dll");
v259 = 0;
v258 = 32768;
LOBYTE(v294) = 62;
v199 = CString__GetBuffer(v198, 0);
v200 = CFile__Open(&SystemTime, v199, v258, v259);
LOBYTE(v294) = 61;
CString___CString(&v292);
LOBYTE(v294) = 60;
CString___CString(&HeaderSum);
if ( v200 )
{
v201 = 0;
do
{
v202 = CFile__Read(&SystemTime, v262, 1024);
v203 = 0;
if ( v202 )
{
do
v201 -= v262[v203++];
while ( v203 < v202 );
}
}
while ( v202 == 1024 );
v287 = v201;
CFile__Close(&SystemTime);
}
LOBYTE(v294) = 4;
CFile___CFile(&SystemTime);
memset(&FindFileData, 0, sizeof(FindFileData));
v205 = CFolderFunc__GetCDSDir(&HeaderSum);
LOBYTE(v294) = 63;
v206 = operator_(&v292, v205, "frame.dll");
v259 = (struct WSAData *)&FindFileData;
LOBYTE(v294) = 64;
v207 = (const CHAR *)CString__GetBuffer(v206, 0);
v204 = FindFirstFileA(v207, (LPWIN32_FIND_DATAA)v259);
LOBYTE(v294) = 63;
v289 = (char *)v204 + 1 != 0;
CString___CString(&v292);
LOBYTE(v294) = 4;
CString___CString(&HeaderSum);
if ( v289 )
{
FindClose(v204);
srand(FindFileData.nFileSizeLow);
CString__CString(&CheckSum, FindFileData.cFileName);
LOBYTE(v294) = 65;
CString__MakeUpper(&CheckSum);
v208 = rand();
v210 = 0;
v209 = *(_DWORD *)(CheckSum - 8);
if ( v209 > 0 )
{
do
v208 += *(_BYTE *)(v210++ + CheckSum);
while ( v210 < v209 );
}
srand(v208);
v211 = rand;
v258 = FindFileData.cFileName[0] + rand();
srand(v258);
v212 = rand();
srand(FindFileData.nFileSizeLow + v212);
FileTimeToSystemTime(&FindFileData.ftLastWriteTime, &SystemTime);
CTime__CTime(&v292, &SystemTime, -1);
HeaderSum = (signed int)v292 / 10000;
v196 = (signed int)v292 / 10000 + rand();
if ( FindFileData.dwFileAttributes & 0x10 )
v196 = 0;
LOBYTE(v294) = 4;
CString___CString(&CheckSum);
}
else
{
v211 = rand;
}
srand(v196 + v287);
v258 = v211();
sprintf(&SubStr, "G%05X", v258);
if ( LoadStringA(hInstance, 1u, &Str, 260) <= 0 )
{
v259 = 0;
v258 = 0;
v257 = 0;
v214 = (int *)&v292;
v248 = 0;
v292 = (void *)80;
v239 = (int *)&v292;
}
else
{
if ( strstr(&Str, &SubStr) )
goto LABEL_231;
v259 = 0;
v258 = 0;
v257 = 0;
v213 = (int *)&v292;
v248 = 0;
v292 = (void *)80;
v239 = (int *)&v292;
}
AfxBeginThread(v213, v214, &loc_401020, v239, v248, v257, v258, v259);
LABEL_231:
CheckSum = 0;
v215 = GetCommandLineA();
CString__CString(&v281, v215);
LOBYTE(v294) = 66;
idThread = 0;
if ( CString__Find(&v281, "-r") >= 0 )
{
CheckSum = 1;
*(_DWORD *)(v288 + 2108) = 1;
}
if ( CString__Find(&v281, "-t") >= 0 )
{
v216 = CString__ReverseFind(&v281, 32);
if ( v216 >= 0 )
{
v259 = *(struct WSAData **)CString__Mid(&v281, &v292, v216 + 1);
idThread = atol((const char *)v259);
CString___CString(&v292);
}
}
CCommandLineInfo__CCommandLineInfo(&v274);
v217 = v279;
LOBYTE(v294) = 67;
CWinApp__ParseCommandLine(v279, &v274);
v218 = (int)v282;
CCDS_Configure__GetWKSname(v282, &v280);
v259 = v219;
v282 = &v259;
LOBYTE(v294) = 68;
CString__CString(&v259, &Default);
CCDS_Configure__SetWKSname(v218, v259);
CCDS_Configure__SaveCfg(v218);
v220 = *(_DWORD *)CCDS_Configure__GetCellDBname(v218, &v282);
LOBYTE(v294) = 69;
v221 = CCellDB__instance(v220, 1);
CCellDB__LoadCDBFile(v221);
LOBYTE(v294) = 68;
CString___CString(&v282);
v222 = CFolderFunc__GetCDSDir(&v292);
LOBYTE(v294) = 70;
v223 = operator_(&v282, v222, "template\\evtStyle\\");
v259 = v224;
LOBYTE(v294) = 71;
HeaderSum = (DWORD)&v259;
operator_(&v259, v223, "EventStyle.sty");
LOBYTE(v294) = 71;
v225 = CEventStyleHolder__Instance(v259);
CEventStyleHolder__LoadTemplate(v225);
LOBYTE(v294) = 70;
CString___CString(&v282);
LOBYTE(v294) = 68;
CString___CString(&v292);
*(_BYTE *)(CDeviceMgr__instance() + 36) = *(_BYTE *)(v218 + 56);
if ( *(_DWORD *)(v280 - 8) )
{
v275 = 1;
CString__operator_(&v276, v280, &v280);
}
else
{
v275 = -1;
}
if ( !CWinApp__ProcessShellCommand(v217, &v274) )
{
LOBYTE(v294) = 67;
CString___CString(&v280);
LOBYTE(v294) = 66;
CCommandLineInfo___CCommandLineInfo(&v274);
LOBYTE(v294) = 4;
CString___CString(&v281);
LOBYTE(v294) = 0;
CString___CString(&v283);
goto LABEL_241;
}
v226 = v288;
v259 = (struct WSAData *)3;
v227 = v288;
*(_DWORD *)(v217 + 120) = 3;
CWnd__ShowWindow(v227, v259);
sub_411F60(1);
v259 = *(struct WSAData **)(v226 + 32);
UpdateWindow(v259);
if ( !CheckSum )
{
if ( dword_45C120 != -2 )
sub_4060E0(v217);
}
if ( (unsigned int)(dword_45C138 - dword_45C13C) > 0x9C40 )
{
sub_4060E0(v217);
v259 = (struct WSAData *)3;
*(_DWORD *)(v217 + 120) = 3;
CWnd__ShowWindow(v226, v259);
if ( (unsigned int)(dword_45C138 - dword_45C13C) <= 0xC8 )
{
v259 = *(struct WSAData **)(v226 + 32);
UpdateWindow(v259);
}
else
{
sub_411F60(1);
}
if ( (unsigned int)(dword_45C138 - dword_45C13C) <= 0x1770 )
{
v259 = *(struct WSAData **)(v217 + 120);
CWnd__ShowWindow(v226, v259);
}
else
{
sub_4060E0(v217);
}
if ( (unsigned int)(dword_45C138 - dword_45C13C) <= 0x1770 )
{
CCDS_Configure__SaveCfg(v218);
v275 = 1;
CString__operator_(&v276, v228, &v280);
CWinApp__ProcessShellCommand(v217, &v274);
CxxThrowException(0, 0, v260, v261);
}
v229 = CCDS_Configure__Instance(dword_45C13C, dword_45C138 - dword_45C13C);
CCDS_Configure__GetWKSname(v229, &v292);
v258 = v230;
LOBYTE(v294) = 73;
v282 = &v258;
CString__CString(&v258, &Default);
CCDS_Configure__SetWKSname(v229, v258);
CxxThrowException(0, 0, v258, v259);
}
LOBYTE(v294) = 67;
CString___CString(&v280);
LOBYTE(v294) = 66;
CCommandLineInfo___CCommandLineInfo(&v274);
LOBYTE(v294) = 4;
CString___CString(&v281);
LOBYTE(v294) = 0;
CString___CString(&v283);
v294 = -1;
CString___CString(&lpLibFileName);
return 1;
}
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)