Function at 0x409040
Capabilities:
Get socket status

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x688
mov r12d, edx
mov edx, 0x10624dd3
mov qword [rsp + 0x6d0], rcx
mov rcx, qword [rcx]
mov eax, r12d
mov dword [rsp + 0x50], 0
mov dword [rsp + 0x260], 0
imul edx
mov eax, r12d
mov dword [rsp + 0x470], 0
sar eax, 0x1f
sar edx, 6
sub edx, eax
mov eax, r12d
mov dword [rsp + 0x48], edx
imul edx, edx, 0x3e8
sub eax, edx
imul eax, eax, 0x3e8
lea rdx, [rsp + 0x48]
test r12d, r12d
mov dword [rsp + 0x4c], eax
mov eax, 0
cmovns rax, rdx
test rcx, rcx
mov qword [rsp + 0x30], rax
je 0x409438
mov byte [rsp + 0x3f], 0
xor r15d, r15d
xor r11d, r11d
xor ebp, ebp
mov byte [rsp + 0x3e], 0
lea rbx, [rsp + 0x470]
mov dword [rsp + 0x38], 0
lea rsi, [rsp + 0x50]
mov byte [rsp + 0x3d], 0
lea rdi, [rsp + 0x260]
and byte [rcx + 0xd2], 0xfc
test word [rcx + 0xd0], 0x2008
jne 0x4091f7
mov rdx, qword [rcx + 0x38]
cmp rdx, 0xffffffffffffffff
je 0x4091f7
movzx r14d, byte [rcx + 0xd0]
movzx r10d, byte [rcx + 0xd1]
mov r13d, r14d
and r13d, 0x20
and r10d, 0x40
je 0x409160
test r13b, r13b
jne 0x409160
cmp qword [rcx + 0x78], 0
je 0x4091f7
test r14b, r14b
js 0x4091f7
nop word [rax + rax]
test r11d, r11d
je 0x40947e
cmp rdx, qword [rsp + 0x478]
je 0x4091a3
lea r8d, [r11 - 1]
mov eax, 1
add r8, 1
jmp 0x40918c
add rax, 1
cmp qword [rbx + rax*8], rdx
je 0x4091a3
cmp r8, rax
mov r9d, eax
jne 0x409182
cmp r11d, 0x3f
ja 0x4091a3
cmp r9d, r11d
je 0x409392
test r10b, r10b
je 0x409320
test r13b, r13b
jne 0x4091bd
cmp qword [rcx + 0x78], 0
je 0x4091f0
test r14b, r14b
js 0x4091f0
test r15d, r15d
je 0x40948c
cmp rdx, qword [rsp + 0x268]
je 0x4091f0
lea r8d, [r15 - 1]
mov eax, 1
add r8, 1
cmp r8, rax
je 0x4093b0
add rax, 1
cmp qword [rdi + rax*8], rdx
jne 0x4091dd
cmp rbp, rdx
cmovb rbp, rdx
mov rcx, qword [rcx]
test rcx, rcx
jne 0x409100
cmp byte [rsp + 0x3d], 0
je 0x409212
mov dword [rsp + 0x470], r11d
cmp byte [rsp + 0x3e], 0
jne 0x4093cf
cmp byte [rsp + 0x3f], 0
jne 0x4094bd
mov rax, qword [rsp + 0x30]
lea ecx, [rbp + 1]
mov r9, rbx
mov r8, rdi
mov rdx, rsi
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
test eax, eax
js 0x409410
mov rax, qword [rsp + 0x6d0]
lea rbp, str.socket_error
mov r12, qword [rax]
test r12, r12
jne 0x4092ef
jmp 0x4093f8
mov rdx, rbx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x4093e0
mov rcx, qword [r12 + 0x38]
cmp rcx, 0xffffffffffffffff
je 0x4092fe
mov rdx, rsi
call sub.WS2_32.dll___WSAFDIsSet
mov rcx, qword [r12 + 0x38]
test eax, eax
movzx eax, byte [r12 + 0xd2]
setne dl
and eax, 0xfffffffe
or eax, edx
cmp rcx, 0xffffffffffffffff
mov byte [r12 + 0xd2], al
je 0x4094ca
mov rdx, rdi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
movzx eax, byte [r12 + 0xd2]
setne dl
add edx, edx
and eax, 0xfffffffd
or eax, edx
mov byte [r12 + 0xd2], al
mov r12, qword [r12]
test r12, r12
je 0x4093f8
mov rcx, qword [r12 + 0x38]
cmp rcx, 0xffffffffffffffff
jne 0x409270
movzx eax, byte [r12 + 0xd2]
xor edx, edx
and eax, 0xfffffffe
mov byte [r12 + 0xd2], al
jmp 0x4092d3
mov eax, dword [rsp + 0x38]
test eax, eax
je 0x4094ad
cmp qword [rsp + 0x58], rdx
je 0x4091ac
lea r8d, [rax - 1]
mov eax, 1
add r8, 1
jmp 0x40935e
add rax, 1
cmp qword [rsi + rax*8], rdx
je 0x4091ac
cmp rax, r8
mov r9d, eax
jne 0x409350
mov eax, dword [rsp + 0x38]
cmp eax, 0x3f
ja 0x4091ac
cmp eax, r9d
jne 0x4091ac
add eax, 1
mov dword [rsp + 0x38], eax
mov qword [rsp + r9*8 + 0x58], rdx
mov byte [rsp + 0x3e], 1
jmp 0x4091ac
add r11d, 1
mov qword [rsp + r9*8 + 0x478], rdx
mov byte [rsp + 0x3d], 1
jmp 0x4091a3
cmp r15d, eax
jne 0x4091f0
cmp r15d, 0x3f
ja 0x4091f0
lea eax, [r15 + 1]
mov r15d, r8d
jmp 0x409491
mov eax, dword [rsp + 0x38]
mov dword [rsp + 0x50], eax
jmp 0x40921d
mov rcx, r12
mov rdx, rbp
call fcn.00408fe0
mov r12, qword [r12]
test r12, r12
jne 0x4092ef
add rsp, 0x688
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test rbp, rbp
je 0x409473
mov dword [rsp + 0x50], 0
mov dword [rsp + 0x260], 0
mov dword [rsp + 0x470], 0
jmp 0x40924c
mov rax, qword [rsp + 0x30]
lea rsi, [rsp + 0x50]
mov ecx, 1
lea rbx, [rsp + 0x470]
mov rdx, rsi
lea rdi, [rsp + 0x260]
mov r9, rbx
mov r8, rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
test eax, eax
jns 0x40924c
mov ecx, r12d
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x409415
xor r9d, r9d
mov r11d, 1
jmp 0x409396
mov eax, 1
cmp rbp, rdx
mov qword [rsp + r15*8 + 0x268], rdx
mov r15d, eax
cmovb rbp, rdx
mov byte [rsp + 0x3f], 1
jmp 0x4091f7
xor r9d, r9d
mov dword [rsp + 0x38], 1
jmp 0x409383
mov dword [rsp + 0x260], r15d
jmp 0x409228
xor edx, edx
jmp 0x4092d3