Function at 0x4180fa
Capabilities:
Check if file exists
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x898
mov eax, dword [0x4c2f90]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, 0x4d0fd0
push edi
mov esi, ecx
mov dword [ebp - 0x848], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor ebx, ebx
cmp dword [esi + 0x58], ebx
je 0x418142
inc dword [esi + 0x60]
xor ebx, ebx
inc ebx
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, ebx
jmp 0x4183cd
push dword [ebp - 0x848]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x418134
cmp dword [esi + 0x50], ebx
jne 0x418196
xor eax, eax
push 0x7fe
mov word [ebp - 0x80c], ax
lea eax, [ebp - 0x80a]
push ebx
push eax
call fcn.004764d0
add esp, 0xc
lea eax, [ebp - 0x80c]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea eax, [ebp - 0x80c]
push eax
lea ecx, [esi + 0x3c]
call fcn.00401a41
push ebx
lea ecx, [ebp - 0x828]
mov dword [ebp - 0x810], 7
call fcn.00401d0c
lea eax, [ebp - 0x828]
push eax
call fcn.00402d00
cmp dword [ebp - 0x810], 8
mov eax, dword [ebp - 0x824]
pop ecx
jae 0x4181ce
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push dword [ebp - 0x848]
lea ecx, [esi + 0x20]
call fcn.00401a41
push dword [ebp - 0x848]
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [esi + 0x58], eax
cmp eax, ebx
jne 0x41821e
cmp dword [esi + 0x54], 8
jb 0x418201
mov esi, dword [esi + 0x40]
jmp 0x418204
add esi, 0x40
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push ebx
push 1
lea ecx, [ebp - 0x828]
call fcn.00401a65
jmp 0x418134
lea eax, [esi + 4]
mov ecx, eax
lea eax, [esi + 8]
mov dword [ebp - 0x884], eax
lea eax, [esi + 0xc]
mov dword [ebp - 0x87c], eax
lea eax, [esi + 0x10]
mov dword [ebp - 0x874], eax
lea eax, [esi + 0x14]
mov dword [ebp - 0x86c], eax
lea eax, [esi + 0x18]
mov dword [ebp - 0x864], eax
lea eax, [esi + 0x1c]
mov dword [ebp - 0x894], ecx
mov dword [ebp - 0x890], str.init
mov dword [ebp - 0x88c], esi
mov dword [ebp - 0x888], str.uninit
mov dword [ebp - 0x880], str.create_new_task
mov dword [ebp - 0x878], str.create_continued_task
mov dword [ebp - 0x870], str.query_task_info
mov dword [ebp - 0x868], str.start_task
mov dword [ebp - 0x860], str.stop_task
mov dword [ebp - 0x85c], eax
mov dword [ebp - 0x858], str.set_task_type
mov dword [ebp - 0x854], ebx
mov dword [ebp - 0x850], 0x4b2eea
mov dword [ebp - 0x848], ebx
cmp ecx, ebx
je 0x418313
xor eax, eax
mov dword [ebp - 0x84c], ecx
push dword [ebp + eax - 0x890]
push dword [esi + 0x58]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp - 0x84c]
mov dword [ecx], eax
cmp eax, ebx
je 0x418366
inc dword [ebp - 0x848]
mov eax, dword [ebp - 0x848]
shl eax, 3
mov ecx, dword [ebp + eax - 0x894]
mov dword [ebp - 0x84c], ecx
cmp ecx, ebx
jne 0x4182d7
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 4]
cmp eax, ebx
jne 0x418333
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebx
call fcn.00418440
jmp 0x4183b6
push ebx
call eax
push edi
mov dword [ebp - 0x84c], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebp - 0x84c], ebx
jne 0x418328
xor eax, eax
inc eax
inc dword [esi + 0x60]
push ebx
push eax
lea ecx, [ebp - 0x828]
mov dword [esi + 0x5c], eax
call fcn.00401a65
jmp 0x418131
push ebx
lea ecx, [ebp - 0x844]
mov dword [ebp - 0x82c], 7
call fcn.00401d0c
mov eax, dword [ebp - 0x848]
mov esi, dword [ebp + eax*8 - 0x890]
mov eax, esi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
cmp dl, bl
jne 0x41838e
sub eax, ecx
lea ecx, [ebp - 0x844]
push ecx
push eax
push esi
call fcn.0040b6f2
add esp, 0xc
push ebx
push 1
lea ecx, [ebp - 0x844]
call fcn.00401a65
push ebx
push 1
lea ecx, [ebp - 0x828]
call fcn.00401a65
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0047654a
leave
ret 4