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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x40
mov dword [ebp - 0x30], 0
cmp eax, 2
je 0x40b090
mov dword [esp + 4], str.AF_INET6
mov ebx, eax
mov dword [esp], 0x41412e
call fcn.004012c0
mov dword [esp + 8], 0x11
mov dword [esp + 4], 2
mov dword [esp], ebx
call dword [sym.imp.ws2_32.dll_socket]
sub esp, 0xc
mov edi, eax
call fcn.0040f800
mov esi, dword [sym.imp.ws2_32.dll_WSAGetLastError]
mov dword [eax], 0x4141a7
mov dword [eax + 4], 0x850
call esi
mov dword [esp + 4], str.socket_error__d_n
mov dword [esp + 8], eax
xor eax, eax
cmp edi, 0xffffffff
setne al
mov dword [esp], eax
call fcn.00402000
mov dword [ebp - 0x26], 0
xor ecx, ecx
xor eax, eax
mov dword [ebp - 0x10], 0
mov edx, 0x18
mov dword [ebp + eax - 0x24], ecx
add eax, 4
cmp eax, edx
jb 0x40aeaa
mov eax, 0x17
mov dword [ebp - 0x2c], 0x1c
mov word [ebp - 0x28], ax
mov eax, dword [0x417ee8]
mov dword [ebp - 0x20], eax
mov eax, dword [0x417eec]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x417ef0]
mov dword [ebp - 0x18], eax
mov eax, dword [0x417ef4]
mov dword [ebp - 0x14], eax
mov eax, 0x869
call fcn.00401820
call esi
lea edx, [ebp - 0x28]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov dword [esp], edi
call dword [sym.imp.ws2_32.dll_bind]
mov ecx, dword [ebp - 0x34]
sub esp, 0xc
test eax, eax
sete al
mov dword [esp + 8], ecx
movzx eax, al
mov dword [esp + 4], str.bind_error__d_n
mov dword [esp], eax
call fcn.00402000
mov eax, 0x86a
call fcn.00401820
call esi
lea edx, [ebp - 0x28]
mov dword [esp], edi
mov esi, eax
lea eax, [ebp - 0x2c]
mov dword [esp + 4], edx
mov dword [esp + 8], eax
call dword [sym.imp.ws2_32.dll_getsockname]
sub esp, 0xc
test eax, eax
sete al
mov dword [esp + 8], esi
movzx eax, al
mov dword [esp + 4], str.getsockname_error__d_n
mov dword [esp], eax
call fcn.00402000
mov eax, ebx
lea ecx, [ebp - 0x30]
mov edx, 1
movzx esi, word [ebp - 0x26]
call fcn.00401500
mov ebx, eax
test eax, eax
jne 0x40b2a8
mov edx, dword [ebp - 0x30]
mov ecx, dword [edx]
test ecx, ecx
je 0x40b030
lea eax, [edx + 4]
jmp 0x40afae
add ebx, 1
add eax, 0x1c
cmp ebx, ecx
je 0x40b030
cmp dword [eax + 0x14], esi
jne 0x40afa0
cmp word [eax], 0
jne 0x40afa0
cmp word [eax + 2], 0
jne 0x40afa0
cmp word [eax + 4], 0
jne 0x40afa0
cmp word [eax + 6], 0
jne 0x40afa0
cmp word [eax + 8], 0
jne 0x40afa0
cmp word [eax + 0xa], 0
jne 0x40afa0
cmp word [eax + 0xc], 0
jne 0x40afa0
cmp word [eax + 0xe], 0x100
jne 0x40afa0
imul ebx, ebx, 0x1c
mov eax, 0x88f
mov dword [ebp - 0x34], edx
call fcn.00401820
mov edx, dword [ebp - 0x34]
mov ecx, dword fs:[0x18]
mov eax, dword [edx + ebx + 0x1c]
mov dword [esp + 4], str.unexpected_socket_owner__04lx_n
mov ebx, 1
mov dword [esp + 8], eax
cmp dword [ecx + 0x20], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00402000
mov edx, dword [ebp - 0x34]
jmp 0x40b032
xor ebx, ebx
mov dword [ebp - 0x34], edx
mov eax, 0x894
call fcn.00401820
mov dword [esp + 4], str.no_table_entry_for_socket_n
mov dword [esp], ebx
call fcn.00402000
mov edx, dword [ebp - 0x34]
mov dword [ebp - 0x34], edx
mov dword [esp], edi
call dword [sym.imp.ws2_32.dll_closesocket]
mov edx, dword [ebp - 0x34]
sub esp, 4
mov dword [esp], edx
call dword [sym.imp.msvcrt.dll_free]
call fcn.0040f800
mov edx, dword [eax + 0xbec]
test edx, edx
je 0x40b085
sub edx, 1
mov dword [eax + 0xbec], edx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], str.AF_INET
mov dword [esp], 0x41412e
call fcn.004012c0
mov dword [esp + 8], 0x11
mov dword [esp + 4], 2
mov dword [esp], 2
call dword [sym.imp.ws2_32.dll_socket]
sub esp, 0xc
mov edi, eax
call fcn.0040f800
mov ebx, dword [sym.imp.ws2_32.dll_WSAGetLastError]
mov dword [eax], 0x4141a7
mov dword [eax + 4], 0x850
call ebx
mov dword [esp + 4], str.socket_error__d_n
mov dword [esp + 8], eax
xor eax, eax
cmp edi, 0xffffffff
setne al
xor esi, esi
mov dword [esp], eax
call fcn.00402000
mov eax, dword [sym.imp.ws2_32.dll_htonl]
xor edx, edx
mov ecx, 2
mov word [ebp - 0x28], cx
mov word [ebp - 0x1a], dx
mov dword [ebp - 0x26], 0
mov dword [ebp - 0x22], 0
mov dword [ebp - 0x1e], 0
mov dword [ebp - 0x2c], 0x10
mov dword [esp], 0x7f000001
mov dword [ebp - 0x3c], eax
call eax
mov word [ebp - 0x26], si
lea esi, [ebp - 0x28]
mov dword [ebp - 0x24], eax
sub esp, 4
mov eax, 0x85b
call fcn.00401820
call ebx
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov dword [esp], edi
call dword [sym.imp.ws2_32.dll_bind]
mov edx, dword [ebp - 0x34]
sub esp, 0xc
test eax, eax
sete al
mov dword [esp + 8], edx
movzx eax, al
mov dword [esp + 4], str.bind_error__d_n
mov dword [esp], eax
call fcn.00402000
mov eax, 0x85c
call fcn.00401820
call ebx
mov dword [esp + 4], esi
mov ebx, eax
lea eax, [ebp - 0x2c]
mov dword [esp], edi
mov dword [esp + 8], eax
call dword [sym.imp.ws2_32.dll_getsockname]
sub esp, 0xc
test eax, eax
sete al
mov dword [esp + 8], ebx
movzx eax, al
mov dword [esp + 4], str.getsockname_error__d_n
mov dword [esp], eax
call fcn.00402000
lea ecx, [ebp - 0x30]
mov edx, 1
mov eax, 2
movzx esi, word [ebp - 0x26]
call fcn.00401500
mov ebx, eax
test eax, eax
jne 0x40b2a8
mov edx, dword [ebp - 0x30]
movzx ecx, si
mov eax, dword [edx]
lea esi, [edx + 4]
test eax, eax
je 0x40b295
mov dword [ebp - 0x40], edi
mov edi, edx
jmp 0x40b21a
add ebx, 1
add esi, 0xc
cmp ebx, dword [edi]
jae 0x40b290
cmp dword [esi + 4], ecx
jne 0x40b210
mov eax, dword [esi]
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x34], eax
mov dword [esp], 0x7f000001
mov ecx, dword [ebp - 0x3c]
call ecx
mov ecx, dword [ebp - 0x38]
sub esp, 4
cmp dword [ebp - 0x34], eax
jne 0x40b210
mov eax, 0x87f
mov dword [ebp - 0x34], edi
mov edi, dword [ebp - 0x40]
call fcn.00401820
mov edx, dword [ebp - 0x34]
lea eax, [ebx + ebx*2]
mov ebx, 1
mov ecx, dword fs:[0x18]
mov eax, dword [edx + eax*4 + 0xc]
mov dword [esp + 4], str.unexpected_socket_owner__04lx_n
mov dword [esp + 8], eax
cmp dword [ecx + 0x20], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00402000
mov edx, dword [ebp - 0x34]
jmp 0x40b297
mov edx, edi
mov edi, dword [ebp - 0x40]
xor ebx, ebx
mov dword [ebp - 0x34], edx
mov eax, 0x884
jmp 0x40b03a
mov eax, 0x872
call fcn.00401820
mov dword [esp + 4], ebx
mov dword [esp], str.error__lu_getting_UDP_table_n
call fcn.00401b20
mov edx, dword [ebp - 0x30]
jmp 0x40b052