Function at 0x509324
Capabilities:
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffdc
push ebx
push esi
xor ecx, ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x24], ecx
mov ebx, edx
mov esi, eax
xor eax, eax
push ebp
push 0x50958c
push dword fs:[eax]
mov dword fs:[eax], esp
test byte [esi + 0x1c], 0x10
jne 0x50956e
test byte [esi + 0x1c], 1
jne 0x50956e
test bl, bl
je 0x509545
cmp dword [esi + 0x48], 0xffffffff
jne 0x509571
push 0x11
push 2
push 2
call sub.wsock32.dll_socket
mov ebx, eax
mov dword [esi + 0x48], ebx
inc ebx
jne 0x5093b0
call sub.kernel32.dll_GetLastError_1
lea edx, [ebp - 0x24]
call fcn.0040fc54
mov ecx, dword [ebp - 0x24]
lea eax, [ebp - 0x20]
mov edx, 0x5095a4
call fcn.00405184
mov ecx, dword [ebp - 0x20]
mov dl, 1
mov eax, dword [0x40acc4]
call fcn.0041049c
call fcn.004047b0
mov byte [ebp - 1], 1
push 1
lea eax, [ebp - 1]
push eax
push 4
push 0xffff
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_setsockopt
inc eax
mov byte [ebp - 2], 0x40
push 1
lea eax, [ebp - 2]
push eax
push 3
push 0
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_setsockopt
inc eax
mov byte [ebp - 1], 1
push 1
lea eax, [ebp - 1]
push eax
push 4
push 0xffff
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_setsockopt
xor eax, eax
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], 4
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 8]
push eax
push 0x1002
push 0xffff
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_getsockopt
test eax, eax
jne 0x50945a
cmp dword [ebp - 8], 0x2000
jge 0x50945a
mov dword [ebp - 8], 0x2000
mov dword [ebp - 0xc], 4
mov eax, dword [ebp - 0xc]
push eax
lea eax, [ebp - 8]
push eax
push 0x1002
push 0xffff
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_setsockopt
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 8]
push eax
push 0x1001
push 0xffff
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_getsockopt
test eax, eax
jne 0x5094ab
cmp dword [ebp - 8], 0x2000
jge 0x5094ab
mov dword [ebp - 8], 0x2000
mov dword [ebp - 0xc], 4
mov eax, dword [ebp - 0xc]
push eax
lea eax, [ebp - 8]
push eax
push 0x1001
push 0xffff
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_setsockopt
mov word [ebp - 0x1c], 2
mov ax, word [esi + 0x30]
push eax
call sub.wsock32.dll_htons
mov word [ebp - 0x1a], ax
xor eax, eax
mov dword [ebp - 0x18], eax
push 1
push 0x401
mov eax, dword [esi + 0x40]
push eax
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_WSAAsyncSelect
push 0x10
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_bind
inc eax
setne bl
mov byte [esi + 0x44], bl
test bl, bl
je 0x509512
cmp dword [esi + 0x5c], 0
je 0x509571
mov eax, dword [esi + 0x5c]
mov edx, 0x5095b4
call fcn.00405284
je 0x509571
mov dl, 1
mov eax, esi
call fcn.00509ac0
jmp 0x509571
push 2
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_shutdown
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_closesocket
mov dword [esi + 0x48], 0xffffffff
mov ecx, 0x5095c4
mov dl, 1
mov eax, dword [0x40acc4]
call fcn.0041049c
call fcn.004047b0
jmp 0x509571
push 2
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_shutdown
mov eax, dword [esi + 0x48]
push eax
call sub.wsock32.dll_closesocket
xor edx, edx
mov eax, esi
call fcn.00509ac0
mov dword [esi + 0x48], 0xffffffff
mov byte [esi + 0x44], bl
jmp 0x509571
mov byte [esi + 0x44], bl
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x509593
lea eax, [ebp - 0x24]
mov edx, 2
call fcn.00404e80
ret