Function at 0x1017bd30
Capabilities:
Set socket configuration

Disassembly:
sub esp, 8
push ebx
push ebp
push esi
mov esi, dword [esp + 0x1c]
push edi
mov edi, dword [esp + 0x1c]
test byte [esi + 0x18], 1
mov ebx, dword [edi + 0x80]
je 0x1017bfe3
mov ecx, dword [esi]
mov eax, dword [esi + 4]
test ecx, ecx
je 0x1017bd5d
mov dword [ecx + 4], eax
jmp 0x1017bd63
mov dword [ebx + 0xc4], eax
push dword [esp + 0x28]
mov ecx, dword [esi + 4]
push dword [esp + 0x28]
mov eax, dword [esi]
push edi
mov dword [ecx], eax
call fcn.10178490
mov ebp, eax
add esp, 0xc
mov eax, dword [esp + 0x30]
and eax, 1
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], eax
test ebp, ebp
je 0x1017bee1
mov ecx, ebp
mov eax, 0x38e38e39
sub ecx, dword [ebx + 0xb0]
imul ecx
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
cmp dword [esp + 0x20], 0
mov dword [esp + 0x14], ecx
je 0x1017be1b
mov dword [esi], 0
mov eax, dword [ebp + 0x38]
mov dword [esi + 4], eax
mov eax, dword [ebp + 0x38]
push 4
mov dword [eax], esi
mov eax, dword [esp + 0x20]
mov dword [eax + 0x38], esi
lea eax, [esp + 0x14]
push eax
push 8
push 0xffff
push dword [esi + 0xc]
mov dword [esi + 8], ecx
mov dword [esp + 0x24], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x1017bed8
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
push str.cant_set_KEEPALIVE_socket_option
push esi
push edi
call fcn.100d0600
add esp, 0xc
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
cmp dword [ebp + 0x3c], 1
mov eax, dword [edi]
mov eax, dword [eax + 0x80]
jne 0x1017be7f
test al, 0xa0
je 0x1017be4a
mov eax, dword [esp + 0x28]
push ecx
push eax
mov eax, dword [esp + 0x2c]
push eax
push str.handshake_from_idle_site__s:_u_EID__u
push edi
call fcn.1013af50
mov ebp, dword [esp + 0x30]
add esp, 0x14
mov edx, dword [ebp + 0x30]
mov ecx, dword [edx]
mov eax, dword [edx + 4]
test ecx, ecx
je 0x1017be69
mov dword [ecx + 4], eax
mov ecx, dword [edx + 4]
mov eax, dword [edx]
push edx
push edi
mov dword [ecx], eax
call fcn.100dc7e0
jmp 0x1017bea9
mov dword [ebx + 0xcc], eax
mov ecx, dword [edx + 4]
mov eax, dword [edx]
push edx
push edi
mov dword [ecx], eax
call fcn.100dc7e0
jmp 0x1017bea9
test al, 0xa0
je 0x1017bea0
mov eax, dword [esp + 0x28]
push ecx
push eax
mov eax, dword [esp + 0x2c]
push eax
push str.connection_from__s:_u_EID__u_supersedes_existing
push edi
call fcn.1013af50
mov ebp, dword [esp + 0x30]
add esp, 0x14
push dword [ebp + 0x30]
push edi
call fcn.10178410
mov eax, dword [esp + 0x1c]
add esp, 8
mov dword [esi + 8], eax
mov eax, dword [esp + 0x1c]
push 1
mov dword [eax + 0x3c], 2
mov eax, dword [esp + 0x20]
mov dword [eax + 0x30], esi
mov eax, dword [esp + 0x20]
add eax, 0x20
push eax
push edi
call fcn.1017d6b0
add esp, 0xc
mov ebp, dword [esp + 0x20]
jmp 0x1017c01e
mov ebp, eax
xor eax, 1
inc eax
push eax
push 0
lea eax, [esp + 0x24]
push eax
mov eax, dword [esp + 0x34]
push eax
mov eax, dword [esp + 0x34]
push eax
push edi
call fcn.10177e80
add esp, 0x18
test eax, eax
jne 0x1017bf29
mov eax, dword [edi]
test byte [eax + 0x80], 0xa0
je 0x1017bf32
push dword [esp + 0x28]
push dword [esp + 0x28]
push str.handshake_introduces_unknown_site__s:_u
push edi
call fcn.1013af50
add esp, 0x10
jmp 0x1017bf32
cmp eax, 0x11
jne 0x1017c08e
mov eax, dword [esp + 0x1c]
mov ecx, eax
sub ecx, dword [ebx + 0xb0]
mov dword [esp + 0x20], eax
mov eax, 0x38e38e39
imul ecx
mov ecx, dword [esp + 0x20]
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x14], eax
test ebp, ebp
je 0x1017bfb9
mov dword [esi], 0
mov eax, dword [ecx + 0x38]
mov dword [esi + 4], eax
mov eax, dword [ecx + 0x38]
push 4
mov dword [eax], esi
mov eax, dword [esp + 0x20]
mov dword [eax + 0x38], esi
lea eax, [esp + 0x14]
push eax
push 8
push 0xffff
push dword [esi + 0xc]
mov dword [esp + 0x24], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
mov dword [esp + 0x20], eax
test eax, eax
je 0x1017bfda
push str.cant_set_KEEPALIVE_socket_option
push eax
push edi
call fcn.100d0600
mov eax, dword [esp + 0x2c]
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
mov dword [ecx + 0x3c], 2
mov eax, dword [esp + 0x1c]
push 1
mov dword [eax + 0x30], esi
mov eax, dword [esp + 0x20]
add eax, 0x20
push eax
push edi
call fcn.1017d6b0
add esp, 0xc
mov eax, dword [esp + 0x14]
mov dword [esi + 8], eax
jmp 0x1017c01e
mov edx, dword [esi + 8]
mov eax, dword [ebx + 0xb0]
lea ecx, [edx + edx*8]
lea ecx, [eax + ecx*8]
mov eax, dword [edi]
mov dword [esp + 0x1c], ecx
test byte [eax + 0x80], 0xa0
je 0x1017c017
movzx eax, word [ecx + 4]
push edx
push eax
push dword [ecx]
push str.handshake_from_connection_to__s:_lu_EID__u
push edi
call fcn.1013af50
add esp, 0x14
mov ebp, dword [esp + 0x30]
and ebp, 1
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
mov dword [eax + 0x18], ecx
mov eax, dword [esp + 0x1c]
or dword [eax + 0x40], 1
cmp dword [ebx + 0xdc], 0xffffffff
je 0x1017c08c
cmp dword [ebx + 0x8c], 0xfffffffe
jne 0x1017c08c
cmp dword [ebx + 0x6c], 2
je 0x1017c08c
cmp dword [ebx + 0x104], 0
jne 0x1017c08c
test ebp, ebp
jne 0x1017c08c
mov dword [ebx + 0x104], 1
mov eax, dword [edi]
test byte [eax + 0x80], 0xa0
je 0x1017c079
push str.handshake_with_no_known_master_to_wake_election_thread
push edi
call fcn.1013af50
add esp, 8
push 3
push edi
call fcn.101776f0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret