Function at 0x408510
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x10028
call fcn.0045f3c0
mov eax, dword [0x476018]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
push 6
push 1
push 2
mov esi, ecx
mov edi, edx
call dword [sym.imp.WS2_32.dll_socket]
xor ebx, ebx
mov dword [ebp - 0x10024], eax
cmp eax, ebx
je 0x40871b
push esi
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, ebx
je 0x40871b
mov ecx, 2
mov word [ebp - 0x1001c], cx
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
mov edx, dword [ebp + 8]
mov ecx, dword [eax]
push edx
mov dword [ebp - 0x10018], ecx
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [ebp - 0x10024]
mov word [ebp - 0x1001a], ax
push 0x10
lea eax, [ebp - 0x1001c]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x40871b
push esi
push edi
push str.GET__s_HTTP_1.1_r_nHost:__s_r_nConnection:_close_r_n_r_n
lea edx, [ebp - 0x1000c]
call fcn.004087a0
lea eax, [ebp - 0x1000c]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4085c0
mov esi, dword [ebp - 0x10024]
push ebx
sub eax, edx
push eax
lea edx, [ebp - 0x1000c]
push edx
push esi
call dword [sym.imp.WS2_32.dll_send]
push esi
lea edi, [ebp - 0x1000c]
mov byte [ebp - 0x1001d], bl
call fcn.00408750
add esp, 4
cmp eax, ebx
jle 0x408714
dec eax
cmp eax, ebx
jl 0x408615
cmp byte [ebp + eax - 0x1000c], 0x20
jge 0x408615
dec eax
mov byte [ebp + eax - 0x1000b], bl
jns 0x408601
lea eax, [ebp - 0x1000c]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x408620
sub eax, edx
je 0x408706
mov edi, dword [sym.imp.MSVCR100.dll_strtok_s]
lea eax, [ebp - 0x10028]
push eax
lea ecx, [ebp - 0x1000c]
push 0x46e900
push ecx
mov dword [ebp - 0x10028], ebx
call edi
mov esi, eax
add esp, 0xc
cmp esi, ebx
je 0x408706
mov edx, str.HTTP_1.0
mov ecx, esi
mov al, byte [ecx]
cmp al, byte [edx]
jne 0x408684
cmp al, bl
je 0x408680
mov al, byte [ecx + 1]
cmp al, byte [edx + 1]
jne 0x408684
add ecx, 2
add edx, 2
cmp al, bl
jne 0x408664
xor eax, eax
jmp 0x408689
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x4086bd
mov ecx, str.HTTP_1.1
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4086b4
cmp dl, bl
je 0x4086b0
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4086b4
add eax, 2
add ecx, 2
cmp dl, bl
jne 0x408694
xor eax, eax
jmp 0x4086b9
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x4086e9
lea edx, [ebp - 0x10028]
push edx
push 0x46e900
push ebx
call edi
push eax
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 0x10
mov dword [0x47ac48], eax
cmp eax, 0xc8
jne 0x4086e9
mov byte [ebp - 0x1001d], 1
mov eax, dword [ebp - 0x10024]
push eax
lea edi, [ebp - 0x1000c]
call fcn.00408750
add esp, 4
cmp eax, ebx
jg 0x4085fc
cmp byte [ebp - 0x1001d], bl
jne 0x40872e
mov esi, dword [ebp - 0x10024]
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00418a8f
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x10024]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00418a8f
mov esp, ebp
pop ebp
ret