Function at 0x1001705
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, 0x60
push esi
xor esi, esi
mov dword [ebp - 4], esi
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x10], esi
mov dword [ebp - 8], esi
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x1c], esi
cmp dword [ebp + 0xc], esi
jne 0x100186b
xor eax, eax
inc eax
pop esi
leave
ret 0x10
push esi
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x1003a9c
xor eax, eax
jmp 0x10019ac
push edi
lea eax, [ebp - 0x28]
push eax
push 0xf01ff
call dword [sym.imp.API_MS_Win_Core_ProcessThreads_L1_1_0.dll_GetCurrentProcess]
push eax
call dword [sym.imp.API_MS_Win_Core_ProcessThreads_L1_1_0.dll_OpenProcessToken]
test eax, eax
je 0x10018a5
push dword [ebp - 0x28]
call dword [sym.imp.USERENV.dll_Ordinal_175]
push dword [ebp - 0x28]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
inc eax
cmp edi, eax
je 0x10019ad
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, esi
je 0x1001739
cmp word [eax], si
je 0x1001739
push eax
call ebx
push 0x10028cc
mov esi, eax
call ebx
lea edi, [esi + eax]
mov esi, 0x10019b4
push esi
call ebx
add eax, edi
lea edi, [eax + eax + 2]
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x1001746
push esi
shr edi, 1
push edi
push eax
call fcn.010021a9
push dword [ebp + 8]
push edi
push dword [ebp - 0xc]
call fcn.01002340
push 0x10028cc
push edi
push dword [ebp - 0xc]
call fcn.01002340
xor edi, edi
mov dword [ebp + 8], edi
lea eax, [ebp - 0x60]
push eax
push edi
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesExW]
test eax, eax
je 0x100381c
lea eax, [ebp + 8]
push eax
push dword [ebp - 0xc]
call fcn.010024aa
push dword [ebp + 0x14]
mov esi, eax
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp - 0xc]
call fcn.01001af3
mov dword [ebp - 4], eax
cmp esi, edi
je 0x1001964
push dword [ebp + 8]
push 0x10019bc
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0xc], edi
je 0x100197b
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0x18], edi
jne 0x1003a61
cmp dword [ebp - 0x10], edi
jne 0x1003a6f
cmp dword [ebp - 8], edi
jne 0x1003a7c
cmp dword [ebp - 4], edi
je 0x1003a95
cmp dword [ebp + 0x10], 0
jne 0x1003a8b
xor eax, eax
inc eax
pop ebx
pop edi
jmp 0x1001734
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x1c], 1
mov esi, eax
je 0x100387d
lea eax, [ebp - 0x2c]
push eax
push 0x20019
push edi
push 0x1003bc8
push 0x80000002
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x1003873
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x34]
push eax
push edi
push 0x1003b80
push dword [ebp - 0x2c]
mov dword [ebp - 0x30], 4
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegQueryValueExW]
push dword [ebp - 0x2c]
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
cmp dword [ebp - 0x1c], 1
jne 0x1003a59
cmp esi, 0x35
jne 0x1003a59
cmp dword [ebp - 0x20], edi
jne 0x1003a59
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
push edi
push edi
push 0x1003b60
call esi
mov dword [ebp - 0x20], eax
cmp eax, edi
je 0x1003a59
add eax, eax
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x18], eax
cmp eax, edi
je 0x1003a59
push dword [ebp - 0x20]
push eax
push 0x1003b60
call esi
test eax, eax
je 0x1003a59
lea eax, [ebp - 0x10]
push eax
push 0x40000000
push edi
push edi
push dword [ebp - 0x18]
push edi
call dword [sym.imp.logoncli.dll_DsGetDcNameW]
test eax, eax
mov eax, dword [ebp - 0x10]
jne 0x1003a59
cmp eax, edi
je 0x1003a59
mov esi, dword [eax]
push esi
call ebx
cmp eax, 1
jle 0x1003914
cmp word [esi], 0x5c
jne 0x1003914
cmp word [esi + 2], 0x5c
jne 0x1003914
add esi, 4
cmp esi, edi
je 0x1003929
push 0x185
push esi
call dword [sym.imp.WLDAP32.dll_Ordinal_145]
pop ecx
pop ecx
mov dword [ebp - 8], eax
cmp dword [ebp - 8], edi
je 0x1003a59
lea eax, [ebp - 0x14]
push eax
mov esi, 0x92
push esi
push dword [ebp - 8]
call dword [sym.imp.WLDAP32.dll_Ordinal_12]
add esp, 0xc
test eax, eax
jne 0x1003a59
or dword [ebp - 0x14], 2
lea eax, [ebp - 0x14]
push eax
push esi
push dword [ebp - 8]
mov esi, dword [sym.imp.WLDAP32.dll_Ordinal_14]
call esi
add esp, 0xc
test eax, eax
jne 0x1003a59
push 1
push 0x98
push dword [ebp - 8]
call esi
add esp, 0xc
test eax, eax
jne 0x1003a59
push edi
push 8
push dword [ebp - 8]
call esi
add esp, 0xc
test eax, eax
jne 0x1003a59
lea eax, [ebp - 0x24]
push eax
push 4
push dword [ebp - 8]
mov dword [ebp - 0x24], 0x1e
call esi
add esp, 0xc
test eax, eax
jne 0x1003a59
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 8]
mov dword [ebp - 0x38], edi
call dword [sym.imp.WLDAP32.dll_Ordinal_88]
pop ecx
pop ecx
test eax, eax
jne 0x1003a59
push 0x486
push edi
push edi
push dword [ebp - 8]
call dword [sym.imp.WLDAP32.dll_Ordinal_73]
add esp, 0x10
test eax, eax
jne 0x1003a59
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x10]
push dword [eax]
call ebx
push 0x10028cc
mov esi, eax
call ebx
lea esi, [esi + eax + 1]
lea eax, [esi + esi]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0xc], eax
cmp eax, edi
je 0x1003a51
mov ecx, dword [ebp - 0x10]
push dword [ecx]
push esi
push eax
call fcn.010021a9
test eax, eax
jl 0x1003a59
push 0x10028cc
push esi
push dword [ebp - 0xc]
call fcn.01002340
test eax, eax
jl 0x1003a59
inc dword [ebp + 8]
cmp dword [ebp + 8], 2
jge 0x100196d
jmp 0x100191a
mov dword [ebp - 4], edi
jmp 0x100197b
mov dword [ebp - 4], edi
jmp 0x100196d
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x1001984
push dword [ebp - 0x10]
call sub.netutils.dll_NetApiBufferFree
jmp 0x100198d
push dword [ebp - 8]
call dword [sym.imp.WLDAP32.dll_Ordinal_46]
pop ecx
jmp 0x1001996
call fcn.01004853
jmp 0x10019a9
xor esi, esi
jmp 0x1001739
mov edi, eax
add edi, edi
je 0x1001746
mov esi, 0x1003b34
push esi
call ebx
lea ebx, [edi + eax*2 + 2]
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
test edi, edi
je 0x1001746
and dword [ebp - 4], 0
shr ebx, 1
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x1003b12
push esi
push ebx
push edi
call fcn.01002340
lea eax, [ebp + 8]
push eax
push edi
call fcn.010024aa
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push edi
call fcn.01001af3
push dword [ebp + 8]
mov dword [ebp - 4], eax
push 0x10019bc
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 4], 0
je 0x1003b2a
cmp dword [ebp + 0x10], 0
je 0x1003b2a
call fcn.01004853
mov eax, dword [ebp - 4]
jmp 0x10019ac