Function at 0x401510
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push ebp
mov eax, 0x13cc
mov ebp, esp
push edi
push esi
push ebx
call fcn.004040f0
xor ebx, ebx
sub esp, eax
lea eax, [ebp - 0x13a8]
mov dword [esp], 0x202
mov dword [esp + 4], eax
call dword [sym.imp.WS2_32.dll_WSAStartup]
mov eax, dword [ebp + 8]
push edi
push edi
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
push edx
je 0x401741
lea esi, [ebp - 0x13b6]
mov edx, eax
mov ecx, 0xe
xor eax, eax
mov word [ebp - 0x13b8], 2
lea ebx, [ebp - 0x13b8]
mov edi, esi
rep stosb byte es:[edi], al
lea eax, [ebp - 0x13b4]
movsx ecx, word [edx + 0xa]
mov edx, dword [edx + 0xc]
mov edi, eax
mov esi, dword [edx]
rep movsb byte es:[edi], byte [esi]
mov dword [esp], 0x50
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x13b6], ax
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x1218]
push esi
mov dword [ebp - 0x13bc], edx
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], edx
mov dword [esp + 4], str.GET__s_HTTP_1.1_r_nHost:__s_r_nAccept:___r_n_r_n
mov dword [esp + 8], eax
call sub.msvcrt.dll_sprintf
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 2
call dword [sym.imp.WS2_32.dll_socket]
sub esp, 0xc
mov esi, eax
mov dword [esp + 8], 0x10
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_connect]
sub esp, 0xc
inc eax
mov edx, dword [ebp - 0x13bc]
je 0x4016a1
xor eax, eax
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
xor ebx, ebx
mov dword [esp + 0xc], 0
mov dword [esp + 4], edx
not ecx
mov dword [esp], esi
dec ecx
mov dword [esp + 8], ecx
call dword [sym.imp.WS2_32.dll_send]
sub esp, 0x10
test eax, eax
jle 0x4016ed
mov eax, 0xfff
lea edi, [ebp - 0x1018]
mov dword [esp + 0xc], 0
sub eax, ebx
mov dword [esp], esi
mov dword [esp + 8], eax
lea eax, [edi + ebx]
mov dword [esp + 4], eax
call dword [sym.imp.WS2_32.dll_recv]
sub esp, 0x10
test eax, eax
jle 0x40168d
add ebx, eax
mov dword [esp + 4], str._r_n_r_n
mov dword [esp], edi
mov byte [ebp + ebx - 0x1018], 0
call sub.msvcrt.dll_strstr
test eax, eax
je 0x40163f
mov dword [esp + 4], str.Content_Length:
mov dword [esp], edi
call sub.msvcrt.dll_strstr
test eax, eax
jne 0x4016b2
mov dword [esp], esi
xor ebx, ebx
call dword [sym.imp.WS2_32.dll_closesocket]
push ecx
jmp 0x401741
add eax, 0xf
mov dword [esp + 8], 0xa
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_strtoul
test eax, eax
je 0x4016a1
mov dword [esp], eax
mov dword [ebp - 0x13bc], eax
xor edi, edi
call sub.msvcrt.dll_malloc
test eax, eax
mov ebx, eax
mov edx, dword [ebp - 0x13bc]
jne 0x40172e
mov dword [esp], esi
call dword [sym.imp.WS2_32.dll_closesocket]
push edx
jmp 0x401741
mov eax, edx
mov dword [ebp - 0x13bc], edx
mov dword [esp + 0xc], 0
sub eax, edi
mov dword [esp], esi
mov dword [esp + 8], eax
lea eax, [ebx + edi]
mov dword [esp + 4], eax
call dword [sym.imp.WS2_32.dll_recv]
sub esp, 0x10
test eax, eax
mov edx, dword [ebp - 0x13bc]
jle 0x401732
add edi, eax
cmp edi, edx
jb 0x4016f9
mov dword [esp], esi
call dword [sym.imp.WS2_32.dll_closesocket]
push eax
mov eax, dword [ebp + 0x10]
mov dword [eax], edi
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret