Function at 0x46a670
Capabilities:
Check for time delay via gettickcount
Reference absolute stream path on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
call fcn.00472d61
test eax, eax
jne 0x46a688
mov ax, 1
jmp 0x46b85c
cmp dword [0x5284e8], 1
jne 0x46a6e1
movsx eax, word [0x5265ea]
cmp eax, 0xffffffff
jne 0x46a6e1
movsx ecx, byte [0x4d21fb]
cmp ecx, 0x40
jne 0x46a6e1
push 0
push 0x4d50d8
mov dx, word [0x4d50d4]
push edx
call fcn.00492700
add esp, 0xc
test eax, eax
je 0x46a6d8
mov eax, dword [0x526a74]
or al, 1
mov dword [0x526a74], eax
xor ax, ax
jmp 0x46b85c
mov ax, 1
jmp 0x46b85c
mov ecx, dword [0x526a74]
or ecx, 1
mov dword [0x526a74], ecx
movsx edx, byte [0x526a58]
test edx, edx
je 0x46a715
movsx eax, byte [0x4f8d90]
movsx ecx, byte [0x5265ea]
cmp eax, ecx
jne 0x46a715
xor ax, ax
jmp 0x46b85c
movsx edx, word [0x5284c0]
cmp edx, 1
jne 0x46a760
cmp dword [0x4f84bc], 0
jb 0x46a75e
push 0xf
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x52c7f0]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x52c290]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x46a778
mov dword [0x5284c4], 0
mov byte [0x52c1be], 0x45
mov byte [0x52c1be], 0x45
mov cl, byte [0x5265ea]
mov byte [0x4f8d90], cl
mov byte [0x526a58], 0
movsx edx, word [ebp + 8]
mov dword [ebp - 0x48], edx
cmp dword [ebp - 0x48], 0xf
ja case.default.0x46a79f
mov eax, dword [ebp - 0x48]
jmp dword [eax*4 + 0x46b860]
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM1
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46a89d
movsx ecx, word [0x5284c0]
cmp ecx, 1
jne 0x46a7ff
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
mov word [0x5265ea], 1
mov word [0x4decd2], 0
mov word [0x4decf0], 1
mov word [0x4ded0e], 0
mov word [0x4ded2c], 0
mov word [0x4ded4a], 0
mov word [0x4ded68], 0
mov word [0x4ded86], 0
mov word [0x4deda4], 0
mov word [0x4dedc2], 0
mov word [0x4dede0], 0
mov word [0x4dedfe], 0
mov word [0x4dee1c], 0
mov word [0x4dee3a], 0
mov word [0x4dee58], 0
mov word [0x4dee76], 0
mov word [0x4dee94], 0
jmp case.0x46a79f.1
lea edx, [ebp - 0x3c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea ecx, [ebp - 0x3c]
push ecx
push str.COM1:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x46a8df
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x44], eax
mov edx, dword [ebp - 0x44]
push edx
push str.lastError
call fcn.0045ab38
add esp, 8
push 1
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM2
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46a995
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea edx, [ebp - 0x3c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea ecx, [ebp - 0x3c]
push ecx
push str.COM2:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM3
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46aa6c
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea eax, [ebp - 0x3c]
push eax
push str.COM3:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM4
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46ab45
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea edx, [ebp - 0x3c]
push edx
push str.COM4:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM5
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46ac1e
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea edx, [ebp - 0x3c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea ecx, [ebp - 0x3c]
push ecx
push str.COM5:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM6
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46acf5
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea eax, [ebp - 0x3c]
push eax
push str.COM6:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM7
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46adce
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea edx, [ebp - 0x3c]
push edx
push str.COM7:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM8
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46aea7
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea edx, [ebp - 0x3c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea ecx, [ebp - 0x3c]
push ecx
push str.COM8:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str.COM9
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46af7e
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea eax, [ebp - 0x3c]
push eax
push str.COM9:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str..COM10
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46b057
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea edx, [ebp - 0x3c]
push edx
push str..COM10:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str..COM11
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46b130
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea edx, [ebp - 0x3c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea ecx, [ebp - 0x3c]
push ecx
push str..COM11:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str..COM12
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46b207
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea eax, [ebp - 0x3c]
push eax
push str..COM12:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str..COM13
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46b2e0
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea edx, [ebp - 0x3c]
push edx
push str..COM13:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str..COM14
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46b3b9
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea edx, [ebp - 0x3c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea ecx, [ebp - 0x3c]
push ecx
push str..COM14:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str..COM15
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46b490
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea eax, [ebp - 0x3c]
push eax
push str..COM15:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
jmp case.default.0x46a79f
push 0
push 0x40000080
push 3
push 0
push 0
push 0xc0000000
push str..COM16
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4f84bc], eax
cmp dword [0x4f84bc], 0xffffffff
jne 0x46b569
push 0
push str.Port_is_not_available__
call fcn.0045aa31
add esp, 8
mov byte [0x526a58], 1
xor ax, ax
jmp 0x46b85c
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCommState]
lea edx, [ebp - 0x3c]
push edx
push str..COM16:9600_n_8_2
call dword [sym.imp.KERNEL32.dll_BuildCommDCBA]
mov dword [ebp - 8], eax
push 1
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0x800
push 0x1000
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetupComm]
push 0xf
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0x3e8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0x3e8
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [0x4f84bc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
cmp dword [0x4d21f4], 0x53
jne 0x46b6b1
mov dword [0x4d21e0], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x20], eax
mov word [ebp - 0x40], 0
jmp 0x46b628
mov dx, word [ebp - 0x40]
add dx, 1
mov word [ebp - 0x40], dx
movsx eax, word [ebp - 0x40]
cmp eax, 0x3e8
jge 0x46b654
mov cx, word [0x5265ea]
push ecx
call fcn.00432b23
add esp, 4
mov edx, dword [0x4d21e0]
add edx, 1
mov dword [0x4d21e0], edx
jmp 0x46b61c
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 0x20]
cmp eax, 0x190
jb 0x46b614
mov ecx, dword [0x4d21e0]
shl ecx, 2
mov dword [0x4d21e0], ecx
mov edx, dword [0x4d21e0]
mov dword [0x4d21e4], edx
mov eax, dword [0x4d21e0]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], 0
fild qword [ebp - 0x50]
fmul dword [0x4d21e8]
call fcn.004bcf10
mov dword [0x4d21e0], eax
mov dword [0x4d21f4], 0x40
mov ecx, dword [ebp - 0x34]
and ch, 0xf7
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x34]
or edx, 2
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x34]
and ah, 0xfb
mov dword [ebp - 0x34], eax
mov byte [ebp - 0x25], 0x58
mov ecx, dword [ebp - 0x34]
and ch, 0xbf
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x34]
or edx, 1
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x34]
and al, 0xfb
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
and ecx, 0xfffffff7
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x34]
and edx, 0xffffffbf
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x34]
and ah, 0xfe
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
and ch, 0xfd
mov dword [ebp - 0x34], ecx
mov byte [ebp - 0x29], 0
mov byte [ebp - 0x28], 2
mov byte [ebp - 0x2a], 8
mov edx, dword [ebp - 0x34]
and edx, 0xffffffcf
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x34]
and al, 0xbf
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
and cl, 0x7f
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x34]
and dh, 0xcf
mov dword [ebp - 0x34], edx
mov byte [ebp - 0x27], 0x59
mov byte [ebp - 0x26], 0x59
mov byte [ebp - 0x24], 0x59
mov byte [ebp - 0x23], 0x59
movsx eax, word [0x5284c0]
test eax, eax
jne 0x46b790
mov dword [ebp - 0x38], 0x38400
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [0x4f84bc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCommState]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x46b790
mov byte [str.230_4_kBaud], 0
mov ax, word [0x4deffe]
sub ax, 1
mov word [0x4deffe], ax
mov word [0x5284c0], 1
mov ecx, dword [ebp + 0x10]
and ecx, 0xffff
mov dword [ebp - 0x54], ecx
cmp dword [ebp - 0x54], 6
jg 0x46b7c5
cmp dword [ebp - 0x54], 6
je 0x46b7df
cmp dword [ebp - 0x54], 1
je 0x46b7fa
cmp dword [ebp - 0x54], 2
je 0x46b7f1
cmp dword [ebp - 0x54], 3
je 0x46b7e8
jmp 0x46b81c
cmp dword [ebp - 0x54], 0xc
je 0x46b7d6
cmp dword [ebp - 0x54], 0x1001
je 0x46b80c
jmp 0x46b81c
mov dword [ebp - 0x38], 0x2580
jmp 0x46b81c
mov dword [ebp - 0x38], 0x4b00
jmp 0x46b81c
mov dword [ebp - 0x38], 0x9600
jmp 0x46b81c
mov dword [ebp - 0x38], 0xe100
jmp 0x46b81c
mov dword [ebp - 0x38], 0x1c200
mov word [0x4f8548], 1
jmp 0x46b81c
mov dword [ebp - 0x38], 0x38400
mov word [0x527b5e], 1
lea edx, [ebp - 0x3c]
push edx
mov eax, dword [0x4f84bc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCommState]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x46b849
push 0
push str.SetCom
call fcn.0045aa31
add esp, 8
xor ax, ax
jmp 0x46b85c
mov ecx, dword [0x526a74]
and ecx, 0xfffffffe
mov dword [0x526a74], ecx
mov ax, 1
mov esp, ebp
pop ebp
ret