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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x519074]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x14], 0
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x1c], edi
mov eax, dword [esi + 8]
cmp eax, 0xffffffff
je 0x401857
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x401857
lea ecx, [ebp - 0x10]
push ecx
lea ecx, [ebp - 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x4016bd
cmp dword [ebp - 0x20], 0
jbe 0x4016bd
push 2
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov eax, dword [esi + 4]
shr eax, 1
test al, 1
je 0x40182a
mov edi, dword [ebp + 0x10]
lea ebx, [esi + 0x174]
cmp edi, 0xffffffff
jne 0x40173c
push ebx
lea eax, [ebp - 0x14]
push eax
push dword [ebp + 0xc]
push dword [ebp - 0x1c]
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40180e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x40180e
mov edi, dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
nop dword [eax + eax]
push 1
lea eax, [ebp - 0x14]
push eax
push ebx
push dword [esi + 8]
call edi
test eax, eax
je 0x401710
mov eax, dword [ebp - 0x14]
add dword [esi + 0x134], eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00476066
mov esp, ebp
pop ebp
ret 0xc
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp + 0xc]
push ebx
cmova ecx, dword [ebp + 0xc]
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x18]
push eax
push ecx
push dword [ebp - 0x1c]
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x14], eax
cmp eax, dword [ebp + 0xc]
jae 0x401811
add eax, dword [ebp - 0x1c]
lea ecx, [ebp - 0x18]
push ebx
push ecx
push 1
push eax
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4017d8
cmp edi, 5
jbe 0x401803
push edi
push dword [esi + 0x184]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x401803
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebx, eax
sub ebx, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x24]
jae 0x4017b2
dec ebx
push 0
lea eax, [ebp - 0x18]
push eax
lea eax, [esi + 0x174]
push eax
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
cmp edi, ebx
jbe 0x4017d0
sub edi, ebx
jmp 0x4017d2
xor edi, edi
lea ebx, [esi + 0x174]
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x14], eax
cmp eax, dword [ebp + 0xc]
jae 0x40180e
test edi, edi
jne 0x401773
add dword [esi + 0x134], eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00476066
mov esp, ebp
pop ebp
ret 0xc
push 2
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov eax, dword [ebp - 0x14]
add dword [esi + 0x134], eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00476066
mov esp, ebp
pop ebp
ret 0xc
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
push edi
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x14]
add dword [esi + 0x134], eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00476066
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00476066
mov esp, ebp
pop ebp
ret 0xc