Function at 0x4613ec
Capabilities:
Get session user name

Disassembly:
push 0x6ec
mov eax, 0x5ad085
call fcn.00588aeb
mov dword [ebp - 0x6f0], ecx
push 0x5d19f4
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 5
call fcn.00423f75
add esp, 0xc
lea ecx, [ebp - 0x6dc]
call fcn.0046e7a3
and dword [ebp - 4], 0
xor esi, esi
and dword [ebp - 0x6e4], esi
xor edi, edi
push str.Advapi32.dll
mov dword [ebp - 0x6e0], edi
call fcn.004042ad
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x46145e
push str.Advapi32.dll_SAW_LoadLibrary_failed._n
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 4
call fcn.00423f75
add esp, 0xc
jmp 0x4615fa
cmp dword [ebp - 0x668], esi
je 0x4615fa
xor eax, eax
mov esi, 0x206
push esi
push eax
mov word [ebp - 0x420], ax
lea eax, [ebp - 0x41e]
push eax
call fcn.00587a70
xor eax, eax
push esi
push eax
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x216]
push eax
call fcn.00587a70
push str.Wtsapi32.dll
mov dword [ebp - 0x6ec], 0x104
call fcn.004042ad
mov esi, eax
add esp, 0x1c
test esi, esi
jne 0x4614c1
push str.Wtsapi32.dll_SAW_LoadLibrary_failed._n
jmp 0x46144a
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WTSQuerySessionInformationW
push esi
call edi
mov dword [ebp - 0x6f4], eax
test eax, eax
jne 0x4614f8
push str.WTSQuerySessionInformationW_GetProcAddress_failed._n
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 4
call fcn.00423f75
mov edi, dword [ebp - 0x6e0]
add esp, 0xc
jmp 0x4615fa
push str.WTSFreeMemory
push esi
call edi
mov edi, eax
test edi, edi
jne 0x46150d
push str.WTSFreeMemory_GetProcAddress_failed._n
jmp 0x4614de
lea eax, [ebp - 0x6f8]
push eax
lea eax, [ebp - 0x6e8]
push eax
push 5
push 0xffffffffffffffff
push 0
call dword [ebp - 0x6f4]
test eax, eax
jne 0x461532
push str.GetUserName_failed._n
jmp 0x4614de
push dword [ebp - 0x6e8]
lea eax, [ebp - 0x420]
push 0x104
push eax
call fcn.0058b0b1
add esp, 0xc
push dword [ebp - 0x6e8]
call edi
lea eax, [ebp - 0x6ec]
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
je 0x46152b
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x420]
push eax
xor esi, esi
call fcn.0058b527
pop ecx
pop ecx
test eax, eax
je 0x4615f8
push str.GetExplorerUserToken.__n
mov edi, str.CUserPrivilege::ImpersonateActiveSessionUser
push edi
push 4
call fcn.00423f75
mov ecx, dword [ebp - 0x6f0]
add esp, 0xc
lea eax, [ebp - 0x6e4]
push eax
call fcn.00460d4d
test eax, eax
je 0x4615f8
push str.Start_Impersonation.__n
push edi
push 4
call fcn.00423f75
add esp, 0xc
push dword [ebp - 0x6e4]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
mov edi, eax
test edi, edi
jne 0x4615fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ImpersonateLoggedOnUser_failed.___1_d___n
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 4
call fcn.00423f75
add esp, 0x10
jmp 0x4615fa
mov edi, esi
cmp dword [ebp - 0x6e4], 0
je 0x461616
push dword [ebp - 0x6e4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp - 0x6e4], 0
test ebx, ebx
je 0x461621
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
je 0x46162c
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push 0x5d1a10
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 5
call fcn.00423f75
or dword [ebp - 4], 0xffffffff
add esp, 0xc
lea ecx, [ebp - 0x6dc]
call fcn.0046ee6e
mov eax, edi
call fcn.00588a9a
ret