Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int __cdecl sub_10012FA0()
- {
- HMODULE v0; // edi@1
- int v2; // esi@11
- unsigned int v3; // ecx@15
- FARPROC v4; // [sp+8h] [bp-224h]@5
- FARPROC v5; // [sp+Ch] [bp-220h]@7
- int v6; // [sp+10h] [bp-21Ch]@11
- FARPROC v7; // [sp+14h] [bp-218h]@6
- int v8; // [sp+18h] [bp-214h]@8
- unsigned int v9; // [sp+1Ch] [bp-210h]@11
- const WCHAR LibFileName[2]; // [sp+20h] [bp-20Ch]@11
- int v11; // [sp+24h] [bp-208h]@20
- int v12; // [sp+28h] [bp-204h]@20
- int v13; // [sp+2Ch] [bp-200h]@20
- int v14; // [sp+30h] [bp-1FCh]@20
- int v15; // [sp+34h] [bp-1F8h]@20
- int v16; // [sp+38h] [bp-1F4h]@20
- int v17; // [sp+3Ch] [bp-1F0h]@20
- __int16 v18[244]; // [sp+40h] [bp-1ECh]@20
- unsigned int v19; // [sp+228h] [bp-4h]@1
- int v20; // [sp+22Ch] [bp+0h]@1
- v19 = (unsigned int)&v20 ^ __security_cookie;
- v0 = LoadLibraryExW(L"ADVAPI32.DLL", 0, 0x800u);
- if ( !v0 )
- {
- if ( GetLastError() != 87 || (v0 = LoadLibraryExW(L"ADVAPI32.DLL", 0, 0)) == 0 )
- return sub_10011014((unsigned int)&v20 ^ v19);
- }
- v4 = GetProcAddress(v0, "RegOpenKeyExW");
- if ( !v4 || (v7 = GetProcAddress(v0, "RegQueryValueExW")) == 0 || (v5 = GetProcAddress(v0, "RegCloseKey")) == 0 )
- return sub_10011014((unsigned int)&v20 ^ v19);
- if ( ((int (__stdcall *)(signed int, _DWORD, _DWORD, signed int, int *))v4)(
- -2147483646,
- L"SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VC",
- 0,
- 1,
- &v8) )
- {
- FreeLibrary(v0);
- return sub_10011014((unsigned int)&v20 ^ v19);
- }
- v9 = 520;
- v2 = ((int (__stdcall *)(int, _DWORD, _DWORD, int *, const WCHAR *, unsigned int *))v7)(
- v8,
- L"ProductDir",
- 0,
- &v6,
- LibFileName,
- &v9);
- ((void (__stdcall *)(int))v5)(v8);
- FreeLibrary(v0);
- if ( v2 || v6 != 1 || v9 & 1 || v9 >> 1 < 2 || (v3 = (v9 >> 1) - 1, LibFileName[v3]) )
- return sub_10011014((unsigned int)&v20 ^ v19);
- if ( *((_WORD *)&v9 + v3 + 1) != 92 )
- LibFileName[v3++] = 92;
- if ( -1 - v3 < 0x12 || v3 + 17 > 0x104 )
- return sub_10011014((unsigned int)&v20 ^ v19);
- *(_DWORD *)&LibFileName[v3] = dword_1001607C;
- *(int *)((char *)&v11 + 2 * v3) = dword_10016080;
- *(int *)((char *)&v12 + 2 * v3) = dword_10016084;
- *(int *)((char *)&v13 + 2 * v3) = dword_10016088;
- *(int *)((char *)&v14 + 2 * v3) = dword_1001608C;
- *(int *)((char *)&v15 + 2 * v3) = dword_10016090;
- *(int *)((char *)&v16 + 2 * v3) = dword_10016094;
- *(int *)((char *)&v17 + 2 * v3) = dword_10016098;
- v18[v3] = word_1001609C;
- if ( !LoadLibraryExW(LibFileName, 0, 0x900u) )
- {
- if ( GetLastError() == 87 )
- LoadLibraryExW(LibFileName, 0, 8u);
- }
- return sub_10011014((unsigned int)&v20 ^ v19);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement