Function at 0x5d54d1d3
Capabilities:
Get domain controller name

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [ebp + 8]
xor edx, edx
push ebx
mov ebx, edx
mov dword [ebp - 0x30], ecx
push esi
push edi
mov edi, 0xc00000da
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x10], edx
cmp dword [ebp + 8], edx
jne 0x5d54d203
mov eax, 0x5d506eb8
lea ecx, [ebp - 0x14]
push ecx
push 0x40000010
push edx
push edx
push eax
push edx
call dword [sym.imp.logoncli.dll_DsGetDcNameW]
mov esi, eax
cmp esi, 0x54b
jne 0x5d54d2ce
lea eax, [ebp - 0x34]
push eax
call dword [sym.imp.ntdll.dll_RtlGetNtProductType]
test al, al
je 0x5d54d2d2
cmp dword [ebp - 0x34], 2
jne 0x5d54d2d2
push 6
pop ecx
xor eax, eax
lea edi, [ebp - 0x4c]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x24]
xor edx, edx
push eax
push 1
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x24], edx
push eax
push edx
mov dword [ebp - 0x1c], edx
call dword [sym.imp.ADVAPI32.dll_LsaOpenPolicy]
test eax, eax
js 0x5d54d2d2
lea eax, [ebp - 0x1c]
push eax
push 0xc
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_LsaQueryInformationPolicy]
mov edi, eax
test edi, edi
js 0x5d54d2c5
push dword [ebp + 8]
lea eax, [ebp - 0x2c]
push eax
call dword [sym.imp.ntdll.dll_RtlInitUnicodeString]
push 1
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ntdll.dll_RtlEqualUnicodeString]
test al, al
jne 0x5d54d2b3
push 1
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x1c]
add eax, 8
push eax
call dword [sym.imp.ntdll.dll_RtlEqualUnicodeString]
test al, al
je 0x5d54d2bc
mov dword [ebp - 0x20], 1
xor esi, esi
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_LsaFreeMemory]
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_LsaClose]
test esi, esi
je 0x5d54d2f2
push 0xc0000001
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x5d54d776
cmp dword [ebp - 0x20], ebx
je 0x5d54d306
xor edx, edx
mov ecx, 0x5d509f70
inc edx
mov dword [ebp - 0x1c], ecx
xor esi, esi
jmp 0x5d54d31b
mov eax, dword [ebp - 0x14]
push 2
pop edx
mov esi, dword [eax + 0x1c]
mov ecx, dword [eax]
mov dword [ebp - 0x1c], ecx
test esi, esi
jne 0x5d54d31b
mov esi, dword [ebp + 8]
push 0x5c
pop eax
dec edx
mov dword [ebp - 0x28], edx
cmp word [ecx], ax
jne 0x5d54d332
add ecx, 2
cmp word [ecx], ax
je 0x5d54d327
mov dword [ebp - 0x1c], ecx
lea eax, [ebp - 0x18]
mov edx, esi
push eax
call fcn.5d54ce34
lea eax, [ebp - 8]
push eax
push 0
push dword [ebp - 0x18]
push 0
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.NTDSAPI.dll_DsBindWithSpnExW]
mov esi, eax
mov dword [ebp - 0x24], esi
cmp dword [ebp - 0x18], ebx
je 0x5d54d368
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [ebp - 0x18], ebx
test esi, esi
je 0x5d54d387
cmp esi, 0x80000000
ja 0x5d54d382
mov eax, dword fs:[0x18]
mov edi, dword [eax + 0xbf4]
jmp 0x5d54d387
mov edi, 0xc0000001
cmp dword [ebp - 0x20], ebx
jne 0x5d54d398
push dword [ebp - 0x14]
call dword [sym.imp.netutils.dll_NetApiBufferFree]
and dword [ebp - 0x14], ebx
test esi, esi
jne 0x5d54d411
mov edx, dword [ebp + 8]
cmp dword [ebp + 8], ebx
jne 0x5d54d3a9
mov edx, 0x5d506eb8
mov ecx, dword [ebp + 0xc]
lea eax, [ebp - 0x10]
push eax
call fcn.5d54d0eb
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x5d54d706
lea ecx, [ebp - 0xc]
push ecx
push eax
push dword [ebp - 0x10]
push 1
push 2
push 0
push dword [ebp - 8]
call dword [sym.imp.NTDSAPI.dll_DsCrackNamesW]
mov edx, dword [ebp - 0x10]
mov esi, eax
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x24], esi
call fcn.5d54d0c0
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
and dword [ebp - 0x10], ebx
test esi, esi
je 0x5d54d486
mov eax, dword fs:[0x18]
mov edi, dword [eax + 0xbf4]
lea eax, [ebp - 8]
push eax
call dword [sym.imp.NTDSAPI.dll_DsUnBindW]
cmp dword [ebp - 0x28], ebx
je 0x5d54d757
cmp esi, 0x6ba
je 0x5d54d43e
cmp esi, 0x6bb
je 0x5d54d43e
cmp esi, 0x6be
je 0x5d54d43e
cmp esi, 0x6bf
jne 0x5d54d757
mov eax, dword [ebp + 8]
cmp dword [ebp + 8], ebx
jne 0x5d54d44b
mov eax, 0x5d506eb8
lea ecx, [ebp - 0x14]
push ecx
push 0x40000011
push 0
push 0
push eax
push 0
call dword [sym.imp.logoncli.dll_DsGetDcNameW]
mov dword [ebp - 0x24], eax
test eax, eax
jne 0x5d54d745
mov eax, dword [ebp - 0x14]
mov esi, dword [eax + 0x1c]
mov ecx, dword [eax]
mov dword [ebp - 0x1c], ecx
test esi, esi
jne 0x5d54d47e
mov esi, dword [ebp + 8]
mov edx, dword [ebp - 0x28]
jmp 0x5d54d31b
mov eax, dword [ebp - 0xc]
push 1
mov esi, dword [eax]
sub esi, 1
pop eax
mov dword [ebp - 0x1c], eax
js 0x5d54d637
imul edx, esi, 0xc
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], edx
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 4]
mov dword [ebp - 0x20], eax
mov edi, dword [eax + edx]
cmp edi, 5
jne 0x5d54d580
cmp dword [ebp + 8], 0
je 0x5d54d4f8
mov ecx, dword [ebp + 8]
mov eax, dword [eax + edx + 4]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x5d54d4eb
test dx, dx
je 0x5d54d4e7
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x5d54d4eb
add eax, 4
add ecx, 4
test dx, dx
jne 0x5d54d4c5
xor eax, eax
jmp 0x5d54d4f0
sbb eax, eax
or eax, 1
test eax, eax
je 0x5d54d57d
push 1
call fcn.5d5567fd
mov edi, eax
test edi, edi
je 0x5d54d6fd
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
push dword [ecx + esi*4]
push SysReAllocString
push edi
call fcn.5d55691a
cmp eax, 0xffffffff
je 0x5d54d6fd
push dword [ebp + 0x20]
mov eax, dword [ebp - 0xc]
push dword [ebp + 0x1c]
mov ecx, dword [ebp - 0x18]
push dword [ebp + 0x18]
mov eax, dword [eax + 4]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push edi
push dword [eax + ecx + 4]
mov ecx, dword [ebp - 0x30]
call fcn.5d54d1d3
push esi
push dword [ebp + 0xc]
mov ebx, eax
call fcn.5d556843
push edi
call fcn.5d55688c
xor eax, eax
inc eax
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword fs:[0x18]
mov dword [ebp - 0x24], eax
mov edi, dword [ecx + 0xbf4]
jmp 0x5d54d625
mov edx, dword [ebp - 0x18]
cmp edi, 7
jae 0x5d54d58e
mov edi, dword [edi*4 + 0x5d509f84]
jmp 0x5d54d593
mov edi, 0xc0000001
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx + 4]
mov eax, dword [eax + esi*4]
mov dword [ebp - 0x28], eax
test edi, edi
js 0x5d54d5ff
cmp dword [eax + 8], 2
jne 0x5d54d5fa
push dword [ebp + 0x20]
mov ecx, dword [ebp - 0x20]
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
push dword [eax + 4]
push dword [ecx + edx + 8]
mov ecx, dword [ebp - 0x30]
push dword [ebp + 8]
push dword [eax]
call fcn.5d54a954
push esi
push dword [ebp + 0xc]
mov ebx, eax
call fcn.5d556843
push 0
push dword [ebp - 0x28]
call fcn.5d54bf10
test ebx, ebx
jne 0x5d54d625
push dword [ebp - 0xc]
call dword [sym.imp.NTDSAPI.dll_DsFreeNameResultW]
lea eax, [ebp - 8]
push eax
call dword [sym.imp.NTDSAPI.dll_DsUnBindW]
jmp 0x5d54d712
mov dword [eax + 0xc], esi
jmp 0x5d54d628
push esi
push ecx
call fcn.5d556843
push 0
push dword [ebp - 0x28]
call fcn.5d54bf10
push edi
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
xor ebx, ebx
mov dword [ebp - 0x1c], eax
mov edx, dword [ebp - 0x18]
sub edx, 0xc
sub esi, 1
mov dword [ebp - 0x18], edx
jns 0x5d54d4a3
mov eax, dword [ebp + 0xc]
cmp dword [eax], 0
je 0x5d54d721
mov edx, dword [ebp - 0xc]
lea ecx, [ebp - 0x10]
and dword [ebp - 0x18], 0
and dword [ebp - 0x20], 0
push ecx
mov ecx, eax
call fcn.5d54d062
mov ebx, eax
mov dword [ebp - 0x28], ebx
test ebx, ebx
je 0x5d54d6fd
lea eax, [ebp - 0x18]
push eax
push ebx
push dword [ebp - 0x10]
push 8
push 1
push 0
push dword [ebp - 8]
call dword [sym.imp.NTDSAPI.dll_DsCrackNamesW]
mov esi, eax
lea eax, [ebp - 0x20]
push eax
push ebx
push dword [ebp - 0x10]
push 3
push 1
push 0
push dword [ebp - 8]
call dword [sym.imp.NTDSAPI.dll_DsCrackNamesW]
push dword [ebp + 0x20]
neg eax
mov ecx, dword [ebp - 0x30]
push dword [ebp + 0x1c]
sbb eax, eax
push dword [ebp + 0x18]
not eax
and eax, dword [ebp - 0x20]
neg esi
push eax
sbb esi, esi
not esi
and esi, dword [ebp - 0x18]
push esi
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
call fcn.5d54aaa8
push dword [ebp - 0x28]
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0x18], 0
je 0x5d54d6e1
push dword [ebp - 0x18]
call dword [sym.imp.NTDSAPI.dll_DsFreeNameResultW]
cmp dword [ebp - 0x20], 0
je 0x5d54d6f0
push dword [ebp - 0x20]
call dword [sym.imp.NTDSAPI.dll_DsFreeNameResultW]
test ebx, ebx
jne 0x5d54d721
xor esi, esi
mov edi, 0xc0000017
jmp 0x5d54d724
push dword [ebp - 0xc]
call dword [sym.imp.NTDSAPI.dll_DsFreeNameResultW]
lea eax, [ebp - 8]
push eax
call dword [sym.imp.NTDSAPI.dll_DsUnBindW]
xor ebx, ebx
mov edi, 0xc0000017
push edi
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
push eax
jmp 0x5d54d76e
mov esi, dword [ebp - 0x1c]
push dword [ebp - 0xc]
call dword [sym.imp.NTDSAPI.dll_DsFreeNameResultW]
lea eax, [ebp - 8]
push eax
call dword [sym.imp.NTDSAPI.dll_DsUnBindW]
test ebx, ebx
jne 0x5d54d774
test esi, esi
jne 0x5d54d759
test edi, edi
jns 0x5d54d759
jmp 0x5d54d717
push 0xc0000001
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor ebx, ebx
push 0xc0000001
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret 0x1c