Function at 0x40c53f
Capabilities:
Connect socket
Connect udp socket
Create udp socket
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov dword [ebp - 0x18], 0x10
mov dword [ebp - 0x14], 0
mov eax, dword [ebp + 8]
mov dword [eax + 4], 0xffffffff
mov ecx, dword [ebp + 8]
mov dword [ecx], 0xffffffff
push 0x10
push 0
lea edx, [ebp - 0x10]
push edx
call sub.MSVCRT.dll_memset
add esp, 0xc
mov word [ebp - 0x10], 2
push 0
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xe], ax
push 0x7f000001
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [ebp - 0xc], eax
push 0
mov eax, dword [ebp + 0xc]
push eax
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
je 0x40c6c6
mov ecx, dword [ebp - 0x18]
push ecx
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jne 0x40c6c6
cmp dword [ebp + 0xc], 2
je 0x40c5e5
push 1
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
jne 0x40c6c6
lea edx, [ebp - 0x18]
push edx
lea eax, [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x40c6c6
push 0
mov edx, dword [ebp + 0xc]
push edx
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
mov edx, dword [ebp + 8]
cmp dword [edx], 0xffffffff
je 0x40c6c6
mov eax, dword [ebp - 0x18]
push eax
lea ecx, [ebp - 0x10]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jne 0x40c6c6
cmp dword [ebp + 0xc], 1
je 0x40c66e
lea ecx, [ebp - 0x18]
push ecx
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x40c6c6
mov edx, dword [ebp - 0x18]
push edx
lea eax, [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jne 0x40c6c6
cmp dword [ebp + 0xc], 2
jne 0x40c67c
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x20], edx
jmp 0x40c691
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x10]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.WS2_32.dll_accept]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x20]
mov dword [eax + 4], ecx
cmp dword [ebp - 0x20], 0xffffffff
je 0x40c6c6
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call fcn.0040c52c
add esp, 4
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 4]
push edx
call fcn.0040c52c
add esp, 4
mov dword [ebp - 0x14], 1
jmp 0x40c703
mov eax, dword [ebp + 8]
cmp dword [eax], 0xffffffff
je 0x40c6da
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp + 8]
cmp dword [eax + 4], 0xffffffff
je 0x40c6f0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 4]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp + 8]
mov dword [eax + 4], 0xffffffff
mov ecx, dword [ebp + 8]
mov dword [ecx], 0xffffffff
cmp dword [ebp + 0xc], 2
je 0x40c713
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret