Function at 0x405740
Capabilities:
Check for time delay via gettickcount
Read file on windows
Receive data
Receive data on socket

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x2c]
mov esi, 0x46f304
lea eax, [edi + 0xf4]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x40577e
test cl, cl
je 0x40577a
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x40577e
add eax, 2
add esi, 2
test cl, cl
jne 0x405756
xor eax, eax
jmp 0x405783
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4058a0
mov edi, dword [esp + 0x38]
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
add edi, 0x1f4
xor esi, esi
call ebx
add edi, eax
mov dword [esp + 0x38], edi
call ebx
cmp eax, edi
ja 0x405842
mov ebp, dword [esp + 0x34]
mov edi, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
lea eax, [esp + 0x14]
push eax
push 0x4004667f
mov edx, dword [ecx + 0x38]
push edx
call sub.WSOCK32.dll_ioctlsocket
test eax, eax
je 0x4057d6
push 0x14
jmp 0x40582b
mov ecx, dword [esp + 0x14]
test ecx, ecx
jbe 0x405829
mov eax, ebp
sub eax, esi
cmp ecx, eax
jae 0x4057e8
mov eax, ecx
mov ecx, dword [esp + 0x2c]
push 0
mov dword [esp + 0x14], eax
push eax
mov edx, dword [ecx + 0x38]
lea eax, [esi + edi]
push eax
push edx
call sub.WSOCK32.dll_recv
add esi, dword [esp + 0x10]
cmp esi, 0xd
jb 0x405825
cmp byte [edi + 1], 0x14
jne 0x40583d
xor eax, eax
xor ecx, ecx
mov al, byte [edi + 7]
mov cl, byte [edi + 6]
shl eax, 8
add eax, ecx
lea edx, [esi - 0xe]
cmp edx, eax
je 0x40583d
cmp esi, ebp
je 0x40583d
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
call ebx
cmp eax, dword [esp + 0x38]
jbe 0x4057b7
cmp esi, 0xd
jae 0x40584e
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
cmp byte [edi], 0x40
je 0x40585f
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
mov cl, byte [edi + 0xc]
mov al, 0xa
cmp cl, al
je 0x40587a
cmp byte [esi + edi - 1], al
je 0x40587a
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
xor cl, cl
xor eax, eax
mov dl, byte [eax + edi]
add cl, dl
inc eax
cmp eax, 0xb
jb 0x40587e
mov al, byte [edi + 0xb]
cmp al, cl
mov eax, esi
je 0x405b6d
pop edi
pop esi
pop ebp
pop ebx
neg eax
add esp, 0x18
ret
cmp dword [edi + 0x2c], 0x4b0
jne 0x4058b1
add dword [esp + 0x38], 0x1f4
mov al, byte [edi + 0x34]
test al, al
je 0x4059be
add edi, 0xf9
mov esi, str.COM1
mov eax, edi
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x4058f1
test cl, cl
je 0x4058ed
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x4058f1
add eax, 2
add esi, 2
test cl, cl
jne 0x4058c9
xor eax, eax
jmp 0x4058f6
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x405901
mov dx, 0x3fc
mov al, 8
out dx, al
mov esi, str.COM2
mov eax, edi
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x405930
test cl, cl
je 0x40592c
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x405930
add eax, 2
add esi, 2
test cl, cl
jne 0x405908
xor eax, eax
jmp 0x405935
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x405940
mov dx, 0x2fc
mov al, 8
out dx, al
mov esi, str.COM3
mov eax, edi
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x40596f
test cl, cl
je 0x40596b
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x40596f
add eax, 2
add esi, 2
test cl, cl
jne 0x405947
xor eax, eax
jmp 0x405974
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40597f
mov dx, 0x3ef
mov al, 1
out dx, al
mov esi, str.COM4
mov eax, edi
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x4059ae
test cl, cl
je 0x4059aa
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x4059ae
add eax, 2
add esi, 2
test cl, cl
jne 0x405986
xor eax, eax
jmp 0x4059b3
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4059be
mov dx, 0x2ef
mov al, 1
out dx, al
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
xor esi, esi
call edi
mov ecx, dword [esp + 0x38]
lea ebx, [eax + ecx]
mov dword [esp + 0x38], ebx
call edi
mov ebp, dword [esp + 0x30]
cmp eax, ebx
mov ebx, dword [esp + 0x2c]
ja 0x405af5
mov ecx, dword [ebx]
lea edx, [esp + 0x1c]
lea eax, [esp + 0x18]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov ecx, dword [esp + 0x20]
test ecx, ecx
jbe 0x405add
mov eax, dword [esp + 0x34]
sub eax, esi
cmp ecx, eax
jae 0x405a10
mov eax, ecx
mov ecx, dword [ebx]
lea edi, [ebx + 0x18]
lea edx, [esp + 0x10]
push edi
push edx
mov dword [esp + 0x18], eax
push eax
lea eax, [esi + ebp]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405a76
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x405a76
mov edx, dword [ebx + 0x28]
push 0x3e8
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x405a59
mov dword [esp + 0x10], 0
jmp 0x405a76
mov ecx, dword [ebx]
lea eax, [esp + 0x10]
push 0
push eax
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov edx, dword [esp + 0x10]
mov eax, dword [ebx + 0x20]
add eax, edx
mov dword [ebx + 0x20], eax
mov ecx, dword [esp + 0x10]
mov al, byte [ebx + 0x33]
add esi, ecx
test al, al
mov eax, dword [0x60b8adc]
jne 0x405aab
cmp esi, 0xd
jb 0x405ad5
cmp byte [ebp + 1], 0x14
jne 0x405afa
xor ecx, ecx
xor edx, edx
mov cl, byte [ebp + 7]
mov dl, byte [ebp + 6]
shl ecx, 8
add ecx, edx
lea edx, [esi - 0xe]
cmp edx, ecx
je 0x405afa
jmp 0x405ad5
mov ecx, esi
sub ecx, eax
cmp ecx, 0xd
jb 0x405ad5
cmp byte [eax + ebp + 1], 0x14
jne 0x405afa
xor edx, edx
add ecx, 0xfffffff2
mov dl, byte [eax + ebp + 7]
mov edi, edx
xor edx, edx
mov dl, byte [eax + ebp + 6]
shl edi, 8
add edi, edx
cmp ecx, edi
je 0x405afa
cmp esi, dword [esp + 0x34]
je 0x405afa
jmp 0x405ae5
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, dword [esp + 0x38]
jbe 0x4059e5
mov eax, dword [0x60b8adc]
mov cl, byte [ebx + 0x33]
test cl, cl
je 0x405b15
xor ecx, ecx
cmp eax, esi
jae 0x405b13
mov dl, byte [eax + ebp]
inc eax
mov byte [ecx + ebp], dl
inc ecx
cmp eax, esi
jb 0x405b07
mov esi, ecx
cmp esi, 0xd
jae 0x405b26
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
cmp byte [ebp], 0x40
je 0x405b38
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
mov cl, byte [ebp + 0xc]
mov al, 0xa
cmp cl, al
je 0x405b53
cmp byte [esi + ebp - 1], al
je 0x405b53
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
xor cl, cl
xor eax, eax
mov bl, byte [eax + ebp]
add cl, bl
inc eax
cmp eax, 0xb
jb 0x405b57
mov al, byte [ebp + 0xb]
cmp al, cl
mov eax, esi
je 0x405b6d
neg eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret