Function at 0x4013e0
Capabilities:
Check if file exists

Disassembly:
sub esp, 0x48
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov al, byte [0x4325f8]
xor ecx, ecx
mov dword [esp + 0x10], edi
mov dword [esp + 0x19], ecx
mov byte [esp + 0x18], al
mov dword [esp + 0x1d], ecx
mov dword [esp + 0x21], ecx
mov word [esp + 0x25], cx
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
push 1
push str.COMPORT
push str.test
mov ecx, eax
call sub.MFC42.DLL_CWinApp::GetProfileIntA
mov esi, eax
cmp esi, 1
jl 0x401430
cmp esi, 4
jle 0x401435
mov esi, 1
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
push 0x4b0
push str.BAUD
push str.test
mov ecx, eax
call sub.MFC42.DLL_CWinApp::GetProfileIntA
mov ebp, eax
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
push 5
push str.DATA
push str.test
mov ecx, eax
call sub.MFC42.DLL_CWinApp::GetProfileIntA
mov ebx, eax
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
push 0xa
push str.STOP
push str.test
mov ecx, eax
call sub.MFC42.DLL_CWinApp::GetProfileIntA
mov dword [esp + 0x34], eax
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
push 3
push str.CHECK
push str.test
mov ecx, eax
call sub.MFC42.DLL_CWinApp::GetProfileIntA
push esi
lea edx, [esp + 0x1c]
push str.COM_d
push edx
mov dword [esp + 0x44], eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [esp + 0x18]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edx, eax
cmp edx, 0xffffffff
mov dword [0x432614], edx
jne 0x40151f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x401607
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push 0x43210c
call sub.MFC42.DLL_CString::CString_1
mov ecx, edi
call fcn.00402980
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret
mov ecx, 7
xor eax, eax
lea edi, [esp + 0x3c]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x3c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetCommState]
test eax, eax
jne 0x401544
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret
mov edx, dword [esp + 0x38]
mov esi, dword [esp + 0x44]
and esi, 0xffffffcf
mov dword [esp + 0x40], ebp
lea eax, [edx - 1]
mov byte [esp + 0x4e], bl
cmp eax, 4
mov dword [esp + 0x44], esi
mov cl, 2
ja case.default.0x401565
jmp dword [eax*4 + 0x401610]
mov byte [esp + 0x4f], 0
jmp case.default.0x401565
mov byte [esp + 0x4f], 1
jmp case.default.0x401565
mov byte [esp + 0x4f], cl
jmp case.default.0x401565
mov byte [esp + 0x4f], 3
jmp case.default.0x401565
mov byte [esp + 0x4f], 4
mov eax, dword [esp + 0x34]
cmp eax, 0xa
je 0x4015ac
cmp eax, 0xf
je 0x4015a5
cmp eax, 0x14
jne 0x4015b1
mov byte [esp + 0x50], cl
jmp 0x4015b1
mov byte [esp + 0x50], 1
jmp 0x4015b1
mov byte [esp + 0x50], 0
mov ecx, dword [0x432614]
lea eax, [esp + 0x3c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
jne 0x4015eb
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
push 0x4320f8
call sub.MFC42.DLL_CString::CString_1
mov ecx, dword [esp + 0x14]
call fcn.00402980
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret
mov edx, dword [0x432614]
push 0x400
push 0x400
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret