Function at 0x140003d62
Capabilities:
Get session user name

Disassembly:
push r15
push r14
push r13
push r12
sub rsp, 0x48
cmp qword [rcx + 0x20], 0
mov r12, rcx
jne 0x140003de2
lea r14, [rsp + 0x38]
xor ecx, ecx
mov dword [rsp + 0x38], 0
mov r13, qword [sym.imp.ADVAPI32.dll_GetUserNameA]
mov rdx, r14
call r13
test eax, eax
je 0x140003da4
lea rax, str.Error_getting_current_logon_account_name
jmp 0x140003fdd
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x140003d98
mov ecx, dword [rsp + 0x38]
test ecx, ecx
je 0x140003d98
call sub.msvcrt.dll_malloc
mov qword [r12 + 0x20], rax
mov rcx, rax
test rax, rax
je 0x140003d98
mov rdx, r14
call r13
test eax, eax
je 0x140003d98
mov rax, qword [r12 + 0x20]
test rax, rax
je 0x140003d98
cmp byte [rax], 0
je 0x140003d98
mov rcx, qword [r12]
xor edx, edx
call qword [sym.imp.WLDAP32.dll_ldap_open]
mov rcx, rax
mov qword [r12 + 0x28], rax
lea rax, str.Error_opening_LDAP_connection
test rcx, rcx
je 0x140003fdd
mov rdx, qword [r12 + 8]
mov r8, qword [r12 + 0x10]
test rdx, rdx
jne 0x140003e23
lea rdx, [0x1400d06f5]
test r8, r8
jne 0x140003e2f
jmp 0x140003e37
test r8, r8
jne 0x140003e2f
lea r8, [0x1400d06f5]
call qword [sym.imp.WLDAP32.dll_ldap_simple_bind_s]
jmp 0x140003e48
mov r9d, 0x486
xor r8d, r8d
xor edx, edx
call qword [sym.imp.WLDAP32.dll_ldap_bind_s]
test eax, eax
je 0x140003e60
mov rcx, r12
call fcn.140003d26
lea rax, str.Error_binding_LDAP
jmp 0x140003fdd
cmp qword [r12 + 0x18], 0
mov r14, qword [sym.imp.WLDAP32.dll_ldap_search]
jne 0x140003f1c
xor edx, edx
mov dword [rsp + 0x28], 0
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], 0
mov rcx, qword [r12 + 0x28]
call r14
mov edx, eax
cmp eax, 0xffffffff
je 0x140003f00
lea rax, [rsp + 0x38]
xor r9d, r9d
xor r8d, r8d
mov rcx, qword [r12 + 0x28]
mov qword [rsp + 0x20], rax
call qword [sym.imp.WLDAP32.dll_ldap_result]
cmp eax, 0x64
jne 0x140003f00
mov rcx, qword [r12 + 0x28]
mov rdx, qword [rsp + 0x38]
lea r8, str.defaultNamingContext
call qword [sym.imp.WLDAP32.dll_ldap_get_values]
mov r13, rax
test rax, rax
je 0x140003ef5
mov rcx, qword [rax]
test rcx, rcx
je 0x140003eec
call sub.msvcrt.dll__strdup
mov qword [r12 + 0x18], rax
mov rcx, r13
call qword [sym.imp.WLDAP32.dll_ldap_value_free]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WLDAP32.dll_ldap_msgfree]
cmp qword [r12 + 0x18], 0
jne 0x140003f1c
mov rcx, r12
call fcn.140003d26
lea rax, str.Error_getting_default_naming_context_from_LDAP
jmp 0x140003fdd
mov r15, qword [r12 + 0x20]
mov rcx, r15
call sub.msvcrt.dll_strlen
lea rcx, [rax + 0x10]
call sub.msvcrt.dll_malloc
lea rdx, str.sAMAccountName
mov r13, rax
mov rcx, rax
call sub.msvcrt.dll_strcpy
mov rdx, r15
mov rcx, r13
call sub.msvcrt.dll_strcat
mov dword [rsp + 0x28], 0
mov rdx, qword [r12 + 0x18]
mov r9, r13
mov qword [rsp + 0x20], 0
mov rcx, qword [r12 + 0x28]
mov r8d, 2
call r14
mov r14d, eax
cmp eax, 0xffffffff
jne 0x140003f8f
mov rcx, r12
call fcn.140003d26
lea rax, str.Error_searching_LDAP
jmp 0x140003fdd
mov rcx, r13
call fcn.14001b340
lea rax, [r12 + 0x30]
mov r8d, 1
mov edx, r14d
mov qword [rsp + 0x20], rax
mov rcx, qword [r12 + 0x28]
lea r9, [rsp + 0x38]
mov qword [rsp + 0x38], 5
call qword [sym.imp.WLDAP32.dll_ldap_result]
mov r8d, eax
xor eax, eax
cmp r8d, 0x65
je 0x140003fdd
mov rcx, r12
call fcn.140003d26
lea rax, str.Error_getting_LDAP_search_result
add rsp, 0x48
pop r12
pop r13
pop r14
pop r15
ret