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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42baaa
mov eax, dword fs:[0]
push eax
sub esp, 0xfc
mov eax, dword [0x43c00c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
lea eax, [esi + 0xc0]
mov dword [ebp - 0x104], eax
mov eax, dword [eax]
test eax, eax
jne 0x407150
mov dword [ebp - 0xf0], eax
mov dword [ebp - 0xf8], eax
lea eax, [ebp - 0xf8]
push eax
lea eax, [ebp - 0xf0]
push eax
push 1
push 0
push 0
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateProcessesW]
test eax, eax
je 0x4071f4
lea eax, [ebp - 0xd0]
mov ecx, esi
push eax
call fcn.00406750
mov dword [ebp - 4], 0
lea ebx, [eax + 4]
mov dword [ebp - 0xe8], ebx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xd0]
call fcn.00401980
mov edi, dword [ebp - 0xf8]
dec edi
mov dword [ebp - 0x100], edi
test edi, edi
jle 0x40714e
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
shl edi, 4
mov dword [ebp - 0xf4], edi
nop dword [eax + eax]
mov eax, dword [ebp - 0xf0]
mov eax, dword [edi + eax + 0xc]
test eax, eax
je 0x407130
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x407130
mov eax, dword [ebp - 0xf0]
push dword [edi + eax + 4]
push 0
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov ebx, eax
mov dword [ebp - 0xec], ebx
mov dword [ebp - 4], 1
test ebx, ebx
jne 0x406ec8
mov dword [ebp - 4], 0xffffffff
jmp 0x40712a
mov dword [ebp - 0xe0], vtable.ATL::CAccessToken.0
mov dword [ebp - 0xdc], 0
mov dword [ebp - 0xd8], 0
mov dword [ebp - 0xd4], 0
mov byte [ebp - 4], 2
lea eax, [ebp - 0x108]
push eax
push 0xb
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x4070b1
mov eax, dword [ebp - 0xe0]
lea ecx, [ebp - 0xe0]
call dword [eax + 4]
mov eax, dword [ebp - 0x108]
push ecx
mov dword [ebp - 0xdc], eax
call fcn.00407270
add esp, 4
test al, al
je 0x40708c
mov edi, dword [ebp - 0xdc]
lea eax, [ebp - 0xe4]
push eax
push 0
push 0
push 0x19
push edi
mov dword [ebp - 0xe4], 0
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov dword [ebp - 0xfc], 0
mov byte [ebp - 4], 4
push dword [ebp - 0xe4]
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
mov dword [ebp - 0xfc], esi
test esi, esi
je 0x407242
lea eax, [ebp - 0xe4]
push eax
push dword [ebp - 0xe4]
push esi
push 0x19
push edi
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x40721b
push ecx
push dword [esi]
lea ecx, [ebp - 0x70]
call fcn.00407ce0
mov byte [ebp - 4], 5
lea eax, [ebp - 0x6c]
push eax
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthorityCount]
mov al, byte [eax]
movzx eax, al
dec eax
push eax
lea eax, [ebp - 0x6c]
push eax
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov edi, dword [eax]
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x70]
call fcn.00401980
mov byte [ebp - 4], 2
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [ebp - 0xfc], 0
cmp edi, 0x2000
je 0x407080
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0xd8]
mov eax, dword [ebp - 0xdc]
mov dword [ebp - 0xe0], vtable.ATL::CAccessToken.0
test ecx, ecx
je 0x40703a
test eax, eax
je 0x407030
push ecx
push eax
call dword [sym.imp.USERENV.dll_UnloadUserProfile]
mov eax, dword [ebp - 0xdc]
mov dword [ebp - 0xd8], 0
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x407051
push eax
call esi
mov dword [ebp - 0xdc], 0
push 4
push dword [ebp - 0xd4]
call fcn.0040cc5d
add esp, 8
mov dword [ebp - 0xd4], 0
mov dword [ebp - 4], 0xffffffff
push ebx
call esi
mov edi, dword [ebp - 0xf4]
jmp 0x407120
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0xf4]
push dword [ebp - 0x104]
push 1
push 3
push 0
push 0x2000000
push dword [ebp - 0xdc]
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x40716c
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0xd8]
mov eax, dword [ebp - 0xdc]
mov dword [ebp - 0xe0], vtable.ATL::CAccessToken.0
test ecx, ecx
je 0x4070eb
test eax, eax
je 0x4070e1
push ecx
push eax
call dword [sym.imp.USERENV.dll_UnloadUserProfile]
mov eax, dword [ebp - 0xdc]
mov dword [ebp - 0xd8], 0
test eax, eax
je 0x4070fc
push eax
call esi
mov dword [ebp - 0xdc], 0
push 4
push dword [ebp - 0xd4]
call fcn.0040cc5d
add esp, 8
mov dword [ebp - 0xd4], 0
mov dword [ebp - 4], 0xffffffff
push ebx
call esi
mov dword [ebp - 0xec], 0
mov ebx, dword [ebp - 0xe8]
mov eax, dword [ebp - 0x100]
sub edi, 0x10
dec eax
mov dword [ebp - 0xf4], edi
mov dword [ebp - 0x100], eax
test eax, eax
jg 0x406e70
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040c5eb
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x104]
mov edi, dword [eax]
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0xd8]
mov eax, dword [ebp - 0xdc]
mov dword [ebp - 0xe0], vtable.ATL::CAccessToken.0
test ecx, ecx
je 0x4071ae
test eax, eax
je 0x4071a4
push ecx
push eax
call dword [sym.imp.USERENV.dll_UnloadUserProfile]
mov eax, dword [ebp - 0xdc]
mov dword [ebp - 0xd8], 0
test eax, eax
je 0x4071bf
push eax
call esi
mov dword [ebp - 0xdc], 0
push 4
push dword [ebp - 0xd4]
call fcn.0040cc5d
add esp, 8
mov dword [ebp - 0xd4], 0
mov dword [ebp - 4], 0xffffffff
push ebx
call esi
mov dword [ebp - 0xec], 0
mov eax, edi
jmp 0x407150
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x407206
movzx eax, ax
or eax, 0x80070000
push eax
push 0x98
mov edx, str.Environment::GetActiveUserToken
mov ecx, str.c:_buildagentwork73b466a3166516aprojectscommonenvironment.cpp
call fcn.00405890
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x40722d
movzx eax, ax
or eax, 0x80070000
push eax
push 0x89
mov edx, str.GetIntegrityLevel
mov ecx, str.c:_buildagentwork73b466a3166516aprojectscommonenvironment.cpp
call fcn.00405890
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x407254
movzx eax, ax
or eax, 0x80070000
push eax
push 0x86
mov edx, str.GetIntegrityLevel
mov ecx, str.c:_buildagentwork73b466a3166516aprojectscommonenvironment.cpp
call fcn.00405890
int3