Function at 0x40fba0
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [0x45f91c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x38], esi
push edi
test esi, esi
jne 0x40fc03
sub esp, 0x10
lea eax, [ebp - 0x48]
xorps xmm0, xmm0
mov dword [ebp - 0x2c], eax
mov eax, esp
movq qword [ebp - 0x48], xmm0
movlpd qword [ebp - 0x34], xmm0
movups xmm0, xmmword [ebp - 0x34]
push str.got_NULL_server
push str.pvpgn::d2cs::s2s_create
push 0x10
movups xmmword [eax], xmm0
call fcn.00415770
add esp, 0x1c
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004217ea
mov esp, ebp
pop ebp
ret
push 0x3f
push str.C:_builder_source_srcd2cs_s2s.cpp
push esi
call fcn.00418820
mov ebx, eax
push 0x3a
push ebx
call fcn.00422ad0
mov edi, eax
add esp, 0x14
test edi, edi
je 0x40fc3b
push 0xa
lea ecx, [edi + 1]
push 0
push ecx
call fcn.0042dd47
add esp, 0xc
movzx eax, ax
mov byte [edi], 0
jmp 0x40fc3f
movzx eax, word [ebp + 0xc]
push 1
mov dword [ebp - 0x3c], eax
call fcn.0040e690
mov edi, eax
add esp, 4
mov dword [ebp - 0x44], edi
xorps xmm0, xmm0
test edi, edi
jns 0x40fca8
sub esp, 0x10
movq qword [ebp - 0x48], xmm0
lea eax, [ebp - 0x48]
movlpd qword [ebp - 0x34], xmm0
mov dword [ebp - 0x2c], eax
mov eax, esp
movups xmm0, xmmword [ebp - 0x34]
push str.error_creating_s2s_socket
push str.pvpgn::d2cs::s2s_create
push 0x10
movups xmmword [eax], xmm0
call fcn.00415770
push 0x4a
push str.C:_builder_source_srcd2cs_s2s.cpp
push ebx
call fcn.00418690
add esp, 0x28
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004217ea
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x3c]
mov eax, 2
movups xmmword [ebp - 0x24], xmm0
mov word [ebp - 0x24], ax
call dword [sym.imp.WS2_32.dll_htons]
push ebx
mov word [ebp - 0x22], ax
call fcn.0040e4d0
push 0x52
push str.C:_builder_source_srcd2cs_s2s.cpp
push ebx
mov dword [ebp - 0x20], eax
call fcn.00418690
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x40]
mov dword [ebp - 0x2c], eax
mov eax, esp
push str.try_make_s2s_connection_to_
mov dword [ebp - 0x34], 0xa
mov dword [ebp - 0x30], 0
movups xmm0, xmmword [ebp - 0x34]
push str.pvpgn::d2cs::s2s_create
push 4
mov dword [ebp - 0x40], esi
movups xmmword [eax], xmm0
call fcn.00415770
add esp, 0x1c
lea eax, [ebp - 0x24]
push 0x10
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x40fdb4
mov ebx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
call ebx
cmp eax, 0x2733
je 0x40fda7
call ebx
cmp eax, 0x2734
je 0x40fda7
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x4c], eax
call ebx
push eax
call fcn.0041f720
mov dword [ebp - 0x48], eax
sub esp, 0xc
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x44], eax
lea eax, [ebp - 0x50]
mov dword [ebp - 0x2c], eax
mov eax, esp
mov dword [ebp - 0x34], 0xaa
mov dword [ebp - 0x30], 0
push str.error_connecting_to___psock_connect:__
movups xmm0, xmmword [ebp - 0x34]
push str.pvpgn::d2cs::s2s_create
push 0x10
movups xmmword [eax], xmm0
call fcn.00415770
add esp, 0x1c
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004217ea
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x38]
xor ebx, ebx
push eax
push str.connection_to_s2s_server__is_in_progress
jmp 0x40fdc2
lea eax, [ebp - 0x38]
mov ebx, 1
push eax
push str.connected_to_s2s_server_
push str.pvpgn::d2cs::s2s_create
push 4
call fcn.00401760
add esp, 0x10
mov dword [ebp - 0x54], 0x10
lea eax, [ebp - 0x54]
xorps xmm0, xmm0
xor esi, esi
movups xmmword [ebp - 0x14], xmm0
push eax
lea eax, [ebp - 0x14]
mov dword [ebp - 0x38], esi
push eax
push edi
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jns 0x40fe2c
sub esp, 0x10
lea eax, [ebp - 0x40]
xorps xmm0, xmm0
mov dword [ebp - 0x2c], eax
mov eax, esp
movq qword [ebp - 0x40], xmm0
movlpd qword [ebp - 0x34], xmm0
movups xmm0, xmmword [ebp - 0x34]
push str.unable_to_get_local_socket_info
push str.pvpgn::d2cs::s2s_create
push 0x10
movups xmmword [eax], xmm0
call fcn.00415770
add esp, 0x1c
jmp 0x40fe8c
mov ax, word [ebp - 0x14]
cmp ax, 2
je 0x40fe74
movzx eax, ax
sub esp, 0x10
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x40]
mov dword [ebp - 0x2c], eax
mov eax, esp
push str.got_bad_socket_family_
mov dword [ebp - 0x34], 3
mov dword [ebp - 0x30], esi
movups xmm0, xmmword [ebp - 0x34]
push str.pvpgn::d2cs::s2s_create
push 0x10
movups xmmword [eax], xmm0
call fcn.00415770
add esp, 0x1c
jmp 0x40fe8c
push dword [ebp - 0x10]
call dword [sym.imp.WS2_32.dll_ntohl]
push dword [ebp - 0x12]
mov dword [ebp - 0x38], eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx esi, ax
push dword [ebp - 0x22]
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
push eax
push dword [ebp - 0x20]
call dword [sym.imp.WS2_32.dll_ntohl]
push eax
push esi
push dword [ebp - 0x38]
push edi
call fcn.00402760
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x40fed8
sub esp, 0x10
lea eax, [ebp - 0x48]
xorps xmm0, xmm0
mov dword [ebp - 0x2c], eax
mov eax, esp
movq qword [ebp - 0x48], xmm0
movlpd qword [ebp - 0x34], xmm0
push str.error_create_s2s_connection
jmp 0x40fd77
push 0x410030
test ebx, ebx
je 0x40ff27
push 1
push esi
call fcn.004017b0
add esp, 0xc
test eax, eax
jns 0x40ff23
lea eax, [ebp - 0x44]
push eax
push str.error_adding_socket__to_fdwatch_pool__max_sockets__
push str.pvpgn::d2cs::s2s_create
push 0x10
call fcn.00409a00
push 0x20
push esi
call fcn.00403060
add esp, 0x18
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004217ea
mov esp, ebp
pop ebp
ret
push 1
jmp 0x40ff38
push 2
push esi
call fcn.004017b0
add esp, 0xc
test eax, eax
js 0x40fef0
push 2
push esi
call fcn.00403060
add esp, 8
push dword [ebp + 0x10]
push esi
call fcn.00403000
mov ecx, dword [ebp - 4]
add esp, 8
mov eax, esi
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004217ea
mov esp, ebp
pop ebp
ret