Function at 0x40cb70
Capabilities:
Check for time delay via gettickcount
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x449d40]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
or ebx, 0xffffffff
push esi
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x14], 0
cmp dword [edi + 8], ebx
jne 0x40cba9
mov esi, str.CM_ASSERT_IsOpen____failed__KRComm_83__
call fcn.0040cf50
test al, al
je 0x40cd66
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x40cd66
mov eax, dword [edi + 8]
lea ecx, [ebp - 0x10]
push ecx
lea edx, [ebp - 0x24]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x40cbdc
cmp dword [ebp - 0x24], 0
jbe 0x40cbdc
mov ecx, dword [edi + 8]
push 2
push ecx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
test byte [edi + 4], 1
je 0x40cd66
cmp dword [ebp + 0x10], ebx
jne 0x40cc52
mov eax, dword [ebp - 0x1c]
mov ecx, dword [edi + 8]
lea ebx, [edi + 0xc4]
push ebx
lea edx, [ebp - 0x14]
push edx
push esi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40cd51
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x40cc2c
mov esi, str.CM_ASSERT_::GetLastError____ERROR_IO_PENDING__failed__KRComm_95__
call fcn.0040cf50
test al, al
je 0x40cd51
mov eax, dword [edi + 8]
push 1
lea edx, [ebp - 0x14]
push edx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov eax, dword [ebp - 0x14]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00427a15
mov esp, ebp
pop ebp
ret 0xc
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp + 0xc]
mov esi, eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x20], esi
cmp eax, ecx
jbe 0x40cc69
mov eax, ecx
mov edx, dword [ebp - 0x1c]
lea ebx, [edi + 0xc4]
push ebx
lea ecx, [ebp - 0x18]
push ecx
push eax
mov eax, dword [edi + 8]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40cc94
mov esi, str.CM_ASSERT_::ReadFile__hComm___pBuffer__uReadLength__uReadReturn__RO_____failed__KRComm_106__
call fcn.0040cf50
mov esi, dword [ebp - 0x20]
mov eax, dword [ebp - 0x14]
add eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
lea ecx, [ecx]
mov edx, dword [ebp - 0x1c]
push ebx
lea ecx, [ebp - 0x18]
push ecx
push 1
add edx, eax
mov eax, dword [edi + 8]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40cd0f
mov eax, dword [ebp + 0x10]
cmp eax, 5
jbe 0x40cd37
mov ecx, dword [edi + 0xd4]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x40cd37
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, esi
jb 0x40cce5
sub eax, esi
mov esi, eax
jmp 0x40ccea
sub eax, esi
lea esi, [eax - 1]
mov eax, dword [edi + 8]
push 0
lea edx, [ebp - 0x18]
push edx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
cmp dword [ebp + 0x10], esi
jbe 0x40cd05
sub dword [ebp + 0x10], esi
jmp 0x40cd0c
mov dword [ebp + 0x10], 0
mov esi, dword [ebp - 0x20]
cmp dword [ebp - 0x18], 0
je 0x40cd51
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, dword [ebp + 0xc]
jb 0x40cca0
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00427a15
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [edi + 8]
push 2
push ecx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
test eax, eax
jne 0x40cd51
mov esi, str.CM_ASSERT_::PurgeComm__hComm___PURGE_RXABORT___failed__KRComm_122__
call fcn.0040cf50
mov eax, dword [ebp - 0x14]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00427a15
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.00427a15
mov esp, ebp
pop ebp
ret 0xc