Function at 0x416cf5
Capabilities:
Create thread

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 0x14]
xor ebp, ebp
push edi
mov edi, dword [eax + 4]
mov ebx, 1
cmp dword [esi + 8], ebp
jne 0x416f06
mov eax, dword [esi + 0x28]
push ebp
push 0x40000080
push 3
push ebp
push ebp
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi + 0x80], eax
cmp eax, 0xffffffff
jne 0x416d50
mov edx, dword [edi]
mov eax, dword [edx + 4]
push 1
push str.Open_COM_port_Fail
mov ecx, edi
lea ebx, [ebp + 8]
call eax
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret
mov dword [esi + 8], ebx
lea ebx, [esi + 0xa0]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetCommState]
test eax, eax
jne 0x416d82
mov edx, dword [edi]
push 1
lea ebx, [eax + 9]
mov eax, dword [edx + 4]
push str.GetCommState_Fail
mov ecx, edi
call eax
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret
push ebx
lea ecx, [esi + 0x84]
push ecx
call sub.CommUtyFx.dll__CommUtyFxSetupDCB_8
mov edx, dword [esi + 0x80]
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
jne 0x416dbe
lea ebx, [eax + 0xa]
mov eax, dword [edi]
mov edx, dword [eax + 4]
push 1
push str.SetCommState_Fail
mov ecx, edi
call edx
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret
mov eax, dword [esi + 0x9c]
mov ecx, dword [esi + 0x98]
mov edx, dword [esi + 0x80]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
test eax, eax
jne 0x416dfa
lea ebx, [eax + 0xb]
mov eax, dword [edi]
mov edx, dword [eax + 4]
push 1
push str.SetupComm_Fail
mov ecx, edi
call edx
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret
mov eax, dword [esi + 0x80]
push 0xf
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
test eax, eax
jne 0x416e2a
mov edx, dword [edi]
push 1
lea ebx, [eax + 0xc]
mov eax, dword [edx + 4]
push str.PurgeComm_Fail_in_Connect
mov ecx, edi
call eax
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret
mov edx, dword [esi + 0x80]
lea ecx, [esp + 0x14]
push ecx
push edx
mov dword [esp + 0x1c], 0xffffffff
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], ebp
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
test eax, eax
jne 0x416e75
lea ebx, [eax + 0xd]
mov eax, dword [edi]
mov edx, dword [eax + 4]
push 1
push str.SetCommTimeouts_Fail
mov ecx, edi
call edx
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret
mov eax, dword [esi + 0xd0]
mov ebx, dword [sym.imp.KERNEL32.dll_ResetEvent]
push eax
call ebx
mov ecx, dword [esi + 0xe4]
push ecx
call ebx
mov edx, dword [esi + 0x3c]
push edx
call ebx
mov eax, dword [esi + 0x44]
mov ecx, dword [esi + 0x40]
push eax
push ebp
push ecx
call fcn.00518320
add esp, 0xc
lea edx, [esp + 0x10]
push edx
push ebp
push esi
push 0x417070
push ebp
push ebp
mov dword [esi + 0x50], ebp
mov dword [esi + 0x70], ebp
mov dword [esi + 0x74], ebp
call dword [sym.imp.KERNEL32.dll_CreateThread]
push ebp
push eax
mov dword [esi + 0x38], eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
cmp dword [esi + 0xbc], ebp
je 0x416f04
mov eax, dword [esi + 0x80]
push 5
push eax
call dword [sym.imp.KERNEL32.dll_EscapeCommFunction]
test eax, eax
jne 0x416f04
mov edx, dword [edi]
push 1
lea ebx, [eax + 0xe]
mov eax, dword [edx + 4]
push str.Set_DTR__Fail
mov ecx, edi
call eax
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret
xor ebx, ebx
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x18
ret