Function at 0x140020050
Capabilities:
Get session user name

Disassembly:
push rbp
push rdi
push r15
lea rbp, [rsp - 0x2e0]
sub rsp, 0x3e0
mov rax, qword [0x14005b040]
xor rax, rsp
mov qword [rbp + 0x2d0], rax
xor edi, edi
mov dword [rsp + 0x48], 0x118
cmp dword [0x14005d898], edi
mov r15d, ecx
je 0x1400200a6
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r8d, eax
lea rdx, str.__X_______RunAsService_r_n
lea rcx, [0x14005d9b0]
call fcn.140019c40
lea rdx, [rsp + 0x48]
lea rcx, [rbp + 0xa0]
call qword [sym.imp.ADVAPI32.dll_GetUserNameA]
test eax, eax
je 0x140020293
cmp dword [rsp + 0x48], edi
jbe 0x140020293
cmp dword [0x14005d898], edi
mov qword [rsp + 0x408], rsi
je 0x1400200fd
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r8d, eax
lea r9, [rbp + 0xa0]
lea rdx, str.__X__Current_User_Name_is___s__r_n
lea rcx, [0x14005d9b0]
call fcn.140019c40
mov qword [rsp + 0x400], rbx
lea rcx, str.advapi32.dll
mov qword [rsp + 0x410], r14
mov dword [rsp + 0x48], 0x118
mov qword [rsp + 0x40], rdi
mov dword [rsp + 0x4c], 0x104
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rsi, rax
test rax, rax
je 0x1400201c1
lea rdx, str.ConvertStringSidToSidA
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.LookupAccountSidA
mov rcx, rsi
mov r14, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rbx, rax
test r14, r14
je 0x1400201c1
test rax, rax
je 0x1400201c1
lea rdx, [rsp + 0x40]
lea rcx, str.S_1_5_18
call r14
test eax, eax
je 0x1400201c1
mov rdx, qword [rsp + 0x40]
lea rax, [rsp + 0x50]
mov qword [rsp + 0x30], rax
lea r9, [rsp + 0x48]
lea rax, [rsp + 0x4c]
xor ecx, ecx
mov qword [rsp + 0x28], rax
lea r8, [rbp - 0x80]
lea rax, [rbp + 0x1c0]
mov qword [rsp + 0x20], rax
call rbx
mov rcx, qword [rsp + 0x40]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_LocalFree]
test ebx, ebx
jne 0x1400201e3
lea r8, str.SYSTEM
mov dword [rsp + 0x48], 7
mov edx, 0x118
lea rcx, [rbp - 0x80]
call fcn.1400270dc
test rsi, rsi
je 0x1400201ec
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov r14, qword [rsp + 0x410]
mov rsi, qword [rsp + 0x408]
mov rbx, qword [rsp + 0x400]
cmp dword [rsp + 0x48], edi
jbe 0x14002027c
cmp dword [0x14005d898], edi
je 0x140020232
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r8d, eax
lea r9, [rbp - 0x80]
lea rdx, str.__X__Local_System_Account_Name_is___s__r_n
lea rcx, [0x14005d9b0]
call fcn.140019c40
test r15d, r15d
jne 0x14002024b
lea rdx, [rbp - 0x80]
lea rcx, [rbp + 0xa0]
call fcn.140033578
test eax, eax
jne 0x1400202b7
lea rax, str.DHCPServer
mov qword [rsp + 0x68], rdi
mov qword [rsp + 0x58], rax
lea rcx, [rsp + 0x58]
lea rax, [0x14001bf50]
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x60], rax
call qword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherA]
mov edi, eax
jmp 0x1400202b7
cmp dword [0x14005d898], edi
je 0x1400202df
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea rdx, str.__X__LookupLocalSystemAccountName_failed_r_n
jmp 0x1400202a8
cmp dword [0x14005d898], edi
je 0x1400202df
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea rdx, str.__X__GetUserName_failed_r_n
mov r8d, eax
lea rcx, [0x14005d9b0]
call fcn.140019c40
cmp dword [0x14005d898], 0
je 0x1400202df
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r9d, edi
lea rdx, str.__X_______RunAsService_returns__d_r_n
mov r8d, eax
lea rcx, [0x14005d9b0]
call fcn.140019c40
mov eax, edi
mov rcx, qword [rbp + 0x2d0]
xor rcx, rsp
call fcn.140020e70
add rsp, 0x3e0
pop r15
pop rdi
pop rbp
ret