Function at 0x405370
Capabilities:
Check for time delay via gettickcount
Encode data using xor
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 0x4053ae
test cl, cl
je 0x4053aa
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x4053ae
add eax, 2
add esi, 2
test cl, cl
jne 0x405386
xor eax, eax
jmp 0x4053b3
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4054a1
mov edi, dword [esp + 0x38]
mov ebp, dword [sym.imp.KERNEL32.dll_GetTickCount]
add edi, 0x1f4
xor esi, esi
call ebp
lea ebx, [eax + edi]
call ebp
mov edi, dword [esp + 0x30]
cmp eax, ebx
ja 0x405446
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 0x4053fb
push 0x14
jmp 0x40543a
mov ecx, dword [esp + 0x14]
test ecx, ecx
jbe 0x405438
mov eax, dword [esp + 0x34]
sub eax, esi
cmp ecx, eax
jae 0x40540f
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 byte [esi + edi - 1], 0xd
je 0x405446
cmp esi, dword [esp + 0x34]
je 0x405446
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
call ebp
cmp eax, ebx
jbe 0x4053dc
cmp byte [edi], 1
je 0x405457
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
cmp byte [esi + edi - 1], 0xd
je 0x40546a
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
lea edx, [esi - 2]
xor al, al
xor ecx, ecx
test edx, edx
jbe 0x405489
mov bl, byte [ecx + edi]
xor al, bl
inc ecx
cmp ecx, edx
jb 0x405475
cmp al, 1
je 0x405487
cmp al, 0xd
jne 0x405489
inc al
mov cl, byte [esi + edi - 2]
cmp cl, al
mov eax, esi
je 0x405734
pop edi
pop esi
pop ebp
pop ebx
neg eax
add esp, 0x18
ret
cmp dword [edi + 0x2c], 0x4b0
jne 0x4054b2
add dword [esp + 0x38], 0x1f4
mov al, byte [edi + 0x34]
test al, al
je 0x4055bf
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 0x4054f2
test cl, cl
je 0x4054ee
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x4054f2
add eax, 2
add esi, 2
test cl, cl
jne 0x4054ca
xor eax, eax
jmp 0x4054f7
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x405502
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 0x405531
test cl, cl
je 0x40552d
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x405531
add eax, 2
add esi, 2
test cl, cl
jne 0x405509
xor eax, eax
jmp 0x405536
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x405541
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 0x405570
test cl, cl
je 0x40556c
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x405570
add eax, 2
add esi, 2
test cl, cl
jne 0x405548
xor eax, eax
jmp 0x405575
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x405580
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 0x4055af
test cl, cl
je 0x4055ab
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x4055af
add eax, 2
add esi, 2
test cl, cl
jne 0x405587
xor eax, eax
jmp 0x4055b4
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4055bf
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
ja 0x4056c0
mov ebx, dword [esp + 0x34]
mov ecx, dword [esp + 0x2c]
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x1c]
mov edx, dword [ecx]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov ecx, dword [esp + 0x20]
test ecx, ecx
jbe 0x4056a8
mov eax, ebx
sub eax, esi
cmp ecx, eax
jae 0x405613
mov eax, ecx
mov ecx, dword [esp + 0x2c]
lea edx, [esp + 0x10]
mov dword [esp + 0x10], eax
lea edi, [ecx + 0x18]
mov ecx, dword [ecx]
push edi
push edx
push eax
lea eax, [esi + ebp]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405684
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x405684
mov edx, dword [esp + 0x2c]
push 0x3e8
mov eax, dword [edx + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x405664
mov dword [esp + 0x10], 0
jmp 0x405684
mov edx, dword [esp + 0x2c]
lea ecx, [esp + 0x10]
push 0
push ecx
mov eax, dword [edx]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x10]
add dword [eax + 0x20], ecx
add esi, dword [esp + 0x10]
cmp byte [esi + ebp - 1], 0xd
jne 0x4056a2
mov edx, dword [esp + 0x2c]
mov al, byte [edx + 0x33]
test al, al
je 0x4056c0
cmp esi, dword [0x60b8adc]
ja 0x4056c0
cmp esi, ebx
je 0x4056c0
jmp 0x4056b0
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, dword [esp + 0x38]
jbe 0x4055e6
mov eax, dword [esp + 0x2c]
mov cl, byte [eax + 0x33]
test cl, cl
je 0x4056e4
mov eax, dword [0x60b8adc]
xor ecx, ecx
cmp eax, esi
jae 0x4056e2
mov dl, byte [eax + ebp]
inc eax
mov byte [ecx + ebp], dl
inc ecx
cmp eax, esi
jb 0x4056d6
mov esi, ecx
cmp byte [ebp], 1
je 0x4056f6
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
cmp byte [esi + ebp - 1], 0xd
je 0x405709
mov eax, esi
pop edi
pop esi
pop ebp
neg eax
pop ebx
add esp, 0x18
ret
lea edx, [esi - 2]
xor al, al
xor ecx, ecx
test edx, edx
jbe 0x405728
mov bl, byte [ecx + ebp]
xor al, bl
inc ecx
cmp ecx, edx
jb 0x405714
cmp al, 1
je 0x405726
cmp al, 0xd
jne 0x405728
inc al
mov cl, byte [esi + ebp - 2]
cmp cl, al
mov eax, esi
je 0x405734
neg eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret