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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff87c
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x784], ecx
mov dword [ebp - 0x780], ecx
mov dword [ebp - 4], edx
xor eax, eax
push ebp
push 0x40d7ca
push dword fs:[eax]
mov dword fs:[eax], esp
mov ecx, dword [ebp - 4]
mov edx, dword [0x54d2e0]
mov eax, dword [sym.imp.AxComponentsRTL.bpl__Axrtl_System_Strutils_StrUtils_]
call sub.AxComponentsRTL.bpl__Axrtl_System_Strutils_StrUtils_SameText_qqrx20System_UnicodeStringt1
test al, al
je 0x40d5ba
call sub.kernel32.dll_GetTickCount
mov edx, dword [0x54d2e4]
call sub.AxComponentsRTL.bpl__Axrtl_System_Sysutils_SysUtils_Sub_qqruiui
cmp eax, 0x1f4
jae 0x40d5ba
mov eax, dword [0x54d2dc]
mov dword [ebp - 8], eax
jmp 0x40d7ac
mov dword [ebp - 8], 0xffffffff
xor eax, eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x128], 0x114
lea eax, [ebp - 0x128]
push eax
call sub.kernel32.dll_GetVersionExW
test eax, eax
je 0x40d691
cmp dword [ebp - 0x118], 2
jne 0x40d691
xor eax, eax
mov dword [ebp - 8], eax
xor edx, edx
push ebp
push 0x40d687
push dword fs:[edx]
mov dword fs:[edx], esp
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x10]
push eax
push 1
push 0
push 0
call sub.wtsapi32.dll_WTSEnumerateProcessesW
mov esi, dword [ebp - 0x10]
xor edx, edx
push ebp
push 0x40d676
push dword fs:[edx]
mov dword fs:[edx], esp
mov ebx, dword [ebp - 0x14]
dec ebx
test ebx, ebx
jl 0x40d65f
inc ebx
lea eax, [ebp - 0x780]
mov edx, dword [esi + 8]
call sub.rtl250.bpl__System__UStrFromPWChar_qqrr20System_UnicodeStringpb
mov ecx, dword [ebp - 0x780]
mov edx, dword [ebp - 4]
mov eax, dword [sym.imp.AxComponentsRTL.bpl__Axrtl_System_Strutils_StrUtils_]
call sub.AxComponentsRTL.bpl__Axrtl_System_Strutils_StrUtils_SameText_qqrx20System_UnicodeStringt1
test al, al
je 0x40d659
inc dword [ebp - 8]
add esi, 0x10
dec ebx
jne 0x40d631
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40d67d
mov eax, dword [ebp - 0x10]
push eax
call sub.wtsapi32.dll_WTSFreeMemory
ret
cmp dword [ebp - 0x14], 0
jne 0x40d78d
xor edx, edx
mov eax, 2
call fcn.00405a5c
mov edi, eax
cmp edi, 0xffffffff
jne 0x40d6ba
mov dword [ebp - 8], 0xffffffff
jmp 0x40d787
mov dword [ebp - 0x354], 0x22c
xor eax, eax
mov dword [ebp - 8], eax
lea edx, [ebp - 0x354]
mov eax, edi
call fcn.00405a7c
mov dword [ebp - 0xc], eax
jmp 0x40d77d
mov edx, dword [ebp - 0x34c]
mov eax, 8
call fcn.00405a5c
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40d763
mov dword [ebp - 0x77c], 0x428
lea edx, [ebp - 0x77c]
mov eax, ebx
call fcn.00405abc
mov esi, eax
jmp 0x40d759
lea eax, [ebp - 0x784]
lea edx, [ebp - 0x75c]
mov ecx, pe_nt_image_headers32
call sub.rtl250.bpl__System__UStrFromWArray_qqrr20System_UnicodeStringpbi
mov ecx, dword [ebp - 0x784]
mov edx, dword [ebp - 4]
mov eax, dword [sym.imp.AxComponentsRTL.bpl__Axrtl_System_Strutils_StrUtils_]
call sub.AxComponentsRTL.bpl__Axrtl_System_Strutils_StrUtils_CompareText_qqrx20System_UnicodeStringt1
test eax, eax
jne 0x40d740
inc dword [ebp - 8]
mov dword [ebp - 0x77c], 0x428
lea edx, [ebp - 0x77c]
mov eax, ebx
call fcn.00405adc
mov esi, eax
test esi, esi
jne 0x40d710
push ebx
call sub.kernel32.dll_CloseHandle
mov dword [ebp - 0x354], 0x22c
lea edx, [ebp - 0x354]
mov eax, edi
call fcn.00405a9c
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x40d6de
push edi
call sub.kernel32.dll_CloseHandle
mov eax, 0x54d2e0
mov edx, dword [ebp - 4]
call sub.rtl250.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.kernel32.dll_GetTickCount
mov dword [0x54d2e4], eax
mov eax, dword [ebp - 8]
mov dword [0x54d2dc], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40d7d1
lea eax, [ebp - 0x784]
mov edx, 2
call sub.rtl250.bpl__System__UStrArrayClr_qqrpvi
ret