Function at 0x100d5c7
Capabilities:
Get domain controller name

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [ebp + 0xc]
push esi
mov esi, dword [sym.imp.NETAPI32.dll_DsGetDcNameW]
push edi
xor edi, edi
mov dword [eax], edi
mov eax, dword [ebp + 0x10]
mov dword [eax], edi
lea eax, [ebp - 8]
push eax
push 0x80000
push edi
push edi
push dword [ebp + 8]
mov dword [ebp - 0x14], edi
push edi
mov dword [ebp - 0xc], edi
mov byte [ebp - 1], 1
mov dword [ebp - 8], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x10], edi
call esi
cmp eax, edi
je 0x100d64f
cmp eax, 0x54b
je 0x100d629
cmp eax, edi
jg 0x100d61d
mov esi, eax
jmp 0x100d7bb
and eax, 0xffff
or eax, 0x80070000
jmp 0x100d616
cmp dword [ebp - 8], edi
je 0x100d639
push dword [ebp - 8]
call sub.NETAPI32.dll_NetApiBufferFree
mov dword [ebp - 8], edi
lea eax, [ebp - 8]
push eax
push 0x10
push edi
push edi
push dword [ebp + 8]
push edi
call esi
cmp eax, edi
jne 0x100d614
mov byte [ebp - 1], 0
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 8]
push edi
push dword [eax]
call dword [sym.imp.NTDSAPI.dll_DsBindW]
cmp eax, edi
jne 0x100d614
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x14]
push eax
xor eax, eax
cmp byte [ebp - 1], al
setne al
lea eax, [eax + eax + 1]
push eax
mov eax, dword [ebp - 8]
push dword [eax + 0x1c]
push dword [ebp - 0x18]
call dword [sym.imp.NTDSAPI.dll_DsGetDomainControllerInfoW]
cmp eax, edi
jne 0x100d614
mov ecx, dword [ebp - 0x14]
cmp ecx, edi
jbe 0x100d6bc
xor eax, eax
cmp byte [ebp - 1], al
sete al
dec eax
and eax, 0x50
add eax, 0x1c
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
add eax, 4
cmp dword [eax], edi
je 0x100d6b1
inc dword [ebp - 0xc]
add eax, dword [ebp - 0x20]
dec ecx
jne 0x100d6aa
cmp dword [ebp - 0xc], edi
jne 0x100d6c6
mov esi, 0x80070774
jmp 0x100d7bb
mov eax, dword [ebp - 0xc]
imul eax, eax, 0x14
push ebx
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp + 8], eax
cmp eax, edi
jne 0x100d6e7
mov esi, 0x8007000e
jmp 0x100d791
mov dword [ebp - 0x1c], edi
cmp dword [ebp - 0x14], edi
jbe 0x100d776
mov dword [ebp - 0x24], edi
lea ebx, [eax + 0x11]
mov eax, dword [ebp - 0x10]
add edi, eax
mov eax, dword [edi + 4]
test eax, eax
je 0x100d75d
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
test dx, dx
jne 0x100d708
sub eax, ecx
sar eax, 1
lea esi, [eax + 1]
lea eax, [esi + esi]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebx - 0x11], eax
test eax, eax
je 0x100d78a
push dword [edi + 4]
push esi
push eax
call fcn.01003fae
mov esi, eax
test esi, esi
jl 0x100d78f
cmp dword [edi + 0x1c], 0
setne al
cmp byte [ebp - 1], 0
mov byte [ebx - 1], al
je 0x100d756
cmp dword [edi + 0x28], 0
je 0x100d756
mov al, 1
jmp 0x100d758
xor al, al
mov byte [ebx], al
add ebx, 0x14
inc dword [ebp - 0x1c]
mov edi, dword [ebp - 0x24]
add edi, dword [ebp - 0x20]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], edi
cmp eax, dword [ebp - 0x14]
jb 0x100d6f9
mov eax, dword [ebp + 8]
xor edi, edi
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp + 0x10]
mov dword [ebp + 8], edi
mov dword [ecx], eax
xor esi, esi
jmp 0x100d791
mov esi, 0x8007000e
xor edi, edi
mov ebx, dword [ebp + 8]
cmp ebx, edi
je 0x100d7ba
cmp dword [ebp - 0xc], edi
jbe 0x100d7b1
mov eax, dword [ebp - 0xc]
mov dword [ebp + 0xc], eax
push ebx
call fcn.0100d58f
add ebx, 0x14
dec dword [ebp + 0xc]
jne 0x100d7a3
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop ebx
cmp dword [ebp - 0x10], edi
je 0x100d7d9
push dword [ebp - 0x10]
xor eax, eax
cmp byte [ebp - 1], al
push dword [ebp - 0x14]
setne al
lea eax, [eax + eax + 1]
push eax
call dword [sym.imp.NTDSAPI.dll_DsFreeDomainControllerInfoW]
cmp dword [ebp - 0x18], edi
je 0x100d7e8
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.NTDSAPI.dll_DsUnBindW]
cmp dword [ebp - 8], edi
je 0x100d7f5
push dword [ebp - 8]
call sub.NETAPI32.dll_NetApiBufferFree
pop edi
mov eax, esi
pop esi
leave
ret 0xc