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

Disassembly:
push ebp
mov eax, 0x4b3690
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov esi, dword [ebp + 0xc]
call fcn.00415660
test eax, eax
mov ebx, eax
je 0x41824f
mov eax, dword [0x4ee454]
test eax, eax
je 0x4182b5
mov eax, 2
mov dword [ebp - 0x28], 0
mov word [ebp - 0x28], ax
movzx eax, word [ebp + 8]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_htons]
sub esp, 4
mov word [ebp - 0x26], ax
mov dword [esp], 0x7f000001
call dword [sym.imp.WS2_32.dll_htonl]
sub esp, 4
mov dword [ebp - 0x24], eax
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp], 2
call dword [sym.imp.WS2_32.dll_socket]
sub esp, 0xc
cmp eax, 0xffffffff
mov edi, eax
je 0x41824f
mov dword [ebx + 0xc], eax
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 1
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0xfffffffb
mov dword [esp + 4], 0xffff
mov dword [esp], edi
call dword [sym.imp.WS2_32.dll_setsockopt]
lea eax, [ebp - 0x28]
sub esp, 0x14
mov dword [esp + 8], 0x10
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [sym.imp.WS2_32.dll_bind]
sub esp, 0xc
test eax, eax
js 0x4182a5
cmp esi, 1
mov edx, str.udp:
je 0x418284
mov edi, dword [ebx + 4]
mov eax, 0xffffffff
test edi, edi
je 0x418215
cmp ebx, 0x4ee460
jb 0x418215
cmp ebx, 0x4f0060
jae 0x418215
mov eax, ebx
sub eax, 0x4ee460
sar eax, 3
imul eax, eax, 0xb6db6db7
add eax, 0x64
mov ecx, dword [ebp + 8]
mov dword [esp + 0xc], eax
lea eax, [ebx + 0x18]
mov dword [esp + 0x10], edx
mov dword [esp + 8], str._d_lo_server:_s_d_
mov dword [esp + 0x14], ecx
mov dword [esp + 4], 0x20
mov dword [esp], eax
call fcn.0049e4c0
test byte [0x4ee060], 0x80
jne 0x4182c5
mov eax, dword [ebx + 4]
test eax, eax
jne 0x418260
mov eax, 0xffffffff
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp ebx, 0x4ee460
jb 0x41824f
cmp ebx, 0x4f0060
jae 0x41824f
sub ebx, 0x4ee460
sar ebx, 3
imul ebx, ebx, 0xb6db6db7
lea eax, [ebx + 0x64]
jmp 0x418254
mov dword [esp + 4], 4
mov dword [esp], edi
call dword [sym.imp.WS2_32.dll_listen]
mov edx, 0x4b26b9
sub esp, 8
test eax, eax
jns 0x4181e6
mov eax, dword [ebx + 4]
test eax, eax
je 0x41824f
mov eax, ebx
call fcn.00414dd0
jmp 0x41824f
call fcn.00415050
lea esi, [esi]
jmp 0x41810d
mov edi, dword [sym.imp.msvcrt.dll__errno]
call edi
mov eax, dword [eax]
mov dword [esp], 0x4ee068
mov dword [ebp - 0x3c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebp - 0x40], eax
call sub.msvcrt.dll__getpid
mov edx, dword [ebp - 0x40]
mov dword [esp + 8], str.socket_loopback_server
mov dword [esp + 4], 0x4b2138
mov dword [esp + 0x10], edx
mov edx, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 0xc], eax
lea eax, [edx + 0x40]
mov dword [esp], eax
call fcn.0049e490
call edi
mov ecx, dword [ebp - 0x3c]
mov edx, 0xffffffff
mov dword [eax], ecx
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x418353
cmp ebx, 0x4ee460
jb 0x418353
cmp ebx, 0x4f0060
jae 0x418353
mov edx, ebx
sub edx, 0x4ee460
sar edx, 3
imul edx, edx, 0xb6db6db7
add edx, 0x64
cmp esi, 1
mov ecx, 0x4b26b0
mov eax, 0x4b26ac
cmove eax, ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x10], edx
mov dword [esp + 4], str.socket_loopback_server:_port__d_type__s___fd__d_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0049e490
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov dword [esp], 0x4ee068
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
call edi
mov ecx, dword [ebp - 0x3c]
mov dword [eax], ecx
mov eax, dword [ebx + 4]
test eax, eax
je 0x41824f
jmp 0x418260