Function at 0x410310
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.00410000
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 0x410363
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WTSEnumerateProcesses___failed__GetLastError__:__d_n
call fcn.00410000
add esp, 8
xor eax, eax
jmp 0x4105fd
mov dword [ebp - 0xc], 0
mov edx, dword [ebp - 8]
sub edx, 1
mov dword [ebp - 0x14], edx
jmp 0x41037e
mov eax, dword [ebp - 0x14]
sub eax, 1
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jle 0x4105ee
mov ecx, dword [ebp - 0x14]
shl ecx, 4
mov edx, dword [ebp - 0x10]
cmp dword [edx + ecx + 0xc], 0
je 0x4105e9
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 0x4103cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ConvertSidToStringSid___failed__GetLastError__:__d_n
call fcn.00410000
add esp, 8
jmp 0x410375
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0xc]
push edx
call fcn.004038e2
add esp, 8
test eax, eax
jne 0x4105e9
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 0x41042a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x414574
call fcn.00410000
add esp, 8
jmp 0x410375
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 0x410464
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DuplicateHandle___failed__GetLastError__:__d_n
call fcn.00410000
add esp, 8
mov eax, dword [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x410375
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
push str.SeBackupPrivilege
mov edx, dword [ebp - 0x24]
push edx
call fcn.00410240
add esp, 0xc
test eax, eax
jne 0x4104a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4145f8
call fcn.00410000
add esp, 8
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x410375
push 1
push str.SeRestorePrivilege
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.00410240
add esp, 0xc
test eax, eax
jne 0x4104e2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x41464c
call fcn.00410000
add esp, 8
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x410375
push 1
push str.SeIncreaseQuotaPrivilege
mov eax, dword [ebp - 0x24]
push eax
call fcn.00410240
add esp, 0xc
test eax, eax
jne 0x41051c
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.00410000
add esp, 8
jmp 0x410375
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 0x410578
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenProcessToken___failed__GetLastError__:__d_n
call fcn.00410000
add esp, 8
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x410375
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 0x4105c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DuplicateTokenEx___failed__GetLastError__:__d_n
call fcn.00410000
add esp, 8
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x410375
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.00410000
add esp, 8
mov eax, dword [ebp - 0x20]
jmp 0x4105fd
jmp 0x410375
push str.GetRealUserToken_returns_NULL_n
call fcn.00410000
add esp, 4
xor eax, eax
mov esp, ebp
pop ebp
ret