Function at 0x40a510
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
Timestomp file
Write file on windows

Disassembly:
sub esp, 0x148
cmp dword [esp + 0x14c], 0xffffffff
push ebx
push esi
push edi
push ebp
je 0x40a9ac
xor edi, edi
cmp dword [0x42f7dc], edi
je 0x40a9ac
push 0x14
mov eax, dword [0x437824]
push eax
inc dword [0x42f7e0]
mov dword [0x42fcd0], edi
call dword [sym.imp.USER32.dll_KillTimer]
push 2
mov dword [0x42f330], edi
call fcn.00403ea0
add esp, 4
xor esi, esi
push edi
push edi
push edi
push edi
call fcn.004098d0
mov ebp, dword [esp + 0x17c]
mov dword [esp + 0x20], edi
add esp, 0x10
cmp ebp, 1
sbb eax, eax
push edi
push pe_nt_image_headers32
and eax, 0xfffffffe
add eax, 4
mov ecx, dword [esp + 0x168]
push eax
push edi
push 1
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov ebx, eax
jne 0x40a5f2
lea eax, [esp + 0x58]
push 0x100
push eax
mov ecx, dword [0x438580]
push 0x36fc
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
call fcn.00420970
mov ecx, dword [eax]
mov edx, dword [esp + 0x160]
lea eax, [esp + 0x58]
push ecx
push edx
push eax
push str.___s__s___u_
call fcn.0040cf50
add esp, 0x10
push 1
call fcn.0040bb30
add esp, 4
jmp 0x40a603
test ebp, ebp
je 0x40a603
push 2
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor ebp, ebp
mov dword [esp + 0x14], ebp
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x24], eax
cmp dword [0x42f330], ebp
jne 0x40a766
push ebp
mov eax, dword [0x42f7e8]
mov ecx, dword [esp + 0x160]
push eax
push 0x438c30
push ecx
call sub.WSOCK32.dll_recv
mov esi, eax
test esi, esi
jle 0x40a766
cmp ebx, 0xffffffff
je 0x40a65e
lea eax, [esp + 0x30]
push ebp
push eax
push esi
push 0x438c30
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], eax
cmp dword [esp + 0x14], ebp
je 0x40a714
cmp dword [esp + 0x30], esi
jl 0x40a714
add edi, esi
mov eax, dword [0x42f2c8]
mov dword [esp + 0x10], 1
push eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
mov eax, dword [esp + 0x2c]
push eax
push edi
call fcn.004098d0
lea eax, [esp + 0x44]
add esp, 0x10
push 1
push ebp
push ebp
push ebp
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x40a75a
cmp dword [0x42f7d4], ebp
je 0x40a6cd
lea eax, [esp + 0x34]
mov ecx, dword [0x42f7d4]
push eax
push ecx
call dword [sym.imp.USER32.dll_IsDialogMessageA]
test eax, eax
jne 0x40a6fe
lea eax, [esp + 0x34]
mov ecx, dword [0x437014]
mov edx, dword [esp + 0x34]
push eax
push ecx
push edx
call dword [sym.imp.USER32.dll_TranslateAcceleratorA]
test eax, eax
jne 0x40a6fe
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
lea eax, [esp + 0x34]
push 1
push ebp
push ebp
push ebp
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
jne 0x40a6af
jmp 0x40a75a
lea eax, [esp + 0x58]
push 0x100
push eax
mov ecx, dword [0x438580]
mov dword [0x42f330], 1
push 0x3700
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [esp + 0x58]
push ecx
push str.___s
call fcn.0040cf50
add esp, 8
push 1
call fcn.0040bb30
mov dword [esp + 0x14], ebp
add esp, 4
cmp dword [0x42f330], ebp
je 0x40a61f
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebp, eax
cmp ebx, 0xffffffff
je 0x40a89e
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
xor eax, eax
cmp dword [0x431350], eax
je 0x40a892
cmp word [0x435f28], ax
je 0x40a892
cmp byte [0x435f2a], al
je 0x40a892
cmp byte [0x435f2b], al
je 0x40a892
cmp esi, 0xffffffff
je 0x40a892
cmp dword [esp + 0x10], 1
jne 0x40a892
cmp dword [0x42f330], eax
jne 0x40a892
lea ecx, [esp + 0x14]
cmp word [0x435f28], 0x32
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
jae 0x40a806
cmp byte [0x435f2a], al
je 0x40a806
cmp byte [0x435f2b], al
je 0x40a806
mov ax, word [0x435f28]
add ax, 0x7d0
jmp 0x40a81b
cmp word [0x435f28], 0x76c
mov ax, word [0x435f28]
jae 0x40a81b
add ax, 0x76c
mov word [esp + 0x14], ax
movzx dx, byte [0x435f2c]
movzx ax, byte [0x435f2a]
mov word [esp + 0x16], ax
movzx cx, byte [0x435f2b]
mov word [esp + 0x1a], cx
lea ecx, [esp + 0x50]
movzx ax, byte [0x435f2d]
mov word [esp + 0x1c], dx
push ecx
mov word [esp + 0x22], ax
lea edx, [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
test eax, eax
je 0x40a892
lea eax, [esp + 0x28]
lea ecx, [esp + 0x50]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFileTimeToFileTime]
test eax, eax
je 0x40a892
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x30]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
call fcn.0041f010
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, 0xffffffff
jne 0x40a912
call sub.WSOCK32.dll_WSAGetLastError
mov esi, eax
push 0x100
lea eax, [esp + 0x5c]
mov ecx, dword [0x438580]
push eax
push 0x37b0
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [esp + 0x58]
push esi
push ecx
call fcn.0041a860
add esp, 8
test edi, edi
jne 0x40a90a
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, 0x148
ret
mov dword [esp + 0x10], 2
lea eax, [esp + 0x58]
push 0x100
push eax
mov ecx, dword [0x438580]
push 0x37af
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
cmp ebx, 0xffffffff
je 0x40a941
cmp dword [0x42f330], 0
mov eax, 0
je 0x40a946
mov eax, 1
lea ecx, [esp + 0x58]
push eax
mov eax, dword [esp + 0x28]
push ebp
push eax
push edi
push ecx
call fcn.00409bf0
add esp, 0x14
cmp dword [0x42f330], 0
je 0x40a982
mov eax, dword [0x42f864]
mov ecx, dword [esp + 0x15c]
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, 0x148
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x148
ret