Function at 0x52ef20
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x592e51
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x98
push ebx
push esi
push edi
lea ecx, [esp + 0xc]
call sub.MFC42.DLL_CString::CString_3
xor ebx, ebx
lea ecx, [esp + 0x10]
mov dword [esp + 0xac], ebx
call sub.MFC42.DLL_CString::CString_3
mov esi, dword [esp + 0xb4]
lea eax, [esp + 0x10]
push esi
push 0x601b04
push eax
mov byte [esp + 0xb8], 1
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::TrimLeft
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::TrimRight
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0xc]
push ecx
push str.com_s
push edx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
cmp esi, 9
jle 0x52efe0
lea eax, [esp + 0xc]
lea ecx, [esp + 0x14]
push eax
push str.._
push ecx
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [esp + 0x10]
mov byte [esp + 0xb0], 2
call sub.MFC42.DLL_CString::operator_2
lea ecx, [esp + 0x14]
mov byte [esp + 0xac], 1
call sub.MFC42.DLL_CString::CString
mov edx, dword [esp + 0xc]
push ebx
push ebx
push 3
push ebx
push ebx
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
or edi, 0xffffffff
cmp esi, edi
jne 0x52f044
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x10]
mov dword [0x6a2d5c], eax
mov byte [esp + 0xac], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0xc]
mov dword [esp + 0xac], edi
call sub.MFC42.DLL_CString::CString
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x98]
mov dword fs:[0], ecx
add esp, 0xa4
ret
lea eax, [esp + 0x64]
mov word [esp + 0x64], 0x40
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCommProperties]
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x30]
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_GetCommConfig]
lea eax, [esp + 0x38]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCommState]
mov eax, dword [esp + 0xb8]
mov dword [esp + 0x3c], 0x4b0
cmp eax, ebx
je 0x52f08b
mov dword [esp + 0x3c], eax
mov al, byte [esp + 0xc4]
mov cl, byte [esp + 0xbc]
mov dl, byte [esp + 0xc0]
mov byte [esp + 0x4c], al
mov eax, dword [esp + 0xc8]
mov byte [esp + 0x4a], cl
cmp eax, ebx
mov byte [esp + 0x4b], dl
jl 0x52f101
jne 0x52f0c9
mov eax, dword [esp + 0x40]
and eax, 0xffffcf83
or eax, 0x380
jmp 0x52f0fa
cmp eax, 1
jne 0x52f0de
mov eax, dword [esp + 0x40]
and eax, 0xffffdc5f
or eax, 0x105c
jmp 0x52f0fa
cmp eax, 2
mov eax, dword [esp + 0x40]
jne 0x52f0f3
and eax, 0xffffec6f
or eax, 0x206c
jmp 0x52f0fa
and eax, 0xffffcc13
or al, 0x10
or ah, 0x40
mov dword [esp + 0x40], eax
lea ecx, [esp + 0x38]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
push ebx
jne 0x52f15e
push ebx
push str.Error_set_opening_COM_port..
call sub.MFC42.DLL_AfxMessageBox_1
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x10]
mov byte [esp + 0xac], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0xc]
mov dword [esp + 0xac], edi
call sub.MFC42.DLL_CString::CString
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x98]
mov dword fs:[0], ecx
add esp, 0xa4
ret
push esi
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 8
push esi
call dword [sym.imp.KERNEL32.dll_PurgeComm]
lea edx, [esp + 0x18]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_GetCommTimeouts]
xor eax, eax
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], eax
push ecx
mov dword [esp + 0x20], eax
push esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], edi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov eax, 0x3e8
mov dword [esp + 0x28], eax
mov dword [esp + 0x30], eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
lea ecx, [esp + 0x10]
mov byte [esp + 0xac], bl
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0xc]
mov dword [esp + 0xac], edi
call sub.MFC42.DLL_CString::CString
mov ecx, dword [esp + 0xa4]
mov eax, esi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0xa4
ret