Function at 0x10139390
Capabilities:
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x17c
mov eax, dword [0x103fbc90]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x108], 0xffffffff
mov dword [ebp - 0x114], 0
push 0x20
push 0
lea eax, [ebp - 0x17c]
push eax
call fcn.103170a0
add esp, 0xc
mov dword [ebp - 0x178], 0
mov dword [ebp - 0x174], 2
mov dword [ebp - 0x170], 0x11
mov dword [ebp - 0x17c], 9
lea ecx, [ebp - 0x114]
push ecx
lea edx, [ebp - 0x17c]
push edx
push 0x103ef4a8
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x1013943a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.getaddrinfo_for_binding_address_failed__errno_d
push 0x45
push 0x103ef4e0
push 4
call fcn.10126d90
add esp, 0x14
or eax, 0xffffffff
jmp 0x10139a14
mov dword [ebp - 0x10c], 0
mov dword [ebp - 0x154], 0x17
mov dword [ebp - 0x150], 2
mov dword [ebp - 0x15c], str.IPv6
mov dword [ebp - 0x158], str.IPv4
mov dword [ebp - 0x11c], 0
jmp 0x10139487
mov edx, dword [ebp - 0x11c]
add edx, 1
mov dword [ebp - 0x11c], edx
cmp dword [ebp - 0x11c], 2
jge 0x1013952c
mov eax, dword [ebp - 0x11c]
mov ecx, dword [ebp + eax*4 - 0x154]
push ecx
mov edx, dword [ebp - 0x114]
push edx
call fcn.1013a270
add esp, 8
mov dword [ebp - 0x10c], eax
cmp dword [ebp - 0x10c], 0
jne 0x101394c2
jmp 0x10139478
mov eax, dword [ebp - 0x10c]
mov ecx, dword [eax + 0xc]
push ecx
mov edx, dword [ebp - 0x10c]
mov eax, dword [edx + 8]
push eax
mov ecx, dword [ebp - 0x10c]
mov edx, dword [ecx + 4]
push edx
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x108], eax
cmp dword [ebp - 0x108], 0xffffffff
jne 0x10139525
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov eax, dword [ebp - 0x11c]
mov ecx, dword [ebp + eax*4 - 0x15c]
push ecx
push str.UDP_socket_creation_for__s_family_failed__errno_d
push 0x54
push 0x103ef578
push 3
call fcn.10126d90
add esp, 0x18
jmp 0x10139478
jmp 0x1013952c
cmp dword [ebp - 0x108], 0xffffffff
jne 0x10139550
push str.UDP_socket_creation_failed:_no_suitable_address_family
push 0x5c
push 0x103ef640
push 4
call fcn.10126d90
add esp, 0x10
jmp 0x101399ee
cmp dword [ebp - 0x10c], 0
jne 0x1013956d
push 0x60
push 0x103ef6b0
push str.ai___NULL
call fcn.10321027
add esp, 0xc
mov dword [ebp - 0x144], 0
mov eax, dword [ebp - 0x10c]
cmp dword [eax + 4], 0x17
jne 0x1013959d
push 4
lea ecx, [ebp - 0x144]
push ecx
push 0x1b
push 0x29
mov edx, dword [ebp - 0x108]
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov dword [ebp - 0x124], 1
push 4
lea eax, [ebp - 0x124]
push eax
push 0xe
push 0
mov ecx, dword [ebp - 0x108]
push ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov edx, dword [ebp - 0x10c]
cmp dword [edx + 4], 0x17
jne 0x101395e7
push 4
lea eax, [ebp - 0x124]
push eax
push 0xe
push 0x29
mov ecx, dword [ebp - 0x108]
push ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov dword [ebp - 0x128], 0x100000
push 4
lea edx, [ebp - 0x128]
push edx
push 0x1002
push 0xffff
mov eax, dword [ebp - 0x108]
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea ecx, [ebp - 0x128]
push ecx
push 0x1001
push 0xffff
mov edx, dword [ebp - 0x108]
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov dword [ebp - 0x148], 1
lea eax, [ebp - 0x148]
push eax
push 0x8004667e
mov ecx, dword [ebp - 0x108]
push ecx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x1013967d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Setting_non_blocking_mode_on_UDP_socket_failed__errno_d
push 0x82
push 0x103ef770
push 4
call fcn.10126d90
add esp, 0x14
jmp 0x101399ee
mov edx, dword [ebp + 8]
movzx eax, word [edx + 4]
test eax, eax
jne 0x1013974f
mov ecx, dword [ebp + 8]
movzx edx, word [ecx + 6]
test edx, edx
jne 0x1013974f
mov eax, dword [ebp - 0x10c]
mov ecx, dword [eax + 0x10]
push ecx
mov edx, dword [ebp - 0x10c]
mov eax, dword [edx + 0x18]
push eax
mov ecx, dword [ebp - 0x108]
push ecx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jne 0x1013972a
mov edx, dword [ebp + 8]
cmp dword [edx], 0
je 0x101396d5
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov dword [ebp - 0x12c], ecx
jmp 0x101396df
mov dword [ebp - 0x12c], 0x103ef6ac
mov edx, dword [ebp - 0x108]
push edx
call fcn.10139d00
add esp, 4
movzx eax, ax
push eax
mov ecx, dword [ebp - 0x12c]
push ecx
push 0x103ef754
push 0x8a
push 0x103ef7e8
push 1
call fcn.10126d90
add esp, 0x18
mov edx, dword [ebp - 0x114]
push edx
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
mov eax, dword [ebp - 0x108]
jmp 0x10139a14
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.UDP_socket_binding_failed__errno_d
push 0x8f
push 0x103ef840
push 4
call fcn.10126d90
add esp, 0x14
jmp 0x101399ee
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 4]
mov edx, dword [ebp + 8]
movzx eax, word [edx + 6]
cmp ecx, eax
jne 0x1013985d
mov ecx, dword [ebp + 8]
mov dx, word [ecx + 4]
mov word [ebp - 0x110], dx
mov eax, dword [ebp - 0x10c]
mov ecx, dword [eax + 0x10]
mov dword [ebp - 0x130], ecx
mov edx, dword [ebp - 0x130]
push edx
mov eax, dword [ebp - 0x10c]
mov ecx, dword [eax + 0x18]
push ecx
lea edx, [ebp - 0x84]
push edx
call fcn.10316b20
add esp, 0xc
movzx eax, word [ebp - 0x110]
push eax
lea ecx, [ebp - 0x84]
push ecx
call fcn.10127220
add esp, 8
mov edx, dword [ebp - 0x130]
push edx
lea eax, [ebp - 0x84]
push eax
mov ecx, dword [ebp - 0x108]
push ecx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jne 0x10139837
mov edx, dword [ebp + 8]
cmp dword [edx], 0
je 0x101397ed
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov dword [ebp - 0x134], ecx
jmp 0x101397f7
mov dword [ebp - 0x134], 0x103ef83c
movzx edx, word [ebp - 0x110]
push edx
mov eax, dword [ebp - 0x134]
push eax
push 0x103ef894
push 0x9a
push 0x103ef8b0
push 1
call fcn.10126d90
add esp, 0x18
mov ecx, dword [ebp - 0x114]
push ecx
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
mov eax, dword [ebp - 0x108]
jmp 0x10139a14
movzx edx, word [ebp - 0x110]
push edx
push str.UDP_socket_binding_failed_on_port__hu__errno_d
push 0x9f
push 0x103ef938
push 4
call fcn.10126d90
add esp, 0x14
jmp 0x101399ee
mov eax, dword [ebp - 0x10c]
mov ecx, dword [eax + 0x10]
mov dword [ebp - 0x138], ecx
mov edx, dword [ebp - 0x138]
push edx
mov eax, dword [ebp - 0x10c]
mov ecx, dword [eax + 0x18]
push ecx
lea edx, [ebp - 0x104]
push edx
call fcn.10316b20
add esp, 0xc
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 6]
mov edx, dword [ebp + 8]
movzx eax, word [edx + 4]
sub ecx, eax
mov dword [ebp - 0x120], ecx
mov ecx, dword [ebp + 8]
movzx edx, word [ecx + 6]
push edx
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 4]
push ecx
call fcn.1013a2a0
add esp, 8
mov word [ebp - 0x118], ax
movzx edx, word [ebp - 0x118]
push edx
lea eax, [ebp - 0x104]
push eax
call fcn.10127220
add esp, 8
mov ecx, dword [ebp - 0x138]
push ecx
lea edx, [ebp - 0x104]
push edx
mov eax, dword [ebp - 0x108]
push eax
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jne 0x10139956
mov ecx, dword [ebp + 8]
cmp dword [ecx], 0
je 0x1013990c
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [ebp - 0x13c], eax
jmp 0x10139916
mov dword [ebp - 0x13c], 0x103ef934
movzx ecx, word [ebp - 0x118]
push ecx
mov edx, dword [ebp - 0x13c]
push edx
push str.UDP_socket_bound_to__s:_hu
push 0xac
push 0x103ef9a8
push 1
call fcn.10126d90
add esp, 0x18
mov eax, dword [ebp - 0x114]
push eax
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
mov eax, dword [ebp - 0x108]
jmp 0x10139a14
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2740
je 0x10139970
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x271d
jne 0x10139998
mov ecx, dword [ebp - 0x120]
mov dword [ebp - 0x14c], ecx
mov edx, dword [ebp - 0x120]
sub edx, 1
mov dword [ebp - 0x120], edx
cmp dword [ebp - 0x14c], 0
jg 0x101398a2
mov eax, dword [ebp + 8]
cmp dword [eax], 0
je 0x101399ad
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov dword [ebp - 0x140], edx
jmp 0x101399b7
mov dword [ebp - 0x140], 0x103ef9fc
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 6]
push ecx
mov edx, dword [ebp + 8]
movzx eax, word [edx + 4]
push eax
mov ecx, dword [ebp - 0x140]
push ecx
push str.UDP_socket_binding_failed_on_port_range__s:__hu__hu___errno_d
push 0xb4
push 0x103efa40
push 4
call fcn.10126d90
add esp, 0x20
mov edx, dword [ebp - 0x114]
push edx
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
cmp dword [ebp - 0x108], 0xffffffff
je 0x10139a11
mov eax, dword [ebp - 0x108]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10314cf5
mov esp, ebp
pop ebp
ret