Function at 0x405165
Capabilities:
Print debug messages

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x90
push edi
mov al, byte [0x422e6c]
mov byte [ebp - 0x90], al
mov ecx, 0x1f
xor eax, eax
lea edi, [ebp - 0x8f]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x100
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x4051bd
push 0
push 0x422e70
push str.LocalAlloc
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
jmp 0x4053b6
cmp dword [ebp + 0x10], 0
je 0x405219
push 0
lea ecx, [ebp - 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [0x422dfc]
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x405219
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 6
jne 0x4051fe
push 0x41f7fc
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
jmp 0x4053b6
push 0
push 0x422e74
push str.Unexpected_GetOverlappedResult_for_WaitCommEvent
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
jmp 0x4053b6
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx]
and edx, 0x80
test edx, edx
je 0x4053a9
push 0
lea eax, [ebp - 8]
push eax
mov ecx, dword [0x422dfc]
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
jne 0x40527f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 6
jne 0x405264
push str.ERROR_INVALID_HANDLE__Likely_that_the_Service_Provider_has_closed_the_port._n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
jmp 0x4053b6
push 0
push 0x422e78
push str.ClearCommError
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
jmp 0x4053b6
cmp dword [ebp - 8], 0
jne 0x405299
push str.NULL_Error
lea edx, [ebp - 0x90]
push edx
call sub.MSVCRT.dll_strcat
add esp, 8
mov eax, dword [ebp - 8]
and eax, 8
test eax, eax
je 0x4052d6
movsx ecx, byte [ebp - 0x90]
test ecx, ecx
je 0x4052c2
push 0x41f8ec
lea edx, [ebp - 0x90]
push edx
call sub.MSVCRT.dll_strcat
add esp, 8
push str.CE_FRAME
lea eax, [ebp - 0x90]
push eax
call sub.MSVCRT.dll_strcat
add esp, 8
mov ecx, dword [ebp - 8]
and ecx, 2
test ecx, ecx
je 0x405313
movsx edx, byte [ebp - 0x90]
test edx, edx
je 0x4052ff
push 0x41f900
lea eax, [ebp - 0x90]
push eax
call sub.MSVCRT.dll_strcat
add esp, 8
push str.CE_OVERRUN
lea ecx, [ebp - 0x90]
push ecx
call sub.MSVCRT.dll_strcat
add esp, 8
mov edx, dword [ebp - 8]
and edx, 4
test edx, edx
je 0x405350
movsx eax, byte [ebp - 0x90]
test eax, eax
je 0x40533c
push 0x41f914
lea ecx, [ebp - 0x90]
push ecx
call sub.MSVCRT.dll_strcat
add esp, 8
push str.CE_RXPARITY
lea edx, [ebp - 0x90]
push edx
call sub.MSVCRT.dll_strcat
add esp, 8
mov eax, dword [ebp - 8]
and al, 0xf1
test eax, eax
je 0x40538c
movsx ecx, byte [ebp - 0x90]
test ecx, ecx
je 0x405378
push str._and
lea edx, [ebp - 0x90]
push edx
call sub.MSVCRT.dll_strcat
add esp, 8
push str.EV_ERR_Unknown_EvtMask
lea eax, [ebp - 0x90]
push eax
call sub.MSVCRT.dll_strcat
add esp, 8
push 0
push 2
push 0x400
mov ecx, dword [0x422df8]
push ecx
call dword [sym.imp.USER32.dll_PostMessageA]
mov eax, 1
jmp 0x4053b6
push str.Unexpected_comm_event
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret