Function at 0x4011c9
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 [0x405030]
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 0x402912
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401940
mov esp, ebp
pop ebp
ret 8
call fcn.00401995
test al, al
je 0x40292a
call dword [sym.imp.ext_ms_win_session_userinit_l1_1_0.dll_PerformXForestLogonCheck]
cmp eax, 1
je 0x401207
test esi, esi
je 0x402ca5
cmp word [esi], di
je 0x402ca5
call fcn.00401995
test al, al
je 0x402ca5
push esi
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
push 0x402d4c
mov esi, eax
call dword [sym.imp.api_ms_win_core_string_obsolete_l1_1_0.dll_lstrlenW]
push 0x402d44
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 0x402989
xor eax, eax
jmp 0x40120a
shr esi, 1
mov ecx, eax
push 0x402d44
mov edx, esi
call fcn.004021d4
push dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x30]
mov edx, esi
call fcn.00403515
mov edx, esi
mov esi, dword [ebp - 0x30]
push 0x402d4c
mov ecx, esi
call fcn.00403515
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 0x402c21
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
cmp dword [ebp - 0x40], 1
mov esi, eax
je 0x402a2f
lea eax, [ebp - 0x4c]
push eax
push 0x20019
push edi
push 0x402d60
push 0x80000002
call dword [sym.imp.api_ms_win_core_registry_l1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x402a25
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 0x402db8
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 0x402c5a
cmp esi, 0x35
jne 0x402c5a
cmp dword [ebp - 0x2c], ebx
jne 0x402c5a
push edi
push edi
push 0x402dfc
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetEnvironmentVariableW]
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x402c5a
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 0x402c5a
push dword [ebp - 0x2c]
push esi
push 0x402dfc
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetEnvironmentVariableW]
test eax, eax
je 0x402c5a
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 0x402c5a
mov esi, dword [ebp - 0x34]
test esi, esi
je 0x402c5a
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 0x402acd
push 0x5c
pop eax
cmp word [esi], ax
jne 0x402acd
cmp word [esi + 2], ax
jne 0x402acd
add esi, 4
test esi, esi
je 0x402ae6
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 0x402ae9
mov esi, dword [ebp - 0x48]
test esi, esi
je 0x402c5a
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 0x402c5a
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 0x402c5a
push 1
push 0x98
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402c5a
push edi
push 8
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_14]
add esp, 0xc
test eax, eax
jne 0x402c5a
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 0x402c5a
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 0x402c5a
push 0x486
push edi
push edi
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_73]
add esp, 0x10
test eax, eax
jne 0x402c5a
push dword [ebp - 0x30]
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
push 0x402d4c
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 0x402c63
mov eax, dword [ebp - 0x34]
mov ecx, esi
mov edx, dword [ebp - 0x54]
push dword [eax]
call fcn.004021d4
test eax, eax
js 0x402c5a
mov edx, dword [ebp - 0x54]
mov ecx, esi
push 0x402d4c
call fcn.00403515
test eax, eax
js 0x402c5a
mov eax, dword [ebp - 0x3c]
inc eax
mov dword [ebp - 0x3c], eax
cmp eax, 2
jge 0x402c5a
jmp 0x4029ba
lea edx, [ebp - 0x2c]
mov ecx, esi
call fcn.0040362c
mov edx, dword [ebp - 0x50]
mov esi, eax
mov ecx, dword [ebp - 0x30]
push 1
push dword [ebp + 8]
call fcn.0040388d
mov ebx, eax
test esi, esi
je 0x402c51
push dword [ebp - 0x2c]
push 0x4034ec
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 0x402c71
push eax
call dword [sym.imp.api_ms_win_core_heap_obsolete_l1_1_0.dll_LocalFree]
cmp dword [ebp - 0x34], edi
je 0x402c7f
push dword [ebp - 0x34]
call dword [sym.imp.netutils.dll_NetApiBufferFree]
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x402c8e
push eax
call dword [sym.imp.WLDAP32.dll_Ordinal_46]
pop ecx
test ebx, ebx
je 0x402ca5
cmp dword [ebp + 8], edi
je 0x401207
call fcn.004036c1
jmp 0x401207
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 0x402982
push 0x402e18
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 0x402982
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 0x402d27
push 0x402e18
mov edx, ebx
mov ecx, esi
call fcn.00403515
lea edx, [ebp - 0x2c]
mov ecx, esi
call fcn.0040362c
mov edx, dword [ebp - 0x50]
mov ecx, esi
push 1
push dword [ebp + 8]
call fcn.0040388d
push dword [ebp - 0x2c]
mov edi, eax
push 0x4034ec
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 0x402d3d
cmp dword [ebp + 8], 0
je 0x402d3d
call fcn.004036c1
mov eax, edi
jmp 0x40120a