Function at 0x40bf16
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket
Send http request

Disassembly:
push ebp
lea ebp, [esp - 0x1414]
mov eax, 0x1494
call fcn.00419cb0
mov eax, dword [0x427c60]
xor eax, ebp
mov dword [ebp + 0x1410], eax
mov eax, dword [ebp + 0x141c]
push ebx
push esi
push edi
xor esi, esi
push esi
push 1
push 2
mov dword [ebp - 0x74], ecx
mov dword [ebp - 0x80], eax
call dword [sym.imp.WS2_32.dll_socket]
mov ecx, dword [ebp - 0x74]
push eax
mov dword [ebp - 0x70], eax
call fcn.00409292
test al, al
je 0x40c13d
call fcn.0041066d
mov ecx, eax
call fcn.00410045
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 0x6c], eax
mov ebx, 0x3fffffff
cmp eax, esi
je 0x40bf8b
push eax
call edi
inc eax
cmp eax, ebx
jle 0x40bf90
mov dword [ebp - 0x7c], esi
jmp 0x40bfab
lea esi, [eax + eax]
mov eax, esi
call fcn.00419c40
mov eax, esp
push 3
push esi
push dword [ebp - 0x6c]
push eax
call fcn.00401153
mov dword [ebp - 0x7c], eax
call fcn.0041066d
mov ecx, eax
add ecx, 0x28
call fcn.00406aaf
mov dword [ebp - 0x6c], eax
test eax, eax
je 0x40bfc9
push eax
call edi
inc eax
cmp eax, ebx
jle 0x40bfcf
and dword [ebp - 0x78], 0
jmp 0x40bfea
lea esi, [eax + eax]
mov eax, esi
call fcn.00419c40
mov eax, esp
push 3
push esi
push dword [ebp - 0x6c]
push eax
call fcn.00401153
mov dword [ebp - 0x78], eax
call fcn.0041066d
mov ecx, eax
call fcn.00410638
mov dword [ebp - 0x6c], eax
test eax, eax
je 0x40c005
push eax
call edi
inc eax
cmp eax, ebx
jle 0x40c00b
and dword [ebp - 0x68], 0
jmp 0x40c026
lea esi, [eax + eax]
mov eax, esi
call fcn.00419c40
mov eax, esp
push 3
push esi
push dword [ebp - 0x6c]
push eax
call fcn.00401153
mov dword [ebp - 0x68], eax
call fcn.0041066d
mov ecx, eax
call fcn.00410610
mov dword [ebp - 0x6c], eax
test eax, eax
je 0x40c041
push eax
call edi
inc eax
cmp eax, ebx
jle 0x40c045
xor esi, esi
jmp 0x40c05f
lea esi, [eax + eax]
mov eax, esi
call fcn.00419c40
mov eax, esp
push 3
push esi
push dword [ebp - 0x6c]
push eax
call fcn.00401153
mov esi, eax
call fcn.0041066d
mov ecx, eax
call fcn.00410660
push edx
push eax
call fcn.0041066d
mov ecx, eax
add ecx, 0x28
call fcn.004012d8
push dword [eax + 0x94]
push dword [eax + 0x90]
call fcn.0041066d
mov ecx, eax
call fcn.004104d9
push eax
push dword [ebp - 0x7c]
lea eax, [ebp + 0x1208]
push dword [ebp - 0x78]
push dword [ebp - 0x68]
push esi
push str.http:__bugreport.xunlei.com_cgi_bin_bugreport.fcgi_appname_sappversion_sexceptcode_speerid_sworkstate_dstarttime_dcrashtime_d
push eax
call dword [sym.imp.MSVCR90.dll_sprintf]
add esp, 0x2c
lea ecx, [ebp + 0xb8]
call fcn.00409bf4
push 0
lea eax, [ebp + 0x1208]
push eax
lea ecx, [ebp + 0xb8]
call fcn.0040a0a3
mov esi, 0x1000
push esi
lea eax, [ebp + 0x208]
push eax
lea ecx, [ebp + 0xb8]
call fcn.00408ce4
xor ebx, ebx
push ebx
push eax
lea eax, [ebp + 0x208]
push eax
push dword [ebp - 0x70]
call dword [sym.imp.WS2_32.dll_send]
push esi
lea eax, [ebp + 0x208]
push ebx
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
push ebx
push esi
lea eax, [ebp + 0x208]
push eax
push dword [ebp - 0x70]
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
cmp edi, 0x20
jge 0x40c15f
push dword [ebp - 0x70]
call dword [sym.imp.WS2_32.dll_closesocket]
lea ecx, [ebp + 0xb8]
call fcn.00409c74
xor al, al
lea esp, [ebp - 0x8c]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x1410]
xor ecx, ebp
call fcn.00419ad8
add ebp, 0x1414
leave
ret 4
lea ecx, [ebp - 0x64]
call fcn.00409d0b
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp + 0x208]
push eax
lea ecx, [ebp - 0x64]
call fcn.00409d67
test eax, eax
je 0x40c1a0
push dword [ebp - 0x70]
call dword [sym.imp.WS2_32.dll_closesocket]
xor bl, bl
lea ecx, [ebp - 0x64]
call fcn.00408f72
lea ecx, [ebp + 0xb8]
call fcn.00409c74
mov al, bl
jmp 0x40c13f
mov esi, dword [ebp - 0x74]
add esi, 8
mov ecx, esi
call fcn.0040b734
lea ecx, [ebp + 0x1ec]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
mov eax, dword [ebp - 0x68]
sub edi, eax
cmp edi, ebx
lea ecx, [ebp + eax + 0x208]
mov dword [ebp - 0x68], ecx
jle 0x40c211
mov eax, dword [ebp - 0x68]
movzx eax, byte [eax]
cmp al, 0xa
je 0x40c1e9
cmp al, 0xd
je 0x40c1e9
push eax
lea ecx, [ebp + 0x1ec]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::push_back_char_]
jmp 0x40c20b
cmp dword [ebp + 0x200], ebx
jbe 0x40c1ff
lea eax, [ebp + 0x1ec]
push eax
mov ecx, esi
call fcn.0040b6da
lea ecx, [ebp + 0x1ec]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::clear_void_]
inc dword [ebp - 0x68]
dec edi
jne 0x40c1cc
push dword [ebp - 0x70]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
push 0x1c
cdq
pop ecx
idiv ecx
mov ecx, dword [ebp - 0x80]
cmp eax, 1
sbb eax, eax
neg eax
mov dword [ecx], eax
mov ecx, dword [ebp - 0x74]
call fcn.0040b86b
mov ecx, dword [ebp - 0x74]
call fcn.00409359
lea ecx, [ebp + 0x1ec]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov bl, 1
jmp 0x40c189