Function at 0x40ede0
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.004090d0
call qword [sym.imp.KERNEL32.dll_GetTickCount]
lea rcx, [r12 + 0x58]
mov edx, eax
mov qword [rsp + 0x28], rdx
call fcn.0040ecf0
mov rbx, qword [r12]
test rbx, rbx
jne 0x40ee2c
jmp 0x40eeec
test rdi, rdi
mov rbx, rdi
je 0x40eeec
mov r8, rbp
mov edx, 2
mov rcx, rbx
mov rdi, qword [rbx]
movzx esi, byte [rbx + 0xd1]
call fcn.00405170
shr sil, 7
test sil, sil
je 0x40ee72
cmp byte [rbx + 0xd1], 0
js 0x40ee72
lea r8, [rsp + 0x30]
mov edx, 7
mov rcx, rbx
mov dword [rsp + 0x30], 0
call fcn.00405170
movzx eax, word [rbx + 0xd0]
test ax, 0x2008
jne 0x40eea5
and ax, 0x101
cmp ax, 1
je 0x40ef00
movzx eax, byte [rbx + 0xd0]
test al, 0x20
je 0x40f030
test byte [rbx + 0xd2], 3
jne 0x40f094
movzx eax, byte [rbx + 0xd1]
test al, 0x10
je 0x40eec0
cmp qword [rbx + 0x78], 0
jne 0x40eec0
or eax, 0x20
mov byte [rbx + 0xd1], al
test al, 0x20
je 0x40ee20
mov rcx, qword [rbx + 0x38]
cmp rcx, 0xffffffffffffffff
je 0x40eed8
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, rbx
mov rbx, rdi
call fcn.00407bf0
test rdi, rdi
jne 0x40ee2c
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
test byte [rbx + 0xd2], 1
je 0x40eea5
mov rcx, qword [rbx + 0x38]
lea rdx, [rsp + 0x30]
mov dword [rsp + 0x20], 0x10
lea r8, [rsp + 0x20]
call fcn.00404780
cmp rax, 0xffffffffffffffff
mov r13, rax
je 0x40eea5
mov rcx, r12
call fcn.00407ba0
test rax, rax
mov rsi, rax
je 0x40f182
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.004049f0
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.00405170
xor r8d, r8d
mov edx, 5
mov rcx, rsi
call fcn.00405170
jmp 0x40eea5
test al, al
js 0x40eea5
movzx edx, byte [rbx + 0xd2]
test dl, 1
jne 0x40f0d4
and edx, 2
je 0x40eea5
test byte [rbx + 0xd0], 0x40
mov rsi, qword [rbx + 0x68]
mov r8, qword [rbx + 0x78]
je 0x40f16f
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.004074a0
jmp 0x40eea5
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 0x40f140
and byte [rbx + 0xd0], 0xdf
xor r8d, r8d
mov edx, 4
mov rcx, rbx
call fcn.00405170
jmp 0x40eea5
mov rdx, qword [rbx + 0x58]
cmp rdx, 0x2fffff
ja 0x40f154
mov r8, qword [rbx + 0x50]
cmp rdx, r8
jae 0x40f190
mov rsi, qword [rbx + 0x48]
sub r8, rdx
add rsi, rdx
test al, 0x40
je 0x40f1b8
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.004074a0
movzx edx, byte [rbx + 0xd2]
jmp 0x40f048
lea rdx, str.socket_error
mov rcx, rbx
call fcn.00409070
jmp 0x40eea5
lea rdx, str.max_recv_buf_size_reached
mov rcx, rbx
call fcn.00409070
movzx edx, byte [rbx + 0xd2]
jmp 0x40f048
mov rdx, rsi
mov rcx, rbx
call fcn.0040a260
mov r8d, eax
jmp 0x40f081
mov rcx, r13
call qword [sym.imp.WS2_32.dll_closesocket]
jmp 0x40eea5
lea rdx, [r8 + 0x800]
lea rcx, [rbx + 0x48]
call fcn.00405d40
test eax, eax
je 0x40f1cb
mov rdx, qword [rbx + 0x58]
mov r8, qword [rbx + 0x50]
movzx eax, byte [rbx + 0xd0]
jmp 0x40f0ee
mov rdx, rsi
mov rcx, rbx
call fcn.0040aeb0
mov r8d, eax
jmp 0x40f11b
lea rdx, [0x00414ebb]
mov rcx, rbx
call fcn.00409070
movzx edx, byte [rbx + 0xd2]
jmp 0x40f048