Function at 0x40ed50
Capabilities:
Set socket configuration

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
lea rbp, [rsp + 0x28]
mov r12, rcx
call fcn.00409040
call qword [sym.imp.KERNEL32.dll_GetTickCount]
lea rcx, [r12 + 0x58]
mov edx, eax
mov qword [rsp + 0x28], rdx
call fcn.0040ec60
mov rbx, qword [r12]
test rbx, rbx
jne 0x40ed9c
jmp 0x40ee5c
test rdi, rdi
mov rbx, rdi
je 0x40ee5c
mov r8, rbp
mov edx, 2
mov rcx, rbx
mov rdi, qword [rbx]
movzx esi, byte [rbx + 0xd1]
call fcn.004050e0
shr sil, 7
test sil, sil
je 0x40ede2
cmp byte [rbx + 0xd1], 0
js 0x40ede2
lea r8, [rsp + 0x30]
mov edx, 7
mov rcx, rbx
mov dword [rsp + 0x30], 0
call fcn.004050e0
movzx eax, word [rbx + 0xd0]
test ax, 0x2008
jne 0x40ee15
and ax, 0x101
cmp ax, 1
je 0x40ee70
movzx eax, byte [rbx + 0xd0]
test al, 0x20
je 0x40efa0
test byte [rbx + 0xd2], 3
jne 0x40f004
movzx eax, byte [rbx + 0xd1]
test al, 0x10
je 0x40ee30
cmp qword [rbx + 0x78], 0
jne 0x40ee30
or eax, 0x20
mov byte [rbx + 0xd1], al
test al, 0x20
je 0x40ed90
mov rcx, qword [rbx + 0x38]
cmp rcx, 0xffffffffffffffff
je 0x40ee48
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, rbx
mov rbx, rdi
call fcn.00407b60
test rdi, rdi
jne 0x40ed9c
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
test byte [rbx + 0xd2], 1
je 0x40ee15
mov rcx, qword [rbx + 0x38]
lea rdx, [rsp + 0x30]
mov dword [rsp + 0x20], 0x10
lea r8, [rsp + 0x20]
call fcn.004046f0
cmp rax, 0xffffffffffffffff
mov r13, rax
je 0x40ee15
mov rcx, r12
call fcn.00407b10
test rax, rax
mov rsi, rax
je 0x40f0f2
cmp dword [rsp + 0x20], 0x10
lea r8, [rsp + 0x24]
mov edx, 0x8004667e
mov rcx, r13
setne byte [rax + 0x36]
movzx eax, word [rsp + 0x32]
mov word [rsi + 0x34], ax
mov eax, dword [rsp + 0x34]
mov dword [rsi + 0x24], eax
mov rax, qword [r12]
mov qword [rsi], rax
mov qword [r12], rsi
mov qword [rsi + 0x38], r13
mov dword [rsp + 0x24], 1
call qword [sym.imp.WS2_32.dll_ioctlsocket]
lea rcx, [rsi + 0x38]
call fcn.00404960
movzx eax, byte [rsi + 0xd1]
xor r8d, r8d
mov rcx, rsi
or byte [rsi + 0xd0], 4
movzx edx, byte [rbx + 0xd1]
and eax, 0xfffffff7
and edx, 8
or eax, edx
mov edx, 1
mov byte [rsi + 0xd1], al
mov rax, qword [rbx + 0x10]
mov qword [rsi + 0x10], rax
mov rax, qword [rbx + 0x18]
mov qword [rsi + 0x18], rax
mov eax, dword [rbx + 0x20]
mov dword [rsi + 0x20], eax
mov rax, qword [rbx + 0x98]
mov qword [rsi + 0x98], rax
mov rax, qword [rbx + 0xa0]
mov qword [rsi + 0xa0], rax
mov rax, qword [rbx + 0x88]
mov qword [rsi + 0x88], rax
mov rax, qword [rbx + 0x90]
mov qword [rsi + 0x90], rax
call fcn.004050e0
xor r8d, r8d
mov edx, 5
mov rcx, rsi
call fcn.004050e0
jmp 0x40ee15
test al, al
js 0x40ee15
movzx edx, byte [rbx + 0xd2]
test dl, 1
jne 0x40f044
and edx, 2
je 0x40ee15
test byte [rbx + 0xd0], 0x40
mov rsi, qword [rbx + 0x68]
mov r8, qword [rbx + 0x78]
je 0x40f0df
test r8, r8
sete r8b
test rsi, rsi
sete al
or r8d, eax
xor r8d, 1
movzx r8d, r8b
neg r8d
xor r9d, r9d
mov rdx, rsi
mov rcx, rbx
call fcn.00407410
jmp 0x40ee15
mov dword [rsp + 0x24], 0x10
lea rdx, [rsp + 0x30]
mov rcx, qword [rbx + 0x38]
lea r8, [rsp + 0x24]
call qword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x40f0b0
and byte [rbx + 0xd0], 0xdf
xor r8d, r8d
mov edx, 4
mov rcx, rbx
call fcn.004050e0
jmp 0x40ee15
mov rdx, qword [rbx + 0x58]
cmp rdx, 0x2fffff
ja 0x40f0c4
mov r8, qword [rbx + 0x50]
cmp rdx, r8
jae 0x40f100
mov rsi, qword [rbx + 0x48]
sub r8, rdx
add rsi, rdx
test al, 0x40
je 0x40f128
test r8, r8
sete r8b
test rsi, rsi
sete al
or r8d, eax
xor r8d, 1
movzx r8d, r8b
neg r8d
mov rdx, rsi
mov r9d, 1
mov rcx, rbx
call fcn.00407410
movzx edx, byte [rbx + 0xd2]
jmp 0x40efb8
lea rdx, str.socket_error
mov rcx, rbx
call fcn.00408fe0
jmp 0x40ee15
lea rdx, str.max_recv_buf_size_reached
mov rcx, rbx
call fcn.00408fe0
movzx edx, byte [rbx + 0xd2]
jmp 0x40efb8
mov rdx, rsi
mov rcx, rbx
call fcn.0040a1d0
mov r8d, eax
jmp 0x40eff1
mov rcx, r13
call qword [sym.imp.WS2_32.dll_closesocket]
jmp 0x40ee15
lea rdx, [r8 + 0x800]
lea rcx, [rbx + 0x48]
call fcn.00405cb0
test eax, eax
je 0x40f13b
mov rdx, qword [rbx + 0x58]
mov r8, qword [rbx + 0x50]
movzx eax, byte [rbx + 0xd0]
jmp 0x40f05e
mov rdx, rsi
mov rcx, rbx
call fcn.0040ae20
mov r8d, eax
jmp 0x40f08b
lea rdx, [0x00414ebb]
mov rcx, rbx
call fcn.00408fe0
movzx edx, byte [rbx + 0xd2]
jmp 0x40efb8