Function at 0x4014c1
Capabilities:
Get common file path
Get domain controller name
Query environment variable
Query or enumerate registry value
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x70
mov eax, dword [0x4050b4]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
xor edi, edi
mov ebx, edx
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x54], edi
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x44], edi
test ecx, ecx
jne 0x40276a
xor eax, eax
inc eax
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004013ef
leave
ret 4
call fcn.00401c97
test al, al
je 0x402782
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_PerformXForestLogonCheck]
cmp eax, 1
je 0x4014fa
test ebx, ebx
je 0x402afe
cmp word [ebx], di
je 0x402afe
call fcn.00401c97
test al, al
je 0x402afe
push ebx
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
push 0x402ba4
mov esi, eax
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
push 0x402b9c
add esi, eax
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
add eax, esi
lea esi, [eax*2 + 2]
push esi
push 0x40
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalAlloc]
mov ecx, eax
mov dword [ebp - 0x4c], ecx
test ecx, ecx
jne 0x4027e3
xor eax, eax
jmp 0x4014fd
shr esi, 1
mov eax, esi
mov dword [ebp - 0x3c], esi
mov edx, 0x402b9c
mov esi, ecx
call fcn.004020e3
mov esi, dword [ebp - 0x3c]
push ebx
mov ebx, dword [ebp - 0x4c]
mov eax, esi
call fcn.00403251
push 0x402ba4
mov eax, esi
call fcn.00403251
mov dword [ebp - 0x3c], edi
lea eax, [ebp - 0x2c]
push eax
push edi
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_2_0.dll_GetFileAttributesExW]
test eax, eax
jne 0x402a77
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
cmp dword [ebp - 0x44], 1
mov esi, eax
je 0x402888
lea eax, [ebp - 0x50]
push eax
push 0x20019
push edi
push 0x402bb8
push 0x80000002
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x40287e
lea eax, [ebp - 0x60]
push eax
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x6c]
push eax
push edi
push 0x402c10
push dword [ebp - 0x50]
mov dword [ebp - 0x60], 4
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
push dword [ebp - 0x50]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
cmp dword [ebp - 0x44], 1
jne 0x402a6f
cmp esi, 0x35
jne 0x402a6f
cmp dword [ebp - 0x30], edi
jne 0x402a6f
push edi
push edi
push 0x402c54
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetEnvironmentVariableW]
mov dword [ebp - 0x30], eax
test eax, eax
je 0x402a6f
add eax, eax
push eax
push 0x40
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalAlloc]
mov esi, eax
mov dword [ebp - 0x54], esi
test esi, esi
je 0x402a6f
push dword [ebp - 0x30]
push esi
push 0x402c54
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetEnvironmentVariableW]
test eax, eax
je 0x402a6f
lea eax, [ebp - 0x34]
push eax
push 0x40000000
push edi
push edi
push esi
push edi
call dword [sym.imp.logoncli.dll_DsGetDcNameW]
test eax, eax
jne 0x402a6f
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x402a6f
mov esi, dword [eax]
push esi
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
cmp eax, 1
jle 0x402926
push 0x5c
pop eax
cmp word [esi], ax
jne 0x402926
cmp word [esi + 2], ax
jne 0x402926
add esi, 4
test esi, esi
je 0x40293f
push 0x185
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_145]
pop ecx
mov esi, eax
pop ecx
mov dword [ebp - 0x48], esi
jmp 0x402942
mov esi, dword [ebp - 0x48]
test esi, esi
je 0x402a6f
lea eax, [ebp - 0x38]
push eax
push 0x92
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_12]
add esp, 0xc
test eax, eax
jne 0x402a6f
or dword [ebp - 0x38], 2
lea eax, [ebp - 0x38]
push eax
push 0x92
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402a6f
push 1
push 0x98
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402a6f
push edi
push 8
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402a6f
lea eax, [ebp - 0x40]
push eax
push 4
push esi
mov dword [ebp - 0x40], 0x1e
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402a6f
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x68], eax
lea eax, [ebp - 0x68]
push eax
push esi
mov dword [ebp - 0x64], edi
call dword [sym.imp.WLDAP32.dll_Ordinal_88]
pop ecx
pop ecx
test eax, eax
jne 0x402a6f
push 0x486
push edi
push edi
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_73]
add esp, 0x10
test eax, eax
jne 0x402a6f
push ebx
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
mov ebx, dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
push 0x402ba4
call ebx
lea esi, [eax + 1]
mov eax, dword [ebp - 0x34]
push dword [eax]
call ebx
add esi, eax
lea eax, [esi + esi]
push eax
push 0x40
mov dword [ebp - 0x5c], esi
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalAlloc]
mov ebx, eax
mov dword [ebp - 0x4c], ebx
test ebx, ebx
je 0x402a73
mov edx, dword [ebp - 0x34]
mov edx, dword [edx]
mov eax, esi
mov esi, ebx
call fcn.004020e3
test eax, eax
js 0x402a6f
mov eax, dword [ebp - 0x5c]
push 0x402ba4
call fcn.00403251
test eax, eax
js 0x402a6f
mov esi, dword [ebp - 0x3c]
inc esi
mov dword [ebp - 0x3c], esi
cmp esi, 2
jl 0x402813
mov ebx, edi
jmp 0x402aae
mov ebx, edi
jmp 0x402abc
lea eax, [ebp - 0x30]
push eax
push ebx
call fcn.00403360
push 1
push dword [ebp + 8]
mov esi, eax
push dword [ebp - 0x58]
push ebx
call fcn.00403605
mov ebx, eax
test esi, esi
je 0x402aa5
push dword [ebp - 0x30]
push 0x4031dc
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
push dword [ebp - 0x30]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
mov ecx, dword [ebp - 0x4c]
test ecx, ecx
je 0x402abc
push ecx
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
mov eax, dword [ebp - 0x54]
test eax, eax
je 0x402aca
push eax
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x402ad8
push eax
call dword [sym.imp.netutils.dll_NetApiBufferFree]
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x402ae7
push eax
call dword [sym.imp.WLDAP32.dll_Ordinal_46]
pop ecx
test ebx, ebx
je 0x402afe
cmp dword [ebp + 8], edi
je 0x4014fa
call fcn.004033f1
jmp 0x4014fa
push edi
push edi
call dword [sym.imp.api_ms_win_core_sysinfo_l1_2_0.dll_GetSystemDirectoryW]
mov esi, eax
add esi, esi
je 0x4027dc
push 0x402c70
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
lea esi, [esi + eax*2]
add esi, 2
push esi
push 0x40
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalAlloc]
mov ebx, eax
test ebx, ebx
je 0x4027dc
shr esi, 1
push esi
push ebx
call dword [sym.imp.api_ms_win_core_sysinfo_l1_2_0.dll_GetSystemDirectoryW]
test eax, eax
je 0x402b7f
push 0x402c70
mov eax, esi
call fcn.00403251
lea eax, [ebp - 0x30]
push eax
push ebx
call fcn.00403360
push 1
push dword [ebp + 8]
push dword [ebp - 0x58]
push ebx
call fcn.00403605
push dword [ebp - 0x30]
mov edi, eax
push 0x4031dc
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
push dword [ebp - 0x30]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
push ebx
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
test edi, edi
je 0x402b95
cmp dword [ebp + 8], 0
je 0x402b95
call fcn.004033f1
mov eax, edi
jmp 0x4014fd