Function at 0x4014b1
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, 0x6c
mov eax, dword [0x4050b4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor edi, edi
mov dword [ebp - 0x50], edx
mov dword [ebp - 0x58], edi
mov esi, ecx
mov dword [ebp - 0x3c], esi
mov ebx, edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x40], edi
test edx, edx
jne 0x402852
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004013df
mov esp, ebp
pop ebp
ret 8
call fcn.0040200e
test al, al
je 0x40286a
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_PerformXForestLogonCheck]
cmp eax, 1
je 0x4014ef
test esi, esi
je 0x402be5
cmp word [esi], di
je 0x402be5
call fcn.0040200e
test al, al
je 0x402be5
push esi
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
push 0x402c8c
mov esi, eax
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
push 0x402c84
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 dword [ebp - 0x30], eax
test eax, eax
jne 0x4028c9
xor eax, eax
jmp 0x4014f2
shr esi, 1
mov ecx, eax
push 0x402c84
mov edx, esi
call fcn.00401c1b
push dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x30]
mov edx, esi
call fcn.00403371
mov edx, esi
mov esi, dword [ebp - 0x30]
push 0x402c8c
mov ecx, esi
call fcn.00403371
mov dword [ebp - 0x3c], edi
lea eax, [ebp - 0x28]
push eax
push edi
push esi
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFileAttributesExW]
test eax, eax
jne 0x402b61
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
cmp dword [ebp - 0x40], 1
mov esi, eax
je 0x40296f
lea eax, [ebp - 0x4c]
push eax
push 0x20019
push edi
push 0x402ca0
push 0x80000002
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x402965
lea eax, [ebp - 0x5c]
mov dword [ebp - 0x5c], 4
push eax
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x68]
push eax
push edi
push 0x402cf8
push dword [ebp - 0x4c]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegQueryValueExW]
push dword [ebp - 0x4c]
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegCloseKey]
cmp dword [ebp - 0x40], 1
jne 0x402b9a
cmp esi, 0x35
jne 0x402b9a
cmp dword [ebp - 0x2c], ebx
jne 0x402b9a
push edi
push edi
push 0x402d3c
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetEnvironmentVariableW]
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x402b9a
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 - 0x58], esi
test esi, esi
je 0x402b9a
push dword [ebp - 0x2c]
push esi
push 0x402d3c
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetEnvironmentVariableW]
test eax, eax
je 0x402b9a
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 0x402b9a
mov esi, dword [ebp - 0x34]
test esi, esi
je 0x402b9a
mov esi, dword [esi]
push esi
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
cmp eax, 1
jle 0x402a0d
push 0x5c
pop eax
cmp word [esi], ax
jne 0x402a0d
cmp word [esi + 2], ax
jne 0x402a0d
add esi, 4
test esi, esi
je 0x402a26
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 0x402a29
mov esi, dword [ebp - 0x48]
test esi, esi
je 0x402b9a
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 0x402b9a
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 0x402b9a
push 1
push 0x98
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402b9a
push edi
push 8
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402b9a
lea eax, [ebp - 0x44]
mov dword [ebp - 0x44], 0x1e
push eax
push 4
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402b9a
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x64], eax
lea eax, [ebp - 0x64]
push eax
push esi
mov dword [ebp - 0x60], edi
call dword [sym.imp.WLDAP32.dll_Ordinal_88]
pop ecx
pop ecx
test eax, eax
jne 0x402b9a
push 0x486
push edi
push edi
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_73]
add esp, 0x10
test eax, eax
jne 0x402b9a
push dword [ebp - 0x30]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
push 0x402c8c
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
mov esi, eax
mov eax, dword [ebp - 0x34]
push dword [eax]
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
inc eax
add eax, esi
mov dword [ebp - 0x54], eax
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 - 0x30], esi
test esi, esi
je 0x402ba3
mov eax, dword [ebp - 0x34]
mov ecx, esi
mov edx, dword [ebp - 0x54]
push dword [eax]
call fcn.00401c1b
test eax, eax
js 0x402b9a
mov edx, dword [ebp - 0x54]
mov ecx, esi
push 0x402c8c
call fcn.00403371
test eax, eax
js 0x402b9a
mov eax, dword [ebp - 0x3c]
inc eax
mov dword [ebp - 0x3c], eax
cmp eax, 2
jge 0x402b9a
jmp 0x4028fa
lea edx, [ebp - 0x2c]
mov ecx, esi
call fcn.00403488
mov edx, dword [ebp - 0x50]
mov esi, eax
mov ecx, dword [ebp - 0x30]
push 1
push dword [ebp + 8]
call fcn.004036dd
mov ebx, eax
test esi, esi
je 0x402b91
push dword [ebp - 0x2c]
push 0x4032e0
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
push dword [ebp - 0x2c]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
push dword [ebp - 0x30]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
mov eax, dword [ebp - 0x58]
test eax, eax
je 0x402bb1
push eax
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
cmp dword [ebp - 0x34], edi
je 0x402bbf
push dword [ebp - 0x34]
call dword [sym.imp.netutils.dll_NetApiBufferFree]
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x402bce
push eax
call dword [sym.imp.WLDAP32.dll_Ordinal_46]
pop ecx
test ebx, ebx
je 0x402be5
cmp dword [ebp + 8], edi
je 0x4014ef
call fcn.0040351d
jmp 0x4014ef
push edi
push edi
call dword [sym.imp.api_ms_win_core_sysinfo_l1_2_1.dll_GetSystemDirectoryW]
mov esi, eax
add esi, esi
je 0x4028c2
push 0x402d58
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
inc eax
lea ebx, [esi + eax*2]
push ebx
push 0x40
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalAlloc]
mov esi, eax
test esi, esi
je 0x4028c2
shr ebx, 1
push ebx
push esi
call dword [sym.imp.api_ms_win_core_sysinfo_l1_2_1.dll_GetSystemDirectoryW]
test eax, eax
je 0x402c67
push 0x402d58
mov edx, ebx
mov ecx, esi
call fcn.00403371
lea edx, [ebp - 0x2c]
mov ecx, esi
call fcn.00403488
mov edx, dword [ebp - 0x50]
mov ecx, esi
push 1
push dword [ebp + 8]
call fcn.004036dd
push dword [ebp - 0x2c]
mov edi, eax
push 0x4032e0
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetEnvironmentVariableW]
push dword [ebp - 0x2c]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
push esi
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
test edi, edi
je 0x402c7d
cmp dword [ebp + 8], 0
je 0x402c7d
call fcn.0040351d
mov eax, edi
jmp 0x4014f2