Function at 0x403910
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x5c
mov eax, dword [0x4f5608]
xor eax, esp
mov dword [esp + 0x54], eax
push ebx
push ebp
push esi
push edi
xor edi, edi
mov ebx, 1
mov dword [esp + 0x18], ebx
cmp dword [0x4ff0b8], edi
jne 0x403949
cmp dword [0x4fde30], edi
jne 0x403949
mov dword [esp + 0x14], ebx
cmp dword [0x4fde34], edi
je 0x40394d
mov dword [esp + 0x14], edi
mov eax, dword [0x4fde38]
mov dword [0x4fdcf0], edi
mov ecx, dword [0x4fdcf0]
mov dword [0x4fdd14], ecx
mov dword [0x4fdce0], edi
mov edx, dword [0x4fdce0]
add eax, 2
push eax
mov dword [0x4fdd10], edx
call fcn.00404430
add esp, 4
push 0x4fdcf8
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea edx, [esp + 0x5c]
mov eax, 0x4f1bbc
mov esi, 4
jmp 0x4039a0
mov cl, byte [eax]
mov byte [edx], cl
add edx, ebx
add eax, ebx
test cl, cl
je 0x4039b2
sub esi, ebx
jne 0x4039a0
jmp 0x4039b6
cmp esi, edi
jne 0x4039c8
mov byte [edx], 0
lea esp, [esp]
mov cl, byte [eax]
add eax, ebx
test cl, cl
jne 0x4039c0
mov edx, dword [0x4ff8d4]
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov eax, dword [0x4fdad4]
mov dword [esp + 0x24], edx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x28], 2
cmp eax, edi
jne 0x403a14
push edi
call fcn.00401a10
mov dword [0x4fdad4], eax
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x24]
push edx
lea ecx, [esp + 0x64]
push ecx
push edi
call eax
mov esi, eax
push esi
call dword [sym.imp.WS2_32.dll_WSASetLastError]
cmp esi, edi
je 0x403a48
push str.getaddrinfo___failed:__m
push 3
call fcn.00405890
add esp, 8
push ebx
call fcn.0040ec6c
cmp dword [esp + 0x14], edi
je 0x403a7e
push edi
push 2
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
je 0x403a69
mov esi, eax
call fcn.004043b0
cmp eax, edi
je 0x403a7e
push str.the_NTP_socket_is_in_use__exiting:__m
push 3
call fcn.00405890
add esp, 8
push ebx
call fcn.0040ec6c
mov eax, dword [esp + 0x10]
mov ebp, dword [sym.imp.WS2_32.dll_bind]
mov ebx, dword [sym.imp.WS2_32.dll_ioctlsocket]
mov dword [0x4ff8d8], edi
mov edi, dword [sym.imp.WS2_32.dll_setsockopt]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x403c67
mov edx, dword [eax + 0xc]
mov ecx, dword [eax + 8]
push edx
mov edx, dword [eax + 4]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_socket]
mov ecx, dword [0x4ff8d8]
mov dword [ecx*4 + 0x4ff8e0], eax
cmp eax, 0xffffffff
jne 0x403b07
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x273b
je 0x403c4f
cmp eax, 0x273f
je 0x403c4f
cmp eax, 0x273e
je 0x403c4f
push str.socket___failed:__m
push 3
call fcn.00405890
add esp, 8
push 1
call fcn.0040ec6c
push 4
lea edx, [esp + 0x1c]
push edx
push 4
push 0xffff
push eax
call edi
test eax, eax
jl 0x403c96
mov ecx, dword [esp + 0x10]
cmp dword [ecx + 4], 0x17
jne 0x403b51
mov ecx, dword [0x4ff8d8]
mov edx, dword [ecx*4 + 0x4ff8e0]
push 4
lea eax, [esp + 0x1c]
push eax
push 0x1b
push 0x29
push edx
call edi
test eax, eax
jl 0x403cac
mov ecx, dword [esp + 0x10]
cmp dword [esp + 0x14], 0
mov esi, dword [0x4ff8d8]
mov eax, dword [ecx + 4]
mov dword [esi*4 + 0x4ffa10], eax
je 0x403bd9
xor eax, eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov eax, dword [ecx + 0x10]
cmp eax, 0x1c
ja 0x403cc2
mov ecx, dword [ecx + 0x18]
push eax
push ecx
lea edx, [esp + 0x48]
push edx
call fcn.0040f1c0
mov eax, 2
sub ax, word [esp + 0x4c]
add esp, 0xc
movzx ecx, ax
mov eax, dword [esi*4 + 0x4ff8e0]
neg ecx
sbb ecx, ecx
and ecx, 0xc
add ecx, 0x10
push ecx
lea edx, [esp + 0x44]
push edx
push eax
call ebp
test eax, eax
jl 0x403ce1
mov esi, dword [0x4ff8d8]
mov ecx, dword [0x4ffa20]
xor eax, eax
test ecx, ecx
jbe 0x403bfe
mov edx, dword [esi*4 + 0x4ff8e0]
lea esp, [esp]
cmp dword [eax*4 + 0x4ffa24], edx
je 0x403bfe
inc eax
cmp eax, ecx
jb 0x403bf0
cmp eax, ecx
jne 0x403c1b
cmp ecx, 0x40
jae 0x403c1b
mov ecx, dword [esi*4 + 0x4ff8e0]
mov dword [eax*4 + 0x4ffa24], ecx
inc dword [0x4ffa20]
mov eax, dword [esi*4 + 0x4ff8e0]
lea ecx, [eax + 1]
cmp dword [0x4ff8cc], ecx
jae 0x403c33
mov dword [0x4ff8cc], ecx
push 0x4fb1b8
push 0x8004667e
push eax
call ebx
cmp eax, 0xffffffff
je 0x403d14
inc dword [0x4ff8d8]
cmp dword [0x4ff8d8], 2
mov edx, dword [esp + 0x10]
mov eax, dword [edx + 0x1c]
mov dword [esp + 0x10], eax
jl 0x403a9e
mov eax, dword [0x4fdad8]
test eax, eax
jne 0x403c7c
push 2
call fcn.00401a10
mov dword [0x4fdad8], eax
mov ecx, dword [esp + 0x1c]
push ecx
call eax
mov ecx, dword [esp + 0x64]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040a326
add esp, 0x5c
ret
push str.setsockopt___SO_REUSEADDR_failed:__m
push 3
call fcn.00405890
add esp, 8
push 1
call fcn.0040ec6c
push str.setsockopt___IPV6_V6ONLY_failed:__m
push 3
call fcn.00405890
add esp, 8
push 1
call fcn.0040ec6c
push str.res__ai_addrlen___sizeof_addr_
push 2
push 0x6e2
push str........._ntpdate_ntpdate.c
call dword [0x4fb0ec]
add esp, 0x10
call fcn.004101fb
call fcn.0040b8d7
mov esi, eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esi], eax
cmp eax, 0x2740
jne 0x403cfe
push str.the_NTP_socket_is_in_use__exiting
jmp 0x403d03
push str.bind___fails:__m
push 3
call fcn.00405890
add esp, 8
push 1
call fcn.0040ec6c
push str.ioctlsocket_FIONBIO__fails:__m
push 3
call fcn.00405890
add esp, 8
push 1
call fcn.0040ec6c
int3