Function at 0x405e02
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Delete file
Download and write a file
Initialize winsock library
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header
Set socket configuration
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xfe0
and dword [ebp - 0xfe0], 0
and dword [ebp - 0xfc4], 0
and dword [ebp - 0x7b4], 0
and dword [ebp - 0xfdc], 0
and dword [ebp - 0xfc0], 0
and dword [ebp - 0x3a8], 0
and dword [ebp - 0x1a0], 0
and dword [ebp - 0x19c], 0
and dword [ebp - 0x3ac], 0
and dword [ebp - 0xfd8], 0
or dword [ebp - 0x7b8], 0xffffffff
mov eax, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [ebp - 4], eax
lea eax, [ebp - 0x198]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
push 2
pop eax
mov word [ebp - 0xfd4], ax
push dword [ebp + 0xc]
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xfd2], ax
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0xfd0], eax
cmp dword [ebp - 0xfd0], 0xffffffff
jne 0x405eb5
push 2
push dword [ebp + 8]
lea eax, [ebp - 0xfd0]
push eax
call fcn.00409246
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x3a4], eax
push 0x10
lea eax, [ebp - 0xfd4]
push eax
push dword [ebp - 0x3a4]
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x405ef4
mov dword [ebp - 0xfc0], 2
jmp 0x4062f4
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp - 0xfd8], eax
push 1
push dword [ebp - 0xfd8]
push dword [ebp - 0x3a4]
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
mov dword [ebp - 0x19c], 0x2710
push 4
lea eax, [ebp - 0x19c]
push eax
push 0x1006
push 0xffff
push dword [ebp - 0x3a4]
call dword [sym.imp.WS2_32.dll_setsockopt]
push 0x200
push 0
lea eax, [ebp - 0x3a0]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push str.HTTP_1.1_r_nAccept:___r_nAccept_Language:_zh_cn_r_nAccept_Encoding:_gzip__deflate_r_nUser_Agent:_Mozilla_4.0__compatible__MSIE_6.0__Windows_NT_5.1__SV1__r_nHost:__s_r_nConnection:_Keep_Alive_r_n_r_n
push str.GET___s
push str._s_s
lea eax, [ebp - 0x3a0]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0x400
push 0
lea eax, [ebp - 0x7b0]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push dword [ebp + 8]
push dword [ebp + 0x10]
lea eax, [ebp - 0x3a0]
push eax
lea eax, [ebp - 0x7b0]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x7b0]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [ebp - 0xfe0], eax
push 0
push dword [ebp - 0xfe0]
mov eax, dword [ebp - 0x3a8]
lea eax, [ebp + eax - 0x7b0]
push eax
push dword [ebp - 0x3a4]
call dword [sym.imp.WS2_32.dll_send]
mov dword [ebp - 0xfc4], eax
mov eax, dword [ebp - 0x3a8]
add eax, dword [ebp - 0xfc4]
mov dword [ebp - 0x3a8], eax
mov eax, dword [ebp - 0xfe0]
sub eax, dword [ebp - 0xfc4]
mov dword [ebp - 0xfe0], eax
cmp dword [ebp - 0xfe0], 0
jg 0x406017
jmp 0x40603f
cmp dword [ebp - 0xfc4], 0
je 0x406029
cmp dword [ebp - 0xfc4], 0xffffffff
jne 0x40603d
mov dword [ebp - 0xfc0], 3
jmp 0x4062f4
jmp 0x405fc0
and dword [ebp - 0xfbc], 0
push 0x2710
push dword [ebp - 0xfd8]
call dword [ebp - 4]
cmp eax, 0x102
jne 0x40606f
mov dword [ebp - 0xfc0], 4
jmp 0x4062f4
push 0x800
push 0
lea eax, [ebp - 0xfb8]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0
push 0x800
lea eax, [ebp - 0xfb8]
push eax
push dword [ebp - 0x3a4]
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0xfc4], eax
mov eax, dword [ebp - 0xfbc]
inc eax
mov dword [ebp - 0xfbc], eax
cmp dword [ebp - 0xfc4], 0
je 0x4060c4
cmp dword [ebp - 0xfc4], 0xffffffff
jne 0x4060d8
mov dword [ebp - 0xfc0], 5
jmp 0x4062f4
cmp dword [ebp - 0xfbc], 1
jne 0x40610d
push str.200_OK
lea eax, [ebp - 0xfb8]
push eax
call dword [sym.imp.MSVCRT.dll_strstr]
pop ecx
pop ecx
test eax, eax
jne 0x40610d
mov dword [ebp - 0xfc0], 6
jmp 0x4062f4
lea eax, [ebp - 0xfb8]
push eax
call fcn.00405d7b
mov dword [ebp - 0x1a0], eax
cmp dword [ebp - 0x1a0], 0
jne 0x40614a
cmp dword [ebp - 0xfbc], 1
jne 0x406136
jmp 0x406046
mov dword [ebp - 0xfc0], 7
jmp 0x4062f4
push str._r_n_r_n
lea eax, [ebp - 0xfb8]
push eax
call dword [sym.imp.MSVCRT.dll_strstr]
pop ecx
pop ecx
add eax, 4
mov dword [ebp - 0xfdc], eax
cmp dword [ebp - 0xfdc], 4
jne 0x406184
mov dword [ebp - 0xfc0], 8
jmp 0x4062f4
mov eax, dword [ebp - 0xfdc]
lea ecx, [ebp - 0xfb8]
sub eax, ecx
mov ecx, dword [ebp - 0xfc4]
sub ecx, eax
mov dword [ebp - 0x7b4], ecx
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x7b8], eax
cmp dword [ebp - 0x7b8], 0xffffffff
jne 0x4061de
mov dword [ebp - 0xfc0], 9
jmp 0x4062f4
push 0
lea eax, [ebp - 0x19c]
push eax
push dword [ebp - 0x7b4]
push dword [ebp - 0xfdc]
push dword [ebp - 0x7b8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x3ac]
add eax, dword [ebp - 0x7b4]
mov dword [ebp - 0x3ac], eax
mov eax, dword [ebp - 0x3ac]
cmp eax, dword [ebp - 0x1a0]
jne 0x406233
mov dword [ebp - 0xfc0], 1
jmp 0x4062f4
push 0x2710
push dword [ebp - 0xfd8]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x40625f
mov dword [ebp - 0xfc0], 0xa
jmp 0x4062f4
push 0
push 0x800
lea eax, [ebp - 0xfb8]
push eax
push dword [ebp - 0x3a4]
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0xfc4], eax
cmp dword [ebp - 0xfc4], 0
je 0x406291
cmp dword [ebp - 0xfc4], 0xffffffff
jne 0x40629f
mov dword [ebp - 0xfc0], 0xb
jmp 0x4062f4
push 0
lea eax, [ebp - 0x19c]
push eax
push dword [ebp - 0xfc4]
lea eax, [ebp - 0xfb8]
push eax
push dword [ebp - 0x7b8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x3ac]
add eax, dword [ebp - 0xfc4]
mov dword [ebp - 0x3ac], eax
mov eax, dword [ebp - 0x3ac]
cmp eax, dword [ebp - 0x1a0]
jne 0x4062ef
mov dword [ebp - 0xfc0], 1
jmp 0x4062f4
jmp 0x406233
cmp dword [ebp - 0x3a4], 0xffffffff
je 0x406317
push 2
push dword [ebp - 0x3a4]
call dword [sym.imp.WS2_32.dll_shutdown]
push dword [ebp - 0x3a4]
call dword [sym.imp.WS2_32.dll_closesocket]
call dword [sym.imp.WS2_32.dll_WSACleanup]
cmp dword [ebp - 0xfd8], 0
je 0x406332
push dword [ebp - 0xfd8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x7b8], 0xffffffff
je 0x406347
push dword [ebp - 0x7b8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0xfc0], 1
je 0x406359
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov eax, dword [ebp - 0xfc0]
leave
ret 0x10