Function at 0x4cb0d0
Capabilities:
Enumerate processes on remote desktop session host

Disassembly:
push 0xffffffffffffffff
push 0x5616e6
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5b3890]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
xor ebx, ebx
test byte [0x5be894], 1
jne 0x4cb138
or dword [0x5be894], 1
push ebx
push str.WTSQueryUserToken
push str.Wtsapi32.dll
push ebx
mov ecx, 0x5be648
mov dword [esp + 0x50], ebx
call fcn.0049a270
push 0x56a8b0
call fcn.005194de
add esp, 4
mov dword [esp + 0x40], 0xffffffff
cmp dword [0x5be644], ebx
jne 0x4cb169
mov ecx, 0x5be648
call fcn.00499ed0
test eax, eax
je 0x4cb15a
mov dword [0x5be644], 0x4ca9e0
jmp 0x4cb169
mov ecx, 0x5be648
call fcn.00499f30
mov dword [0x5be644], eax
mov ebp, dword [esp + 0x48]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea ecx, [esp + 0x20]
push ecx
push eax
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x18]
push eax
push 1
push ebx
push ebx
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
mov esi, eax
cmp esi, ebx
je 0x4cb1b0
mov ecx, dword [esp + 0x14]
cmp ecx, ebx
jne 0x4cb255
cmp byte [0x5be640], bl
jne 0x4cb400
mov byte [0x5be640], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0x20], eax
cmp eax, 0x6a6
jne 0x4cb241
push str.GlobalTermSrvReadyEvent
push ebx
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenEventW]
mov esi, eax
cmp esi, ebx
jne 0x4cb200
xor eax, eax
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
cmp dword [0x5b2e94], ebx
je 0x4cb225
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, edi
push 0x3e8
push esi
call edi
cmp eax, ebx
je 0x4cb225
sub dword [0x5b2e94], 1
jne 0x4cb210
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x18]
push edx
push 1
push ebx
push ebx
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
mov esi, eax
cmp esi, ebx
je 0x4cb3f7
mov ecx, dword [esp + 0x14]
cmp ecx, ebx
je 0x4cb3f7
xor esi, esi
mov dword [esp + 0x48], esi
cmp dword [esp + 0x1c], ebx
jbe 0x4cb3db
xor edi, edi
jmp 0x4cb270
mov edx, dword [0x5be644]
cmp edx, 0x4ca9e0
setne al
cmp al, bl
jne 0x4cb290
mov eax, dword [esp + 0x20]
cmp eax, dword [edi + ecx]
je 0x4cb3c1
mov ecx, dword [edi + ecx]
lea eax, [esp + 0x18]
push eax
push ecx
call edx
cmp eax, ebx
jne 0x4cb325
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0x20], eax
cmp eax, 0x7a
jne 0x4cb317
call fcn.0045e770
cmp dword [0x5b1f24], 0xffffffff
mov esi, eax
jne 0x4cb2de
push 0x5b1f24
mov dword [0x5b1f24], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
mov ecx, esi
call fcn.0046b950
test eax, eax
je 0x4cb317
cmp dword [0x5b1f24], ebx
setg al
cmp al, bl
je 0x4cb317
mov eax, fcn.004ca710
cmp dword [0x5be644], eax
je 0x4cb3c1
mov dword [0x5be644], eax
mov eax, dword [esp + 0x14]
mov ecx, dword [edi + eax]
lea edx, [esp + 0x18]
push edx
push ecx
call fcn.004ca710
cmp eax, ebx
jne 0x4cb325
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0x20], eax
jmp 0x4cb3c1
mov edx, dword [esp + 0x18]
push edx
push ebx
call fcn.00404130
add esp, 4
mov ecx, eax
call fcn.00490d50
mov esi, eax
cmp esi, ebx
je 0x4cb3b6
mov ecx, dword [esi]
lea eax, [esp + 0x24]
push eax
push ecx
push ebx
call fcn.00404130
add esp, 4
mov ecx, eax
call fcn.0048f5f0
mov edx, dword [esp + 0x24]
push 0xffffffffffffffff
push edx
lea ecx, [esp + 0x30]
call fcn.0049eff0
mov dword [esp + 0x28], vtable.cWCStr.0
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x18]
push eax
push ecx
mov ecx, ebp
mov dword [esp + 0x48], 1
call fcn.004cac90
mov edx, dword [esp + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
push esi
call fcn.0051d586
add esp, 4
lea ecx, [esp + 0x28]
mov dword [esp + 0x40], 0xffffffff
mov dword [esp + 0x28], vtable.cWCS.0
call fcn.0049ee80
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x48]
mov ecx, dword [esp + 0x14]
inc esi
add edi, 0xc
mov dword [esp + 0x48], esi
cmp esi, dword [esp + 0x1c]
jb 0x4cb270
push ecx
call sub.WTSAPI32.dll_WTSFreeMemory
mov eax, esi
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 0x20], eax
push ebp
call fcn.004cae20
add esp, 4
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret