Function at 0x40a1f0
Capabilities:
Check for time delay via gettickcount
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Write file on windows

Disassembly:
sub esp, 0x130
push ebx
push esi
push edi
push ebp
xor edi, edi
cmp dword [esp + 0x144], 0xffffffff
mov dword [esp + 0x18], edi
je 0x40a4fb
cmp dword [0x42f7dc], edi
je 0x40a4fb
push 2
inc dword [0x42f7e0]
mov dword [0x42fcd0], edi
mov dword [0x42f330], edi
call fcn.00403ea0
add esp, 4
push edi
push edi
push edi
push edi
call fcn.004098d0
mov eax, dword [esp + 0x160]
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], eax
add esp, 0x10
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x1c], eax
cmp dword [0x42f330], edi
jne 0x40a3e1
mov ebp, dword [sym.imp.USER32.dll_TranslateAcceleratorA]
mov esi, dword [sym.imp.USER32.dll_IsDialogMessageA]
mov ebx, dword [sym.imp.USER32.dll_PeekMessageA]
push 0
mov eax, dword [0x42f7e8]
mov ecx, dword [esp + 0x148]
push eax
push 0x438c30
push ecx
call sub.WSOCK32.dll_recv
mov edi, eax
mov eax, dword [0x438580]
test edi, edi
jle 0x40a3e1
lea eax, [esp + 0x20]
push 0
mov ecx, dword [esp + 0x14c]
push eax
push edi
push 0x438c30
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x18], eax
mov eax, dword [0x438580]
cmp dword [esp + 0x18], 0
je 0x40a390
cmp dword [esp + 0x20], edi
jl 0x40a390
mov eax, dword [0x42f2c8]
add dword [esp + 0x14], edi
mov dword [esp + 0x10], 1
cmp dword [esp + 0x150], eax
jae 0x40a2fc
sub eax, dword [esp + 0x150]
push eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
mov eax, dword [esp + 0x24]
push eax
mov eax, dword [esp + 0x20]
sub eax, dword [esp + 0x15c]
push eax
call fcn.004098d0
lea ecx, [esp + 0x34]
add esp, 0x10
push 1
push 0
push 0
push 0
push ecx
call ebx
test eax, eax
mov eax, dword [0x42f7d4]
je 0x40a3d4
test eax, eax
je 0x40a349
lea ecx, [esp + 0x24]
push ecx
push eax
call esi
test eax, eax
jne 0x40a376
lea eax, [esp + 0x24]
mov ecx, dword [0x437014]
mov edx, dword [esp + 0x24]
push eax
push ecx
push edx
call ebp
test eax, eax
jne 0x40a376
lea eax, [esp + 0x24]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [esp + 0x24]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
lea eax, [esp + 0x24]
push 1
push 0
push 0
push 0
push eax
call ebx
test eax, eax
mov eax, dword [0x42f7d4]
jne 0x40a339
jmp 0x40a3d4
lea ecx, [esp + 0x40]
push 0x100
mov dword [0x42f330], 1
push ecx
push 0x3700
push eax
call dword [sym.imp.USER32.dll_LoadStringA]
lea eax, [esp + 0x40]
push eax
push str.___s
call fcn.0040cf50
add esp, 8
push 1
call fcn.0040bb30
mov dword [esp + 0x14], 0
add esp, 4
cmp dword [0x42f330], 0
je 0x40a279
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov esi, eax
cmp edi, 0xffffffff
jne 0x40a466
call sub.WSOCK32.dll_WSAGetLastError
mov edi, eax
push 0x100
lea eax, [esp + 0x44]
mov ecx, dword [0x438580]
push eax
push 0x37b0
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [esp + 0x40]
push edi
push ecx
call fcn.0041a860
mov ecx, dword [esp + 0x158]
add esp, 8
cmp ecx, dword [esp + 0x14]
jne 0x40a45e
push 0x10
call fcn.0040bb30
add esp, 4
dec dword [0x42f7e0]
push 0
push 0
push 0
push 0
call fcn.004098d0
add esp, 0x10
call fcn.00403f30
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x130
ret
mov dword [esp + 0x10], 2
lea eax, [esp + 0x40]
push 0x100
push eax
mov ecx, dword [0x438580]
push 0x37af
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
mov ecx, dword [0x42f330]
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
push ecx
sub eax, dword [esp + 0x154]
push esi
lea ecx, [esp + 0x48]
push edx
push eax
push ecx
call fcn.00409bf0
add esp, 0x14
cmp dword [0x42f330], 0
je 0x40a4d1
mov eax, dword [esp + 0x14c]
mov ecx, dword [esp + 0x144]
mov dword [esp + 0x10], 2
push eax
push ecx
call fcn.00409770
add esp, 8
push 0
dec dword [0x42f7e0]
push 0
push 0
push 0
call fcn.004098d0
add esp, 0x10
call fcn.00403f30
mov eax, dword [esp + 0x10]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x130
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x130
ret