Function at 0x40a761
Capabilities:
Create tcp socket
Create udp socket
Read and send data from client to server
Read file on windows
Receive data
Receive data on socket
Send data
Send data on socket
Send http request

Disassembly:
push ebp
mov eax, 0x14b0
lea ebp, [esp - 0x1430]
call fcn.0040f600
mov eax, dword [0x416180]
push ebx
push esi
xor eax, ebp
push edi
mov dword [ebp + 0x142c], eax
mov esi, ecx
call fcn.0040a107
test al, al
je 0x40aa6e
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
push eax
mov ecx, esi
mov dword [ebp - 0x58], eax
call fcn.0040916a
test al, al
je 0x40aa6e
lea ecx, [ebp + 0x208]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::constructor_void_]
call fcn.0040e18e
add eax, 8
push eax
lea ecx, [ebp + 0x208]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::operator_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int___const__]
push str.bugreport.zip
lea ecx, [ebp + 0x208]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::operator_unsigned_short_int_const__]
cmp dword [ebp + 0x220], 8
mov eax, dword [ebp + 0x20c]
jae 0x40a7f8
lea eax, [ebp + 0x20c]
push 0x411cb4
push eax
call dword [sym.imp.MSVCR71.dll__wfopen]
test eax, eax
pop ecx
pop ecx
mov dword [ebp - 0x54], eax
je 0x40aa62
cmp dword [ebp + 0x220], 8
mov eax, dword [ebp + 0x20c]
jae 0x40a826
lea eax, [ebp + 0x20c]
lea ecx, [ebp - 0x80]
push ecx
push eax
call dword [sym.imp.MSVCR71.dll__wstat]
pop ecx
pop ecx
call dword [0x416040]
mov dword [ebp - 0x50], eax
call fcn.0040e18e
mov ecx, eax
call fcn.0040e052
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebx, eax
test ebx, ebx
jne 0x40a85a
and dword [ebp - 0x5c], 0
jmp 0x40a87e
push ebx
call esi
lea edi, [eax + eax + 2]
mov eax, edi
add eax, 3
and eax, 0xfffffffc
call fcn.0040f600
mov eax, esp
push dword [ebp - 0x50]
push edi
push ebx
push eax
call fcn.004010e9
mov dword [ebp - 0x5c], eax
call fcn.0040e18e
mov ecx, eax
add ecx, 0x28
call fcn.00406df7
mov ebx, eax
test ebx, ebx
jne 0x40a898
and dword [ebp - 0x4c], eax
jmp 0x40a8bc
push ebx
call esi
lea edi, [eax + eax + 2]
mov eax, edi
add eax, 3
and eax, 0xfffffffc
call fcn.0040f600
mov eax, esp
push dword [ebp - 0x50]
push edi
push ebx
push eax
call fcn.004010e9
mov dword [ebp - 0x4c], eax
call fcn.0040e18e
mov ecx, eax
call fcn.0040e15f
mov ebx, eax
test ebx, ebx
je 0x40a8f1
push ebx
call esi
lea edi, [eax + eax + 2]
mov eax, edi
add eax, 3
and eax, 0xfffffffc
call fcn.0040f600
mov eax, esp
push dword [ebp - 0x50]
push edi
push ebx
push eax
call fcn.004010e9
mov ebx, eax
call fcn.0040e18e
mov ecx, eax
call fcn.0040e137
mov edi, eax
test edi, edi
je 0x40a924
push edi
call esi
lea esi, [eax + eax + 2]
mov eax, esi
add eax, 3
and eax, 0xfffffffc
call fcn.0040f600
mov eax, esp
push dword [ebp - 0x50]
push esi
push edi
push eax
call fcn.004010e9
push dword [ebp - 0x5c]
push dword [ebp - 0x4c]
push ebx
push eax
lea eax, [ebp + 0x1224]
push str.http:__bugreport.xunlei.com_cgi_bin_bugreport.fcgi_appname_sappversion_sexceptcode_speerid_s
push eax
call dword [sym.imp.MSVCR71.dll_sprintf]
add esp, 0x18
lea ecx, [ebp + 0xd4]
call fcn.004095dc
push 1
lea eax, [ebp + 0x1224]
push eax
lea ecx, [ebp + 0xd4]
call fcn.00409aac
mov eax, dword [ebp - 0x6c]
push str.application_zip
lea ecx, [ebp + 0x11c]
mov dword [ebp + 0x118], eax
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator_char_const__]
mov esi, 0x1000
push esi
lea eax, [ebp + 0x224]
push eax
lea ecx, [ebp + 0xd4]
call fcn.00408bc2
mov edi, dword [sym.imp.WS2_32.dll_send]
push 0
push eax
lea eax, [ebp + 0x224]
push eax
push dword [ebp - 0x58]
call edi
mov ebx, 0x400
push dword [ebp - 0x54]
lea eax, [ebp + 0x224]
push ebx
push 1
push eax
call dword [sym.imp.MSVCR71.dll_fread]
add esp, 0x10
test eax, eax
mov dword [ebp - 0x4c], eax
jbe 0x40a9d8
push 0
push eax
lea eax, [ebp + 0x224]
push eax
push dword [ebp - 0x58]
call edi
cmp dword [ebp - 0x4c], ebx
je 0x40a9ac
push dword [ebp - 0x54]
call dword [sym.imp.MSVCR71.dll_fclose]
push esi
lea eax, [ebp + 0x224]
push 0
push eax
call sub.MSVCR71.dll_memset
mov edi, dword [ebp - 0x58]
add esp, 0x10
push 0
push esi
lea eax, [ebp + 0x224]
push eax
push edi
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0x20
mov esi, dword [sym.imp.WS2_32.dll_closesocket]
jge 0x40aa1a
push edi
call esi
lea ecx, [ebp - 0x48]
call fcn.0040978b
lea eax, [ebp - 0x54]
push eax
lea eax, [ebp + 0x224]
push eax
lea ecx, [ebp - 0x48]
call fcn.004097e7
test eax, eax
je 0x40aa3c
push edi
call esi
push edi
call esi
lea ecx, [ebp - 0x48]
call fcn.00408e50
lea ecx, [ebp + 0xd4]
call fcn.0040965c
lea ecx, [ebp + 0x208]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::destructor_void_]
mov al, 1
jmp 0x40aa70
lea ecx, [ebp + 0x208]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::destructor_void_]
xor al, al
lea esp, [ebp - 0x8c]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x142c]
xor ecx, ebp
call fcn.0040f50d
add ebp, 0x1430
leave
ret