Function at 0x4b58d0
Capabilities:
Create tcp socket
Create udp socket
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x144
mov eax, dword [0x76c12c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [edi]
push esi
push 0xff
lea eax, [ebp - 0x10b]
push 0
push eax
mov byte [ebp - 0x10c], 0
call fcn.005902c0
mov dword [ebp - 0x138], 0x10
mov esi, dword [ebx + 0x2b8]
add esp, 0xc
mov byte [ebp - 0x12d], 0
mov dword [ebp - 0x134], 0
mov byte [ebp - 0x12e], 1
test esi, esi
je 0x4b595b
push esi
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
je 0x4b599f
push 0
push esi
push eax
call fcn.004a2750
add esp, 0xc
mov dword [ebp - 0x134], eax
cmp dword [ebp - 0x134], 0
jne 0x4b5a72
mov ecx, dword [edi + 0xa4]
lea edx, [ebp - 0x138]
push edx
lea eax, [ebp - 0x11c]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x4b5a58
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push edi
call fcn.004c1590
push eax
push str.getsockname___failed:__s
push ebx
call fcn.004ab1b0
add esp, 0x14
jmp 0x4b5c73
push 0x100
lea ecx, [ebp - 0x10c]
push ecx
push esi
call fcn.004c1650
add esp, 0xc
test eax, eax
je 0x4b59d3
lea edx, [ebp - 0x10c]
push edx
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0
lea ecx, [ebp - 0x10c]
push ecx
jmp 0x4b593f
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4b59d8
sub eax, edx
cmp eax, 1
jbe 0x4b595b
lea edx, [ebp - 0x13c]
push edx
push 0
push esi
push edi
mov dword [ebp - 0x13c], 0
call fcn.004a2560
add esp, 0x10
cmp eax, 1
jne 0x4b5a1c
lea eax, [ebp - 0x13c]
push eax
push edi
call fcn.004b07d0
add esp, 8
mov eax, dword [ebp - 0x13c]
test eax, eax
je 0x4b5a44
mov ecx, dword [eax]
push eax
push ebx
mov dword [ebp - 0x134], ecx
call fcn.004a2410
add esp, 8
mov byte [ebp - 0x12e], 0
jmp 0x4b594e
push esi
push str.Failed_to_resolve_host_name__s_n
push ebx
call fcn.004ab130
add esp, 0xc
jmp 0x4b595b
mov eax, 0x10
cmp dword [ebp - 0x138], eax
jle 0x4b5a6b
mov dword [ebp - 0x138], eax
mov byte [ebp - 0x12d], 1
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x4b5c65
mov eax, dword [edi + 0xa8]
cmp eax, 0xffffffff
je 0x4b5a9b
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
cmp byte [ebp - 0x12d], 0
mov dword [edi + 0xa8], esi
jne 0x4b5ad4
mov edx, dword [ebp - 0x138]
mov eax, dword [ebp - 0x134]
mov ecx, dword [eax + 0x18]
push edx
push ecx
lea edx, [ebp - 0x11c]
push edx
call fcn.005905c0
add esp, 0xc
mov dword [ebp - 0x118], 0
push 0x10
lea ecx, [ebp - 0x11c]
push ecx
xor eax, eax
push esi
mov word [ebp - 0x11a], ax
mov dword [ebp - 0x138], 0x10
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jne 0x4b5c5e
lea edx, [ebp - 0x140]
push edx
lea eax, [ebp - 0x12c]
push eax
push esi
mov dword [ebp - 0x140], 0x10
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x4b597e
mov ecx, dword [ebp - 0x12a]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, ax
push 1
push esi
mov dword [ebp - 0x144], edx
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x4b5b53
push str.listen_2__failed_on_socket
jmp 0x4b5c6a
cmp byte [ebp - 0x12d], 0
push 0x100
je 0x4b5b7b
lea eax, [ebp - 0x10c]
push eax
lea ecx, [ebp - 0x118]
push ecx
push 2
call fcn.004aec50
add esp, 0x10
jmp 0x4b5b91
mov eax, dword [ebp - 0x134]
lea edx, [ebp - 0x10c]
push edx
push eax
call fcn.004a2180
add esp, 0xc
lea ecx, [ebp - 6]
push ecx
lea edx, [ebp - 8]
push edx
lea eax, [ebp - 0xa]
push eax
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 0x10c]
push str._hu._hu._hu._hu
push edx
call fcn.00590dac
add esp, 0x18
cmp eax, 4
jne 0x4b5c73
movzx esi, word [ebp - 0x144]
movzx eax, word [ebp - 6]
movzx ecx, word [ebp - 8]
movzx edx, word [ebp - 0xa]
push esi
push eax
movzx eax, word [ebp - 0xc]
push ecx
push edx
push eax
push str.Telling_server_to_connect_to__d._d._d._d:_d_n
push ebx
call fcn.004ab130
movzx edx, word [ebp - 6]
movzx eax, word [ebp - 8]
mov ecx, esi
and ecx, 0xff
push ecx
movzx ecx, word [ebp - 0xa]
shr esi, 8
push esi
push edx
movzx edx, word [ebp - 0xc]
push eax
push ecx
push edx
push str.PORT__d__d__d__d__d__d
push edi
call fcn.004b5100
add esp, 0x3c
test eax, eax
jne 0x4b5c78
cmp byte [ebp - 0x12e], al
je 0x4b5c2f
mov eax, dword [ebp - 0x134]
push eax
call fcn.004a2450
add esp, 4
mov dword [edi + 0x30c], 1
mov eax, 0x1a
mov ecx, edi
mov byte [edi + 0x121], 1
call fcn.004b4b70
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0058cf08
mov esp, ebp
pop ebp
ret
push str.bind_2__failed_on_socket
jmp 0x4b5c6a
push str.socket_2__failed___s_
push ebx
call fcn.004ab1b0
add esp, 8
mov eax, 0x1e
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.0058cf08
mov esp, ebp
pop ebp
ret