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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov dword [ebp - 8], 0
mov dword [ebp - 4], 0
push str.GetRealUserToken_startss
call fcn.00410030
add esp, 4
lea eax, [ebp - 8]
push eax
lea ecx, [ebp - 0x10]
push ecx
push 1
push 0
push 0
call sub.WTSAPI32.dll_WTSEnumerateProcessesW
test eax, eax
jne 0x410393
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WTSEnumerateProcesses___failed__GetLastError__:__d_n
call fcn.00410030
add esp, 8
xor eax, eax
jmp 0x41062d
mov dword [ebp - 0xc], 0
mov edx, dword [ebp - 8]
sub edx, 1
mov dword [ebp - 0x14], edx
jmp 0x4103ae
mov eax, dword [ebp - 0x14]
sub eax, 1
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jle 0x41061e
mov ecx, dword [ebp - 0x14]
shl ecx, 4
mov edx, dword [ebp - 0x10]
cmp dword [edx + ecx + 0xc], 0
je 0x410619
lea eax, [ebp - 0xc]
push eax
mov ecx, dword [ebp - 0x14]
shl ecx, 4
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + ecx + 0xc]
push eax
call sub.ADVAPI32.dll_ConvertSidToStringSidW
test eax, eax
jne 0x4103fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ConvertSidToStringSid___failed__GetLastError__:__d_n
call fcn.00410030
add esp, 8
jmp 0x4103a5
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0xc]
push edx
call fcn.00403902
add esp, 8
test eax, eax
jne 0x410619
push 0
push 0
push 0x400
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
jne 0x41045a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x414570
call fcn.00410030
add esp, 8
jmp 0x4103a5
lea ecx, [ebp - 0x24]
push ecx
push 0xf01ff
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x410494
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DuplicateHandle___failed__GetLastError__:__d_n
call fcn.00410030
add esp, 8
mov eax, dword [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4103a5
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
push 0x4145d0
mov edx, dword [ebp - 0x24]
push edx
call fcn.00410270
add esp, 0xc
test eax, eax
jne 0x4104d8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4145f4
call fcn.00410030
add esp, 8
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4103a5
push 1
push 0x414620
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.00410270
add esp, 0xc
test eax, eax
jne 0x410512
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x414648
call fcn.00410030
add esp, 8
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4103a5
push 1
push 0x414674
mov eax, dword [ebp - 0x24]
push eax
call fcn.00410270
add esp, 0xc
test eax, eax
jne 0x41054c
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetPrivilege___failed__GetLastError__:__d_n
call fcn.00410030
add esp, 8
jmp 0x4103a5
mov edx, dword [ebp - 0x14]
shl edx, 4
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + edx + 4]
push ecx
push 0
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], 0
lea edx, [ebp - 0x1c]
push edx
push 0xb
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x4105a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenProcessToken___failed__GetLastError__:__d_n
call fcn.00410030
add esp, 8
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4103a5
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x20], 0
lea eax, [ebp - 0x20]
push eax
push 1
push 3
push 0
push 0x2000000
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x4105f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DuplicateTokenEx___failed__GetLastError__:__d_n
call fcn.00410030
add esp, 8
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4103a5
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x20]
push ecx
push str.GetRealUserToken_returns__d_n
call fcn.00410030
add esp, 8
mov eax, dword [ebp - 0x20]
jmp 0x41062d
jmp 0x4103a5
push str.GetRealUserToken_returns_NULL_n
call fcn.00410030
add esp, 4
xor eax, eax
mov esp, ebp
pop ebp
ret