Function at 0x40e136
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 [0x583d10]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
xor ebx, ebx
push 0xff
push ebx
mov byte [ebp - 0x110], bl
mov eax, dword [edi + 0x16c]
mov esi, dword [edi]
mov dword [ebp - 0x140], eax
lea eax, [ebp - 0x10f]
push eax
call fcn.004f2e30
add esp, 0xc
mov byte [ebp - 0x131], bl
mov dword [ebp - 0x13c], ebx
cmp dword [esi + 0x70], ebx
je 0x40e209
push dword [esi + 0x70]
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
je 0x40e1ae
mov edx, dword [esi + 0x70]
mov ecx, eax
push ebx
call fcn.00414908
mov ebx, eax
pop ecx
mov dword [ebp - 0x13c], ebx
jmp 0x40e205
push dword [esi + 0x70]
call fcn.004f95a0
pop ecx
cmp eax, 1
jbe 0x40e209
and dword [ebp - 0x138], ebx
lea eax, [ebp - 0x138]
push eax
push 0
lea edx, [ebp - 0x110]
mov ecx, edi
call fcn.00406ddb
pop ecx
pop ecx
cmp eax, 1
jne 0x40e1ec
lea edx, [ebp - 0x138]
mov ecx, edi
call fcn.0040a922
mov edx, dword [ebp - 0x138]
test edx, edx
je 0x40e209
mov ebx, dword [edx]
mov ecx, esi
mov dword [ebp - 0x13c], ebx
call fcn.00406f2b
test ebx, ebx
jne 0x40e242
lea eax, [ebp - 0x138]
mov dword [ebp - 0x138], 0x10
push eax
lea eax, [ebp - 0x120]
push eax
push dword [edi + 0xa0]
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jns 0x40e23b
push str.getsockname___failed
jmp 0x40e403
mov byte [ebp - 0x131], 1
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40e3fe
mov eax, dword [edi + 0xa4]
cmp eax, 0xffffffff
je 0x40e26b
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
cmp byte [ebp - 0x131], 0
mov dword [edi + 0xa4], ebx
jne 0x40e29b
mov eax, dword [ebp - 0x13c]
push 0x10
push dword [eax + 0x14]
lea eax, [ebp - 0x120]
push eax
call fcn.004f27e0
add esp, 0xc
and dword [ebp - 0x11c], 0
xor eax, eax
mov word [ebp - 0x11e], ax
lea eax, [ebp - 0x120]
push 0x10
push eax
push ebx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x40e3f7
lea eax, [ebp - 0x138]
mov dword [ebp - 0x138], 0x10
push eax
lea eax, [ebp - 0x130]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
js 0x40e231
push dword [ebp - 0x12e]
call dword [sym.imp.WS2_32.dll_ntohs]
push 1
movzx eax, ax
push ebx
mov dword [ebp - 0x144], eax
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x40e30f
push str.listen_2__failed_on_socket
jmp 0x40e403
cmp byte [ebp - 0x131], 0
push 0x100
je 0x40e335
lea eax, [ebp - 0x110]
push eax
push 2
lea edx, [ebp - 0x11c]
pop ecx
call fcn.00414a22
pop ecx
jmp 0x40e346
mov ecx, dword [ebp - 0x13c]
lea edx, [ebp - 0x110]
call fcn.00406ca3
pop ecx
lea eax, [ebp - 6]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xa]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x110]
push str._hu._hu._hu._hu
push eax
call fcn.004f7ccc
add esp, 0x18
cmp eax, 4
jne 0x40e40b
mov eax, dword [ebp - 0x144]
movzx ebx, ax
movzx eax, word [ebp - 6]
push ebx
push eax
movzx eax, word [ebp - 8]
push eax
movzx eax, word [ebp - 0xa]
push eax
movzx eax, word [ebp - 0xc]
push eax
push str.Telling_server_to_connect_to__d._d._d._d:_d_n
push esi
call fcn.004017c3
add esp, 0x1c
movzx eax, bl
shr ebx, 8
push eax
movzx eax, word [ebp - 6]
push ebx
push eax
movzx eax, word [ebp - 8]
push eax
movzx eax, word [ebp - 0xa]
push eax
movzx eax, word [ebp - 0xc]
push eax
push str.PORT__d__d__d__d__d__d
push edi
call fcn.00410361
add esp, 0x20
test eax, eax
jne 0x40e40e
mov ecx, dword [ebp - 0x13c]
call fcn.004148f0
mov eax, dword [ebp - 0x140]
mov dword [eax + 0x48], 2
mov eax, dword [edi + 0x16c]
mov dword [eax + 0x68], 0x19
xor eax, eax
jmp 0x40e40e
push str.bind_2__failed_on_socket
jmp 0x40e403
push str.socket_2__failed___s_
push esi
call fcn.00401832
pop ecx
pop ecx
push 0x1e
pop eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004f225b
mov esp, ebp
pop ebp
ret