Function at 0x597060
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
mov ebx, dword [ebp + 8]
mov ecx, 0x40
push esi
mov esi, dword [ebp + 0xc]
push edi
mov eax, dword [ebx + 0x244]
lea edi, [ebx + 0x106]
rep movsd dword es:[edi], dword [esi]
mov dword [ebp + 8], eax
movsw word es:[edi], word [esi]
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x5970d0
mov ecx, dword [esi]
push 0x402
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 5
jl 0x5970d0
mov edx, dword [ebp + 0xc]
mov ecx, dword [esi]
movzx eax, word [edx + 0x100]
push eax
mov eax, dword [ecx]
push edx
push dword [ebx + 0x21c]
push ebx
push str.id_p_handle_p:_connecting_to_to__s:_d
push 0x402
push 5
push esi
call eax
add esp, 0x20
push 4
lea eax, [ebp - 4]
mov dword [ebp - 4], 1
push eax
push 4
push 0xffff
push dword [ebx + 0x21c]
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x597145
call fcn.004db1d0
mov edi, eax
test edi, edi
je 0x59734b
mov ecx, dword [edi]
push 0x402
push edi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 3
jl 0x59734b
mov esi, dword [edi]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [ebx + 0x21c]
mov eax, dword [esi]
push ebx
push str.id_p_handle_p:_setsockopt___call_for_enabling_SO_REUSEADDR_failed_with_WSAError__d
push 0x402
push 3
push edi
call eax
add esp, 0x1c
jmp 0x59734b
mov edi, dword [ebp + 0x18]
mov esi, dword [ebp + 0x14]
push edi
push esi
push dword [ebx + 0x21c]
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x5971e8
call fcn.004db1d0
mov edi, eax
test edi, edi
je 0x5971b1
mov ecx, dword [edi]
push 0x402
push edi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x5971b1
mov esi, dword [edi]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [ebp + 0xc]
push eax
movzx eax, word [ecx + 0x100]
push eax
mov eax, dword [esi]
push ecx
push dword [ebx + 0x21c]
push ebx
push str.id_p_handle_p:_Failed_to_connect_to__s:_d_with_error__d.
push 0x402
push 2
push edi
call eax
add esp, 0x24
mov dword [ebx + 0x22c], 0x200
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00596e30
mov esi, eax
push esi
call fcn.004d86d0
mov eax, dword [ebp + 8]
push esi
push ebx
mov eax, dword [eax]
mov eax, dword [eax + 4]
call eax
add esp, 0x10
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 8]
mov dword [ebp - 8], edi
push eax
push esi
push dword [ebx + 0x21c]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x5972fd
cmp dword [ebx + 0x20c], 0
lea edi, [ebx + 4]
movzx eax, word [esi + 2]
push eax
jne 0x597225
call dword [sym.imp.WS2_32.dll_ntohs]
mov ecx, 2
lea eax, [ecx + 2]
jmp 0x597235
call dword [sym.imp.WS2_32.dll_ntohs]
mov ecx, 0x17
mov eax, 8
push 0x100
push edi
add eax, esi
push eax
push ecx
call sub.WS2_32.dll_inet_ntop
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x59728a
mov ecx, dword [esi]
push 0x402
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 5
jl 0x59728a
movzx eax, word [ebx + 0x104]
mov ecx, dword [esi]
push eax
push edi
push dword [ebx + 0x21c]
mov eax, dword [ecx]
push ebx
push str.id_p_handle_p:_local_endpoint__s:_d
push 0x402
push 5
push esi
call eax
add esp, 0x20
push ebx
call fcn.00597ae0
add esp, 4
test eax, eax
jne 0x5972e9
mov esi, dword [ebp + 0x10]
mov dword [ebx + 0x22c], 0xc
test esi, esi
je 0x5972e0
push esi
push ebx
call fcn.00596590
add esp, 8
test eax, eax
jne 0x5972e9
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 4]
mov dword [eax + 0x30], 0x596df0
mov eax, dword [ecx + 4]
mov dword [eax + 0x34], eax
mov eax, dword [ecx + 4]
mov byte [eax + 0x58], 1
mov eax, dword [ecx + 4]
add eax, 0x30
push eax
push esi
call fcn.00588270
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov dword [ebx + 0x22c], 0x200
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.004db1d0
mov edi, eax
test edi, edi
je 0x597341
mov ecx, dword [edi]
push 0x402
push edi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x597341
mov esi, dword [edi]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [ebx + 0x21c]
mov eax, dword [esi]
push ebx
push str.id_p_handle_p:_Failed_to_connect_with_error__d
push 0x402
push 2
push edi
call eax
add esp, 0x1c
mov dword [ebx + 0x22c], 0x200
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.00596e30
push eax
call fcn.004d86d0
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret