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

Disassembly:
sub esp, 0x8a8
lea eax, [esp + 0x18]
lea edx, [esp + 0x28]
push ebx
mov ebx, dword [esp + 0x8b0]
push ebp
push esi
push edi
push eax
push edx
push ebx
call fcn.00402ca0
test eax, eax
jne 0x40312b
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x403119
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x403106
mov ecx, dword [eax + 0xc]
xor eax, eax
mov edx, dword [ecx]
lea ecx, [esp + 0x28]
push ecx
mov esi, dword [edx]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov word [esp + 0x1c], 2
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
call fcn.00411c47
add esp, 4
push eax
call dword [sym.imp.WS2_32.dll_htons]
lea edx, [esp + 0x18]
push 0x10
push edx
push ebp
mov word [esp + 0x26], ax
mov dword [esp + 0x28], esi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jne 0x4030f4
mov ecx, 0x100
lea edi, [esp + 0xb8]
rep stosd dword es:[edi], eax
or ecx, 0xffffffff
mov edi, str.GET_http:__
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0xb8]
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0xb8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0xb8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str._HTTP_1.1
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0xb8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x42522c
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0xb8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.Host:
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0xb8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
lea edi, [esp + 0x38]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0xb8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, 0x42522c
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0xb8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.Connection:Keep_Alive
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0xb8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x42522c
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0xb8]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov edi, 0x42522c
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0xbc]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0xbc]
push ecx
push eax
push ebp
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x4030e2
lea ecx, [esp + 0x14]
push 4
push ecx
push 0x1006
push 0xffff
push ebp
mov dword [esp + 0x28], 0x1388
call dword [sym.imp.WS2_32.dll_setsockopt]
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x4b8]
xor ebx, ebx
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.WS2_32.dll_recv]
xor esi, esi
test ebx, ebx
je 0x403075
cmp esi, 0x400
jl 0x4030ca
push 0
lea edx, [esp + 0x17]
push 1
push edx
push ebp
mov byte [esp + 0x23], 0
call edi
test eax, eax
jle 0x4030c3
mov al, byte [esp + 0x13]
mov byte [esp + esi + 0x4b8], al
inc esi
cmp esi, 4
jl 0x403069
cmp byte [esp + esi + 0x4b4], 0xd
jne 0x403069
cmp byte [esp + esi + 0x4b5], 0xa
jne 0x403069
cmp byte [esp + esi + 0x4b6], 0xd
jne 0x403069
cmp byte [esp + esi + 0x4b7], 0xa
jne 0x403069
mov ebx, 1
jmp 0x403069
mov ecx, dword [esp + 0x8c0]
pop edi
pop esi
xor eax, eax
mov dword [ecx], ebp
pop ebp
pop ebx
add esp, 0x8a8
ret 8
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x8a8
ret 8
pop edi
pop esi
pop ebp
mov eax, 4
pop ebx
add esp, 0x8a8
ret 8
call dword [sym.imp.KERNEL32.DLL_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8a8
ret 8
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x8a8
ret 8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x8a8
ret 8