Function at 0x4084a0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x234
mov eax, dword [0x45c050]
xor eax, esp
mov dword [esp + 0x230], eax
push ebx
push esi
push edi
mov esi, ecx
xorps xmm0, xmm0
push 1
movlpd qword [esp + 0x10], xmm0
movlpd qword [esp + 0x18], xmm0
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_SetCommMask]
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov edi, dword [esi + 0x14]
mov ecx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebx, dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov dword [esp + 0x1c], eax
test edi, edi
je 0x408514
push 0
push edi
call ecx
push edi
mov dword [esi], 1
call ebx
mov ecx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x408520
mov dword [esi], 1
nop word [eax + eax]
mov edi, dword [esi + 0x14]
test edi, edi
je 0x408537
push 0
push edi
call ecx
mov ebx, dword [esi]
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x408539
mov ebx, dword [esi]
cmp ebx, 1
jne 0x408688
push 0
lea eax, [esp + 0x28]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_WaitCommEvent]
test eax, eax
je 0x408669
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x2c]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test byte [esp + 0x24], bl
je 0x408669
mov edi, dword [esp + 0x30]
test edi, edi
je 0x408669
push 0x200
lea eax, [esp + 0x3c]
push 0
push eax
call fcn.00426040
add esp, 0xc
lea eax, [esp + 0xc]
push eax
lea eax, [esp + 0x24]
push eax
push edi
lea eax, [esp + 0x44]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40861c
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x20], eax
call ebx
cmp eax, 0x3e5
jne 0x40867e
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0
lea edi, [eax + 0x3e8]
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x14]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x40861c
call ebx
cmp eax, 0x3e4
jne 0x40861c
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, edi
ja 0x40861c
push 0
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x14]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x4085f0
mov ebx, dword [esp + 0x20]
test ebx, ebx
je 0x408669
mov edi, dword [esi + 0x10]
test edi, edi
je 0x408634
push 0
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [esi + 0x1c]
lea eax, [edx + ebx]
cmp eax, 0x400
jae 0x40865c
mov ecx, dword [esi + 0x18]
lea eax, [esp + 0x38]
push ebx
add ecx, edx
mov edx, 0x400
push eax
call fcn.00408330
add esp, 8
add dword [esi + 0x1c], ebx
test edi, edi
je 0x408669
mov ebx, dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push edi
call ebx
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ecx, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x408520
mov dword [esp + 0x20], 0
jmp 0x408669
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x408697
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 8
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov ecx, dword [esp + 0x23c]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004245df
mov esp, ebp
pop ebp
ret