Function at 0x4fb988
Capabilities:
Get session information
Get session user name

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffed4
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0x11c], eax
mov dword [ebp - 0x120], eax
mov dword [ebp - 0x124], eax
mov dword [ebp - 0x128], eax
mov dword [ebp - 0x12c], eax
xor eax, eax
push ebp
push 0x4fbc43
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 4]
push eax
push 1
push 0
push 0
call sub.wtsapi32.dll_WTSEnumerateSessionsA
mov eax, dword [ebp - 4]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp + 8]
add eax, 0xfffffffc
mov ecx, 1
mov edx, dword [0x4fb968]
call fcn.00407958
add esp, 4
cmp dword [ebp - 0xc], 0
jbe 0x4fba10
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
xor ecx, ecx
mov edx, 0x80
call fcn.00404e90
mov edi, dword [ebp - 0xc]
dec edi
test edi, edi
jl 0x4fbc1c
inc edi
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x10], eax
mov esi, ebx
shl esi, 4
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
mov edx, dword [ebp - 4]
mov edx, dword [edx]
mov dword [eax + esi*8], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
mov edx, dword [ebp - 4]
mov edx, dword [edx + 8]
mov dword [eax + esi*8 + 4], edx
lea eax, [ebp - 0x118]
mov edx, dword [ebp - 4]
mov edx, dword [edx + 4]
call fcn.00405000
lea edx, [ebp - 0x118]
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
lea eax, [eax + esi*8 + 0x1e]
mov cl, 0x1e
call fcn.00404d80
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push 5
mov eax, dword [ebp - 4]
mov eax, dword [eax]
push eax
push 0
call sub.wtsapi32.dll_WTSQuerySessionInformationA
test eax, eax
je 0x4fbab8
lea eax, [ebp - 0x118]
mov edx, dword [ebp - 0x10]
call fcn.00405000
lea edx, [ebp - 0x118]
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
lea eax, [eax + esi*8 + 9]
mov cl, 0x14
call fcn.00404d80
mov eax, dword [ebp - 0x10]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push 0xa
mov eax, dword [ebp - 4]
mov eax, dword [eax]
push eax
push 0
call sub.wtsapi32.dll_WTSQuerySessionInformationA
test eax, eax
je 0x4fbb01
lea eax, [ebp - 0x118]
mov edx, dword [ebp - 0x10]
call fcn.00405000
lea edx, [ebp - 0x118]
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
lea eax, [eax + esi*8 + 0x3d]
mov cl, 0x1e
call fcn.00404d80
mov eax, dword [ebp - 0x10]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
cmp byte [eax + esi*8 + 0x3d], 0
je 0x4fbbf0
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x18]
push eax
push 0xe
mov eax, dword [ebp - 4]
mov eax, dword [eax]
push eax
push 0
call sub.wtsapi32.dll_WTSQuerySessionInformationA
test eax, eax
je 0x4fbbf0
cmp dword [ebp - 0x18], 0
je 0x4fbbe7
lea edx, [ebp - 0x120]
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 6]
call fcn.0040aff8
push dword [ebp - 0x120]
push 0x4fbc5c
lea edx, [ebp - 0x124]
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 7]
call fcn.0040aff8
push dword [ebp - 0x124]
push 0x4fbc5c
lea edx, [ebp - 0x128]
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 8]
call fcn.0040aff8
push dword [ebp - 0x128]
push 0x4fbc5c
lea edx, [ebp - 0x12c]
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 9]
call fcn.0040aff8
push dword [ebp - 0x12c]
lea eax, [ebp - 0x11c]
mov edx, 7
call fcn.00406870
mov edx, dword [ebp - 0x11c]
lea eax, [ebp - 0x118]
mov ecx, 0xff
call fcn.00406778
lea edx, [ebp - 0x118]
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
lea eax, [eax + esi*8 + 0x5c]
mov cl, 0xf
call fcn.00404d80
mov eax, dword [ebp - 0x18]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
mov eax, dword [ebp - 4]
mov eax, dword [eax]
mov edx, dword [0x50f238]
mov edx, dword [edx]
cmp eax, dword [edx + 0x3b8]
jne 0x4fbc10
mov eax, dword [ebp + 8]
mov eax, dword [eax - 4]
mov byte [eax + esi*8 + 8], 1
add dword [ebp - 4], 0xc
inc ebx
dec edi
jne 0x4fba1f
mov eax, dword [ebp - 8]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4fbc4a
lea eax, [ebp - 0x12c]
mov edx, 5
call fcn.004064f0
ret