Function at 0x417331
Capabilities:
Get domain controller name
Get hostname
Get user security identifier

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x114
mov eax, dword [0x41d174]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0xd0], eax
mov eax, dword [ebp + 0x18]
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov dword [ebp - 0xc4], eax
mov eax, dword [ebp + 0x1c]
and dword [eax], 0
push 0x40
mov dword [ebp - 0xe8], eax
pop ebx
lea eax, [ebp - 0xec]
push eax
lea eax, [ebp - 0xc0]
push eax
lea eax, [ebp - 0x64]
push eax
lea eax, [ebp - 0xb0]
mov dword [ebp - 0xd4], ecx
lea ecx, [ebp - 0xa4]
push eax
mov eax, ecx
mov dword [ebp - 0xb8], 1
mov dword [ebp - 0xac], ecx
mov dword [ebp - 0xc0], 0x10
mov dword [ebp - 0xb0], ebx
push eax
jmp 0x417412
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x417428
cmp dword [ebp - 0xc0], 0x10
ja 0x417420
cmp dword [ebp - 0xb0], ebx
jbe 0x417420
push dword [ebp - 0xb0]
call fcn.0040928d
pop ecx
mov dword [ebp - 0xac], eax
test eax, eax
je 0x417868
lea eax, [ebp - 0xec]
push eax
lea eax, [ebp - 0xc0]
push eax
lea eax, [ebp - 0x64]
push eax
lea eax, [ebp - 0xb0]
push eax
push dword [ebp - 0xac]
push esi
push 0
call edi
test eax, eax
je 0x4173bd
jmp 0x4176fc
xor eax, eax
inc eax
jmp 0x417888
cmp eax, 0x534
jne 0x417868
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenW]
push esi
call ebx
inc eax
mov dword [ebp - 0xa8], 0
je 0x417492
lea edi, [ebp - 0x24]
mov ecx, esi
sub edi, esi
cmp dword [ebp - 0xa8], 0xf
ja 0x417868
movzx edx, word [ecx]
test dx, dx
je 0x417868
cmp dx, 0x5c
je 0x417485
inc dword [ebp - 0xa8]
mov word [edi + ecx], dx
inc ecx
inc ecx
cmp dword [ebp - 0xa8], eax
jb 0x417450
jmp 0x417492
mov ecx, dword [ebp - 0xa8]
xor eax, eax
mov word [ebp + ecx*2 - 0x24], ax
lea eax, [ebp - 0xf0]
push eax
lea eax, [ebp - 0x44]
push eax
mov dword [ebp - 0xf0], 0x10
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
test eax, eax
je 0x4174d0
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x44]
push eax
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x4174d0
and dword [ebp - 0xb8], eax
jmp 0x417868
lea eax, [ebp - 0xc8]
push eax
push 0x10000
xor eax, eax
push eax
push eax
lea ecx, [ebp - 0x24]
push ecx
push eax
call dword [sym.imp.logoncli.dll_DsGetDcNameW]
test eax, eax
jne 0x417868
lea edi, [ebp - 0x110]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0xfc]
mov dword [ebp - 0x100], eax
mov eax, dword [ebp - 0xc8]
mov dword [ebp - 0xfc], 0xc
mov dword [ebp - 0xf8], 2
mov byte [ebp - 0xf4], 1
mov byte [ebp - 0xf3], 0
mov dword [ebp - 0x114], 0x18
mov eax, dword [eax]
push eax
mov dword [ebp - 0xe0], eax
call ebx
add eax, eax
mov word [ebp - 0xe4], ax
mov eax, dword [ebp - 0xe4]
add eax, 2
mov word [ebp - 0xe2], ax
lea eax, [ebp - 0xcc]
push eax
push 0x800
lea eax, [ebp - 0x114]
push eax
lea eax, [ebp - 0xe4]
push eax
call sub.ADVAPI32.dll_LsaOpenPolicy
push dword [ebp - 0xc8]
mov edi, eax
call sub.netutils.dll_NetApiBufferFree
test edi, edi
jne 0x417868
and dword [ebp - 0xbc], edi
and dword [ebp - 0xb4], edi
push esi
mov dword [ebp - 0xd8], esi
call ebx
add eax, eax
mov word [ebp - 0xdc], ax
mov eax, dword [ebp - 0xdc]
add eax, 2
mov word [ebp - 0xda], ax
lea eax, [ebp - 0xb4]
push eax
lea eax, [ebp - 0xbc]
push eax
lea eax, [ebp - 0xdc]
push eax
push 1
push dword [ebp - 0xcc]
call sub.ADVAPI32.dll_LsaLookupNames
push dword [ebp - 0xcc]
mov esi, eax
call sub.ADVAPI32.dll_LsaClose
cmp esi, edi
je 0x417626
cmp dword [ebp - 0xbc], edi
je 0x417608
push dword [ebp - 0xbc]
call sub.ADVAPI32.dll_LsaFreeMemory
cmp dword [ebp - 0xb4], edi
je 0x41761b
push dword [ebp - 0xb4]
call sub.ADVAPI32.dll_LsaFreeMemory
mov dword [ebp - 0xb8], edi
jmp 0x417868
mov eax, dword [ebp - 0xb4]
mov eax, dword [eax + 8]
mov ecx, dword [ebp - 0xbc]
imul eax, eax, 0xc
mov ecx, dword [ecx + 4]
mov esi, dword [eax + ecx + 8]
mov edi, dword [sym.imp.ADVAPI32.dll_GetSidSubAuthorityCount]
push esi
call edi
mov bl, byte [eax]
mov eax, dword [ebp - 0xb4]
cmp dword [eax], 3
mov byte [ebp - 0xa8], bl
je 0x417663
inc bl
mov byte [ebp - 0xa8], bl
push dword [ebp - 0xa8]
call dword [sym.imp.ADVAPI32.dll_GetSidLengthRequired]
mov dword [ebp - 0xb0], eax
cmp eax, 0x40
jbe 0x4176a6
push eax
call fcn.0040928d
pop ecx
mov dword [ebp - 0xac], eax
test eax, eax
jne 0x4176a6
push dword [ebp - 0xbc]
call sub.ADVAPI32.dll_LsaFreeMemory
push dword [ebp - 0xb4]
call sub.ADVAPI32.dll_LsaFreeMemory
jmp 0x417868
push esi
push dword [ebp - 0xac]
push dword [ebp - 0xb0]
call dword [sym.imp.ADVAPI32.dll_CopySid]
push dword [ebp - 0xac]
call edi
mov byte [eax], bl
mov eax, dword [ebp - 0xb4]
cmp dword [eax], 3
je 0x4176e6
lea esi, [eax + 4]
movzx eax, bl
dec eax
push eax
push dword [ebp - 0xac]
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov ecx, dword [esi]
mov dword [eax], ecx
push dword [ebp - 0xbc]
call sub.ADVAPI32.dll_LsaFreeMemory
push dword [ebp - 0xb4]
call sub.ADVAPI32.dll_LsaFreeMemory
xor ebx, ebx
cmp dword [0x42316c], ebx
je 0x417709
mov dword [ebp + 0x10], ebx
mov edi, dword [ebp - 0xac]
push edi
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthorityCount]
movzx eax, byte [eax]
push eax
call dword [sym.imp.ADVAPI32.dll_GetSidLengthRequired]
mov dword [ebp - 0xb0], eax
cmp dword [ebp + 0x10], ebx
je 0x417750
cmp eax, dword [ebp + 0x14]
jne 0x417745
mov edi, dword [ebp + 0x10]
mov esi, dword [ebp - 0xac]
mov ecx, eax
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x41783b
mov dword [ebp - 0xb8], ebx
jmp 0x417868
mov ecx, dword [ebp - 0xd4]
push edi
call fcn.0041721c
test eax, eax
je 0x417802
lea eax, [ebp - 0xa8]
push eax
push edi
mov dword [ebp - 0xa8], ebx
call sub.ADVAPI32.dll_ConvertSidToStringSidW
test eax, eax
je 0x417802
push dword [ebp - 0xa8]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea esi, [eax + eax + 2]
push esi
call dword [sym.imp.ole32.dll_CoTaskMemAlloc]
push dword [ebp - 0xa8]
mov edi, eax
cmp edi, ebx
jne 0x4177b3
mov dword [ebp - 0xb8], ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x417868
push esi
push edi
call fcn.00415be5
push dword [ebp - 0xa8]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp esi, ebx
jge 0x4177de
push edi
mov dword [ebp - 0xb8], ebx
call dword [sym.imp.ole32.dll_CoTaskMemFree]
jmp 0x417868
push dword [ebp - 0xac]
mov ecx, dword [ebp - 0xd4]
push dword [ebp - 0xb0]
push edi
push dword [ebp - 0xd0]
call fcn.00417247
test eax, eax
jl 0x417868
jmp 0x41782f
mov esi, dword [ebp - 0xd0]
mov eax, dword [esi]
push esi
call dword [eax + 0x40]
test eax, eax
jl 0x417868
mov eax, dword [esi]
push edi
push dword [ebp - 0xb0]
push 3
push esi
call dword [eax + 0x50]
test eax, eax
jl 0x417868
mov eax, dword [esi]
push esi
call dword [eax + 0x48]
test eax, eax
jl 0x41783b
mov eax, dword [ebp - 0xc4]
mov dword [eax], 1
push dword [ebp - 0xb0]
call fcn.0040928d
pop ecx
mov ecx, dword [ebp - 0xe8]
mov dword [ecx], eax
cmp eax, ebx
je 0x417868
push dword [ebp - 0xb0]
push dword [ebp - 0xac]
push eax
call fcn.00412cd6
add esp, 0xc
lea eax, [ebp - 0xa4]
cmp dword [ebp - 0xac], eax
je 0x417882
push dword [ebp - 0xac]
call fcn.004092a2
pop ecx
mov eax, dword [ebp - 0xb8]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00412cc0
leave
ret 0x18