Function at 0x4013e0
Capabilities:
Compare security identifiers
Enumerate processes on remote desktop session host

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
push str.GetRealUserToken_In
mov esi, ecx
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], 0
call fcn.004010f0
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 4
test esi, esi
je 0x40144b
lea eax, [ebp - 0x10]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_ConvertStringSidToSidW]
test eax, eax
jne 0x40144b
call ebx
push eax
push str.GetRealUserToken___:_ConvertStringSidToSid___err___d_n
call fcn.004010f0
add esp, 8
cmp dword [ebp - 0x10], 0
je 0x401479
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x14]
push eax
push 1
push 0
push 0
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateProcessesW]
test eax, eax
jne 0x401479
call ebx
push eax
push str.GetRealUserToken___:_WTSEnumerateProcesses___err___d_n
call fcn.004010f0
add esp, 8
cmp dword [ebp - 0xc], 0
je 0x401513
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
je 0x4014b7
push 0
push 0
push 0x400
lea ecx, [ebp - 0x1c]
push ecx
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
jne 0x4014b7
call ebx
push eax
push str.GetRealUserToken___:_DuplicateHandle___err___d_n
call fcn.004010f0
add esp, 8
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x4014e2
lea ecx, [ebp - 4]
push ecx
push 0xf01ff
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x4014e2
call ebx
push eax
push str.GetRealUserToken___:_OpenProcessToken___err___d_n
call fcn.004010f0
add esp, 8
mov eax, dword [ebp - 4]
test eax, eax
je 0x401513
push ecx
mov edx, str.SeBackupPrivilege
mov ecx, eax
call fcn.00401170
mov ecx, dword [ebp - 4]
mov edx, str.SeRestorePrivilege
call fcn.00401170
mov ecx, dword [ebp - 4]
mov edx, str.SeIncreaseQuotaPrivilege
call fcn.00401170
add esp, 4
cmp dword [ebp - 0xc], 0
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x20], 0
jbe 0x40160d
xor edi, edi
nop dword [eax]
cmp dword [ebp - 4], 0
je 0x40160d
cmp dword [ebp - 0x18], 0
jne 0x40160d
mov eax, dword [ebp - 0x14]
mov eax, dword [edi + eax + 0xc]
test eax, eax
je 0x4015fa
push eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x4015fa
mov eax, dword [ebp - 0x14]
mov dword [ebp - 8], 0
push dword [edi + eax + 4]
push 0
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
test esi, esi
je 0x4015a7
lea eax, [ebp - 8]
push eax
push 0xb
push esi
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x4015a7
call ebx
push eax
push str.OpenProcessToken___failed__GetLastError__:__d_n
call fcn.004010f0
add esp, 8
mov eax, dword [ebp - 8]
test eax, eax
je 0x4015db
lea ecx, [ebp - 0x18]
push ecx
push 1
push 3
push 0
push 0x2000000
push eax
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x4015d8
call ebx
push eax
push str.DuplicateTokenEx___failed__GetLastError__:__d_n
call fcn.004010f0
add esp, 8
mov eax, dword [ebp - 8]
test esi, esi
je 0x4015ed
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
mov eax, dword [ebp - 8]
jmp 0x4015f3
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x4015fa
push eax
call esi
mov eax, dword [ebp - 0x20]
add edi, 0x10
inc eax
mov dword [ebp - 0x20], eax
cmp eax, dword [ebp - 0xc]
jb 0x401530
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x401617
push eax
call esi
mov eax, dword [ebp - 4]
test eax, eax
je 0x401621
push eax
call esi
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x40162f
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x40163d
push eax
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
push dword [ebp - 0x18]
push str.GetRealUserToken_Out__ret__0x_x_n
call fcn.004010f0
mov eax, dword [ebp - 0x18]
add esp, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret