Function at 0x418940
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x458bec
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x128
push ebx
push esi
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x20], esi
jne 0x41898d
pop esi
or eax, eax
pop ebx
mov ecx, dword [esp + 0x128]
mov dword fs:[0], ecx
add esp, 0x134
ret
lea eax, [esp + 8]
mov dword [esp + 8], 1
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x4189cb
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
pop esi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x128]
mov dword fs:[0], ecx
add esp, 0x134
ret
mov cl, byte [esp + 0xf]
push ebp
mov ebp, dword [esp + 0x148]
push edi
mov byte [esp + 0x18], cl
push 0
lea ecx, [esp + 0x1c]
and ebp, 0xffff
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov edi, dword [esp + 0x148]
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
lea ecx, [esp + 0x1c]
push ebx
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x418a3d
mov esi, dword [esp + 0x148]
mov edi, dword [esp + 0x1c]
mov ecx, ebx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x28]
mov dword [esp + 0x20], ebx
mov byte [eax + ebx], 0
mov ebx, dword [esp + 0x158]
mov dword [esp + 0x140], 0
mov al, byte [ebx + 0x38]
test al, al
je 0x418a6f
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov edx, dword [ecx]
lea ecx, [esp + 0x18]
push edx
push 0
push ebx
call dword [sym.imp.MSVCP60.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__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov ebp, dword [ebx + 0x10]
mov edi, dword [esp + 0x154]
push ebp
mov word [edi], 2
call dword [sym.imp.WS2_32.dll_htons]
mov word [edi + 2], ax
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x418a93
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0x10
push edi
push esi
mov dword [edi + 4], eax
call dword [sym.imp.WS2_32.dll_connect]
pop edi
pop ebp
test eax, eax
jne 0x418af1
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x418c0b
mov al, byte [ecx - 1]
test al, al
je 0x418c01
cmp al, 0xff
je 0x418c01
dec al
pop esi
mov byte [ecx - 1], al
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x128]
mov dword fs:[0], ecx
add esp, 0x134
ret
mov ecx, dword [esp + 0x148]
mov eax, 0x10624dd3
mul ecx
shr edx, 6
mov dword [esp + 0x24], edx
mov dword [esp + 0x30], esi
lea edx, [edx + edx*4]
mov dword [esp + 0x2c], 1
lea eax, [edx + edx*4]
lea edx, [esp + 0x2c]
lea eax, [eax + eax*4]
shl eax, 3
sub ecx, eax
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0x24]
push ecx
push 0
push edx
push 0
push 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x418aad
lea eax, [esp + 8]
mov dword [esp + 8], 0
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
je 0x418bc9
mov al, byte [ebx + 0x38]
test al, al
je 0x418c24
mov eax, dword [ebx + 0x34]
test eax, eax
jne 0x418b8d
mov ecx, dword [esp + 0x144]
mov edx, dword [esp + 0x140]
push ecx
push edx
push esi
call fcn.00421d90
add esp, 0xc
jmp 0x418bc5
cmp eax, 1
jne 0x418bc9
mov ecx, dword [ebx + 0x28]
mov edx, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
test ecx, ecx
jne 0x418ba1
mov ecx, edx
mov eax, dword [ebx + 0x18]
test eax, eax
jne 0x418baa
mov eax, edx
push ecx
mov ecx, dword [esp + 0x144]
push eax
mov eax, dword [esp + 0x14c]
push eax
push ecx
push esi
call fcn.00421e50
add esp, 0x14
test eax, eax
je 0x418c24
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x418c0b
mov al, byte [ecx - 1]
test al, al
je 0x418c01
cmp al, 0xff
je 0x418c01
dec al
pop esi
mov byte [ecx - 1], al
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x128]
mov dword fs:[0], ecx
add esp, 0x134
ret
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
pop esi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x128]
mov dword fs:[0], ecx
add esp, 0x134
ret
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x418c48
mov al, byte [ecx - 1]
test al, al
je 0x418c3e
cmp al, 0xff
je 0x418c3e
dec al
mov byte [ecx - 1], al
jmp 0x418c48
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov ecx, dword [esp + 0x130]
mov eax, esi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x134
ret