Code:
signed int __cdecl sub_407BDB(int a1, CHAR *a2)
{
unsigned __int8 *v2; // ecx
unsigned __int8 *v3; // esi
unsigned __int8 *v4; // edi
_BYTE *v5; // esi
_BYTE *v6; // esi
_BYTE *v7; // edi
CHAR *v8; // edi
_BYTE *v9; // eax
int v10; // esi
_BYTE *v11; // ebx
signed int v12; // eax
double v13; // st7
__int64 v14; // kr00_8
__int64 v15; // rax
signed __int64 v16; // rax
__int64 v17; // kr08_8
__int64 v18; // ST2C_8
__int64 v19; // kr10_8
__int64 v20; // rax
_BYTE *v21; // esi
_BYTE *v22; // edi
int v23; // esi
int v24; // ecx
int v25; // eax
int v26; // edx
int v27; // ecx
char *v28; // eax
int v29; // esi
int v30; // edx
int v31; // ecx
int v32; // eax
int v33; // eax
int v34; // edx
int v35; // ecx
_BYTE *v36; // eax
_BYTE *v37; // eax
_BYTE *v38; // esi
_BYTE *v39; // esi
_BYTE *v40; // eax
BOOL v41; // eax
bool v42; // zf
LPSTR v43; // esi
signed int v44; // eax
int v45; // eax
int v46; // ST30_4
int v47; // eax
__int64 v48; // rax
_BYTE *v49; // esi
_BYTE *v50; // esi
_BYTE *v51; // eax
unsigned int v52; // edi
__int64 v53; // kr18_8
__int64 v54; // rax
_BYTE *v55; // esi
unsigned int v56; // edx
__int64 v57; // rax
unsigned __int8 v58; // cl
_BYTE *v59; // esi
_BYTE *v60; // eax
LPSTR v61; // ebx
_BYTE *v62; // edi
char *v63; // ST2C_4
_BYTE *v64; // eax
_BYTE *v65; // esi
char *v66; // ST30_4
_BYTE *v67; // eax
int v68; // eax
char *v69; // ecx
_BYTE *v70; // edi
int v71; // edi
_BYTE *v72; // edi
int v73; // ecx
size_t v74; // eax
void *v75; // edx
int v76; // ecx
int v77; // eax
signed int v79; // [esp-18h] [ebp-478h]
int (__cdecl *v80)(int); // [esp-14h] [ebp-474h]
int (__cdecl *v81)(int); // [esp-10h] [ebp-470h]
int (__cdecl *v82)(void *); // [esp-Ch] [ebp-46Ch]
int (__cdecl *v83)(int, void *, int); // [esp-8h] [ebp-468h]
int (__cdecl *v84)(int); // [esp-4h] [ebp-464h]
int v85; // [esp+0h] [ebp-460h]
int (__cdecl *v86)(int, int, int); // [esp+0h] [ebp-460h]
CHAR *v87; // [esp+4h] [ebp-45Ch]
signed int v88; // [esp+4h] [ebp-45Ch]
signed int v89; // [esp+4h] [ebp-45Ch]
signed int v90; // [esp+4h] [ebp-45Ch]
int v91; // [esp+4h] [ebp-45Ch]
int v92; // [esp+4h] [ebp-45Ch]
int (__cdecl *v93)(int, int, int, int); // [esp+4h] [ebp-45Ch]
int v94; // [esp+14h] [ebp-44Ch]
int v95; // [esp+18h] [ebp-448h]
char v96; // [esp+1Ch] [ebp-444h]
__int16 v97; // [esp+1Dh] [ebp-443h]
char v98; // [esp+1Fh] [ebp-441h]
int v99; // [esp+20h] [ebp-440h]
_BYTE *v100; // [esp+24h] [ebp-43Ch]
unsigned int v101; // [esp+28h] [ebp-438h]
int v102; // [esp+2Ch] [ebp-434h]
int v103; // [esp+33h] [ebp-42Dh]
char v104[5]; // [esp+37h] [ebp-429h]
_BYTE *v105; // [esp+3Ch] [ebp-424h]
int v106; // [esp+40h] [ebp-420h]
char *v107; // [esp+44h] [ebp-41Ch]
_BYTE *v108; // [esp+48h] [ebp-418h]
LPSTR lpMultiByteStr; // [esp+4Ch] [ebp-414h]
char v110; // [esp+50h] [ebp-410h]
char v111; // [esp+51h] [ebp-40Fh]
__int64 v112; // [esp+450h] [ebp-10h]
v100 = (_BYTE *)a1;
lpMultiByteStr = a2;
v3 = v2;
v96 = 0;
v97 = 0;
v98 = 0;
*(_DWORD *)&v104[1] = 0;
v106 = 0;
v102 = 0;
LOBYTE(v103) = 0;
*(_WORD *)((char *)&v103 + 1) = 0;
HIBYTE(v103) = 0;
v104[0] = 0;
v107 = 0;
v108 = 0;
v105 = 0;
v99 = 0;
v95 = 0;
v94 = 0;
HIDWORD(v112) = 0;
v110 = 0;
memset(&v111, 0, 0x3FFu);
if ( sub_4078A2(v3, &v107, 58) == 1 )
++v107;
v4 = (unsigned __int8 *)v107;
if ( sub_407403(v3, "ModuleArguments") == 1 || sub_407403(v3, "Arguments") == 1 )
{
sub_40183B((int)&v110, 1024);
if ( sub_40BF40(&v110) == 1 )
sub_406C9E(lpMultiByteStr, (_BYTE *)HIDWORD(v112), 0x2000);
return 1;
}
if ( sub_407403(v3, "ModuleFilename") == 1 )
{
v87 = lpMultiByteStr;
v85 = 12;
LABEL_63:
sub_401C74(0x2000, v85, v87);
return 1;
}
if ( sub_407403(v3, "ModuleFile") == 1 )
{
sub_401C74(0x2000, 12, lpMultiByteStr);
if ( sub_4078E2(lpMultiByteStr, 92, &v108) == 1 )
sub_4071BB();
if ( sub_4078E2(lpMultiByteStr, 47, &v108) == 1 )
sub_4071BB();
return 1;
}
if ( sub_407403(v3, "ModuleFileTitle") == 1 )
{
sub_401C74(0x2000, 12, lpMultiByteStr);
if ( sub_4078E2(lpMultiByteStr, 92, &v108) == 1 )
sub_4071BB();
if ( sub_4078E2(lpMultiByteStr, 47, &v108) == 1 )
sub_4071BB();
if ( sub_4078E2(lpMultiByteStr, 46, &v108) == 1 )
*v108 = 0;
return 1;
}
if ( sub_407403(v3, "ModuleAppFilename") == 1 )
{
v87 = lpMultiByteStr;
v85 = 14;
goto LABEL_63;
}
if ( sub_407403(v3, "ModulePath") == 1 || sub_407403(v3, "ModuleDirectory") == 1 )
{
v87 = lpMultiByteStr;
v85 = 13;
goto LABEL_63;
}
if ( sub_407403(v3, "ModuleAppPath") == 1 )
{
v87 = lpMultiByteStr;
v85 = 15;
goto LABEL_63;
}
if ( sub_407403(v3, "ModuleBitness") == 1 )
{
v88 = 32;
LABEL_67:
sub_406549((int)lpMultiByteStr, 0x2000, "%d", v88);
return 1;
}
if ( sub_407403(v3, "ModuleDllFilename") == 1 )
{
v87 = lpMultiByteStr;
v85 = 16;
goto LABEL_63;
}
if ( sub_407403(v3, "ModuleDllPath") == 1 )
{
v87 = lpMultiByteStr;
v85 = 17;
goto LABEL_63;
}
if ( sub_407403(v3, "TempPath") == 1 )
{
v87 = lpMultiByteStr;
v85 = 9;
goto LABEL_63;
}
if ( sub_407403(v3, "AdminTempPath") == 1 )
{
v87 = lpMultiByteStr;
v85 = 10;
goto LABEL_63;
}
if ( sub_407403(v3, "PipePath") == 1 )
{
v87 = lpMultiByteStr;
v85 = 18;
goto LABEL_63;
}
if ( sub_407403(v3, "ProgramFiles") == 1 )
{
v87 = lpMultiByteStr;
v85 = 2;
goto LABEL_63;
}
if ( sub_407403(v3, "StartMenu") == 1 )
{
sub_401C74(0x2000, 1, lpMultiByteStr);
return 1;
}
if ( sub_407403(v3, "UserHome") == 1 || sub_407403(v3, "Home") == 1 )
{
v87 = lpMultiByteStr;
v85 = 3;
goto LABEL_63;
}
if ( sub_407403(v3, "UserDocuments") == 1 || sub_407403(v3, "Documents") == 1 )
{
v87 = lpMultiByteStr;
v85 = 4;
goto LABEL_63;
}
if ( sub_407403(v3, "UserDesktop") == 1 || sub_407403(v3, "Desktop") == 1 )
{
v87 = lpMultiByteStr;
v85 = 5;
goto LABEL_63;
}
if ( sub_407403(v3, "UserAppData") == 1 )
{
v87 = lpMultiByteStr;
v85 = 6;
goto LABEL_63;
}
if ( sub_407403(v3, "UserAppDataRoaming") == 1 )
{
v87 = lpMultiByteStr;
v85 = 7;
goto LABEL_63;
}
if ( sub_407403(v3, "CommonAppData") == 1 )
{
v87 = lpMultiByteStr;
v85 = 8;
goto LABEL_63;
}
if ( sub_407403(v3, "SystemShortName") == 1 )
{
sub_404807(lpMultiByteStr);
return 1;
}
if ( sub_407403(v3, "SystemName") == 1 )
{
sub_404821(0x2000);
return 1;
}
if ( sub_407403(v3, "SystemVersion") == 1 )
{
sub_40489B(0x2000);
return 1;
}
if ( sub_407403(v3, "SystemPath") == 1 )
{
v87 = lpMultiByteStr;
v85 = 11;
goto LABEL_63;
}
if ( sub_407403(v3, "DownloadPath") == 1 )
{
v87 = lpMultiByteStr;
v85 = 19;
goto LABEL_63;
}
if ( sub_407403(v3, "SystemBitness") == 1 )
{
sub_401E10();
v88 = v106;
goto LABEL_67;
}
if ( sub_407403(v3, "UserName") != 1 )
{
if ( sub_407403(v3, "UserISO639LangName") == 1 )
{
sub_404999(0x2000);
return 1;
}
if ( sub_407403(v3, "UserISO3166CountryName") == 1 )
{
sub_404A18(0x2000);
return 1;
}
if ( sub_407403(v3, "PathSeparator") == 1 )
{
sub_406549((int)lpMultiByteStr, 0x2000, "%c", 92);
return 1;
}
if ( sub_4076AB("DiskSerial:", v3) == 1 )
{
sub_401E7C(v4, lpMultiByteStr);
return 1;
}
if ( sub_4076AB("DiskImage:", v3) == 1 )
{
sub_402041();
return 1;
}
if ( sub_4076AB("FileVersion:", v3) == 1 )
{
sub_41173F(v4, 0x2000);
return 1;
}
if ( sub_4076AB("ProductVersion:", v3) == 1 )
{
sub_411757(v4);
return 1;
}
if ( sub_4076AB("ProductName:", v3) == 1 )
{
sub_41176E(v4);
return 1;
}
if ( sub_4076AB("Copyright:", v3) == 1 )
{
sub_411785(v4);
return 1;
}
if ( sub_4076AB("FileDataStore:", v3) == 1 )
{
sub_404A97(v4);
return 1;
}
if ( sub_4076AB("Registry:", v3) == 1 )
{
if ( sub_4078A2(v107, &v108, 44) == 1 )
{
v5 = v108;
*v108 = 0;
v6 = v5 + 1;
if ( sub_4078A2(v6, &v105, 44) == 1 )
{
v7 = v105;
*v105 = 0;
v8 = v7 + 1;
if ( sub_4078E2(v8, 92, &v99) == 1 )
{
v9 = (_BYTE *)v99++;
*v9 = 0;
}
if ( v8 != (CHAR *)v99 )
sub_418947((int)v107, (int)v6, v8, v99, (int)&unk_47DBD9, (int)lpMultiByteStr);
}
}
return 1;
}
if ( sub_407403(v3, "This") == 1 )
{
if ( sub_4078A2(v100, &v108, 123) )
{
v10 = 0x2000;
if ( v108 - v100 + 1 < 0x2000 )
v10 = v108 - v100 + 1;
v89 = v10;
}
else
{
v89 = 0x2000;
}
sub_406C9E(lpMultiByteStr, v100, v89);
return 1;
}
if ( sub_407403(v3, "ThisUrlPath") == 1 )
{
if ( sub_407957(v100, &v94, (int)"://") )
v11 = (_BYTE *)(v94 + 3);
else
v11 = v100;
if ( sub_4078A2(v11, &v108, 47) == 1 )
v11 = v108;
if ( sub_4078A2(v100, &v95, 123) )
{
v12 = v95 - (_DWORD)v11 + 1;
if ( v12 >= 0x2000 )
v12 = 0x2000;
sub_406C9E(lpMultiByteStr, v11, v12);
}
else
{
sub_406C9E(lpMultiByteStr, v11, 0x2000);
}
return 1;
}
if ( sub_407403(v3, "Time") == 1 )
{
v13 = sub_40C11F();
LABEL_122:
sub_406549((int)lpMultiByteStr, 0x2000, "%.0f", LODWORD(v13), (_DWORD)(*(unsigned __int64 *)&v13 >> 32));
return 1;
}
if ( sub_407403(v3, "Time60") == 1 )
{
v13 = sub_40C11F() / 60.0 * 60.0;
goto LABEL_122;
}
if ( sub_407403(v3, "TimeTick") == 1 )
{
v13 = sub_414B56();
goto LABEL_122;
}
if ( sub_4076AB("TimeStamp:", v3) == 1 )
{
v112 = sub_406A54(v4);
sub_40C39C((_BYTE *)&v103 + 2, (int)v104, (int)&v103 + 3, (int)&v103 + 1, (int)&v103, (int)&v102, (double)v112);
sub_406549(
(int)lpMultiByteStr,
0x2000,
"%04d%02d%02d%02d%02d%02d",
v102,
(unsigned __int8)v103,
BYTE2(v103),
(unsigned __int8)v104[0],
HIBYTE(v103),
BYTE1(v103));
return 1;
}
if ( sub_4076AB("Add:", v3) == 1 )
{
v14 = sub_406A54(v4);
HIDWORD(v112) = HIDWORD(v14);
while ( *v3 && *v3 != 44 )
++v3;
v15 = sub_406A54(v3 + 1);
v16 = __PAIR__(HIDWORD(v112), (unsigned int)v14) + v15;
LABEL_137:
sub_406549((int)lpMultiByteStr, 0x2000, "%I64d", v16);
return 1;
}
if ( sub_4076AB("Mod:", v3) == 1 )
{
v17 = sub_406A54(v4);
HIDWORD(v112) = HIDWORD(v17);
while ( *v3 && *v3 != 44 )
++v3;
v18 = sub_406A54(v3 + 1);
v16 = (signed __int64)__PAIR__(HIDWORD(v112), (unsigned int)v17) % v18;
goto LABEL_137;
}
if ( sub_4076AB("Subtract:", v3) == 1 )
{
v19 = sub_406A54((unsigned __int8 *)v107);
while ( *v3 && *v3 != 44 )
++v3;
v20 = sub_406A54(v3 + 1);
sub_406549((int)lpMultiByteStr, 0x2000, "%I64d", v19 - v20);
return 1;
}
if ( sub_4076AB("Copy:", v3) == 1 )
{
sub_406C9E(lpMultiByteStr, v4, 0x2000);
return 1;
}
if ( sub_4076AB("SubCopy:", v3) == 1 )
{
if ( sub_4078A2(v107, &v108, 44) != 1 )
return 1;
v21 = v108 + 1;
*v108 = 0;
if ( sub_4078A2(v21, &v105, 44) != 1 )
return 1;
v22 = v105;
*v105 = 0;
v106 = sub_406B10();
v23 = sub_406B10();
v25 = sub_406BAE(v24, v22 + 1);
if ( v106 >= v25 )
return 1;
if ( v23 == -1 )
{
v90 = 0x2000;
}
else
{
if ( v106 > v23 )
return 1;
v29 = v23 - v106 + 1;
*(_DWORD *)&v104[1] = 1 - v106;
v102 = v29;
if ( v29 >= *(_DWORD *)&v104[1] + sub_406BAE(v27, v26) )
v32 = *(_DWORD *)&v104[1] + sub_406BAE(v31, v30);
else
v32 = v29;
if ( v32 <= 0x2000 )
{
v35 = *(_DWORD *)&v104[1] + sub_406BAE(v31, v30);
v33 = v102;
if ( v102 >= v35 )
v33 = *(_DWORD *)&v104[1] + sub_406BAE(v35, v34);
}
else
{
v33 = 0x2000;
}
v90 = v33;
}
v28 = &v22[v106 + 1];
goto LABEL_154;
}
if ( sub_4076AB("Replace:", v3) == 1 )
{
if ( sub_4078A2(v107, &v108, 44) == 1 )
{
v36 = v108;
*v108 = 0;
HIDWORD(v112) = v36 + 1;
if ( sub_4078A2(v36 + 1, &v105, 44) == 1 )
{
v37 = v105;
*v105 = 0;
sub_406C9E(lpMultiByteStr, v37 + 1, 0x2000);
sub_407395(v107, 0x2000);
}
}
return 1;
}
if ( sub_4076AB("VersionCompare:", v3) == 1 )
{
v106 = 0;
if ( sub_4078A2(v107, &v108, 44) != 1 )
return 1;
v38 = v108;
*v108 = 0;
v39 = v38 + 1;
if ( sub_4078A2(v39, &v105, 44) != 1 )
return 1;
v40 = v105;
*v105 = 0;
if ( sub_4098B6(v107, v40 + 1, &v106) != 1 )
return 1;
if ( sub_4073A7(v39) == 1 )
{
v41 = v106 < 0;
LOBYTE(v41) = v106 > 0;
}
else if ( sub_4073A7(v39) == 1 )
{
v41 = v106 < 0;
}
else
{
if ( sub_4073A7(v39) == 1 )
{
if ( !v106 || v106 > 0 )
goto LABEL_190;
goto LABEL_179;
}
if ( sub_4073A7(v39) == 1 )
{
if ( !v106 || v106 < 0 )
goto LABEL_190;
goto LABEL_179;
}
if ( sub_4073A7(v39) != 1 && sub_4073A7(v39) != 1 )
goto LABEL_179;
v41 = v106 == 0;
}
v42 = v41 == 1;
goto LABEL_189;
}
if ( sub_4076AB("FromBase64:", v3) == 1 )
{
v43 = lpMultiByteStr;
sub_41755C(lpMultiByteStr, v4);
v44 = 0x1FFF;
if ( v106 < 0x1FFF )
v44 = v106;
v43[v44] = 0;
return 1;
}
if ( sub_4076AB("ToBase64:", v3) == 1 )
{
v45 = sub_406BAE(v91, v4);
sub_41747A(v4, v45);
return 1;
}
if ( sub_4076AB("FromHex:", v3) == 1 )
{
sub_406634(lpMultiByteStr);
return 1;
}
if ( sub_4076AB("ToHex:", v3) == 1 )
{
v46 = sub_406BAE(v92, v4);
sub_4065C6(v46);
return 1;
}
if ( sub_4076AB("Int32ToHex:", v3) == 1 )
{
v47 = sub_406B10();
LABEL_203:
HIDWORD(v112) = v47;
sub_4065C6(4);
return 1;
}
if ( sub_4076AB("Int64ToHex:", v3) == 1 )
{
v48 = sub_406A54(v4);
LABEL_237:
v112 = v48;
sub_4065C6(8);
return 1;
}
if ( sub_4076AB("Int64Compare:", v3) == 1 )
{
v112 = sub_406A54((unsigned __int8 *)v107);
if ( sub_4078A2(v107, &v108, 44) != 1 )
return 1;
v49 = v108;
*v108 = 0;
v50 = v49 + 1;
if ( sub_4078A2(v50, &v105, 44) != 1 )
return 1;
v51 = v105;
*v105 = 0;
v53 = sub_406A54(v51 + 1);
v52 = HIDWORD(v53);
v101 = v53;
if ( sub_4073A7(v50) == 1 )
{
if ( SHIDWORD(v112) > SHIDWORD(v53) )
goto LABEL_190;
if ( SHIDWORD(v112) < SHIDWORD(v53) )
{
LABEL_179:
v28 = "0";
LABEL_180:
v90 = 0x2000;
LABEL_154:
sub_406C9E(lpMultiByteStr, v28, v90);
return 1;
}
LABEL_212:
if ( (unsigned int)v112 > v101 )
goto LABEL_190;
goto LABEL_179;
}
if ( sub_4073A7(v50) == 1 )
{
if ( SHIDWORD(v112) < SHIDWORD(v53) )
goto LABEL_190;
if ( SHIDWORD(v112) > SHIDWORD(v53) )
goto LABEL_179;
LABEL_217:
if ( (unsigned int)v112 < v101 )
goto LABEL_190;
goto LABEL_179;
}
if ( sub_4073A7(v50) == 1 )
{
if ( SHIDWORD(v112) > SHIDWORD(v53) )
goto LABEL_190;
if ( SHIDWORD(v112) < SHIDWORD(v53) )
goto LABEL_179;
LABEL_222:
if ( (unsigned int)v112 >= v101 )
goto LABEL_190;
goto LABEL_179;
}
if ( sub_4073A7(v50) == 1 )
{
if ( SHIDWORD(v112) < SHIDWORD(v53) )
goto LABEL_190;
if ( SHIDWORD(v112) > SHIDWORD(v53) )
goto LABEL_179;
LABEL_227:
if ( (unsigned int)v112 <= v101 )
goto LABEL_190;
goto LABEL_179;
}
}
else
{
if ( sub_4076AB("UInt32ToHex:", v3) == 1 )
{
v47 = sub_406A4C();
goto LABEL_203;
}
if ( sub_4076AB("UInt64ToHex:", v3) == 1 )
{
LODWORD(v48) = sub_4069D0();
goto LABEL_237;
}
if ( sub_4076AB("UInt64Compare:", v3) != 1 )
{
if ( sub_4076AB("Limit:", v3) == 1 )
{
v57 = sub_406A54(v4);
v58 = *v3;
HIDWORD(v112) = HIDWORD(v57);
if ( !v58 )
return 1;
do
{
if ( v58 == 44 )
break;
v58 = *++v3;
}
while ( *v3 );
if ( !*v3 )
return 1;
v90 = v57 + 1;
v59 = v3 + 1;
}
else
{
if ( sub_4076AB("Trim:", v3) == 1 )
{
if ( sub_4078A2(v107, &v108, 44) == 1 )
{
v60 = v108;
v61 = lpMultiByteStr;
*v108 = 0;
sub_406C9E(v61, v60 + 1, 0x2000);
sub_40711D(v107);
}
return 1;
}
if ( sub_4076AB("Upper:", v3) == 1 )
{
sub_406C9E(lpMultiByteStr, v4, 0x2000);
sub_406E73();
return 1;
}
if ( sub_4076AB("Lower:", v3) == 1 )
{
sub_406C9E(lpMultiByteStr, v4, 0x2000);
sub_406EB7();
return 1;
}
if ( sub_4076AB("If:", v3) != 1 )
{
if ( sub_4076AB("IndexOf:", v3) == 1 )
{
if ( sub_4078A2(v107, &v108, 44) == 1 )
{
v65 = v108;
v66 = v107;
v67 = v108 + 1;
*v108 = 0;
sub_407957(v67, &v105, (int)v66);
if ( v105 )
v68 = v105 - v65 - 1;
else
v68 = -1;
sub_406549((int)lpMultiByteStr, 0x2000, "%d", v68);
}
return 1;
}
if ( sub_4076AB("Equals:", v3) == 1 )
{
if ( sub_4078A2(v107, &v108, 44) == 1 )
{
v69 = v107;
*v108 = 0;
if ( sub_4073A7(v69) == 1 )
sub_406C9E(lpMultiByteStr, "1", 0x2000);
else
sub_406C9E(lpMultiByteStr, "0", 0x2000);
}
return 1;
}
if ( sub_407403(v3, "Random") == 1 )
{
sub_406EFB();
return 1;
}
if ( sub_407403(v3, "Guid") == 1 )
{
sub_406F86(0x2000);
return 1;
}
if ( sub_4076AB("CRC:", v3) == 1 )
{
sub_406D15(0, &v106);
sub_406549((int)lpMultiByteStr, 0x2000, "%lu", v106);
return 1;
}
if ( sub_4076AB("MD4:", v3) == 1 )
{
sub_406D7F(v4, lpMultiByteStr);
return 1;
}
if ( sub_4076AB("MD5:", v3) == 1 )
{
sub_406DC9(v4, lpMultiByteStr);
return 1;
}
if ( sub_4076AB("SHA1:", v3) == 1 )
{
sub_406E1E(v4, lpMultiByteStr);
return 1;
}
if ( sub_4076AB("HMACMD5:", v3) == 1 )
{
if ( sub_4078A2(v107, &v108, 44) != 1 )
return 1;
v70 = v108;
*v108 = 0;
v71 = (int)(v70 + 1);
sub_414977();
v93 = sub_4120BB;
v86 = sub_412186;
v84 = sub_411FF3;
v83 = (int (__cdecl *)(int, void *, int))sub_411E8A;
v82 = sub_412223;
v81 = sub_412317;
v80 = sub_4122BB;
v79 = 16;
}
else
{
if ( sub_4076AB("HMACSHA1:", v3) != 1 )
{
if ( sub_407403(v3, "PrimaryMAC") == 1 )
{
LOBYTE(v112) = 0;
*(_DWORD *)((char *)&v112 + 1) = 0;
BYTE5(v112) = 0;
sub_417194(&v112);
sub_406549(
(int)lpMultiByteStr,
0x2000,
"%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
(unsigned __int8)v112,
BYTE1(v112),
BYTE2(v112),
BYTE3(v112),
BYTE4(v112),
BYTE5(v112));
return 1;
}
if ( sub_407403(v3, "IntranetIP") == 1 )
{
if ( sub_416C63() == 1 )
sub_406549((int)lpMultiByteStr, 0x2000, "%ipv4", &v96);
return 1;
}
if ( sub_4076AB("Env:", v3) != 1 )
return 0;
v28 = getenv((const char *)v4);
if ( !v28 )
return 0;
goto LABEL_180;
}
if ( sub_4078A2(v107, &v108, 44) != 1 )
return 1;
v72 = v108;
*v108 = 0;
v71 = (int)(v72 + 1);
sub_414977();
v93 = sub_414202;
v86 = sub_4142EA;
v84 = sub_414106;
v83 = sub_413FB5;
v82 = sub_414388;
v81 = sub_41447C;
v80 = sub_414420;
v79 = 20;
}
sub_414502(v79, v80, v81, v82, v83, v84, v86, v93);
v74 = sub_406BAE(v73, v107);
sub_41463B(v75, v74);
v77 = sub_406BAE(v76, v71);
sub_41471B(v71, v77);
sub_4147E7();
sub_4148D8(lpMultiByteStr);
sub_4149C6(&v104[1]);
return 1;
}
if ( sub_4078A2(v107, &v108, 44) != 1 )
return 1;
v62 = v108;
v63 = v107;
*v108 = 0;
sub_409631(v63, 0);
v59 = v62 + 1;
v42 = sub_4078A2(v62 + 1, &v105, 44) == 1;
v64 = v105;
if ( v42 )
*v105 = 0;
v90 = 0x2000;
if ( v106 != 1 )
{
if ( !v64 )
{
sub_406C9E(lpMultiByteStr, &unk_47DBD9, 0x2000);
return 1;
}
v28 = v64 + 1;
goto LABEL_154;
}
}
sub_406C9E(lpMultiByteStr, v59, v90);
return 1;
}
LODWORD(v54) = sub_4069D0();
v112 = v54;
if ( sub_4078A2(v107, &v108, 44) != 1 )
return 1;
v55 = v108;
*v108 = 0;
v50 = v55 + 1;
if ( sub_4078A2(v50, &v105, 44) != 1 )
return 1;
*v105 = 0;
v101 = sub_4069D0();
v52 = v56;
if ( sub_4073A7(v50) == 1 )
{
if ( HIDWORD(v112) > v52 )
goto LABEL_190;
if ( HIDWORD(v112) < v52 )
goto LABEL_179;
goto LABEL_212;
}
if ( sub_4073A7(v50) == 1 )
{
if ( HIDWORD(v112) < v52 )
goto LABEL_190;
if ( HIDWORD(v112) > v52 )
goto LABEL_179;
goto LABEL_217;
}
if ( sub_4073A7(v50) == 1 )
{
if ( HIDWORD(v112) > v52 )
goto LABEL_190;
if ( HIDWORD(v112) < v52 )
goto LABEL_179;
goto LABEL_222;
}
if ( sub_4073A7(v50) == 1 )
{
if ( HIDWORD(v112) < v52 )
goto LABEL_190;
if ( HIDWORD(v112) > v52 )
goto LABEL_179;
goto LABEL_227;
}
}
if ( sub_4073A7(v50) != 1 && sub_4073A7(v50) != 1 || (_DWORD)v112 != v101 )
goto LABEL_179;
v42 = HIDWORD(v112) == v52;
LABEL_189:
if ( v42 )
{
LABEL_190:
v28 = "1";
goto LABEL_180;
}
goto LABEL_179;
}
sub_404915((int)lpMultiByteStr);
return 1;
}
Look at all the information they take. Especially DiskSerial and PrimaryMAC. They take the MAC directly from OS, hard to spoof that.