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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4316a6
mov eax, dword fs:[0]
push eax
sub esp, 0x264
mov eax, dword [0x43ec2c]
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
push str.CEPSDNMON_:_FindRunningApp_r_n
push 0x442e1c
mov esi, ecx
call fcn.004013e0
add esp, 8
xor edi, edi
push 0x4372b0
lea ecx, [ebp - 0x248]
mov dword [ebp - 0x260], edi
mov dword [ebp - 0x264], edi
call fcn.00401bf0
mov dword [ebp - 4], edi
mov eax, dword [esi + 0x1c]
xor ecx, ecx
cmp eax, edi
mov dword [ebp - 0x250], edi
mov dword [ebp - 0x25c], edi
mov dword [ebp - 0x254], edi
mov dword [ebp - 0x268], eax
mov dword [ebp - 0x24c], ecx
jle 0x40a463
lea ebx, [esi + 0x14]
mov dword [ebp - 0x26c], ebx
mov dword [ebp - 0x244], edi
jmp 0x40a0e6
mov ecx, dword [ebp - 0x24c]
test edi, edi
jl 0x40a4dd
cmp ecx, dword [ebx + 8]
jge 0x40a4dd
mov eax, dword [ebx + 4]
add eax, edi
mov dword [eax + 0x14], 0
cmp ecx, dword [ebx + 8]
jge 0x40a4dd
mov eax, dword [ebx + 4]
mov edx, dword [ebp - 0x248]
add eax, edi
mov eax, dword [eax + 4]
lea ecx, [eax - 0x10]
lea esi, [edx - 0x10]
cmp ecx, esi
je 0x40a181
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x40a165
mov edx, dword [ecx]
cmp edx, dword [esi]
jne 0x40a165
push ecx
call fcn.00401610
mov ebx, eax
add esp, 4
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x40a154
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
lea edx, [ebx + 0x10]
mov ebx, dword [ebp - 0x26c]
mov dword [ebp - 0x248], edx
jmp 0x40a17b
mov ecx, dword [eax - 0xc]
push ecx
push eax
lea ecx, [ebp - 0x248]
call fcn.00401af0
mov edx, dword [ebp - 0x248]
mov edi, dword [ebp - 0x244]
cmp dword [edx - 0xc], 0
je 0x40a43f
push str.Error
push edx
call fcn.00418d73
add esp, 8
test eax, eax
je 0x40a43f
mov ecx, dword [ebp - 0x24c]
cmp ecx, dword [ebx + 8]
jge 0x40a4dd
mov eax, dword [ebx + 4]
add eax, edi
cmp dword [eax + 0x10], 0
je 0x40a43f
cmp ecx, dword [ebx + 8]
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
push edx
push eax
push 1
jge 0x40a4dd
mov eax, dword [ebx + 4]
add eax, edi
mov eax, dword [eax + 8]
push ecx
sub eax, 0x10
mov dword [ebp - 0x244], esp
mov esi, esp
push eax
call fcn.00401610
add eax, 0x10
add esp, 4
mov dword [esi], eax
call fcn.004022a0
add esp, 0x10
test eax, eax
je 0x40a43f
xor esi, esi
cmp dword [ebp - 0x250], esi
jne 0x40a24b
lea ecx, [ebp - 0x25c]
push ecx
lea edx, [ebp - 0x250]
push edx
push 1
push esi
push esi
mov dword [ebp - 0x25c], esi
call sub.WTSAPI32.dll_WTSEnumerateProcessesW
neg eax
sbb eax, eax
neg eax
mov dword [ebp - 0x264], eax
jne 0x40a257
push str.CEPSDNMON_:_WTSEnumerateProcesses_Failed_r_n
push 0x442e1c
call fcn.004013e0
add esp, 8
cmp dword [ebp - 0x264], esi
je 0x40a35e
mov dword [ebp - 0x244], esi
cmp dword [ebp - 0x25c], esi
jbe 0x40a43f
mov esi, dword [ebp - 0x250]
add esi, 8
mov eax, dword [esi]
push eax
lea ecx, [ebp - 0x258]
call fcn.00401bf0
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x258]
push ecx
push str.CEPSDNMON_:_csProcessName____s__r_n
push 0x442e1c
call fcn.004013e0
mov ecx, dword [ebp - 0x248]
xor eax, eax
add esp, 0xc
test ecx, ecx
setne al
test eax, eax
je 0x40a4d3
mov edx, dword [ebp - 0x258]
push ecx
push edx
call fcn.00418d73
add esp, 8
test eax, eax
je 0x40a30d
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x258]
add eax, 0xfffffff0
add esi, 0x10
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a2ef
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x244]
inc eax
mov dword [ebp - 0x244], eax
cmp eax, dword [ebp - 0x25c]
jb 0x40a272
jmp 0x40a43f
mov edx, dword [ebp - 0x24c]
cmp edx, dword [ebx + 8]
mov ecx, 1
mov dword [ebp - 0x260], ecx
jge 0x40a4dd
mov eax, dword [ebx + 4]
add eax, edi
mov dword [eax + 0x14], ecx
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x258]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a43f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40a43f
push str.CEPSDNMON_:_CreateToolhelp32Snapshot___r_n
push 0x442e1c
call fcn.004013e0
mov esi, dword [ebp - 0x254]
add esp, 8
test esi, esi
jne 0x40a392
push esi
push 2
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov dword [ebp - 0x254], eax
test eax, eax
je 0x40a42d
mov esi, eax
lea ecx, [ebp - 0x240]
push ecx
push esi
mov dword [ebp - 0x240], 0x22c
call sub.KERNEL32.dll_Process32FirstW
test eax, eax
je 0x40a43f
lea edx, [ebp - 0x21c]
push edx
push str.CEPSDNMON_:_CreateToolhelp32Snapshot______s_r_n
push 0x442e1c
call fcn.004013e0
mov ecx, dword [ebp - 0x248]
add esp, 0xc
lea eax, [ebp - 0x21c]
push eax
push ecx
call fcn.00418d73
add esp, 8
test eax, eax
je 0x40a3f7
lea edx, [ebp - 0x240]
push edx
push esi
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x40a3b1
jmp 0x40a43f
mov eax, dword [ebp - 0x24c]
mov esi, 1
mov ecx, ebx
mov dword [ebp - 0x260], esi
call fcn.00406a60
mov dword [eax + 0x14], esi
lea eax, [ebp - 0x21c]
push eax
push str.CEPSDNMON_:_CreateToolhelp32Snapshot_____match___s__r_n
push 0x442e1c
call fcn.004013e0
add esp, 0xc
jmp 0x40a43f
push str.CEPSDNMON_:_CreateToolhelp32Snapshot_____failure__r_n
push 0x442e1c
call fcn.004013e0
add esp, 8
mov eax, dword [ebp - 0x24c]
inc eax
add edi, 0x18
cmp eax, dword [ebp - 0x268]
mov dword [ebp - 0x24c], eax
mov dword [ebp - 0x244], edi
jl 0x40a0e0
xor edi, edi
mov ecx, dword [ebp - 0x254]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x250]
cmp eax, edi
je 0x40a486
push eax
call sub.WTSAPI32.dll_WTSFreeMemory
mov dword [ebp - 0x250], edi
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x248]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40a4af
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x260]
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.004183f6
mov esp, ebp
pop ebp
ret 8
push 0x80004005
call fcn.00401cd0
call fcn.0040d813
int3