Function at 0x140154830
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
mov dword [rsp + 0x10], edx
mov qword [rsp + 8], rcx
sub rsp, 0x578
mov rax, qword [0x140298e80]
xor rax, rsp
mov qword [rsp + 0x560], rax
mov rax, qword [rsp + 0x580]
cmp dword [rax + 0x58], 1
jne 0x1401548c0
cmp dword [rsp + 0x588], 0
jle 0x1401548bb
mov eax, dword [rsp + 0x588]
cdq
mov ecx, 0x3e8
idiv ecx
mov dword [rsp + 0x128], eax
mov eax, dword [rsp + 0x588]
cdq
mov ecx, 0x3e8
idiv ecx
mov eax, edx
imul eax, eax, 0x3e8
mov dword [rsp + 0x12c], eax
lea rax, [rsp + 0x128]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.WS2_32.dll_select]
jmp 0x140154efd
cmp dword [rsp + 0x588], 0
je 0x140154a9b
mov eax, dword [rsp + 0x588]
cdq
mov ecx, 0x3e8
idiv ecx
mov dword [rsp + 0x130], eax
mov eax, dword [rsp + 0x588]
cdq
mov ecx, 0x3e8
idiv ecx
mov eax, edx
imul eax, eax, 0x3e8
mov dword [rsp + 0x134], eax
mov dword [rsp + 0x350], 0
mov dword [rsp + 0x140], 0
mov dword [rsp + 0x30], 0
jmp 0x14015492c
mov eax, dword [rsp + 0x30]
inc eax
mov dword [rsp + 0x30], eax
mov eax, dword [rsp + 0x350]
cmp dword [rsp + 0x30], eax
jae 0x140154957
mov eax, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x580]
mov rcx, qword [rcx + 0x50]
cmp qword [rsp + rax*8 + 0x358], rcx
jne 0x140154955
jmp 0x140154957
jmp 0x140154922
mov eax, dword [rsp + 0x350]
cmp dword [rsp + 0x30], eax
jne 0x140154996
cmp dword [rsp + 0x350], 0x40
jae 0x140154996
mov eax, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x580]
mov rcx, qword [rcx + 0x50]
mov qword [rsp + rax*8 + 0x358], rcx
mov eax, dword [rsp + 0x350]
inc eax
mov dword [rsp + 0x350], eax
xor eax, eax
test eax, eax
jne 0x140154918
mov rax, qword [rsp + 0x580]
add rax, 0x20
mov rcx, rax
call fcn.140137f20
test rax, rax
je 0x140154a45
mov dword [rsp + 0x34], 0
jmp 0x1401549d1
mov eax, dword [rsp + 0x34]
inc eax
mov dword [rsp + 0x34], eax
mov eax, dword [rsp + 0x140]
cmp dword [rsp + 0x34], eax
jae 0x1401549fc
mov eax, dword [rsp + 0x34]
mov rcx, qword [rsp + 0x580]
mov rcx, qword [rcx + 0x50]
cmp qword [rsp + rax*8 + 0x148], rcx
jne 0x1401549fa
jmp 0x1401549fc
jmp 0x1401549c7
mov eax, dword [rsp + 0x140]
cmp dword [rsp + 0x34], eax
jne 0x140154a3b
cmp dword [rsp + 0x140], 0x40
jae 0x140154a3b
mov eax, dword [rsp + 0x34]
mov rcx, qword [rsp + 0x580]
mov rcx, qword [rcx + 0x50]
mov qword [rsp + rax*8 + 0x148], rcx
mov eax, dword [rsp + 0x140]
inc eax
mov dword [rsp + 0x140], eax
xor eax, eax
test eax, eax
jne 0x1401549bd
cmp dword [rsp + 0x588], 0
jle 0x140154a5e
lea rax, [rsp + 0x130]
mov qword [rsp + 0x58], rax
jmp 0x140154a67
mov qword [rsp + 0x58], 0
mov rax, qword [rsp + 0x580]
mov rax, qword [rax + 0x50]
inc rax
mov rcx, qword [rsp + 0x58]
mov qword [rsp + 0x20], rcx
xor r9d, r9d
lea r8, [rsp + 0x140]
lea rdx, [rsp + 0x350]
mov ecx, eax
call qword [sym.imp.WS2_32.dll_select]
xor eax, eax
cmp eax, 1
je 0x140154c91
mov rax, qword [rsp + 0x580]
add rax, 8
mov rcx, rax
call fcn.140137f20
mov dword [rsp + 0x38], eax
mov rax, qword [rsp + 0x580]
add rax, 8
mov qword [rsp + 0x70], rax
mov eax, dword [rsp + 0x38]
add eax, 0x5dc
cdqe
mov rdx, rax
mov rcx, qword [rsp + 0x70]
call fcn.140133f60
mov rax, qword [rsp + 0x580]
add rax, 8
mov qword [rsp + 0x78], rax
movsxd rax, dword [rsp + 0x38]
mov qword [rsp + 0x80], rax
xor edx, edx
mov rcx, qword [rsp + 0x78]
call fcn.140100f70
mov rcx, qword [rsp + 0x80]
add rax, rcx
mov qword [rsp + 0x88], rax
mov rax, qword [rsp + 0x580]
mov rax, qword [rax + 0x50]
mov qword [rsp + 0x90], rax
xor r9d, r9d
mov r8d, 0x5dc
mov rdx, qword [rsp + 0x88]
mov rcx, qword [rsp + 0x90]
call qword [sym.imp.WS2_32.dll_recv]
mov dword [rsp + 0x3c], eax
xor eax, eax
test eax, eax
je 0x140154b66
jmp 0x140154c8c
cmp dword [rsp + 0x3c], 0
jge 0x140154bba
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x140154b87
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
jne 0x140154bba
mov rax, qword [rsp + 0x580]
add rax, 8
mov qword [rsp + 0x98], rax
movsxd rax, dword [rsp + 0x38]
mov rdx, rax
mov rcx, qword [rsp + 0x98]
call fcn.140133f60
jmp 0x140154c91
cmp dword [rsp + 0x3c], 0
jg 0x140154c5a
mov rax, qword [rsp + 0x580]
add rax, 8
mov qword [rsp + 0xa0], rax
movsxd rax, dword [rsp + 0x38]
mov rdx, rax
mov rcx, qword [rsp + 0xa0]
call fcn.140133f60
mov rax, qword [rsp + 0x580]
mov rcx, qword [rax + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x580]
mov dword [rax + 0x58], 1
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov qword [rsp + 0xa8], rax
cmp dword [rsp + 0x3c], 0
jge 0x140154c37
lea rax, str.Connection_error__n
mov qword [rsp + 0x48], rax
jmp 0x140154c43
lea rax, str.Connection_closed__n
mov qword [rsp + 0x48], rax
mov rdx, qword [rsp + 0xa8]
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
jmp 0x140154c91
mov rax, qword [rsp + 0x580]
add rax, 8
mov qword [rsp + 0xb0], rax
mov eax, dword [rsp + 0x3c]
mov ecx, dword [rsp + 0x38]
add ecx, eax
mov eax, ecx
cdqe
mov rdx, rax
mov rcx, qword [rsp + 0xb0]
call fcn.140133f60
jmp 0x140154a9b
mov rax, qword [rsp + 0x580]
add rax, 0x20
mov rcx, rax
call fcn.140137f20
test rax, rax
je 0x140154eb5
mov rax, qword [rsp + 0x580]
add rax, 0x20
mov rcx, rax
call fcn.140137f20
mov dword [rsp + 0x44], eax
mov rax, qword [rsp + 0x580]
add rax, 0x20
mov qword [rsp + 0xb8], rax
xor edx, edx
mov rcx, qword [rsp + 0xb8]
call fcn.140100f70
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0x580]
mov rax, qword [rax + 0x50]
mov qword [rsp + 0xc8], rax
xor r9d, r9d
mov r8d, dword [rsp + 0x44]
mov rdx, qword [rsp + 0xc0]
mov rcx, qword [rsp + 0xc8]
call qword [sym.imp.WS2_32.dll_send]
mov dword [rsp + 0x40], eax
xor eax, eax
test eax, eax
je 0x140154d32
jmp 0x140154eb0
cmp dword [rsp + 0x40], 0
jge 0x140154d5d
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x140154d53
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
jne 0x140154d5d
jmp 0x140154eb5
cmp dword [rsp + 0x40], 0
jg 0x140154dd6
mov rax, qword [rsp + 0x580]
mov rcx, qword [rax + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x580]
mov dword [rax + 0x58], 1
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov qword [rsp + 0xd0], rax
cmp dword [rsp + 0x40], 0
jge 0x140154dad
lea rax, str.Connection_error__n
mov qword [rsp + 0x50], rax
jmp 0x140154db9
lea rax, str.Connection_closed__n
mov qword [rsp + 0x50], rax
mov rdx, qword [rsp + 0xd0]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
jmp 0x140154eb5
mov rax, qword [rsp + 0x580]
add rax, 0x20
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0x580]
add rax, 0x20
mov qword [rsp + 0xd8], rax
lea rdx, [rsp + 0x108]
mov rcx, qword [rsp + 0xd8]
call fcn.140016750
mov qword [rsp + 0xe0], rax
movsxd rax, dword [rsp + 0x40]
mov r8, rax
lea rdx, [rsp + 0x110]
mov rcx, qword [rsp + 0xe0]
call fcn.1401528b0
mov rax, qword [rax]
mov qword [rsp + 0xe8], rax
mov rax, qword [rsp + 0xe8]
mov qword [rsp + 0x100], rax
mov rax, qword [rsp + 0x580]
add rax, 0x20
mov qword [rsp + 0xf0], rax
lea rdx, [rsp + 0x118]
mov rcx, qword [rsp + 0xf0]
call fcn.140016750
mov rax, qword [rax]
mov qword [rsp + 0xf8], rax
mov rax, qword [rsp + 0xf8]
mov qword [rsp + 0x60], rax
mov r9, qword [rsp + 0x100]
mov r8, qword [rsp + 0x60]
lea rdx, [rsp + 0x120]
mov rcx, qword [rsp + 0x68]
call fcn.140153cf0
jmp 0x140154c91
mov rax, qword [rsp + 0x580]
add rax, 0x20
mov rcx, rax
call fcn.140137f20
test rax, rax
jne 0x140154efd
mov rax, qword [rsp + 0x580]
cmp dword [rax + 0x58], 0
jne 0x140154efd
mov rax, qword [rsp + 0x580]
mov rcx, qword [rax + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x580]
mov dword [rax + 0x58], 1
mov rcx, qword [rsp + 0x560]
xor rcx, rsp
call fcn.1401dae20
add rsp, 0x578
ret