Function at 0x1005ee9
Capabilities:
Get domain controller name

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
mov esi, dword [ebp + 0x14]
push edi
xor edi, edi
cmp dword [ebp + 0xc], edi
push 0x20
mov dword [ebp - 4], edi
mov dword [ebp - 0xc], edi
mov dword [ebp - 8], edi
pop eax
jne 0x1005f42
cmp dword [ebp + 0x18], edi
je 0x1005f14
mov eax, 0x1020
test byte [esi + 0x18], 8
je 0x1005f1f
or eax, 0x80
lea ecx, [ebp - 4]
push ecx
push eax
push edi
push edi
push dword [ebp + 8]
push edi
call dword [sym.imp.NETAPI32.dll_DsGetDcNameW]
mov ebx, eax
cmp ebx, edi
jne 0x10060de
mov eax, dword [ebp - 4]
mov eax, dword [eax]
mov dword [ebp + 0xc], eax
push esi
push dword [ebp + 0xc]
call dword [sym.imp.msvcrt.dll_wcslen]
pop ecx
lea eax, [eax + eax + 2]
push eax
call sub.NETAPI32.dll_NetApiBufferAllocate
mov ebx, eax
cmp ebx, edi
jne 0x10060de
push dword [ebp + 0xc]
push dword [esi]
call dword [sym.imp.msvcrt.dll_wcscpy]
cmp dword [0x1012ca8], edi
pop ecx
pop ecx
je 0x1005f85
push dword [ebp + 0xc]
push 0x2ee4
call fcn.0100371a
pop ecx
pop ecx
cmp dword [ebp + 0x20], edi
mov edx, dword [ebp + 0x10]
mov eax, 0x1001510
mov ecx, eax
jne 0x1005f99
mov ecx, dword [edx + 4]
mov eax, dword [edx]
mov edx, dword [ebp + 0x20]
neg edx
sbb edx, edx
and edx, 0xf
inc edx
push edx
push ecx
push eax
push dword [ebp + 0xc]
call fcn.0100d0d6
mov ebx, eax
cmp ebx, edi
jne 0x1005fbc
mov dword [esi + 0x20], 1
cmp ebx, 0x4c3
jne 0x1005fd8
cmp dword [ebp + 0x20], edi
jne 0x1005ff0
push dword [ebp + 0xc]
push 0x1fa1
call fcn.0100371a
pop ecx
pop ecx
mov eax, 0x52e
cmp ebx, eax
jne 0x1005fe8
mov ebx, eax
jmp 0x1006169
cmp ebx, edi
jne 0x10060de
push dword [ebp + 0xc]
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.ntdll.dll_RtlInitUnicodeString]
cmp dword [0x1012ca8], edi
mov dword [ebp - 0x2c], 0x18
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], edi
je 0x1006026
push 0x2efc
call fcn.0100371a
pop ecx
cmp dword [ebp + 0x18], edi
mov eax, 0x801
je 0x1006033
add eax, 0x28
lea ebx, [esi + 0x10]
push ebx
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x14]
push eax
call sub.ADVAPI32.dll_LsaOpenPolicy
cmp eax, edi
jl 0x10060a2
lea eax, [ebp - 8]
push eax
push 0xc
push dword [ebx]
call sub.ADVAPI32.dll_LsaQueryInformationPolicy
cmp eax, edi
jl 0x1006072
mov ecx, dword [ebp - 8]
lea edx, [ecx + 8]
mov dword [esi + 4], edx
mov dword [esi + 8], ecx
mov edx, dword [ecx + 0x28]
mov dword [esi + 0x1c], 1
jmp 0x1006099
cmp eax, 0xc002002e
jne 0x10060a2
lea eax, [ebp - 0xc]
push eax
push 3
push dword [ebx]
call sub.ADVAPI32.dll_LsaQueryInformationPolicy
cmp eax, edi
jl 0x10060a2
mov ecx, dword [ebp - 0xc]
mov dword [esi + 4], ecx
mov dword [esi + 8], ecx
mov edx, dword [ecx + 8]
mov dword [esi + 0x1c], edi
mov dword [esi + 0xc], edx
mov dword [esi + 0x24], ecx
mov dword [esi + 0x28], edi
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov ebx, eax
cmp ebx, edi
je 0x1006169
cmp dword [0x1012ca8], edi
je 0x10060ca
push dword [ebp + 0xc]
push 0x2ee5
call fcn.0100371a
pop ecx
pop ecx
push 2
push edi
push edi
push dword [ebp + 0xc]
call fcn.0100d0d6
mov dword [esi + 0x20], edi
jmp 0x1006169
cmp dword [ebp + 0x1c], edi
je 0x1006152
cmp dword [0x1012ca8], edi
je 0x10060fa
push dword [ebp + 8]
push 0x2f05
call fcn.0100371a
pop ecx
pop ecx
lea eax, [ebp + 0x14]
push eax
push dword [ebp + 8]
mov dword [esi + 0x18], 1
call dword [sym.imp.msvcrt.dll_wcslen]
pop ecx
lea eax, [eax + eax + 2]
push eax
call sub.NETAPI32.dll_NetApiBufferAllocate
mov ebx, eax
cmp ebx, edi
jne 0x1006169
lea eax, [esi + 4]
push eax
push 8
call sub.NETAPI32.dll_NetApiBufferAllocate
mov ebx, eax
cmp ebx, edi
jne 0x1006169
push dword [ebp + 8]
push dword [ebp + 0x14]
call dword [sym.imp.msvcrt.dll_wcscpy]
pop ecx
pop ecx
push dword [ebp + 0x14]
push dword [esi + 4]
call dword [sym.imp.ntdll.dll_RtlInitUnicodeString]
mov eax, dword [esi + 4]
mov dword [esi + 8], eax
jmp 0x1006169
cmp dword [0x1012ca8], edi
je 0x1006169
push dword [ebp + 8]
push 0x1fa0
call fcn.0100371a
pop ecx
pop ecx
push dword [ebp - 4]
call sub.NETAPI32.dll_NetApiBufferFree
pop edi
pop esi
mov eax, ebx
pop ebx
leave
ret 0x1c