Function at 0x4015b0
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.004012d0
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 4
test esi, esi
je 0x40161b
lea eax, [ebp - 0x10]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_ConvertStringSidToSidW]
test eax, eax
jne 0x40161b
call ebx
push eax
push str.GetRealUserToken___:_ConvertStringSidToSid___err___d_n
call fcn.004012d0
add esp, 8
cmp dword [ebp - 0x10], 0
je 0x401649
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 0x401649
call ebx
push eax
push str.GetRealUserToken___:_WTSEnumerateProcesses___err___d_n
call fcn.004012d0
add esp, 8
cmp dword [ebp - 0xc], 0
je 0x4016e3
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test eax, eax
je 0x401687
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 0x401687
call ebx
push eax
push str.GetRealUserToken___:_DuplicateHandle___err___d_n
call fcn.004012d0
add esp, 8
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x4016b2
lea ecx, [ebp - 4]
push ecx
push 0xf01ff
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x4016b2
call ebx
push eax
push str.GetRealUserToken___:_OpenProcessToken___err___d_n
call fcn.004012d0
add esp, 8
mov eax, dword [ebp - 4]
test eax, eax
je 0x4016e3
push ecx
mov edx, 0x43224c
mov ecx, eax
call fcn.00401340
mov ecx, dword [ebp - 4]
mov edx, 0x432270
call fcn.00401340
mov ecx, dword [ebp - 4]
mov edx, 0x432298
call fcn.00401340
add esp, 4
cmp dword [ebp - 0xc], 0
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x20], 0
jbe 0x4017dd
xor edi, edi
lea esp, [esp]
cmp dword [ebp - 4], 0
je 0x4017dd
cmp dword [ebp - 0x18], 0
jne 0x4017dd
mov eax, dword [ebp - 0x14]
mov eax, dword [edi + eax + 0xc]
test eax, eax
je 0x4017ca
push eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x4017ca
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 0x401777
lea eax, [ebp - 8]
push eax
push 0xb
push esi
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x401777
call ebx
push eax
push str.OpenProcessToken___failed__GetLastError__:__d_n
call fcn.004012d0
add esp, 8
mov eax, dword [ebp - 8]
test eax, eax
je 0x4017ab
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 0x4017a8
call ebx
push eax
push str.DuplicateTokenEx___failed__GetLastError__:__d_n
call fcn.004012d0
add esp, 8
mov eax, dword [ebp - 8]
test esi, esi
je 0x4017bd
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
mov eax, dword [ebp - 8]
jmp 0x4017c3
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x4017ca
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 0x401700
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x4017e7
push eax
call esi
mov eax, dword [ebp - 4]
test eax, eax
je 0x4017f1
push eax
call esi
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4017ff
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x40180d
push eax
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
push dword [ebp - 0x18]
push str.GetRealUserToken_Out__ret__0x_x_n
call fcn.004012d0
mov eax, dword [ebp - 0x18]
add esp, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret