Function at 0x4a9de0
Capabilities:
Get session user name

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x234
mov eax, dword [0x5322a8]
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.004a9b20
add esp, 4
test eax, eax
je 0x4aa004
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 0x4a9ee4
mov eax, dword [ebp - 0x230]
push eax
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x4a9ea1
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 0x4a9e88
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.004e3946
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.004e3946
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.004e45ff
add esp, 0xc
lea edx, [ebp - 0x24]
mov ecx, 0x524288
jmp 0x4aa00e
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.004e45ff
add esp, 0xc
push str.GetLoginName
lea edx, [ebp - 0x24]
mov ecx, 0x5242d4
call fcn.004a5a90
add esp, 4
push 0xfe
lea eax, [ebp - 0x126]
xor edx, edx
push edi
push eax
mov word [ebp - 0x128], dx
call fcn.004e7d90
add esp, 0xc
push 0xfe
lea edx, [ebp - 0x226]
xor ecx, ecx
push edi
push edx
mov word [ebp - 0x228], cx
call fcn.004e7d90
add esp, 0xc
push edi
push edi
lea edx, [ebp - 0x228]
lea ecx, [ebp - 0x128]
call fcn.004b5ce0
add esp, 8
test eax, eax
jne 0x4a9f91
mov edx, str.Failed
mov ecx, str.GetLogonInfo
jmp 0x4aa00e
lea eax, [ebp - 0x128]
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4a9fa0
sub eax, edx
sar eax, 1
cmp eax, edi
jbe 0x4aa01b
lea eax, [ebp - 0x228]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4a9fc0
sub eax, edx
sar eax, 1
cmp eax, edi
jbe 0x4aa01b
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.004e3946
mov esp, ebp
pop ebp
ret
mov edx, str.Cant_get_active_session_id
mov ecx, str.GetCurrentActiveSessionID
push str.GetLoginName
call fcn.004a5a90
add esp, 4
mov ecx, dword [ebp - 4]
xor ecx, ebp
xor eax, eax
pop edi
call fcn.004e3946
mov esp, ebp
pop ebp
ret