Function at 0x140006690
Capabilities:
Get socket status
Receive data
Receive data on socket

Disassembly:
push rbp
push rsi
push r12
push r13
push r14
push r15
sub rsp, 0x268
mov rax, qword [section..data]
xor rax, rsp
mov qword [rsp + 0x250], rax
movsxd r14, r8d
lea r12, [0x140000000]
lea r15, [r12 + 0x2a270]
mov ebp, edx
mov rsi, rcx
lea r13, [r14*4]
add r15, r13
mov qword [rsp + 0x30], r15
cmp dword [r15], 1
jne 0x1400066e8
xor eax, eax
jmp 0x140006a08
mov qword [rsp + 0x2b8], rbx
mov ecx, 1
mov qword [rsp + 0x260], rdi
test rsi, rsi
jne 0x14000676a
lea rax, [r14 + r14*8]
lea rbx, [rax*8]
cmp ebp, dword [rbx + r12 + 0x2ac38]
jbe 0x14000674a
test edx, edx
mov rdi, rbp
cmove rdi, rcx
mov rcx, qword [rbx + r12 + 0x2ac30]
mov rdx, rdi
call fcn.14000d604
test rax, rax
je 0x140006b6d
mov qword [rbx + r12 + 0x2ac30], rax
mov dword [rbx + r12 + 0x2ac38], ebp
mov rax, qword [rbx + r12 + 0x2ac30]
lea rsi, [r12 + 0x2ac20]
add rsi, rbx
mov qword [rbx + r12 + 0x2ac28], rax
mov qword [rsi], rax
jmp 0x1400067ca
mov ebx, dword [rsi + 8]
mov eax, dword [rsi + 0x10]
sub ebx, eax
lea r15d, [rbx + rbp]
cmp r15d, dword [rsi + 0x18]
jbe 0x1400067c5
mov r12d, dword [rsi]
sub r12d, eax
mov edi, r15d
test r15d, r15d
cmove rdi, rcx
mov rcx, qword [rsi + 0x10]
mov rdx, rdi
call fcn.14000d604
mov rcx, rax
test rax, rax
je 0x140006b87
mov qword [rsi + 0x10], rax
mov eax, r12d
lea r12, [0x140000000]
add rax, rcx
mov dword [rsi + 0x18], r15d
mov qword [rsi], rax
mov eax, ebx
add rax, rcx
mov qword [rsi + 8], rax
mov r15, qword [rsp + 0x30]
test ebp, ebp
je 0x1400069f5
lea r14, [r14*8]
mov edi, 1
xor ebx, ebx
xor ecx, ecx
mov qword [r14 + r12 + 0x2a5e0], rbx
mov qword [r14 + r12 + 0x2a3f0], rbx
call fcn.14000d5c4
movsxd rcx, dword [r12 + r13 + 0x2b820]
lea rdx, [rsp + 0x40]
mov qword [r14 + r12 + 0x2a3f0], rax
xor r9d, r9d
mov qword [rsp + 0x48], rcx
lea rax, [rsp + 0x30]
inc ecx
mov dword [rsp + 0x30], ebx
xor r8d, r8d
mov dword [rsp + 0x34], 0xc350
mov dword [rsp + 0x40], edi
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x14000688a
cmp qword [r14 + r12 + 0x2b700], rbx
je 0x140006863
xor ecx, ecx
call fcn.14000d5c4
mov rcx, rax
mov rax, qword [r14 + r12 + 0x2b700]
add rax, 3
cmp rax, rcx
jl 0x14000688a
xor ecx, ecx
call fcn.14000d5c4
mov rcx, rax
mov rax, qword [r14 + r12 + 0x2a3f0]
add rax, 6
cmp rcx, rax
jle 0x14000688a
lea rcx, str.UNKNOWN___RDP_protocol_error___receive_timeout_r_n
call fcn.140007ea0
mov rcx, qword [r14 + r12 + 0x2a350]
test rcx, rcx
je 0x1400068f8
call qword [sym.imp.libssl_1_1_x64.dll_SSL_pending]
mov rcx, qword [r14 + r12 + 0x2a350]
test rcx, rcx
je 0x1400068f8
mov rdx, qword [rsi + 8]
mov r8d, ebp
call qword [sym.imp.libssl_1_1_x64.dll_SSL_read]
mov rcx, qword [r14 + r12 + 0x2a350]
mov edx, eax
mov ebx, eax
call qword [sym.imp.libssl_1_1_x64.dll_SSL_get_error]
mov edi, eax
cmp eax, 1
je 0x140006a59
add eax, 0xfffffffe
cmp eax, 1
jbe 0x1400068ee
test edi, edi
jne 0x140006a2a
mov edi, 1
jmp 0x1400069c9
xor ebx, ebx
lea edi, [rbx + 1]
jmp 0x1400069c9
movsxd rcx, dword [r12 + r13 + 0x2b820]
lea rax, [rsp + 0x38]
mov qword [rsp + 0x48], rcx
lea rdx, [rsp + 0x40]
inc ecx
mov dword [rsp + 0x38], ebx
xor r9d, r9d
mov dword [rsp + 0x3c], 0xc350
xor r8d, r8d
mov dword [rsp + 0x40], edi
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
movsxd rcx, dword [r12 + r13 + 0x2b820]
xor r9d, r9d
mov rdx, qword [rsi + 8]
mov r8d, ebp
call qword [sym.imp.WS2_32.dll_recv]
mov ebx, eax
test eax, eax
jns 0x1400069c3
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
sub ecx, 0x2733
je 0x1400069bf
sub ecx, 0x12
je 0x1400069a3
cmp ecx, 1
jne 0x140006aba
cmp qword [r14 + r12 + 0x2a5e0], 0
jne 0x140006995
cmp dword [r12 + r13 + 0x28f20], ecx
jg 0x140006b53
lea rcx, str.UNKNOWN___no_connection___connection_closed__RST__r_n
call fcn.140007ea0
jmp 0x1400069c9
lea rcx, str.UNKNOWN___RDP_protocol_error___connection_reset_by_peer_r_n
call fcn.140007ea0
jmp 0x1400069c9
lea rdx, str.connection_aborted_r_n
mov ecx, edi
call fcn.140008230
lea rcx, str.UNKNOWN___RDP_protocol_error___connection_aborted_r_n
call fcn.140007ea0
jmp 0x1400069c9
xor ebx, ebx
jmp 0x1400069c9
je 0x140006b09
movsxd rax, ebx
sub ebp, ebx
add qword [rsi + 8], rax
test ebx, ebx
je 0x1400069ed
add qword [r14 + r12 + 0x2a5e0], rax
xor ecx, ecx
call fcn.14000d5c4
mov qword [r14 + r12 + 0x2a3f0], rax
test ebp, ebp
jne 0x1400067df
mov rax, rsi
mov rbx, qword [rsp + 0x2b8]
mov rdi, qword [rsp + 0x260]
mov rcx, qword [rsp + 0x250]
xor rcx, rsp
call fcn.1400083c0
add rsp, 0x268
pop r15
pop r14
pop r13
pop r12
pop rsi
pop rbp
ret
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.140008290
mov r9, rax
lea rdx, str.SSL_read:__d___s__r_n
mov r8d, edi
xor ecx, ecx
call fcn.140008230
lea rcx, str.UNKNOWN___SSL___network_error_r_n
call fcn.140007ea0
jmp 0x140006aab
mov rcx, qword [r14 + r12 + 0x2a350]
call qword [sym.imp.libssl_1_1_x64.dll_SSL_get_shutdown]
test al, 2
je 0x140006a8c
lea rdx, str.Remote_peer_initiated_ssl_shutdown._r_n
xor ecx, ecx
call fcn.140008230
lea rcx, str.UNKNOWN___SSL_protocol_error___network_error_r_n
call fcn.140007ea0
xor eax, eax
jmp 0x1400069f8
call fcn.1400065d0
mov rdx, rax
lea rcx, str.UNKNOWN___SSL_protocol_error____s_r_n
mov rbx, rax
call fcn.140007ea0
mov rcx, rbx
call fcn.14000da14
mov ecx, 1
xor eax, eax
mov dword [r15], ecx
jmp 0x1400069f8
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.140008290
mov r8, rax
lea rdx, str.____recv:__s_n
mov ecx, edi
call fcn.140008230
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.140008290
mov rbx, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8, rbx
lea rcx, str.UNKNOWN___RDP_protocol_error_____d___s_r_n
mov edx, eax
call fcn.140007ea0
xor eax, eax
mov dword [r15], edi
jmp 0x1400069f8
lea rdx, str.____connection_closed__TCP_FIN__r_n
mov ecx, edi
call fcn.140008230
cmp dword [r12 + r13 + 0x2a300], 0
je 0x140006b35
lea rcx, str.UNKNOWN___RDP_protocol_error___connection_closed__FIN__r_n
call fcn.140007ea0
xor eax, eax
jmp 0x1400069f8
cmp dword [r12 + r13 + 0x28f20], 1
jg 0x140006b53
lea rcx, str.UNKNOWN___no_connection___connection_closed__FIN__r_n
call fcn.140007ea0
xor eax, eax
jmp 0x1400069f8
mov ecx, 0x1388
call qword [sym.imp.KERNEL32.dll_Sleep]
dec dword [r12 + r13 + 0x28f20]
xor eax, eax
jmp 0x1400069f8
mov rdx, rdi
lea rcx, str.xrealloc__ld_n
call fcn.140008260
mov ecx, 0x45
call fcn.14000a75c
int3
mov rdx, rdi
lea rcx, str.xrealloc__ld_n
call fcn.140008260
mov ecx, 0x45
call fcn.14000a75c
int3