Function at 0x418330
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
cmp edi, 1
je 0x4184b2
cmp edi, 2
je 0x4184a8
test edi, edi
je 0x418380
test byte [0x4f3060], 0x80
mov esi, dword [sym.imp.msvcrt.dll__errno]
jne 0x4184e4
call esi
mov ebx, 0xffffffff
mov dword [eax], 0x16
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, 0x80000000
mov eax, 0x4b87e8
call fcn.004169f0
test eax, eax
mov edi, eax
je 0x4188fe
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
lea ecx, [ebp - 0x1c]
mov dword [esp + 4], ebx
mov dword [esp], ecx
mov dword [esp + 8], eax
call fcn.0041c900
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
sub esp, 0x1c
cmp eax, 0xffffffff
mov dword [edi + 0xc], eax
je 0x418660
mov esi, dword [edi + 4]
mov eax, 0xffffffff
test esi, esi
je 0x418413
cmp edi, 0x4f3460
jae 0x4184c0
mov dword [esp + 0xc], eax
lea eax, [edi + 0x18]
mov dword [esp + 0x10], ebx
mov dword [esp + 8], str._d__s_
mov dword [esp + 4], 0x20
mov dword [esp], eax
call fcn.0049fc60
test byte [0x4f3060], 0x80
jne 0x418580
mov edx, dword [edi + 4]
mov ebx, 0xffffffff
test edx, edx
je 0x418473
cmp edi, 0x4f3460
jb 0x418473
cmp edi, 0x4f5060
jae 0x418473
mov edx, edi
sub edx, 0x4f3460
sar edx, 3
imul edx, edx, 0xb6db6db7
lea ebx, [edx + 0x64]
mov eax, dword [ebp - 0x1c]
lea esi, [eax - 0xc]
cmp esi, 0x4b0f34
je 0x418375
sub eax, 4
call fcn.004ab77c
test eax, eax
jg 0x418375
lea eax, [ebp - 0x1d]
mov ecx, esi
mov dword [esp], eax
call fcn.004a31a0
push eax
jmp 0x418375
mov esi, 0xc0000000
jmp 0x418385
mov esi, 0x40000000
jmp 0x418385
cmp edi, 0x4f5060
jae 0x418413
mov eax, edi
sub eax, 0x4f3460
sar eax, 3
imul eax, eax, 0xb6db6db7
add eax, 0x64
jmp 0x418413
call esi
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x2c], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x2c]
mov dword [esp + 8], str.adb_open
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call esi
mov dword [eax], ebx
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], edi
mov dword [esp + 4], str.adb_open:_invalid_options__0x_0x__n
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov dword [eax], ebx
jmp 0x418368
mov esi, dword [sym.imp.msvcrt.dll__errno]
call esi
mov eax, dword [eax]
mov dword [esp], 0x4f3068
mov dword [ebp - 0x2c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x30], eax
call sub.msvcrt.dll__getpid
mov ecx, dword [ebp - 0x30]
mov dword [esp + 8], str.adb_open
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0x10], ecx
mov ecx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], eax
lea eax, [ecx + 0x40]
mov dword [esp], eax
call fcn.0049fc30
call esi
mov edx, dword [ebp - 0x2c]
mov dword [eax], edx
mov ecx, dword [edi + 4]
mov eax, 0xffffffff
test ecx, ecx
je 0x418610
cmp edi, 0x4f3460
jb 0x418610
cmp edi, 0x4f5060
jae 0x418610
mov eax, edi
sub eax, 0x4f3460
sar eax, 3
imul eax, eax, 0xb6db6db7
add eax, 0x64
lea esi, [esi]
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.adb_open:__s___fd__d_n
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov edx, dword [ebp - 0x2c]
mov dword [eax], edx
jmp 0x418443
mov eax, dword [edi + 4]
test eax, eax
jne 0x418800
test byte [0x4f3060], 0x80
mov esi, dword [sym.imp.msvcrt.dll__errno]
jne 0x418767
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x4186d0
cmp eax, 3
jne 0x4186b0
test byte [0x4f3060], 0x80
jne 0x418870
call esi
mov ebx, 0xffffffff
mov dword [eax], 0x14
jmp 0x418473
test byte [0x4f3060], 0x80
jne 0x418810
call esi
mov ebx, 0xffffffff
mov dword [eax], 2
jmp 0x418473
test byte [0x4f3060], 0x80
je 0x4186bd
call esi
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str.adb_open
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call esi
mov dword [eax], ebx
mov dword [esp + 4], str.file_not_found_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov dword [eax], ebx
jmp 0x4186bd
call esi
mov edi, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x2c], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x2c]
mov dword [esp + 8], str.adb_open
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call esi
mov dword [eax], edi
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], ebx
mov dword [esp + 4], str.adb_open:_could_not_open__s:
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov dword [eax], edi
jmp 0x41867e
mov eax, edi
call fcn.00416160
jmp 0x41866b
call esi
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str.adb_open
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call esi
mov dword [eax], ebx
mov dword [esp + 4], str.unknown_error_n
jmp 0x41872e
call esi
mov ebx, dword [eax]
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, eax
call sub.msvcrt.dll__getpid
mov dword [esp + 0x10], edi
mov dword [esp + 8], str.adb_open
mov dword [esp + 4], 0x4b7278
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
call esi
mov dword [eax], ebx
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str.path_not_found_n
add eax, 0x40
mov dword [esp], eax
call fcn.0049fc30
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4f3068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call esi
mov dword [eax], ebx
jmp 0x41869b
nop
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, 0xffffffff
mov dword [eax], 0xc
jmp 0x418375