Function at 0x402880
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Receive data
Receive data on socket
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x310
push ebx
push ebp
push esi
push edi
push 6
push 1
mov ebp, ecx
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [ebp + 4], eax
je 0x402b26
mov ebx, dword [esp + 0x324]
mov word [esp + 0x10], 2
push ebx
call sub.WSOCK32.dll_inet_addr
mov dword [esp + 0x14], eax
mov ax, word [ebx + 0x100]
push eax
call sub.WSOCK32.dll_htons
mov word [esp + 0x12], ax
mov eax, dword [esp + 0x14]
cmp eax, 0xffffffff
jne 0x4028ff
push ebx
call sub.WSOCK32.dll_gethostbyname
test eax, eax
je 0x402b26
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
mov eax, ecx
lea edi, [esp + 0x14]
mov esi, dword [edx]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x10]
push 0x10
push ecx
push edx
call sub.WSOCK32.dll_connect
cmp eax, 0xffffffff
jne 0x40292a
pop edi
mov dword [ebp], 1
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x310
ret 4
mov ax, word [ebx + 0x202]
push eax
call sub.WSOCK32.dll_htons
lea esi, [ebx + 0x102]
mov word [ebp + 0xa], ax
push esi
call sub.WSOCK32.dll_inet_addr
lea edi, [ebp + 0xc]
cmp eax, 0xffffffff
mov dword [edi], eax
jne 0x402988
push esi
call sub.WSOCK32.dll_gethostbyname
test eax, eax
jne 0x402971
pop edi
mov dword [ebp], 8
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x310
ret 4
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
mov eax, ecx
shr ecx, 2
mov esi, dword [edx]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [sym.imp.MSVCRT.dll_sprintf]
xor ecx, ecx
mov cx, word [ebx + 0x202]
lea eax, [ebx + 0x102]
push ecx
push eax
lea edx, [esp + 0x28]
push str.CONNECT__s:_u_HTTP_1.0_r_n
push edx
call edi
mov esi, eax
mov eax, dword [ebx + 0x204]
add esp, 0x10
test eax, eax
je 0x402a08
lea eax, [ebx + 0x307]
add ebx, 0x208
push eax
push ebx
lea ecx, [esp + 0x228]
push str._s:_s
push ecx
call edi
lea edx, [esp + 0x2b0]
lea eax, [esp + 0x230]
push edx
push eax
call fcn.00402da0
add esp, 0x18
lea ecx, [esp + 0x2a0]
lea edx, [esp + esi + 0x20]
push ecx
push str.Proxy_Authorization:Basic__s_r_n
push edx
call edi
add esp, 0xc
add esi, eax
mov eax, dword [0x408220]
lea edi, [esp + 0x20]
mov dword [esp + esi + 0x20], eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
lea ecx, [esp + 0x20]
push esi
push ecx
mov ecx, ebp
call fcn.00402ba0
cmp eax, esi
je 0x402a4f
mov ecx, ebp
call fcn.004023f0
pop edi
mov dword [ebp], 9
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x310
ret 4
mov eax, dword [ebp + 4]
push 0
lea edx, [esp + 0x24]
push 0x1ff
push edx
push eax
call sub.WSOCK32.dll_recv
cmp eax, 0xc
jge 0x402a86
mov ecx, ebp
call fcn.004023f0
pop edi
mov dword [ebp], 0xa
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x310
ret 4
lea ecx, [esp + 0x20]
mov byte [esp + eax + 0x20], 0
push ecx
call dword [sym.imp.MSVCRT.dll__strupr]
mov esi, dword [sym.imp.MSVCRT.dll_strstr]
lea edx, [esp + 0x24]
push str.HTTP_1.0_407
push edx
call esi
add esp, 0xc
test eax, eax
jne 0x402b18
lea eax, [esp + 0x20]
push str.HTTP_1.1_407
push eax
call esi
add esp, 8
test eax, eax
jne 0x402b18
lea ecx, [esp + 0x20]
push str.HTTP_1.0_200
push ecx
call esi
add esp, 8
test eax, eax
jne 0x402b05
lea edx, [esp + 0x20]
push str.HTTP_1.1_200
push edx
call esi
add esp, 8
test eax, eax
jne 0x402b05
mov ecx, ebp
call fcn.004023f0
pop edi
mov dword [ebp], 5
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x310
ret 4
pop edi
mov byte [ebp + 0x1c], 1
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x310
ret 4
mov ecx, ebp
call fcn.004023f0
mov dword [ebp], 6
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x310
ret 4