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

Disassembly:
mov rax, rsp
sub rsp, 0xe8
mov qword [rsp + 0xb0], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov qword [rax - 8], r12
mov qword [rax - 0x10], r13
mov qword [rax - 0x18], r14
mov qword [rax - 0x20], r15
mov rdi, rcx
lea r13, [rcx + 8]
mov rax, qword [r13]
cmp dword [rax - 0x10], 0
jne 0x4138ae
xor eax, eax
jmp 0x4141a3
lea r15, [rcx + 0x18]
mov rcx, qword [r15]
xor r12d, r12d
test rcx, rcx
je 0x4138c6
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov qword [r15], r12
cmp dword [rdi + 0x10], r12d
je 0x4138f1
mov rdx, r15
mov rcx, qword [r13]
call qword [sym.imp.ADVAPI32.dll_ConvertStringSidToSidW]
test eax, eax
jne 0x4138ea
mov qword [r15], r12
mov eax, 6
jmp 0x4141a3
xor eax, eax
jmp 0x4141a3
call fcn.00426d94
mov rdx, rax
mov ecx, r12d
test rax, rax
setne cl
test ecx, ecx
jne 0x413911
mov ecx, 0x80004005
call entry0
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
lea rsi, [rax + 0x18]
mov qword [rsp + 0x40], rsi
call fcn.00426d94
mov rdx, rax
mov ecx, r12d
test rax, rax
setne cl
test ecx, ecx
jne 0x413943
mov ecx, 0x80004005
call entry0
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x50], rax
call fcn.00426d94
mov rdx, rax
mov ecx, r12d
test rax, rax
setne cl
test ecx, ecx
jne 0x413975
mov ecx, 0x80004005
call entry0
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x48], rax
call fcn.00426d94
mov rdx, rax
mov ecx, r12d
test rax, rax
setne cl
test ecx, ecx
jne 0x4139a7
mov ecx, 0x80004005
call entry0
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x58], rbx
mov dword [rsp + 0x70], 0x1000
mov edx, 0x1000
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0xa0], rax
mov dword [rsp + 0x74], 0x1000
mov qword [rsp + 0x68], r12
mov dword [rsp + 0x60], r12d
mov rcx, qword [r13]
mov rbp, 0xffffffffffffffff
cmp dword [rcx - 0x10], 0
jl 0x413bd2
lea rdx, [0x004586f8]
call fcn.00437ec0
mov r14, rax
test rax, rax
je 0x413bd2
sub r14, qword [r13]
sar r14, 1
cmp r14d, ebp
je 0x413bd2
mov r8d, r14d
lea rdx, [rsp + 0xa8]
mov rcx, r13
call fcn.00416d80
nop
mov rdx, qword [rax]
lea rcx, [rdx - 0x18]
add rsi, 0xffffffffffffffe8
cmp rcx, rsi
je 0x413a95
cmp dword [rsi + 0x10], 0
jl 0x413a86
mov rax, qword [rsi]
cmp qword [rcx], rax
jne 0x413a86
call fcn.00417a50
mov rdi, rax
mov ecx, ebp
lock xadd dword [rsi + 0x10], ecx
add ecx, ebp
test ecx, ecx
jg 0x413a7b
mov rcx, qword [rsi]
mov rax, qword [rcx]
mov rdx, rsi
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea rax, [rdi + 0x18]
mov qword [rsp + 0x40], rax
jmp 0x413a95
mov r8d, dword [rdx - 0x10]
lea rcx, [rsp + 0x40]
call fcn.00417880
nop
mov rdx, qword [rsp + 0xa8]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x413ab8
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rdx, qword [rsp + 0x40]
lea rcx, [rdx - 0x18]
mov rdi, qword [rsp + 0x50]
add rdi, 0xffffffffffffffe8
cmp rcx, rdi
je 0x413b18
cmp dword [rdi + 0x10], 0
jl 0x413b0a
mov rax, qword [rdi]
cmp qword [rcx], rax
jne 0x413b0a
call fcn.00417a50
mov rsi, rax
mov ecx, ebp
lock xadd dword [rdi + 0x10], ecx
add ecx, 0xffffffff
test ecx, ecx
jg 0x413aff
mov rcx, qword [rdi]
mov rax, qword [rcx]
mov rdx, rdi
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea rax, [rsi + 0x18]
mov qword [rsp + 0x50], rax
jmp 0x413b18
mov r8d, dword [rdx - 0x10]
lea rcx, [rsp + 0x50]
call fcn.00417880
mov rax, qword [r13]
mov r8d, dword [rax - 0x10]
sub r8d, r14d
sub r8d, 1
lea rdx, [rsp + 0x98]
mov rcx, r13
call fcn.00416be0
nop
mov rdx, qword [rax]
lea rcx, [rdx - 0x18]
mov rdi, qword [rsp + 0x48]
add rdi, 0xffffffffffffffe8
cmp rcx, rdi
je 0x413b97
cmp dword [rdi + 0x10], 0
jl 0x413b88
mov rax, qword [rdi]
cmp qword [rcx], rax
jne 0x413b88
call fcn.00417a50
mov rsi, rax
mov ecx, ebp
lock xadd dword [rdi + 0x10], ecx
add ecx, 0xffffffff
test ecx, ecx
jg 0x413b7d
mov rcx, qword [rdi]
mov rax, qword [rcx]
mov rdx, rdi
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea rax, [rsi + 0x18]
mov qword [rsp + 0x48], rax
jmp 0x413b97
mov r8d, dword [rdx - 0x10]
lea rcx, [rsp + 0x48]
call fcn.00417880
nop
mov rdx, qword [rsp + 0x98]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x413bc6
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rsi, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x58]
jmp 0x413c3a
mov rsi, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x58]
jmp 0x413c3a
mov rdx, qword [r13]
lea rcx, [rdx - 0x18]
mov rdi, qword [rsp + 0x48]
add rdi, 0xffffffffffffffe8
cmp rcx, rdi
je 0x413c3a
cmp dword [rdi + 0x10], 0
jl 0x413c2c
mov rax, qword [rdi]
cmp qword [rcx], rax
jne 0x413c2c
call fcn.00417a50
mov rsi, rax
mov ecx, ebp
lock xadd dword [rdi + 0x10], ecx
add ecx, ebp
test ecx, ecx
jg 0x413c17
mov rcx, qword [rdi]
mov rax, qword [rcx]
mov rdx, rdi
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea rax, [rsi + 0x18]
mov qword [rsp + 0x48], rax
mov rsi, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x58]
jmp 0x413c3a
mov r8d, dword [rdx - 0x10]
lea rcx, [rsp + 0x48]
call fcn.00417880
mov r13d, 1
cmp dword [rsi - 0x10], 0
je 0x413e19
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x80000000
xor r9d, r9d
xor r8d, r8d
mov rdx, rsi
xor ecx, ecx
call qword [sym.imp.NETAPI32.dll_DsGetDcNameW]
test eax, eax
jne 0x413db2
mov rax, qword [rsp + 0x68]
mov rdx, qword [rax]
test rdx, rdx
jne 0x413c87
mov ecx, r12d
jmp 0x413c98
xor eax, eax
mov rcx, rbp
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
sub rcx, r13
mov r8d, ecx
lea rcx, [rsp + 0x40]
call fcn.00417880
mov rdx, qword [rsp + 0x68]
mov rdx, qword [rdx + 0x28]
test rdx, rdx
jne 0x413cb8
mov ecx, r12d
jmp 0x413cc9
xor eax, eax
mov rcx, rbp
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
sub rcx, r13
mov r8d, ecx
lea rcx, [rsp + 0x50]
call fcn.00417880
mov r14d, r13d
mov r8d, 2
lea rdx, [rsp + 0x80]
lea rcx, [rsp + 0x40]
call fcn.00416d80
xor edx, edx
lea rdi, [0x004586f0]
mov rsi, qword [rax]
mov ecx, 3
repe cmpsw word [rsi], word [rdi]
je 0x413d0c
sbb edx, edx
sbb edx, 0xffffffff
test edx, edx
sete dil
mov rdx, qword [rsp + 0x80]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x413d35
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
test dil, dil
je 0x413d8b
mov rax, qword [rsp + 0x40]
mov r8d, dword [rax - 0x10]
add r8d, 0xfffffffe
lea rdx, [rsp + 0x90]
lea rcx, [rsp + 0x40]
call fcn.00416be0
nop
mov rdx, rax
lea rcx, [rsp + 0x40]
call fcn.00417730
nop
mov rdx, qword [rsp + 0x90]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x413d8b
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x413da6
call sub.NETAPI32.dll_NetApiBufferFree
mov rsi, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x58]
jmp 0x413e25
mov rsi, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x58]
jmp 0x413e25
lea r8, [rsp + 0x78]
mov edx, r13d
mov rcx, rsi
call sub.NETAPI32.dll_DsRoleGetPrimaryDomainInformation
test eax, eax
jne 0x413e20
mov rcx, qword [rsp + 0x78]
mov eax, dword [rcx]
cmp eax, 4
je 0x413dd7
cmp eax, 5
jne 0x413e0d
mov rdx, qword [rcx + 8]
test rdx, rdx
jne 0x413de5
mov ecx, r12d
jmp 0x413df6
xor eax, eax
mov rcx, rbp
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
sub rcx, r13
mov r8d, ecx
lea rcx, [rsp + 0x50]
call fcn.00417880
mov r14d, r13d
mov rcx, qword [rsp + 0x78]
jmp 0x413e12
mov r14d, dword [rsp + 0x60]
call sub.NETAPI32.dll_DsRoleFreeMemory
jmp 0x413e25
mov r14d, dword [rsp + 0x60]
jmp 0x413e25
mov r14d, dword [rsp + 0x60]
mov edx, dword [rsi - 0x10]
test edx, edx
jne 0x413e31
mov rdi, r12
jmp 0x413e52
mov ecx, r13d
sub ecx, dword [rsi - 8]
mov eax, dword [rsi - 0xc]
sub eax, edx
or eax, ecx
jge 0x413e4f
lea rcx, [rsp + 0x40]
call fcn.004179f0
mov rsi, qword [rsp + 0x40]
mov rdi, rsi
sub r13d, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, 0x1000
or eax, r13d
jge 0x413e77
mov edx, 0x1000
lea rcx, [rsp + 0x58]
call fcn.004179f0
mov rbx, qword [rsp + 0x58]
lea rax, [rsp + 0x88]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x74]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x70]
mov r13, qword [rsp + 0xa0]
mov r8, r13
mov rdx, qword [rsp + 0x48]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0x414089
test rsi, rsi
jne 0x413ec3
mov ecx, r12d
jmp 0x413edd
xor eax, eax
mov rcx, rbp
mov rdi, rsi
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
test ecx, ecx
js 0x41407e
cmp ecx, dword [rsi - 0xc]
jg 0x41407e
mov dword [rsi - 0x10], ecx
movsxd rax, ecx
mov word [rsi + rax*2], 0
test rbx, rbx
je 0x413f14
xor eax, eax
mov rcx, rbp
mov rdi, rbx
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
mov r12d, ecx
test ecx, ecx
js 0x414073
cmp r12d, dword [rbx - 0xc]
jg 0x414073
mov dword [rbx - 0x10], r12d
movsxd rax, r12d
mov word [rbx + rax*2], 0
cmp dword [rsi - 0x10], 0
je 0x413f47
test r14d, r14d
je 0x413f47
mov rdx, qword [rsp + 0x50]
mov rcx, rbx
call fcn.00436d50
test eax, eax
jne 0x413f52
mov rcx, r13
call fcn.00415ba0
mov qword [r15], rax
test r13, r13
je 0x413f60
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_LocalFree]
cmp qword [r15], 0
jne 0x413ff0
lea rdx, [rbx - 0x18]
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x413f86
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x48]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x413fa7
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x50]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x413fc8
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x40]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], ebp
add ebp, 0xffffffff
test ebp, ebp
jg 0x413fe6
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, 6
jmp 0x4141a3
lea rdx, [rbx - 0x18]
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x41400c
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x48]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x41402d
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x50]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x41404e
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x40]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], ebp
add ebp, 0xffffffff
test ebp, ebp
jg 0x41406c
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
xor eax, eax
jmp 0x4141a3
mov ecx, 0x80070057
call entry0
int3
mov ecx, 0x80070057
call entry0
int3
test rsi, rsi
jne 0x414093
mov ecx, r12d
jmp 0x4140ad
xor eax, eax
mov rcx, rbp
mov rdi, rsi
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
test ecx, ecx
js 0x414198
cmp ecx, dword [rsi - 0xc]
jg 0x414198
mov dword [rsi - 0x10], ecx
movsxd rax, ecx
mov word [rsi + rax*2], 0
test rbx, rbx
je 0x4140e4
xor eax, eax
mov rcx, rbp
mov rdi, rbx
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
mov r12d, ecx
test ecx, ecx
js 0x41418d
cmp r12d, dword [rbx - 0xc]
jg 0x41418d
mov dword [rbx - 0x10], r12d
movsxd rax, r12d
mov word [rbx + rax*2], 0
test r13, r13
je 0x41410a
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_LocalFree]
nop
lea rdx, [rbx - 0x18]
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x414126
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x48]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x414147
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x50]
add rdx, 0xffffffffffffffe8
mov eax, ebp
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x414168
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x40]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], ebp
add ebp, 0xffffffff
test ebp, ebp
jg 0x414186
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, 6
jmp 0x4141a3
mov ecx, 0x80070057
call entry0
int3
mov ecx, 0x80070057
call entry0
nop
mov rbx, qword [rsp + 0xf0]
mov rbp, qword [rsp + 0xf8]
mov rsi, qword [rsp + 0x100]
mov rdi, qword [rsp + 0x108]
mov r12, qword [rsp + 0xe0]
mov r13, qword [rsp + 0xd8]
mov r14, qword [rsp + 0xd0]
mov r15, qword [rsp + 0xc8]
add rsp, 0xe8
ret