Function at 0x512240
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x12c
mov eax, dword [0x570400]
xor eax, esp
mov dword [esp + 0x128], eax
mov eax, dword [esp + 0x130]
push ebx
mov ebx, dword [esp + 0x138]
push ebp
push esi
push edi
mov edi, dword [eax + 8]
mov dword [esp + 0x14], eax
lea eax, [esp + 0x28]
push eax
mov byte [esp + 0x17], 0
call fcn.004fb620
lea ebp, [edi + 0x98]
push ebp
movups xmm0, xmmword [eax]
lea eax, [edi + 8]
push eax
push ebx
movups xmmword [edi + 0x120], xmm0
call fcn.00512a00
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x51230a
mov eax, dword [esp + 0x14]
mov esi, dword [eax + 8]
lea eax, [esi + 0x118]
push eax
lea eax, [esi + 0xbc]
push eax
push dword [esi + 0x14]
lea eax, [esi + 0x18]
push eax
call fcn.00506460
add esp, 0x10
test al, al
jne 0x51235f
mov edi, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
call edi
mov eax, dword [eax]
mov dword [esi + 0x150], eax
call edi
mov esi, dword [eax]
call edi
mov edi, eax
lea eax, [esp + 0x38]
push 0x100
push eax
push esi
call fcn.0051c950
push eax
push dword [edi]
push str.sa_addr_inet_ntop___failed_with_errno__d:__s
push ebx
call fcn.004f54f0
add esp, 0x1c
mov esi, 2
mov edi, dword [ebp]
mov eax, dword [esp + 0x14]
cmp edi, 0xffffffff
je 0x512673
mov eax, dword [eax + 0xc]
mov dword [esp + 0x24], eax
test eax, eax
je 0x512661
cmp dword [eax + 0xc], 0
push edi
push ebx
je 0x512659
call fcn.004f5f10
push 1
push ebx
call fcn.004f6390
mov eax, dword [esp + 0x34]
push edi
push dword [eax + 0x10]
mov eax, dword [eax + 0xc]
call eax
push 0
push ebx
call fcn.004f6390
add esp, 0x20
jmp 0x512668
xor esi, esi
cmp dword [edi + 8], 0x17
jne 0x512386
push 4
lea eax, [esp + 0x24]
mov dword [esp + 0x24], esi
push eax
push 0x1b
push 0x29
push dword [ebp]
call dword [sym.imp.WS2_32.dll_setsockopt]
mov ecx, str.__Trying___s_:_d...
jmp 0x51238b
mov ecx, str.__Trying__s:_d...
mov eax, dword [edi + 0x118]
push eax
lea eax, [edi + 0xbc]
push eax
push ecx
push ebx
call fcn.004f55c0
mov eax, dword [edi + 8]
add esp, 0x10
cmp eax, 2
je 0x5123b0
cmp eax, 0x17
jne 0x51240b
cmp dword [edi + 0xc], 1
jne 0x51240b
cmp byte [ebx + 0x68e], 0
mov byte [esp + 0x12], 1
je 0x512410
push 4
lea eax, [esp + 0x24]
mov dword [esp + 0x24], 1
push eax
push 1
push 6
push dword [ebp]
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x512410
push 0x100
lea eax, [esp + 0x3c]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.0051c950
push eax
push str.Could_not_set_TCP_NODELAY:__s
push ebx
call fcn.004f55c0
add esp, 0x18
jmp 0x512410
mov byte [esp + 0x12], 0
mov eax, dword [ebp]
mov dword [esp + 0x20], eax
mov eax, dword [0x572ca0]
mov dword [esp + 0x18], 0x4020
mov dword [esp + 0x1c], esi
mov dword [esp + 0x24], 4
test eax, eax
jne 0x512460
push 3
push 2
push eax
push eax
push 6
call fcn.005392a0
add esp, 0x14
test al, al
je 0x512454
mov dword [0x572ca0], 2
jmp 0x5124ac
mov dword [0x572ca0], 1
jmp 0x512465
cmp eax, 2
je 0x5124ac
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x20]
push eax
push 0x1001
push 0xffff
push dword [esp + 0x30]
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x512491
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x18]
jg 0x5124ac
push 4
lea eax, [esp + 0x1c]
push eax
push 0x1001
push 0xffff
push dword [esp + 0x30]
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp byte [esp + 0x12], 0
je 0x51257b
cmp byte [ebx + 0x695], 0
je 0x51257b
mov eax, dword [ebp]
lea ecx, [esp + 0x18]
push 4
push ecx
push 8
push 0xffff
push eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x5124fe
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [esp + 0x20]
push str.Failed_to_set_SO_KEEPALIVE_on_fd__d:_errno__d
jmp 0x512572
push dword [ebx + 0x630]
mov dword [esp + 0x2c], 1
call fcn.004f5160
push dword [ebx + 0x634]
imul eax, eax, 0x3e8
mov dword [esp + 0x20], eax
mov dword [esp + 0x34], eax
call fcn.004f5160
add esp, 8
imul eax, eax, 0x3e8
push 0
push 0
mov dword [esp + 0x20], eax
mov dword [esp + 0x38], eax
lea eax, [esp + 0x2c]
push eax
push 0
push 0
push 0xc
lea eax, [esp + 0x40]
push eax
push 0x98000004
push dword [esp + 0x3c]
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
je 0x51257b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [esp + 0x20]
push str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:_errno__d
push ebx
call fcn.004f55c0
add esp, 0x10
cmp dword [ebx + 0x19c], esi
je 0x5125bb
push 1
push ebx
call fcn.004f6390
mov eax, dword [ebx + 0x19c]
push 0
push dword [ebp]
push dword [ebx + 0x1a0]
call eax
push 0
push ebx
mov dword [esp + 0x40], eax
call fcn.004f6390
mov eax, dword [esp + 0x40]
add esp, 0x1c
cmp eax, 2
jne 0x5125ff
mov byte [esp + 0x13], 1
mov eax, dword [edi + 8]
cmp eax, 2
je 0x5125c8
cmp eax, 0x17
jne 0x51260d
lea eax, [edi + 0x18]
push eax
call fcn.0053b420
push eax
push dword [edi + 8]
mov eax, dword [esp + 0x20]
push dword [ebp]
push dword [eax + 0xc]
push ebx
call fcn.00511d40
mov esi, eax
add esp, 0x18
test esi, esi
je 0x51260d
cmp esi, 1
jne 0x51230a
lea esi, [eax + 6]
jmp 0x51230a
test eax, eax
je 0x5125bb
mov esi, 0x2a
jmp 0x51230a
push 1
push dword [ebp]
call fcn.0053b3f0
add esp, 8
cmp dword [edi + 0xc], 2
setne al
cmp byte [esp + 0x13], 0
mov byte [edi + 0x156], al
je 0x51266f
push ebx
push dword [esp + 0x18]
call fcn.00512790
lea eax, [esp + 0x30]
push eax
call fcn.004fb620
add esp, 0xc
movups xmm0, xmmword [eax]
mov eax, dword [esp + 0x14]
movups xmmword [edi + 0x130], xmm0
mov byte [eax + 0x14], 1
jmp 0x512673
call fcn.004f5f10
add esp, 8
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebp], 0xffffffff
mov eax, dword [esp + 0x14]
push dword [ebp]
push esi
push str.cf_socket_open_______d__fd_d
push eax
push ebx
call fcn.004f5600
mov ecx, dword [esp + 0x14c]
add esp, 0x14
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0054507b
add esp, 0x12c
ret