Function at 0x40f540
Capabilities:
Check if file exists
Create process on windows
Create process suspended
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x535721
mov eax, dword fs:[0]
push eax
sub esp, 0x27c
mov eax, dword [0x5a6a30]
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 eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
xor esi, esi
mov dword [ebp - 0x230], eax
mov dword [ebp - 0x234], ecx
mov dword [ebp - 0x220], esi
mov dword [ebp - 0x22c], esi
call fcn.0042aa6c
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x40f5a8
push 0x80004005
call fcn.004010e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x224], eax
mov dword [ebp - 4], esi
call fcn.0042aa6c
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x40f5d7
push 0x80004005
call fcn.004010e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [ebp - 0x21c], edi
push str.DoPortMonitorUninstall________________________IN_n
push 4
mov byte [ebp - 4], 1
call fcn.00403750
add esp, 8
call fcn.0042cb3b
mov ebx, dword [eax + 0xc]
call fcn.0042cb3b
mov eax, dword [eax + 4]
mov esi, dword [eax + 0x44]
call fcn.0042cb3b
push 0x1bbc
mov dword [eax + 0xc], esi
call fcn.0042a962
test eax, eax
je 0x40f636
push 0x1bbc
push eax
lea ecx, [ebp - 0x224]
call fcn.00401a80
push 0x1bbd
call fcn.0042a962
test eax, eax
je 0x40f65b
push 0x1bbd
push eax
lea ecx, [ebp - 0x21c]
call fcn.00401a80
mov edi, dword [ebp - 0x21c]
call fcn.0042cb3b
push 0x44
lea ecx, [ebp - 0x288]
push 0
push ecx
mov dword [eax + 0xc], ebx
call fcn.0051eb70
push 0x208
lea edx, [ebp - 0x218]
push 0
push edx
mov dword [ebp - 0x288], 0x44
call fcn.0051eb70
add esp, 0x18
push 0x104
lea eax, [ebp - 0x218]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [ebp - 0x218]
push 0x5c
push ecx
call fcn.0051edd8
add esp, 8
test eax, eax
je 0x40f6c1
xor edx, edx
mov word [eax], dx
mov esi, dword [ebp - 0x224]
push esi
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.0051f22b
add esp, 0xc
lea ecx, [ebp - 0x218]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40f73a
add edi, 0xfffffff0
mov byte [ebp - 4], 0
lea edx, [edi + 0xc]
or eax, eax
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x40f70d
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
lea eax, [esi - 0x10]
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f730
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
jmp 0x40f918
mov ecx, dword [edi - 8]
mov eax, 1
sub eax, dword [edi - 4]
or ecx, eax
jge 0x40f75c
push 0
lea ecx, [ebp - 0x21c]
call fcn.004015a0
mov edi, dword [ebp - 0x21c]
mov ecx, dword [ebp - 0x230]
push ecx
lea edx, [ebp - 0x21c]
push edi
push edx
call fcn.00404ae0
mov eax, dword [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x218]
push 0x104
push ecx
call fcn.0051f22b
lea edx, [ebp - 0x218]
push edx
push str.__CreateProcess___lpCommandLine:__1_s___n
push 2
call fcn.00403750
add esp, 0x24
lea eax, [ebp - 0x244]
push eax
lea ecx, [ebp - 0x288]
push ecx
push 0
push 0
push 0x20
push 0
push 0
push 0
lea edx, [ebp - 0x218]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40f885
mov eax, dword [ebp - 0x240]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call fcn.0042cb3b
mov ecx, dword [eax + 4]
call fcn.0042cf67
push 0x1f4
mov byte [ebp - 4], 2
call edi
mov ecx, dword [ebp - 0x244]
push 0x64
push ecx
call ebx
mov esi, eax
call fcn.0040c100
lea ecx, [ebp - 0x225]
mov byte [ebp - 4], 1
call fcn.0040c890
cmp esi, 0x102
je 0x40f7e8
mov eax, dword [ebp - 0x244]
lea edx, [ebp - 0x22c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
mov ecx, dword [ebp - 0x244]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x22c]
sub eax, 0
je 0x40f879
dec eax
je 0x40f861
sub eax, 0xfff
jne 0x40f8b4
jmp 0x40f8aa
mov edx, dword [ebp - 0x234]
mov dword [ebp - 0x220], 1
mov dword [edx], 1
jmp 0x40f8b4
mov dword [ebp - 0x220], 1
jmp 0x40f8b4
push str._CreateProcess___is_missing_n
push 2
call fcn.00403750
add esp, 8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.__GetLastError__:_d_n
push 2
call fcn.00403750
add esp, 0xc
mov dword [ebp - 0x220], 0
push 0x5492a8
push 4
call fcn.00403750
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
add esp, 8
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f8e9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x224]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f912
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x220]
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.0051e701
mov esp, ebp
pop ebp
ret