Function at 0x407cc0
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x104c
call fcn.00598f80
mov eax, dword [0x64786c]
xor eax, esp
mov dword [esp + 0x1048], eax
mov ecx, dword [ebp + 0x18]
mov eax, dword [ebp + 0x14]
push ebx
push esi
mov edx, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x1c]
push edi
mov dword [esp + 0x14], ecx
mov ecx, 0x1f
mov esi, str.CONNECT__s:_d_HTTP_1.0_r_nuser_agent:_MTTP2.0_r_nhost:__s_r_ncontent_length:_0_r_nproxy_connection:_Keep_Alive_r_npragma:_no_cache_r_n_r_n
lea edi, [esp + 0x128]
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x10]
mov ecx, 0x27
mov esi, str.CONNECT__s:_d_HTTP_1.0_r_nuser_agent:_MTTP2.0_r_nProxy_Authorization:_Basic__s_r_nhost:__s_r_ncontent_length:_0_r_nproxy_connection:_Keep_Alive_r_npragma:_no_cache_r_n_r_n
lea edi, [esp + 0x1a8]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp + 8]
push eax
push ecx
mov ecx, dword [ebp + 0x24]
xor esi, esi
mov dword [esp + 0x18], esi
call fcn.004079e0
add esp, 8
test eax, eax
je 0x408107
mov eax, dword [esp + 0xc]
cmp eax, esi
je 0x407dd7
cmp byte [eax], 0
je 0x407dd7
mov edx, dword [esp + 0x14]
push edx
push eax
lea eax, [esp + 0xa58]
push str._s:_s
push eax
mov dword [esp + 0x1c], 0x400
call fcn.005992e6
lea eax, [esp + 0xa60]
add esp, 0x10
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407d80
lea ecx, [esp + 0xc50]
sub eax, edx
push ecx
push eax
lea eax, [esp + 0x14]
lea edi, [esp + 0xa58]
call fcn.004015c0
movzx ecx, word [ebp + 0x20]
mov edx, dword [esp + 0x14]
push ebx
lea eax, [esp + 0xc5c]
push eax
push ecx
mov byte [esp + edx + 0xc64], 0
push ebx
lea edx, [esp + 0x1c0]
push edx
lea eax, [esp + 0x264]
push eax
call fcn.005992e6
add esp, 0x20
jmp 0x407df6
movzx ecx, word [ebp + 0x20]
push ebx
push ecx
push ebx
lea edx, [esp + 0x134]
push edx
lea eax, [esp + 0x258]
push eax
call fcn.005992e6
add esp, 0x14
cmp dword [0x653730], 1
mov edi, eax
jg 0x407e1d
lea ecx, [esp + 0x248]
push ecx
push 0xbd
push str....._base_srcwin32TSocket.c
push 1
call fcn.00401320
add esp, 0x10
test edi, edi
jle 0x407e83
mov ebx, dword [ebp + 8]
push 0
mov edx, edi
sub edx, esi
push edx
lea eax, [esp + esi + 0x250]
push eax
push ebx
call sub.WS2_32.dll_send
cmp eax, 0xffffffff
je 0x407e46
add esi, eax
cmp esi, edi
jl 0x407e21
jmp 0x407e86
cmp dword [0x653730], 3
jg 0x408107
push str.Fail_to_send_header.
push 0xc4
push str....._base_srcwin32TSocket.c
push 3
call fcn.00401320
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1048]
xor ecx, esp
call fcn.0059709c
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 8]
mov ecx, dword [ebp + 0x24]
mov dword [esp + 0x24], ebx
mov dword [esp + 0x20], 1
cmp ecx, 0xffffffff
je 0x407ec0
mov eax, 0x10624dd3
mul ecx
shr edx, 6
mov dword [esp + 0x18], edx
imul edx, edx, 0x3e8
sub ecx, edx
imul ecx, ecx, 0x3e8
lea edi, [esp + 0x18]
mov dword [esp + 0x1c], ecx
jmp 0x407ec4
mov edi, dword [esp + 0x10]
push 0x804
lea ecx, [esp + 0x24c]
push 0
push ecx
call fcn.00597130
add esp, 0xc
xor esi, esi
push edi
push 0
push 0
lea edx, [esp + 0x2c]
push edx
push 1
call sub.WS2_32.dll_select
cmp eax, 0xffffffff
je 0x4080df
test eax, eax
je 0x4080df
push 0
mov eax, 0x800
sub eax, esi
push eax
lea ecx, [esp + esi + 0x250]
push ecx
push ebx
call sub.WS2_32.dll_recv
cmp eax, 0xffffffff
je 0x4080c4
test eax, eax
je 0x4080c4
add esi, eax
cmp esi, 4
jl 0x407f78
cmp byte [esp + esi + 0x247], 0xa
jne 0x407f5b
mov al, byte [esp + esi + 0x246]
cmp al, 0xa
je 0x407f9b
cmp al, 0xd
jne 0x407f5b
cmp byte [esp + esi + 0x245], 0xa
jne 0x407f5b
cmp byte [esp + esi + 0x244], al
je 0x407f9b
lea edx, [esp + 0x248]
push str._r_n_r_n
push edx
call fcn.0059d240
add esp, 8
test eax, eax
jne 0x408088
cmp esi, 0x800
jl 0x407edd
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1048]
xor ecx, esp
call fcn.0059709c
mov esp, ebp
pop ebp
ret
xor edx, edx
xor ecx, ecx
test esi, esi
jle 0x408048
jmp 0x407fb0
mov al, byte [esp + ecx + 0x248]
cmp al, 0x20
jne 0x407fd0
mov byte [esp + ecx + 0x248], 0
test edx, edx
jne 0x407fd8
lea edx, [esp + ecx + 0x249]
jmp 0x407fd8
cmp al, 0xd
je 0x407fdf
cmp al, 0xa
je 0x407fdf
inc ecx
cmp ecx, esi
jl 0x407fb0
jmp 0x407fe7
mov byte [esp + ecx + 0x248], 0
test edx, edx
je 0x408048
push edx
call fcn.0059da48
mov ecx, eax
mov eax, 0x51eb851f
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
add esp, 4
cmp eax, 2
jne 0x408048
cmp dword [0x653730], 1
jg 0x40802e
push str.HTTP_Proxy_connected.
push 0x10f
push str....._base_srcwin32TSocket.c
push 1
call fcn.00401320
add esp, 0x10
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1048]
xor ecx, esp
call fcn.0059709c
mov esp, ebp
pop ebp
ret
cmp dword [0x653730], 1
jg 0x408107
lea ecx, [esp + 0x248]
push ecx
push 0x10b
push str....._base_srcwin32TSocket.c
push 1
call fcn.00401320
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1048]
xor ecx, esp
call fcn.0059709c
mov esp, ebp
pop ebp
ret
cmp dword [0x653730], 1
jg 0x408107
lea edx, [esp + 0x248]
push edx
push 0x114
push str....._base_srcwin32TSocket.c
push 1
call fcn.00401320
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1048]
xor ecx, esp
call fcn.0059709c
mov esp, ebp
pop ebp
ret
cmp dword [0x653730], 3
jg 0x408107
call sub.WS2_32.dll_WSAGetLastError
push eax
push str.recv_error__u
push 0xe9
jmp 0x4080f8
cmp dword [0x653730], 3
jg 0x408107
call sub.WS2_32.dll_WSAGetLastError
push eax
push str.socket_error__u
push 0xe1
push str....._base_srcwin32TSocket.c
push 3
call fcn.00401320
add esp, 0x14
mov ecx, dword [esp + 0x1054]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0059709c
mov esp, ebp
pop ebp
ret