Function at 0x409510
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0xb8
mov eax, dword [0x6a7c78]
xor eax, esp
mov dword [esp + 0xb4], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0xc8]
movsx ecx, byte [esi + 0x12d]
mov eax, dword [esi + 0xc8]
xor ebx, ebx
push edi
shl ecx, 6
mov dword [esp + 0x30], ebx
mov dword [esp + 0x20], ebx
mov edx, dword [ecx + eax + 0x4c]
push 0xf
push esi
mov dword [esp + 0x34], ebx
xor ebp, ebp
mov dword [esp + 0x24], eax
mov dword [esp + 0x2c], 0x3ea
mov dword [esp + 0x40], edx
mov dword [esp + 0x30], 1
call fcn.00407290
mov edi, eax
add esp, 8
mov dword [esp + 0x18], edi
cmp edi, ebx
je 0x409de1
push edi
call dword [sym.imp.MSVCR90.dll_atoi]
add esp, 4
mov dword [esp + 0x10], eax
cmp eax, 0x12d
je 0x409d0b
cmp eax, 0x12e
je 0x409d0b
cmp eax, 0x12f
je 0x409d0b
cmp eax, 0x133
je 0x409d0b
cmp eax, 0x134
je 0x409d0b
push 0xd
push esi
call fcn.004071d0
add esp, 8
test eax, eax
jne 0x4095e5
mov dword [esp + 0x2c], 1
jmp 0x409de1
push 3
push 0x5db6bc
push edi
call dword [sym.imp.MSVCR90.dll_strncmp]
add esp, 0xc
test eax, eax
je 0x40960f
push edi
push str.lws_client_handshake:_got_bad_HTTP_response__s_n
push 2
call fcn.00403280
add esp, 0xc
jmp 0x409de1
push 5
push esi
call fcn.00407290
mov edi, eax
add esp, 8
mov dword [esp + 0x18], edi
test edi, edi
je 0x409de1
call fcn.004094e0
mov ecx, str.websocket
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x409654
test dl, dl
je 0x409650
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x409654
add eax, 2
add ecx, 2
test dl, dl
jne 0x409634
xor eax, eax
jmp 0x409659
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x409672
push edi
push str.lws_client_handshake:_got_bad_Upgrade_header__s_n
push 2
call fcn.00403280
add esp, 0xc
jmp 0x409de1
push 4
push esi
call fcn.00407290
mov edi, eax
add esp, 8
mov dword [esp + 0x18], edi
test edi, edi
je 0x409de1
call fcn.004094e0
mov ecx, str.upgrade
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4096b7
test dl, dl
je 0x4096b3
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4096b7
add eax, 2
add ecx, 2
test dl, dl
jne 0x409697
xor eax, eax
jmp 0x4096bc
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4096d5
push edi
push str.lws_client_int_s_hs:_bad_header__s_n
push 2
call fcn.00403280
add esp, 0xc
jmp 0x409de1
push 0x4f
push esi
call fcn.00407290
push 0xc
push esi
mov edi, eax
call fcn.004071d0
add esp, 0x10
test eax, eax
jne 0x409742
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 0x168]
mov dword [esi + 0xcc], ecx
push 9
push esi
call fcn.004071d0
add esp, 8
test eax, eax
je 0x409aa6
mov edi, dword [esp + 0x38]
push 9
push 0x1000
push edi
push esi
call fcn.00407210
add esp, 0x10
test eax, eax
jge 0x409870
push str.ext_list_from_server_failed_to_copy_n
push 2
call fcn.00403280
add esp, 8
jmp 0x409de9
push 0xc
push esi
call fcn.00407290
add esp, 8
mov dword [esp + 0x18], eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409754
sub eax, edx
mov ebp, eax
test edi, edi
je 0x4097b5
cmp byte [edi], 0
je 0x4097b1
test ebx, ebx
jne 0x4097ce
mov edx, dword [esp + 0x18]
push ebp
push edx
push edi
call dword [sym.imp.MSVCR90.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x409792
mov al, byte [edi + ebp]
cmp al, 0x2c
je 0x40978b
test al, al
jne 0x409792
mov ebx, 1
jmp 0x409763
mov al, byte [edi]
test al, al
je 0x409763
inc edi
cmp al, 0x2c
jne 0x409792
mov al, byte [edi]
test al, al
je 0x409763
cmp al, 0x20
jne 0x409763
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4097a3
jmp 0x409763
test ebx, ebx
jne 0x4097ce
mov eax, dword [esp + 0x18]
push eax
push str.lws_client_int_s_hs:_got_bad_protocol__s_n
push 1
call fcn.00403280
add esp, 0xc
jmp 0x409de9
mov ecx, dword [esp + 0x1c]
xor edi, edi
mov dword [esp + 0x10], edi
mov dword [esi + 0xcc], edi
mov eax, dword [ecx + 0x168]
cmp dword [eax + 4], edi
je 0x40984a
mov ebp, dword [esp + 0x18]
mov ebx, ecx
nop
lea edx, [edi + edi*2]
mov ecx, dword [eax + edx*8]
mov eax, ebp
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x409818
test dl, dl
je 0x409814
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x409818
add eax, 2
add ecx, 2
test dl, dl
jne 0x4097f8
xor eax, eax
jmp 0x40981d
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x409838
inc edi
mov dword [esp + 0x10], edi
mov eax, dword [ebx + 0x168]
lea ecx, [edi + edi*2]
cmp dword [eax + ecx*8 + 4], 0
jne 0x4097f0
jmp 0x40984a
mov eax, dword [ebx + 0x168]
lea edx, [edi + edi*2]
lea ecx, [eax + edx*8]
mov dword [esi + 0xcc], ecx
cmp dword [esi + 0xcc], 0
jne 0x4096fe
mov edx, dword [esp + 0x18]
push edx
push str.lws_client_int_s_hs:_fail_protocol__s_n
push 1
call fcn.00403280
add esp, 0xc
jmp 0x409de9
xor ecx, ecx
mov ebx, edi
mov dword [esp + 0x10], ecx
mov byte [esp + 0x17], cl
xor ebp, ebp
mov edi, edi
mov al, byte [ebx]
test al, al
je 0x4098c3
cmp al, 0x2c
je 0x4098c3
cmp al, 9
je 0x4098c3
cmp al, 0x3b
jne 0x4098a4
mov byte [esp + 0x17], 1
test ebp, ebp
jne 0x40989e
lea ebp, [ebx + 1]
inc ebx
jmp 0x409a9b
cmp byte [esp + 0x17], 0
jne 0x40989e
cmp al, 0x20
je 0x40989e
inc ebx
mov byte [esp + ecx + 0x44], al
cmp ecx, 0x7f
jae 0x409a9b
inc ecx
jmp 0x409a97
mov byte [esp + ecx + 0x44], 0
cmp byte [ebx], 0
mov byte [esp + 0x17], 0
jne 0x4098dc
mov dword [esp + 0x28], 0
jmp 0x4098e5
inc ebx
test ecx, ecx
je 0x409a9b
lea eax, [esp + 0x44]
push eax
push str.checking_client_ext__s_n
push 4
call fcn.00403280
push esi
mov dword [esp + 0x20], 0
call fcn.004032e0
mov edi, dword [eax + 0x174]
add esp, 0x10
test edi, edi
je 0x409a88
cmp dword [edi + 4], 0
je 0x409a88
mov ecx, dword [edi]
lea eax, [esp + 0x44]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x409945
test dl, dl
je 0x409941
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x409945
add eax, 2
add ecx, 2
test dl, dl
jne 0x409925
xor eax, eax
jmp 0x40994a
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x409a7d
lea ecx, [esp + 0x44]
push ecx
push str.instantiating_client_ext__s_n
push 4
mov dword [esp + 0x1c], 1
call fcn.00403280
movzx edx, byte [esi + 0x124]
add esp, 0xc
mov dword [esi + edx*4 + 0xe4], edi
movzx ecx, byte [esi + 0x124]
push 0
lea eax, [esp + 0x38]
push eax
lea edx, [esi + ecx*4 + 0xec]
push edx
push 5
push esi
push edi
push esi
call fcn.004032e0
add esp, 4
push eax
mov eax, dword [edi + 4]
call eax
mov eax, dword [esi + 0xcc]
push 0x80
mov byte [esp + 0x64], 0
mov edx, dword [edi]
lea ecx, [esp + 0x64]
push ecx
mov ecx, dword [eax + 4]
push edx
push 0x27
push esi
push ecx
call fcn.004039e0
add esp, 0x34
test eax, eax
jne 0x409de9
cmp byte [esp + 0x44], al
je 0x409a16
lea eax, [esp + 0x44]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4099e1
movzx ecx, byte [esi + 0x124]
sub eax, edx
push eax
mov eax, dword [esp + 0x38]
lea edx, [esp + 0x48]
push edx
mov edx, dword [esi + ecx*4 + 0xec]
push eax
push edx
push esi
push edi
call fcn.00406960
add esp, 0x18
test eax, eax
jne 0x409ae7
test ebp, ebp
je 0x409a46
movzx edx, byte [esi + 0x124]
mov ecx, dword [esp + 0x34]
mov eax, ebx
sub eax, ebp
push eax
mov eax, dword [esi + edx*4 + 0xec]
push ebp
push ecx
push eax
push esi
push edi
call fcn.00406960
add esp, 0x18
test eax, eax
jne 0x409b05
movzx ecx, byte [esi + 0x124]
mov edx, dword [esi + ecx*4 + 0xec]
push 0
push 0
push edx
push 0x19
push esi
push edi
push esi
call fcn.004032e0
add esp, 4
push eax
mov eax, dword [edi + 4]
call eax
add esp, 0x1c
test eax, eax
jne 0x409b1f
inc byte [esi + 0x124]
add edi, 0xc
test edi, edi
jne 0x409915
cmp dword [esp + 0x10], 0
je 0x409b37
xor ebp, ebp
xor ecx, ecx
mov dword [esp + 0x10], ecx
cmp dword [esp + 0x28], 0
jne 0x409880
push 0xd
push esi
call fcn.00407290
mov ebx, eax
mov eax, dword [esi]
lea edi, [eax + 0xc5c]
add esp, 8
mov dword [esp + 0x18], ebx
mov ecx, edi
mov eax, ebx
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x409b50
test dl, dl
je 0x409ae3
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x409b50
add eax, 2
add ecx, 2
test dl, dl
jne 0x409ac3
xor eax, eax
jmp 0x409b55
lea ecx, [esp + 0x44]
push ecx
push str.lws_client_interpret_server_handshake
push str._s:_unable_to_parse_user_defaults__s
push 1
call fcn.00403280
add esp, 0x10
jmp 0x409de9
push ebp
push str.lws_client_interpret_server_handshake
push str._s:_unable_to_parse_remote_def__s
push 1
call fcn.00403280
add esp, 0x10
jmp 0x409de9
mov edx, dword [edi]
push ebp
push edx
push str._s:_ext__s_rejects_server_options__s
push 1
call fcn.00403280
add esp, 0x10
jmp 0x409de9
lea eax, [esp + 0x44]
push eax
push str.Unknown_ext__s__n
push 2
call fcn.00403280
add esp, 0xc
jmp 0x409de9
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x409b6f
push edi
push ebx
push str.lws_client_int_s_hs:_accept__s_wrong_vs__s_n
push 2
call fcn.00403280
add esp, 0x10
jmp 0x409de9
push esi
call fcn.00403b60
add esp, 4
test eax, eax
je 0x409b90
push str.Problem_allocating_wsi_user_mem_n
push 1
call fcn.00403280
add esp, 8
jmp 0x409de9
mov edx, dword [esi + 0xd8]
mov ecx, dword [esi + 0xcc]
mov eax, dword [ecx + 4]
push 0
push 0
push edx
push 2
push esi
call eax
add esp, 0x14
test eax, eax
jne 0x409de9
push eax
push eax
push esi
call fcn.00402f60
push esi
call fcn.00407040
push 4
push esi
call fcn.004032a0
mov ecx, dword [esi + 0x120]
mov edx, dword [esi + 0xcc]
and ecx, 0xffffffef
or ecx, 8
mov byte [esi + 0x127], 5
mov dword [esi + 0x120], ecx
mov eax, dword [edx + 0xc]
add esp, 0x18
test eax, eax
jne 0x409bf8
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 [esi + 4], eax
test eax, eax
jne 0x409c2d
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
jmp 0x409de9
mov eax, dword [esi + 0x104]
mov ecx, dword [esp + 0x10]
push 4
lea edx, [esp + 0x14]
push edx
push 0x1001
push 0xffff
push eax
mov dword [esi + 8], ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x409c6f
mov ecx, dword [esp + 0x10]
push ecx
push str.Failed_to_set_SNDBUF_to__d
push 2
call fcn.00403280
add esp, 0xc
jmp 0x409de1
mov eax, dword [esi + 0xd8]
mov edx, dword [esi + 0xcc]
mov ecx, dword [edx + 4]
push 0
push 0
push eax
push 3
push esi
call ecx
add esp, 0x14
test eax, eax
jne 0x409de1
mov ebx, dword [esp + 0x1c]
mov edi, dword [ebx + 0x174]
test edi, edi
je 0x409cf0
cmp dword [edi + 4], 0
je 0x409cf0
xor eax, eax
xor ecx, ecx
mov dword [esp + 0x10], eax
cmp byte [esi + 0x124], al
jbe 0x409cd9
movzx edx, byte [esi + 0x124]
mov edi, edi
cmp dword [esi + eax*4 + 0xe4], edi
jne 0x409cd0
mov ecx, dword [esi + eax*4 + 0xec]
inc eax
cmp eax, edx
mov dword [esp + 0x10], eax
jl 0x409cc0
mov edx, dword [edi + 4]
push 0
push 0
push ecx
push 0xa
push esi
push edi
push ebx
call edx
add esp, 0x1c
add edi, 0xc
jne 0x409ca1
xor eax, eax
mov ecx, dword [esp + 0xc4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004adf6a
add esp, 0xb8
ret
push 0x3b
push esi
call fcn.00407290
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
je 0x409de1
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x34]
push edx
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x4c]
push edx
push eax
call fcn.004033e0
add esp, 0x14
test eax, eax
jne 0x409de1
mov edi, dword [esp + 0x40]
mov ecx, str.wss:__
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x409d72
test dl, dl
je 0x409d6e
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x409d72
add eax, 2
add ecx, 2
test dl, dl
jne 0x409d52
xor eax, eax
jmp 0x409d77
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x409dab
mov ecx, 0x5db45c
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x409da2
test dl, dl
je 0x409d9e
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x409da2
add eax, 2
add ecx, 2
test dl, dl
jne 0x409d82
xor eax, eax
jmp 0x409da7
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x409db0
mov ebp, 1
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x30]
push eax
push ecx
push edx
push eax
push ebp
push esi
call fcn.0040b9a0
add esp, 0x18
test eax, eax
je 0x409cf0
push str.Redirect_failed_n
push 1
call fcn.00403280
add esp, 8
mov dword [esp + 0x24], 0
mov edx, dword [esi + 0xcc]
test edx, edx
je 0x409e33
cmp byte [esi + 0x127], 5
jne 0x409e33
cmp dword [esp + 0x2c], 0
je 0x409e1d
mov ebx, dword [esp + 0x18]
test ebx, ebx
je 0x409e1d
mov eax, ebx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409e10
sub eax, edi
push eax
push ebx
jmp 0x409e21
push 0
push 0
mov eax, dword [esi + 0xd8]
mov ecx, dword [edx + 4]
push eax
push 1
push esi
call ecx
add esp, 0x14
mov edx, dword [esp + 0x24]
push edx
push esi
call fcn.00403570
add esp, 8
mov eax, 1
jmp 0x409cf2