Function at 0x42be51
Capabilities:
Get session user name

Disassembly:
push 0x6ec
mov eax, 0x44b92e
call fcn.004386f7
mov dword [ebp - 0x6f0], ecx
push 0x456594
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 5
call fcn.00405a24
add esp, 0xc
lea ecx, [ebp - 0x6dc]
call fcn.004331f7
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.00401fef
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x42bec3
push str.Advapi32.dll_SAW_LoadLibrary_failed._n
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 4
call fcn.00405a24
add esp, 0xc
jmp 0x42c05f
cmp dword [ebp - 0x668], esi
je 0x42c05f
xor eax, eax
mov esi, 0x206
push esi
push eax
mov word [ebp - 0x420], ax
lea eax, [ebp - 0x41e]
push eax
call fcn.00438dc0
xor eax, eax
push esi
push eax
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x216]
push eax
call fcn.00438dc0
push str.Wtsapi32.dll
mov dword [ebp - 0x6ec], 0x104
call fcn.00401fef
mov esi, eax
add esp, 0x1c
test esi, esi
jne 0x42bf26
push str.Wtsapi32.dll_SAW_LoadLibrary_failed._n
jmp 0x42beaf
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WTSQuerySessionInformationW
push esi
call edi
mov dword [ebp - 0x6f4], eax
test eax, eax
jne 0x42bf5d
push str.WTSQuerySessionInformationW_GetProcAddress_failed._n
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 4
call fcn.00405a24
mov edi, dword [ebp - 0x6e0]
add esp, 0xc
jmp 0x42c05f
push str.WTSFreeMemory
push esi
call edi
mov edi, eax
test edi, edi
jne 0x42bf72
push str.WTSFreeMemory_GetProcAddress_failed._n
jmp 0x42bf43
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 0x42bf97
push str.GetUserName_failed._n
jmp 0x42bf43
push dword [ebp - 0x6e8]
lea eax, [ebp - 0x420]
push 0x104
push eax
call fcn.00439aca
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 0x42bf90
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.0043933f
pop ecx
pop ecx
test eax, eax
je 0x42c05d
push str.GetExplorerUserToken.__n
mov edi, str.CUserPrivilege::ImpersonateActiveSessionUser
push edi
push 4
call fcn.00405a24
mov ecx, dword [ebp - 0x6f0]
add esp, 0xc
lea eax, [ebp - 0x6e4]
push eax
call fcn.0042b7b2
test eax, eax
je 0x42c05d
push str.Start_Impersonation.__n
push edi
push 4
call fcn.00405a24
add esp, 0xc
push dword [ebp - 0x6e4]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
mov edi, eax
test edi, edi
jne 0x42c05f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ImpersonateLoggedOnUser_failed.___1_d___n
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 4
call fcn.00405a24
add esp, 0x10
jmp 0x42c05f
mov edi, esi
cmp dword [ebp - 0x6e4], 0
je 0x42c07b
push dword [ebp - 0x6e4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebp - 0x6e4], 0
test ebx, ebx
je 0x42c086
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
je 0x42c091
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push 0x4565b0
push str.CUserPrivilege::ImpersonateActiveSessionUser
push 5
call fcn.00405a24
or dword [ebp - 4], 0xffffffff
add esp, 0xc
lea ecx, [ebp - 0x6dc]
call fcn.004338c2
mov eax, edi
call fcn.004386a6
ret