Function at 0x4a5b30
Capabilities:
Get session user name

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x234
mov eax, dword [0x5552b0]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
lea eax, [ebp - 0x22c]
xor edi, edi
push eax
mov dword [ebp - 0x22c], edi
call fcn.004a5870
add esp, 4
test eax, eax
je 0x4a5d54
mov edx, dword [ebp - 0x22c]
lea ecx, [ebp - 0x230]
push ecx
push edx
mov dword [ebp - 0x230], edi
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
je 0x4a5c34
mov eax, dword [ebp - 0x230]
push eax
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x4a5bf1
lea ecx, [ebp - 0x22c]
push ecx
push edi
mov dword [ebp - 0x22c], edi
mov edi, dword [sym.imp.Secur32.dll_GetUserNameExW]
push 2
call edi
mov eax, dword [ebp - 0x22c]
cmp eax, dword [esi]
jae 0x4a5bd8
push esi
push ebx
push 2
call edi
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov eax, 1
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e4746
mov esp, ebp
pop ebp
ret
mov dword [esi], eax
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e4746
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
mov dword [ebp - 0x22], ecx
mov dword [ebp - 0x1e], ecx
mov dword [ebp - 0x1a], ecx
mov dword [ebp - 0x16], ecx
mov dword [ebp - 0x12], ecx
mov dword [ebp - 0xe], ecx
mov dword [ebp - 0xa], ecx
mov word [ebp - 6], cx
push 0xa
lea ecx, [ebp - 0x24]
push ecx
xor edx, edx
push eax
mov word [ebp - 0x24], dx
call fcn.004e534f
add esp, 0xc
lea edx, [ebp - 0x24]
mov ecx, 0x5235e4
jmp 0x4a5d5e
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
mov dword [ebp - 0x22], ecx
mov dword [ebp - 0x1e], ecx
mov dword [ebp - 0x1a], ecx
mov dword [ebp - 0x16], ecx
mov dword [ebp - 0x12], ecx
mov dword [ebp - 0xe], ecx
mov dword [ebp - 0xa], ecx
mov word [ebp - 6], cx
push 0xa
lea ecx, [ebp - 0x24]
push ecx
xor edx, edx
push eax
mov word [ebp - 0x24], dx
call fcn.004e534f
add esp, 0xc
push str.GetLoginName
lea edx, [ebp - 0x24]
mov ecx, 0x523630
call fcn.004a3f00
add esp, 4
push 0xfe
lea eax, [ebp - 0x126]
xor edx, edx
push edi
push eax
mov word [ebp - 0x128], dx
call fcn.004e8ba0
add esp, 0xc
push 0xfe
lea edx, [ebp - 0x226]
xor ecx, ecx
push edi
push edx
mov word [ebp - 0x228], cx
call fcn.004e8ba0
add esp, 0xc
push edi
push edi
lea edx, [ebp - 0x228]
lea ecx, [ebp - 0x128]
call fcn.004b4850
add esp, 8
test eax, eax
jne 0x4a5ce1
mov edx, str.Failed
mov ecx, str.GetLogonInfo
jmp 0x4a5d5e
lea eax, [ebp - 0x128]
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4a5cf0
sub eax, edx
sar eax, 1
cmp eax, edi
jbe 0x4a5d6b
lea eax, [ebp - 0x228]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4a5d10
sub eax, edx
sar eax, 1
cmp eax, edi
jbe 0x4a5d6b
lea eax, [ebp - 0x228]
push eax
lea ecx, [ebp - 0x128]
push ecx
push str._s_s
push ebx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
mov eax, 1
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e4746
mov esp, ebp
pop ebp
ret
mov edx, str.Cant_get_active_session_id
mov ecx, str.GetCurrentActiveSessionID
push str.GetLoginName
call fcn.004a3f00
add esp, 4
mov ecx, dword [ebp - 4]
xor ecx, ebp
xor eax, eax
pop edi
call fcn.004e4746
mov esp, ebp
pop ebp
ret