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

Disassembly:
sub esp, 0x30
mov eax, dword [0x4d4430]
xor eax, esp
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x40]
push edi
or edi, 0xffffffff
cmp dword [esp + 0x40], 0
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edi
jne 0x47d7a8
mov eax, dword [esp + 0x38]
cmp eax, 2
je 0x47d5db
cmp eax, 1
jne 0x47d7a8
test ecx, ecx
jne 0x47d5fc
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
mov eax, edi
pop edi
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.0040c660
add esp, 0x30
ret
push ebx
mov ebx, dword [esp + 0x40]
push ebp
mov ebp, dword [sym.imp.WS2_32.dll_socket]
push esi
push 0
push ebx
push 2
call ebp
mov esi, eax
test esi, esi
js 0x47d792
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov eax, 2
push 0x7f000001
mov word [esp + 0x20], ax
call dword [sym.imp.WS2_32.dll_htonl]
push 0x10
lea edx, [esp + 0x20]
push edx
xor ecx, ecx
push esi
mov dword [esp + 0x2c], eax
mov word [esp + 0x2a], cx
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
je 0x47d75b
push 1
push esi
call dword [sym.imp.WS2_32.dll_listen]
cmp eax, 0xffffffff
je 0x47d75b
push 0
push ebx
push 2
call ebp
mov edi, eax
test edi, edi
js 0x47d75b
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x30]
push ecx
mov ebp, 0x10
push esi
mov dword [esp + 0x1c], ebp
call dword [sym.imp.WS2_32.dll_getsockname]
cmp eax, 0xffffffff
je 0x47d75b
cmp dword [esp + 0x10], ebp
jne 0x47d74d
push ebp
lea edx, [esp + 0x30]
push edx
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x47d75b
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x20]
push ecx
push esi
mov dword [esp + 0x1c], ebp
call dword [sym.imp.WS2_32.dll_accept]
mov ebx, eax
test ebx, ebx
js 0x47d75f
cmp dword [esp + 0x10], ebp
jne 0x47d751
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x30]
push eax
push edi
call dword [sym.imp.WS2_32.dll_getsockname]
cmp eax, 0xffffffff
je 0x47d75f
cmp dword [esp + 0x10], ebp
jne 0x47d751
mov cx, word [esp + 0x1c]
cmp cx, word [esp + 0x2c]
jne 0x47d751
mov edx, dword [esp + 0x20]
cmp edx, dword [esp + 0x30]
jne 0x47d751
mov ax, word [esp + 0x1e]
cmp ax, word [esp + 0x2e]
jne 0x47d751
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [esp + 0x18]
pop esi
pop ebp
mov dword [eax + 4], ebx
mov dword [eax], edi
pop ebx
xor eax, eax
pop edi
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.0040c660
add esp, 0x30
ret
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x14], 0x2745
jmp 0x47d769
mov ebx, dword [esp + 0x14]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x14], eax
mov ebp, dword [sym.imp.WS2_32.dll_closesocket]
cmp esi, 0xffffffff
je 0x47d777
push esi
call ebp
cmp edi, 0xffffffff
je 0x47d77f
push edi
call ebp
cmp ebx, 0xffffffff
je 0x47d787
push ebx
call ebp
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.WS2_32.dll_WSASetLastError]
pop esi
pop ebp
pop ebx
or eax, 0xffffffff
pop edi
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.0040c660
add esp, 0x30
ret
push 0x273f
call dword [sym.imp.WS2_32.dll_WSASetLastError]
mov ecx, dword [esp + 0x30]
mov eax, edi
pop edi
xor ecx, esp
call fcn.0040c660
add esp, 0x30
ret
jmp 0x47d5a0