Function at 0x4089b0
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0xb0
mov eax, dword [0x6a7c78]
xor eax, esp
mov dword [esp + 0xac], eax
push ebx
push ebp
mov ebp, dword [esp + 0xbc]
push esi
mov esi, dword [esp + 0xc4]
push edi
push ebp
call fcn.004032e0
mov edi, dword [esp + 0xd0]
add esp, 4
mov dword [esp + 0x14], eax
mov bl, 0x58
lea esp, [esp]
mov eax, edi
dec edi
test eax, eax
je 0x408d2d
test edi, edi
setne cl
mov byte [ebp + 0x18], cl
mov eax, dword [esi]
movzx ecx, byte [eax]
push ecx
inc eax
push ebp
mov dword [esi], eax
call fcn.00407550
add esp, 8
test eax, eax
jne 0x408ce7
cmp byte [ebp + 0x16], bl
jne 0x4089f0
push eax
push eax
push ebp
mov byte [ebp + 0x126], 2
call fcn.00402f60
push 5
push ebp
call fcn.004071d0
add esp, 0x14
test eax, eax
je 0x408d06
push str.websocket
push 5
push ebp
call fcn.00407290
add esp, 8
push eax
call dword [sym.imp.MSVCR90.dll__stricmp]
add esp, 8
test eax, eax
jne 0x408cd8
cmp dword [ebp + 0xcc], eax
jne 0x408a7d
push str.NULL_protocol_at_lws_read_n
push 1
call fcn.00403280
add esp, 8
push 0xc
push 0x7f
lea edx, [esp + 0x44]
push edx
push ebp
call fcn.00407210
add esp, 0x10
test eax, eax
jge 0x408a9d
push str.protocol_list_too_long
jmp 0x408cdd
push 0xc
push ebp
call fcn.004071d0
add esp, 8
mov byte [esp + eax + 0x3c], 0
cmp byte [esp + 0x3c], 0
lea ebx, [esp + 0x3c]
mov dword [esp + 0x18], 0
je 0x408b6d
cmp dword [esp + 0x18], 0
jne 0x408ba5
xor eax, eax
mov cl, byte [ebx]
test cl, cl
je 0x408ae7
cmp cl, 0x2c
je 0x408ae7
mov byte [esp + eax + 0x1c], cl
inc eax
inc ebx
cmp eax, 0x1f
jb 0x408ad1
cmp byte [ebx], 0
mov byte [esp + eax + 0x1c], 0
je 0x408af2
inc ebx
mov eax, dword [esp + 0x14]
mov edi, dword [eax + 0x168]
xor esi, esi
cmp dword [edi + 4], esi
je 0x408b5d
mov eax, edi
mov eax, dword [eax]
test eax, eax
je 0x408b39
lea ecx, [esp + 0x1c]
nop
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x408b30
test dl, dl
je 0x408b2c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x408b30
add eax, 2
add ecx, 2
test dl, dl
jne 0x408b10
xor eax, eax
jmp 0x408b35
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x408b49
inc esi
lea ecx, [esi + esi*2]
cmp dword [edi + ecx*8 + 4], 0
lea eax, [edi + ecx*8]
jne 0x408b05
jmp 0x408b5d
lea edx, [esi + esi*2]
lea eax, [edi + edx*8]
mov dword [ebp + 0xcc], eax
mov dword [esp + 0x18], 1
cmp byte [ebx], 0
jne 0x408ac4
cmp dword [esp + 0x18], 0
jne 0x408ba5
push 0xc
push ebp
call fcn.00407290
add esp, 8
test eax, eax
je 0x408b95
lea ecx, [esp + 0x3c]
push ecx
push str.No_protocol_from___s__supported_n
push 1
call fcn.00403280
add esp, 0xc
jmp 0x408ce7
mov edx, dword [esp + 0x14]
mov eax, dword [edx + 0x168]
mov dword [ebp + 0xcc], eax
push ebp
call fcn.00403b60
add esp, 4
test eax, eax
jne 0x408ce7
mov esi, dword [ebp + 0xcc]
push eax
push 0xc
push ebp
call fcn.00407290
mov ecx, dword [ebp + 0xd8]
mov edx, dword [esi + 4]
add esp, 8
push eax
push ecx
push 0x14
push ebp
call edx
add esp, 0x14
test eax, eax
je 0x408beb
push str.User_code_denied_connection_n
push 2
jmp 0x408cdf
mov al, byte [ebp + 0x125]
cmp al, 0xd
je 0x408c0d
movzx eax, al
push eax
push str.Unknown_client_spec_version__d_n
push 2
call fcn.00403280
add esp, 0xc
jmp 0x408ce7
mov ecx, dword [esp + 0x14]
push ebp
push ecx
call fcn.0040b310
add esp, 8
test eax, eax
jne 0x408ce7
push 3
mov ecx, 7
mov esi, ebp
lea edi, [esp + 0x20]
push ebp
rep movsd dword es:[edi], dword [esi]
call fcn.004032a0
mov edx, dword [ebp + 0xcc]
mov ecx, 7
lea esi, [esp + 0x24]
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov eax, dword [edx + 0xc]
add esp, 8
test eax, eax
jne 0x408c5a
mov eax, 0x1000
add eax, 0x10
mov dword [esp + 0x10], eax
add eax, 4
push eax
push 0
call fcn.00405ae0
add esp, 8
mov dword [ebp + 4], eax
test eax, eax
jne 0x408c94
mov eax, dword [esp + 0x10]
push eax
push str.Out_of_Mem_allocating_rx_buffer__d_n
push 1
call fcn.00403280
add esp, 0xc
mov eax, 1
jmp 0x408d2f
mov eax, dword [ebp + 0x104]
mov ecx, dword [esp + 0x10]
push 4
lea edx, [esp + 0x14]
push edx
push 0x1001
push 0xffff
push eax
mov dword [ebp + 8], ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x408d2d
mov ecx, dword [esp + 0x10]
push ecx
push str.Failed_to_set_SNDBUF_to__d
push 2
call fcn.00403280
mov eax, 1
add esp, 0xc
jmp 0x408d2f
push str.Unknown_upgrade_n
push 1
call fcn.00403280
add esp, 8
mov eax, dword [ebp]
mov edx, dword [eax + 0xc58]
push ebp
mov dword [eax + 0xc54], edx
call fcn.00407040
add esp, 4
mov eax, 1
jmp 0x408d2f
mov esi, dword [ebp]
push 1
push ebp
call fcn.004032a0
push ebp
mov byte [ebp + 0x127], 0
mov dword [ebp + 0x14], 0xffffffff
mov dword [ebp], esi
call fcn.00408740
add esp, 0xc
jmp 0x408d2f
xor eax, eax
mov ecx, dword [esp + 0xbc]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004adf6a
add esp, 0xb0
ret