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

Disassembly:
sub esp, 0x24
mov eax, dword [esp + 0x2c]
test eax, eax
push ebx
push ebp
push esi
push edi
mov di, dx
mov word [esp + 0x10], di
mov ebx, ecx
je 0x504a21
cmp eax, 1
jne 0x504a18
mov dword [esp + 0x14], 2
jmp 0x504a29
cmp eax, 2
jne 0x504d20
mov dword [esp + 0x14], 1
mov eax, dword [esp + 0x38]
test eax, eax
je 0x504a36
mov word [eax], 0
movzx eax, bx
movzx esi, di
sub esi, eax
mov dword [esp + 0x1c], eax
je 0x504a7f
mov eax, dword [0x5ae594]
test eax, eax
je 0x504a79
call fcn.00504540
inc esi
test esi, esi
mov dword [esp + 0x20], esi
fild dword [esp + 0x20]
jge 0x504a65
fadd qword [0x584288]
call fcn.005713da
fiadd dword [esp + 0x1c]
call fcn.0056fe50
mov esi, eax
mov ebp, esi
jmp 0x504a83
mov esi, ebx
mov ebp, esi
jmp 0x504a83
mov esi, ebx
mov ebp, ebx
cmp dword [esp + 0x40], 2
je 0x504aa4
mov eax, dword [esp + 0x44]
test eax, eax
mov eax, dword [0x59bcf4]
jne 0x504a9c
mov eax, dword [0x5ae590]
test eax, eax
je 0x504c17
mov dword [esp + 0x44], 0
lea esp, [esp]
mov eax, dword [esp + 0x44]
mov ecx, dword [0x5a3a48]
inc eax
mov dword [esp + 0x44], eax
mov eax, ecx
test eax, eax
je 0x504af7
mov edx, dword [eax + 0x520]
test edx, edx
je 0x504aed
cmp word [eax + 0x51c], si
jne 0x504aed
inc esi
cmp si, di
jbe 0x504ae0
mov esi, ebx
cmp si, bp
je 0x504c17
mov eax, ecx
jmp 0x504af3
mov eax, dword [eax + 0x88c]
test eax, eax
jne 0x504ac5
mov ecx, dword [0x5afc18]
mov eax, ecx
test eax, eax
je 0x504b35
mov edx, dword [eax + 0x33c]
test edx, edx
je 0x504b2b
cmp word [eax + 0x354], si
jne 0x504b2b
inc esi
cmp si, di
jbe 0x504b1e
mov esi, ebx
cmp si, bp
je 0x504c17
mov eax, ecx
jmp 0x504b31
mov eax, dword [eax + 0x3cc]
test eax, eax
jne 0x504b03
mov ecx, dword [0x5a8ba4]
mov eax, ecx
test eax, eax
je 0x504b73
mov edx, dword [eax + 0x440]
test edx, edx
je 0x504b69
cmp word [eax + 0x454], si
jne 0x504b69
inc esi
cmp si, di
jbe 0x504b5c
mov esi, ebx
cmp si, bp
je 0x504c17
mov eax, ecx
jmp 0x504b6f
mov eax, dword [eax + 0x4bc]
test eax, eax
jne 0x504b41
mov ecx, dword [0x5b1224]
mov eax, ecx
test eax, eax
je 0x504ba8
nop
cmp word [eax + 0xc8], si
jne 0x504b9e
inc esi
cmp si, di
jbe 0x504b91
mov esi, ebx
cmp si, bp
je 0x504c17
mov eax, ecx
jmp 0x504ba4
mov eax, dword [eax + 0x198]
test eax, eax
jne 0x504b80
mov ecx, esi
call fcn.00504850
test eax, eax
jne 0x504bfe
push eax
mov eax, dword [esp + 0x18]
push eax
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x504c17
mov edx, esi
mov ecx, edi
call fcn.00504920
test eax, eax
je 0x504bf2
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x504cd7
push 5
push edi
call dword [sym.imp.WSOCK32.dll_listen]
test eax, eax
je 0x504cd7
push edi
call dword [sym.imp.WSOCK32.dll_closesocket]
mov di, word [esp + 0x10]
inc esi
cmp si, di
jbe 0x504c06
mov esi, ebx
cmp si, bp
je 0x504c17
cmp word [esp + 0x44], 0x32
jb 0x504ab0
cmp dword [esp + 0x40], 2
je 0x504d20
mov ecx, dword [esp + 0x14]
push 0
push ecx
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x504ccb
mov edi, dword [esp + 0x3c]
cmp edi, 1
je 0x504c4a
cmp edi, 2
jne 0x504c64
mov eax, dword [0x5ae598]
test eax, eax
je 0x504c5c
mov al, byte [0x5ae5a0]
test al, al
jne 0x504c64
mov eax, dword [esp + 0x38]
test eax, eax
je 0x504ccb
xor edx, edx
mov ecx, esi
call fcn.00504920
test eax, eax
je 0x504d19
cmp edi, 1
je 0x504c98
cmp edi, 2
je 0x504c98
test edi, edi
jne 0x504d19
push 5
push esi
call dword [sym.imp.WSOCK32.dll_listen]
test eax, eax
jne 0x504d19
mov edi, dword [esp + 0x38]
test edi, edi
je 0x504ccb
lea edx, [esp + 0x18]
push edx
lea eax, [esp + 0x28]
push eax
push esi
mov dword [esp + 0x24], 0x10
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jne 0x504ccb
mov ecx, dword [esp + 0x26]
push ecx
call dword [sym.imp.WSOCK32.dll_ntohs]
mov word [edi], ax
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret 0x10
mov ebx, dword [esp + 0x38]
test ebx, ebx
je 0x504d0d
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x28]
push edx
push edi
mov word [ebx], si
mov dword [esp + 0x24], 0x10
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jne 0x504d0d
mov eax, dword [esp + 0x26]
push eax
call dword [sym.imp.WSOCK32.dll_ntohs]
mov word [ebx], ax
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret 0x10
push esi
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x24
ret 0x10