Function at 0x406920
Capabilities:
Get domain controller name
Get domain information
Get user security identifier

Disassembly:
push 0xffffffffffffffff
push 0x435248
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push ebx
push ebp
push esi
push edi
mov eax, dword [0x449fb0]
xor eax, esp
push eax
lea eax, [esp + 0x44]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [edi + 4]
mov eax, dword [eax - 0xc]
lea esi, [edi + 4]
test eax, eax
je 0x406dba
mov eax, dword [edi + 0xc]
lea ebx, [edi + 0xc]
mov dword [esp + 0x34], ebx
test eax, eax
je 0x406975
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebx], 0
cmp dword [edi + 8], 0
je 0x406993
mov esi, dword [esi]
push ebx
push esi
call sub.ADVAPI32.dll_ConvertStringSidToSidW
test eax, eax
jne 0x406dba
mov dword [ebx], eax
jmp 0x406eaf
call fcn.00414de3
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4069ad
push 0x80004005
call fcn.00401090
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [esp + 0x14], edi
mov dword [esp + 0x4c], 0
call fcn.00414de3
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4069df
push 0x80004005
call fcn.00401090
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov byte [esp + 0x4c], 1
call fcn.00414de3
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x406a0e
push 0x80004005
call fcn.00401090
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
mov byte [esp + 0x4c], 2
call fcn.00414de3
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x406a3d
push 0x80004005
call fcn.00401090
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebp, [eax + 0x10]
mov dword [esp + 0x24], ebp
mov ebx, 0x1000
push ebx
push 0x40
mov byte [esp + 0x54], 3
mov dword [esp + 0x44], ebx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [esp + 0x38], ebx
xor ebx, ebx
mov dword [esp + 0x28], eax
mov eax, dword [esi]
mov dword [esp + 0x20], ebx
mov ecx, dword [eax - 0xc]
cmp ecx, ebx
mov dword [esp + 0x2c], ebx
jl 0x406c17
push 0x438814
push eax
call fcn.00420df2
add esp, 8
cmp eax, ebx
je 0x406c17
sub eax, dword [esi]
sar eax, 1
mov ebx, eax
cmp ebx, 0xffffffff
je 0x406c17
push ebx
lea ecx, [esp + 0x34]
push ecx
mov ecx, esi
call fcn.00402970
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x50], 4
call fcn.00403950
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
mov byte [esp + 0x4c], 3
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x406ae9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x1c]
call fcn.00403950
mov edx, dword [esi]
mov eax, dword [edx - 0xc]
sub eax, ebx
dec eax
push eax
lea eax, [esp + 0x34]
push eax
mov ecx, esi
call fcn.004028f0
push eax
lea ecx, [esp + 0x20]
mov byte [esp + 0x50], 5
call fcn.00403950
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
mov byte [esp + 0x4c], 3
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406b40
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [esp + 0x14]
mov eax, dword [edi - 0xc]
test eax, eax
je 0x406c0c
lea ecx, [esp + 0x20]
push ecx
push 0x80000000
push 0
push 0
push edi
push 0
call dword [sym.imp.NETAPI32.dll_DsGetDcNameW]
test eax, eax
jne 0x406c26
mov edx, dword [esp + 0x20]
mov eax, dword [edx]
push eax
lea ecx, [esp + 0x18]
call fcn.00404560
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0x1c]
push edx
lea ecx, [esp + 0x1c]
call fcn.00404560
push 2
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x1c]
mov dword [esp + 0x34], 1
call fcn.00402970
push 0x4385e4
push eax
call fcn.00401e90
add esp, 8
lea ecx, [esp + 0x30]
mov bl, al
call fcn.00402050
test bl, bl
je 0x406bfa
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx - 0xc]
add eax, 0xfffffffe
push eax
lea edx, [esp + 0x34]
push edx
lea ecx, [esp + 0x1c]
call fcn.004028f0
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x50], 6
call fcn.00403950
lea ecx, [esp + 0x30]
mov byte [esp + 0x4c], 3
call fcn.00402050
mov eax, dword [esp + 0x20]
test eax, eax
je 0x406c08
push eax
call sub.NETAPI32.dll_NetApiBufferFree
mov edi, dword [esp + 0x14]
mov edx, dword [edi - 0xc]
test edx, edx
jne 0x406c68
xor esi, esi
jmp 0x406c89
push esi
lea ecx, [esp + 0x20]
call fcn.00403950
jmp 0x406b44
lea eax, [esp + 0x30]
push eax
push 1
push edi
call sub.NETAPI32.dll_DsRoleGetPrimaryDomainInformation
test eax, eax
jne 0x406c0c
mov ecx, dword [esp + 0x30]
mov eax, dword [ecx]
cmp eax, 4
je 0x406c47
cmp eax, 5
jne 0x406c60
mov ecx, dword [ecx + 8]
push ecx
lea ecx, [esp + 0x1c]
call fcn.00404560
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x2c], 1
push ecx
call sub.NETAPI32.dll_DsRoleFreeMemory
jmp 0x406c0c
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, edx
or eax, ecx
jge 0x406c87
push edx
lea ecx, [esp + 0x18]
call fcn.00402160
mov edi, dword [esp + 0x14]
mov esi, edi
mov eax, dword [ebp - 8]
mov ecx, 1
sub ecx, dword [ebp - 4]
sub eax, 0x1000
or eax, ecx
jge 0x406caf
push 0x1000
lea ecx, [esp + 0x28]
call fcn.00402160
mov ebp, dword [esp + 0x24]
mov ebx, dword [esp + 0x1c]
lea edx, [esp + 0x40]
push edx
mov edx, dword [esp + 0x2c]
lea eax, [esp + 0x3c]
push eax
push ebp
lea ecx, [esp + 0x48]
push ecx
push edx
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
mov eax, dword [edi - 8]
push eax
push edi
je 0x406dda
call fcn.0042159c
add esp, 8
test eax, eax
jl 0x406dd0
cmp eax, dword [edi - 8]
jg 0x406dd0
mov dword [edi - 0xc], eax
xor ecx, ecx
mov word [edi + eax*2], cx
mov eax, dword [ebp - 8]
push eax
push ebp
call fcn.0042159c
add esp, 8
test eax, eax
jl 0x406dd0
cmp eax, dword [ebp - 8]
jg 0x406dd0
xor edx, edx
mov dword [ebp - 0xc], eax
mov word [ebp + eax*2], dx
cmp dword [edi - 0xc], edx
je 0x406d44
cmp dword [esp + 0x2c], edx
je 0x406d44
mov eax, dword [esp + 0x18]
push eax
push ebp
call fcn.00420d5f
add esp, 8
test eax, eax
jne 0x406d59
mov esi, dword [esp + 0x28]
push esi
call fcn.00401a30
mov ecx, dword [esp + 0x38]
add esp, 4
mov dword [ecx], eax
jmp 0x406d5d
mov esi, dword [esp + 0x28]
test esi, esi
je 0x406d68
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, dword [esp + 0x34]
cmp dword [edx], 0
lea ecx, [esp + 0x24]
jne 0x406d9a
call fcn.00402050
lea ecx, [esp + 0x1c]
call fcn.00402050
lea ecx, [esp + 0x18]
call fcn.00402050
lea ecx, [esp + 0x14]
call fcn.00402050
jmp 0x406eaf
call fcn.00402050
lea ecx, [esp + 0x1c]
call fcn.00402050
lea ecx, [esp + 0x18]
call fcn.00402050
lea ecx, [esp + 0x14]
call fcn.00402050
xor eax, eax
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
push 0x80070057
call fcn.00401090
call fcn.0042159c
add esp, 8
test eax, eax
jl 0x406dd0
cmp eax, dword [edi - 8]
jg 0x406dd0
mov dword [edi - 0xc], eax
xor ecx, ecx
mov word [edi + eax*2], cx
mov eax, dword [ebp - 8]
push eax
push ebp
call fcn.0042159c
add esp, 8
test eax, eax
jl 0x406dd0
cmp eax, dword [ebp - 8]
jg 0x406dd0
xor edx, edx
mov dword [ebp - 0xc], eax
mov word [ebp + eax*2], dx
mov eax, dword [esp + 0x28]
test eax, eax
je 0x406e23
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
add ebp, 0xfffffff0
mov byte [esp + 0x4c], 2
lea eax, [ebp + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x406e45
mov ecx, dword [ebp]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebp
call eax
lea eax, [ebx - 0x10]
mov byte [esp + 0x4c], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406e66
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov byte [esp + 0x4c], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406e8b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add edi, 0xfffffff0
mov dword [esp + 0x4c], 0xffffffff
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406eaf
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov eax, 6
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret