Function at 0x4f164c
Capabilities:
Get session information
Get session user name
Print debug messages

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0xf
push 0
push 0
dec ecx
jne 0x4f1654
push ebx
push esi
xor eax, eax
push ebp
push 0x4f1bfb
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x14]
push eax
push 1
push 0
push 0
call sub.wtsapi32.dll_WTSEnumerateSessionsA
mov dword [ebp - 0x10], 0xffff
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0xc]
mov eax, dword [eax + 0x3b4]
mov dword [ebp - 0x24], eax
mov byte [ebp - 0x29], 0
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x24]
call fcn.0047eeec
mov eax, dword [ebp - 0x1c]
test eax, eax
jle 0x4f16d7
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x20], 1
mov eax, dword [ebp - 0x14]
mov edx, dword [eax]
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x24]
xor ecx, ecx
mov ebx, dword [eax]
call dword [ebx]
add dword [ebp - 0x14], 0xc
inc dword [ebp - 0x20]
dec dword [ebp - 0x3c]
jne 0x4f16ba
sub dword [ebp - 0x14], 0xc
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0xc]
mov eax, dword [eax + 0x3b8]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x1c]
test eax, eax
jle 0x4f1836
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x20], 1
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 8]
sub eax, 1
jb 0x4f172a
jne 0x4f1826
mov eax, dword [ebp - 0x14]
mov eax, dword [eax]
mov dword [ebp - 0x24], eax
cmp eax, dword [ebp - 0x28]
jne 0x4f1826
mov byte [ebp - 0x29], 1
jmp 0x4f1826
mov eax, dword [ebp - 0x14]
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
cmp eax, dword [ebp - 0x28]
jne 0x4f173b
mov byte [ebp - 0x29], 1
mov eax, dword [0x50f470]
mov eax, dword [eax]
call fcn.0047f244
xor eax, eax
push ebp
push 0x4f181f
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0xc]
mov eax, dword [eax + 0x3b4]
cmp eax, dword [ebp - 0x10]
je 0x4f1805
push 0
mov eax, dword [0x50f470]
mov eax, dword [eax]
xor ecx, ecx
mov edx, dword [ebp - 0x10]
call fcn.0047f328
test al, al
jne 0x4f1805
push 0x4f1c14
mov eax, dword [ebp - 0x28]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x40]
call fcn.0040b0e4
push dword [ebp - 0x40]
push 0x4f1c34
mov eax, dword [ebp - 0x10]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x44]
call fcn.0040b0e4
push dword [ebp - 0x44]
push 0x4f1c44
lea eax, [ebp - 0x48]
mov edx, dword [ebp - 0x14]
mov edx, dword [edx + 4]
call fcn.004066d4
push dword [ebp - 0x48]
lea eax, [ebp - 8]
mov edx, 6
call fcn.00406870
mov eax, dword [ebp - 8]
call fcn.0040696c
push eax
call sub.kernel32.dll_OutputDebugStringA
push 0
mov ecx, dword [ebp - 0x10]
mov dl, 1
mov eax, dword [0x4ee994]
call fcn.004ee9f4
mov edx, eax
mov eax, dword [0x50f470]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [eax]
call dword [ebx]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4f1826
mov eax, dword [0x50f470]
mov eax, dword [eax]
call fcn.0047f544
ret
sub dword [ebp - 0x14], 0xc
inc dword [ebp - 0x20]
dec dword [ebp - 0x3c]
jne 0x4f16ff
cmp dword [ebp - 0x10], 0xffff
jne 0x4f1931
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0xc]
mov eax, dword [eax + 0x3b4]
cmp eax, dword [ebp - 0x10]
je 0x4f193d
mov eax, dword [0x50f470]
mov eax, dword [eax]
call fcn.0047f244
xor eax, eax
push ebp
push 0x4f192a
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
mov eax, dword [0x50f470]
mov eax, dword [eax]
xor ecx, ecx
mov ebx, dword [ebp - 0x10]
mov edx, ebx
call fcn.0047f328
test al, al
jne 0x4f1910
push 0x4f1c50
mov eax, dword [ebp - 0x28]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x4c]
call fcn.0040b0e4
push dword [ebp - 0x4c]
push 0x4f1c34
mov eax, dword [ebp - 0x10]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x50]
call fcn.0040b0e4
push dword [ebp - 0x50]
push 0x4f1c44
lea eax, [ebp - 0x54]
mov edx, dword [ebp - 0x14]
mov edx, dword [edx + 4]
call fcn.004066d4
push dword [ebp - 0x54]
lea eax, [ebp - 0xc]
mov edx, 6
call fcn.00406870
mov eax, dword [ebp - 0xc]
call fcn.0040696c
push eax
call sub.kernel32.dll_OutputDebugStringA
push 0
mov ecx, dword [ebp - 0x10]
mov dl, 1
mov eax, dword [0x4ee994]
call fcn.004ee9f4
mov edx, eax
mov eax, dword [0x50f470]
mov eax, dword [eax]
mov ecx, ebx
mov ebx, dword [eax]
call dword [ebx]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4f193d
mov eax, dword [0x50f470]
mov eax, dword [eax]
call fcn.0047f544
ret
cmp byte [ebp - 0x29], 0
je 0x4f193d
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x18]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x28]
cmp eax, dword [ebp - 0x10]
je 0x4f1b13
push 0x4f1c70
mov eax, dword [ebp - 0x10]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x58]
call fcn.0040b0e4
push dword [ebp - 0x58]
push 0x4f1c84
lea eax, [ebp - 4]
mov edx, 3
call fcn.00406870
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x30]
push eax
push 5
mov eax, dword [ebp - 0x10]
push eax
push 0
call sub.wtsapi32.dll_WTSQuerySessionInformationA
test eax, eax
je 0x4f19b6
lea eax, [ebp - 0x5c]
mov edx, dword [ebp - 0x30]
call fcn.004066d4
mov edx, dword [ebp - 0x5c]
lea eax, [ebp - 4]
call fcn.004067a8
mov eax, dword [ebp - 0x30]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
xor eax, eax
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x30]
push eax
push 0xa
mov eax, dword [ebp - 0x10]
push eax
push 0
call sub.wtsapi32.dll_WTSQuerySessionInformationA
test eax, eax
je 0x4f1a1a
push dword [ebp - 4]
push 0x4f1c94
lea eax, [ebp - 0x60]
mov edx, dword [ebp - 0x30]
call fcn.004066d4
push dword [ebp - 0x60]
lea eax, [ebp - 4]
mov edx, 3
call fcn.00406870
lea eax, [ebp - 0x64]
mov edx, dword [ebp - 0x30]
call fcn.004066d4
mov eax, dword [ebp - 0x64]
test eax, eax
je 0x4f1a0e
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x30]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
cmp dword [ebp - 0x34], 0
jbe 0x4f1ab8
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x38]
push eax
push 0xe
mov eax, dword [ebp - 0x10]
push eax
push 0
call sub.wtsapi32.dll_WTSQuerySessionInformationA
test eax, eax
je 0x4f1ab8
cmp dword [ebp - 0x38], 0
je 0x4f1aaf
push dword [ebp - 4]
push 0x4f1ca4
lea edx, [ebp - 0x68]
mov eax, dword [ebp - 0x38]
movzx eax, byte [eax + 6]
call fcn.0040aff8
push dword [ebp - 0x68]
push 0x4f1cb4
lea edx, [ebp - 0x6c]
mov eax, dword [ebp - 0x38]
movzx eax, byte [eax + 7]
call fcn.0040aff8
push dword [ebp - 0x6c]
push 0x4f1cb4
lea edx, [ebp - 0x70]
mov eax, dword [ebp - 0x38]
movzx eax, byte [eax + 8]
call fcn.0040aff8
push dword [ebp - 0x70]
push 0x4f1cb4
lea edx, [ebp - 0x74]
mov eax, dword [ebp - 0x38]
movzx eax, byte [eax + 9]
call fcn.0040aff8
push dword [ebp - 0x74]
lea eax, [ebp - 4]
mov edx, 9
call fcn.00406870
mov eax, dword [ebp - 0x38]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x30]
push eax
push 6
mov eax, dword [ebp - 0x10]
push eax
push 0
call sub.wtsapi32.dll_WTSQuerySessionInformationA
test eax, eax
je 0x4f1b03
cmp dword [ebp - 0x34], 0
jbe 0x4f1afa
push dword [ebp - 4]
push 0x4f1cc0
lea eax, [ebp - 0x78]
mov edx, dword [ebp - 0x30]
call fcn.004066d4
push dword [ebp - 0x78]
lea eax, [ebp - 4]
mov edx, 3
call fcn.00406870
mov eax, dword [ebp - 0x30]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0xc]
mov ecx, dword [ebp - 4]
mov dl, 3
call fcn.004f4b08
mov eax, dword [0x50f470]
mov eax, dword [eax]
call fcn.0047f244
xor eax, eax
push ebp
push 0x4f1bcc
push dword fs:[eax]
mov dword fs:[eax], esp
lea edx, [ebp - 0x20]
mov eax, dword [0x50f470]
mov eax, dword [eax]
call fcn.0047f4ac
mov ebx, eax
test ebx, ebx
je 0x4f1ba7
push 0
push 0
mov edx, dword [ebx + 0x10]
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x24]
xor ecx, ecx
mov esi, dword [eax]
call dword [esi + 4]
test al, al
jne 0x4f1b90
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x28], eax
mov eax, dword [ebx + 0xc]
call fcn.004055b0
lea edx, [ebp - 0x20]
mov eax, dword [0x50f470]
mov eax, dword [eax]
mov ecx, ebx
call fcn.0047f4f4
mov ebx, eax
push 0
mov eax, dword [0x50f470]
mov eax, dword [eax]
xor ecx, ecx
mov edx, dword [ebp - 0x28]
call fcn.0047efb8
jmp 0x4f1ba3
lea edx, [ebp - 0x20]
mov eax, dword [0x50f470]
mov eax, dword [eax]
mov ecx, ebx
call fcn.0047f4f4
mov ebx, eax
test ebx, ebx
jne 0x4f1b42
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4f1bd3
mov eax, dword [0x50f470]
mov eax, dword [eax]
call fcn.0047f544
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x24]
call fcn.0047eeec
ret