Function at 0x51d51b
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x50
lea esi, [ebp - 0x50]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x18], edx
mov ecx, esi
push 1
call 0x51d51b
pop eax
cmp byte [esi], 4
je 0x51d24e
mov eax, dword [ebp - 0x50]
cmp al, 4
jne 0x51d3fa
mov edi, dword [ebp - 0x18]
lea ecx, [ebp - 0x20]
mov edx, edi
push dword [ebp + 8]
call fcn.0051d1f5
pop eax
mov ecx, esi
mov edx, edi
push 0
call 0x51d51b
pop eax
cmp byte [esi], 4
je 0x51d27b
mov eax, dword [ebp - 0x50]
cmp al, 4
jne 0x51d40a
mov al, byte [ebp - 0x20]
cmp al, 4
jne 0x51d28d
mov eax, dword [ebp - 0x10]
mov byte [eax], 4
jmp 0x51d4d8
lea ecx, [ebp - 0x20]
mov byte [ebp - 0x11], al
call fcn.0051d552
cmp al, 0xd
jne 0x51d42b
mov ebx, dword [ebp + 0x10]
mov edi, dword [ebp + 0xc]
mov esi, dword [ebp + 0x14]
call fcn.005213a0
mov dword [ebp - 0x2c], edx
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x28], ecx
lea ecx, [ebp - 0x58]
mov dword [ebp - 0x30], eax
mov dword [ecx], edx
mov dword [ecx + 4], 0x110
lea ecx, [esi + 0x3b9aca00]
mov dword [ebp - 0x24], ecx
call fcn.005213a0
mov esi, ecx
mov ecx, eax
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
push esi
call fcn.00521530
add esp, 0x10
cmp ecx, 0x3b9aca00
mov esi, 0
cmove edx, esi
cmove eax, esi
cmove ecx, esi
cmp eax, edi
mov esi, edx
sbb esi, ebx
jb 0x51d322
mov esi, edi
mov edi, ebx
xor esi, eax
xor edi, edx
or edi, esi
mov edi, dword [ebp + 0xc]
jne 0x51d440
cmp ecx, dword [ebp + 0x14]
jae 0x51d440
sub edi, eax
mov eax, dword [ebp + 0x14]
sbb ebx, edx
jb 0x51d4e0
cmp ecx, eax
jbe 0x51d346
mov eax, edi
or eax, ebx
je 0x51d4e0
mov eax, dword [ebp - 0x24]
add edi, 0xffffffff
adc ebx, 0xffffffff
sub eax, ecx
xor edx, edx
mov esi, 0x3b9aca00
div esi
add eax, edi
adc ebx, 0
jb 0x51d4f2
mov ecx, 0x3e8
mov esi, edx
mul ecx
mov dword [ebp - 0x34], eax
mov eax, ebx
mov edi, edx
mul ecx
mov ebx, eax
mov ecx, edx
mov eax, esi
mov esi, 0xf4240
add ebx, edi
adc ecx, 0
xor edx, edx
div esi
mov esi, 0x7fffffff
add eax, dword [ebp - 0x34]
adc ebx, 0
adc ecx, 0
setb dl
cmp eax, esi
jb 0x51d39c
mov eax, 0x7fffffff
mov edi, dword [ebp + 0xc]
test ebx, ebx
je 0x51d3a8
mov eax, 0x7fffffff
mov ebx, dword [ebp + 0x10]
movzx edx, dl
or ecx, edx
je 0x51d3b7
mov eax, 0x7fffffff
cmp eax, 1
adc eax, 0
push eax
push 1
lea eax, [ebp - 0x58]
push eax
call sub.ws2_32.dll_WSAPoll
cmp eax, 0xffffffff
jne 0x51d43c
call sub.KERNEL32.DLL_GetLastError
and dword [ebp - 0x50], 0
lea ecx, [ebp - 0x50]
mov esi, eax
mov dword [ebp - 0x4c], eax
call fcn.0051d552
cmp al, 0x23
jne 0x51d4a1
xor ecx, ecx
mov edx, esi
call fcn.0048655f
jmp 0x51d2cf
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x4c]
mov dword [edx], eax
mov dword [edx + 4], ecx
jmp 0x51d4d8
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x4c]
mov dword [edx], eax
mov al, byte [ebp - 0x20]
mov dword [edx + 4], ecx
cmp al, 4
je 0x51d4d8
mov edx, dword [ebp - 0x1c]
movzx ecx, al
jmp 0x51d4d3
movsd xmm0, qword [ebp - 0x20]
mov eax, dword [ebp - 0x10]
movsd qword [eax], xmm0
jmp 0x51d4d8
test eax, eax
jne 0x51d44f
mov eax, dword [ebp - 0x10]
and dword [eax + 4], 0
mov dword [eax], 0x1601
jmp 0x51d4cc
test byte [ebp - 0x52], 3
je 0x51d4ac
lea eax, [ebp - 0x5c]
lea ecx, [ebp - 0x38]
mov dword [eax], 4
push eax
push ecx
push 0x1007
push 0xffff
push dword [ebp - 0x18]
call sub.ws2_32.dll_getsockopt
cmp eax, 0xffffffff
je 0x51d4b4
mov eax, dword [ebp - 0x38]
xor ecx, ecx
test eax, eax
sete cl
shl ecx, 2
test ecx, ecx
je 0x51d4c4
push 0x27
pop edx
mov ecx, dword [ebp - 0x10]
push 0x1a
push 0x69b173
call fcn.0051cc58
pop eax
pop ecx
jmp 0x51d4cc
mov eax, dword [ebp - 0x10]
and dword [eax], 0
mov dword [eax + 4], esi
jmp 0x51d4cc
mov eax, dword [ebp - 0x10]
mov byte [eax], 4
jmp 0x51d4cc
call sub.KERNEL32.DLL_GetLastError
mov ecx, dword [ebp - 0x10]
and dword [ecx], 0
mov dword [ecx + 4], eax
jmp 0x51d4cc
mov edx, dword [ebp - 0x10]
mov dword [edx], ecx
mov dword [edx + 4], eax
mov edx, dword [ebp - 0x1c]
movzx ecx, byte [ebp - 0x11]
call fcn.0048655f
add esp, 0x50
pop esi
pop edi
pop ebx
pop ebp
ret
push 0x23
pop edx
mov ecx, str.overflow_when_subtracting_durations
push 0x69e034
call fcn.004408d0
lea ecx, [ebp - 0x50]
mov edx, 0x69b720
mov dword [ecx], 0x69b6d0
mov dword [ecx + 4], 1
and dword [ecx + 0x10], 0
mov dword [ecx + 8], 0x6c4590
and dword [ecx + 0xc], 0
call fcn.00439fc0
push ebp
mov ebp, esp
push esi
push eax
movzx eax, byte [ebp + 8]
mov esi, ecx
lea ecx, [ebp - 8]
mov dword [ecx], eax
push ecx
push 0x8004667e
push edx
call sub.ws2_32.dll_ioctlsocket
cmp eax, 0xffffffff
je 0x51d541
mov byte [esi], 4
jmp 0x51d54c
call sub.KERNEL32.DLL_GetLastError
and dword [esi], 0
mov dword [esi + 4], eax
add esp, 4
pop esi
pop ebp
ret