Function at 0x422770
Capabilities:
Create thread

Disassembly:
push ebp
mov eax, 1
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x70
mov dword [ebp - 0x48], 0
call fcn.004224e0
cmp eax, 0xffffffff
je 0x422b8b
mov ebx, eax
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x606
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetCommState]
sub esp, 8
mov dword [esp + 4], str.GetCommState_failed_n
mov dword [esp], eax
call fcn.00421f50
test byte [ebp - 0x20], 0x30
je 0x422b98
mov dword [ebp - 0x44], 0x1f4
mov dword [ebp - 0x40], ebx
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x610
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x44]
mov dword [esp], str.test_AbortWaitCts_timeout__Id_handle__p_n
mov dword [esp + 4], eax
call fcn.004219c0
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x612
mov dword [esp + 4], 8
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_SetCommMask]
sub esp, 8
mov dword [esp + 4], str.SetCommMask_failed_n
mov dword [esp], eax
call fcn.00421f50
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventW]
sub esp, 0x10
mov edi, eax
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x614
xor eax, eax
test edi, edi
setne al
mov dword [esp + 4], 0x58b9f1
mov dword [esp], eax
call fcn.00421f50
lea eax, [ebp - 0x50]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x44]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x422390
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateThread]
sub esp, 0x18
mov esi, eax
mov dword [ebp - 0x58], eax
mov dword [esp], 0xa
call dword [sym.imp.kernel32.dll_Sleep]
sub esp, 4
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x618
mov dword [esp], str.Thread_created_n
call fcn.004219c0
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x619
xor eax, eax
test esi, esi
setne al
mov dword [esp + 4], str.CreateThread_Failed_n
mov dword [esp], eax
call fcn.00421f50
mov eax, dword [sym.imp.kernel32.dll_GetTickCount]
mov dword [ebp - 0x64], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x54], eax
call eax
lea edx, [ebp - 0x3c]
mov dword [ebp - 0x5c], eax
mov dword [esp + 8], edx
lea edx, [ebp - 0x48]
mov dword [esp + 4], edx
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_WaitCommEvent]
sub esp, 0xc
mov esi, eax
mov eax, dword fs:[0x18]
mov edi, dword [eax + 0x34]
mov eax, dword [ebp - 0x54]
call eax
mov dword [ebp - 0x60], eax
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x622
mov eax, dword [ebp - 0x48]
mov dword [esp + 8], edi
mov dword [esp + 0xc], eax
mov dword [esp + 4], esi
mov dword [esp], str.Success_0x_08lx_err__ld_evtmask_0x_08lx_n
call fcn.004219c0
call fcn.0057d110
cmp edi, 0x3e5
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x623
sete al
test esi, esi
mov edi, eax
setne al
mov dword [esp + 4], str.overlapped_WaitCommEvent_failed_n
or eax, edi
movzx eax, al
mov dword [esp], eax
call fcn.00421f50
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x624
mov dword [esp], str.overlapped_WaitCommEvent_returned._n
call fcn.004219c0
test esi, esi
jne 0x422a0e
mov eax, edi
test al, al
jne 0x422bd0
lea eax, [ebp - 0x4c]
mov dword [esp], ebx
mov dword [esp + 8], eax
lea eax, [ebp - 0x3c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetOverlappedResult]
mov edi, eax
sub esp, 0x10
mov eax, dword fs:[0x18]
mov edx, dword [eax + 0x34]
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x64], edx
call eax
mov esi, eax
call fcn.0057d110
mov ecx, dword [ebp - 0x5c]
mov dword [eax], 0x58b46e
sub esi, ecx
mov dword [eax + 4], 0x62b
mov dword [esp + 0x14], esi
mov eax, dword [ebp - 0x60]
sub eax, ecx
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x48]
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0x64]
mov dword [esp + 4], edi
mov dword [esp + 8], edx
mov dword [esp], str.Success_0x_08lx_err__ld_evtmask_0x_08lx_diff1__ld__diff2__ld_n
call fcn.004219c0
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x62e
mov eax, dword [ebp - 0x48]
mov dword [esp + 0xc], 0
test eax, eax
mov dword [esp + 8], eax
sete al
mov dword [esp + 4], str.Incorrect_EventMask_0x_08lx_returned_on_Wait_aborted_bu_SetCommMask__expected_0x_08x_n
movzx eax, al
mov dword [esp], eax
call fcn.00421f50
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x630
lea eax, [ebp - 0x48]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetCommModemStatus]
sub esp, 8
mov dword [esp], eax
mov dword [esp + 4], str.GetCommModemStatus_failed_n
call fcn.00421f50
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x632
xor eax, eax
mov dword [esp + 8], esi
sub esi, 0x15f
cmp esi, 0x12a
mov dword [esp + 0xc], 0x1f4
setbe al
mov dword [esp + 4], str.Unexpected_time__ld__expected_around__d_n
mov dword [esp], eax
call fcn.00421f50
mov dword [esp], ebx
mov ebx, dword [sym.imp.kernel32.dll_CloseHandle]
call ebx
sub esp, 4
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x636
mov dword [esp + 4], 0x2710
mov esi, dword [ebp - 0x58]
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
sub esp, 8
test eax, eax
sete al
mov dword [esp + 4], 0x58bb85
movzx eax, al
mov dword [esp], eax
call fcn.00421f50
mov dword [esp], esi
call ebx
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x609
mov dword [esp], str.RTS_CONTROL_HANDSHAKE_is_set__so_dont_manipulate_DTR_n
call fcn.004219c0
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.0057d110
mov dword [eax], 0x58b46e
mov dword [eax + 4], 0x626
mov dword [esp + 8], 1
mov dword [esp + 4], 0x3e8
mov edi, dword [ebp - 0x64]
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_WaitForSingleObjectEx]
sub esp, 0xc
test eax, eax
sete al
mov dword [esp + 4], str.AbortWaitCts_hComPortEvent_failed_n
movzx eax, al
mov dword [esp], eax
call fcn.00421f50
jmp 0x422a0e