Function at 0x140004990
Capabilities:
Get socket status
Read and send data from client to server
Read file on windows
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
mov dword [rsp + 8], ecx
push rsi
push rdi
sub rsp, 0x98
mov dword [rsp + 0x70], 0
mov dword [rsp + 0x74], 0x3e8
lea rcx, [rsp + 0x78]
call fcn.140002b70
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__isatty]
test eax, eax
jne 0x1400049d7
mov edx, 0x8000
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
nop
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__isatty]
mov dword [rsp + 0x58], eax
cmp dword [rsp + 0x58], 0
jne 0x1400049f8
mov edx, 0x8000
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
nop
mov rax, qword [0x14000a8b0]
cmp dword [rax], 0x40
jae 0x140004a34
mov rax, qword [0x14000a8b0]
mov eax, dword [rax]
mov ecx, dword [rsp + 0xb0]
mov rdx, qword [0x14000a8b0]
mov qword [rdx + rax*8 + 8], rcx
mov rax, qword [0x14000a8b0]
mov eax, dword [rax]
inc eax
mov rcx, qword [0x14000a8b0]
mov dword [rcx], eax
xor eax, eax
test eax, eax
jne 0x1400049f8
mov eax, 2
mov word [rsp + 0x68], ax
xor eax, eax
mov word [rsp + 0x44], ax
mov dword [rsp + 0x38], 0
mov eax, dword [rsp + 0x38]
mov dword [rsp + 0x34], eax
cmp dword [0x14000a728], 0
je 0x140004b46
mov eax, dword [0x14000a728]
mov dword [rsp + 0x34], eax
mov rax, qword [0x14000a890]
mov qword [rsp + 0x50], rax
mov eax, 1
mov word [rsp + 0x44], ax
movzx eax, word [reloc.WS2_32.dll_accept]
test eax, eax
je 0x140004aa2
mov dword [0x14000a728], 0
jmp 0x140004b46
mov dword [rsp + 0x3c], 0
jmp 0x140004ab6
mov eax, dword [rsp + 0x3c]
inc eax
mov dword [rsp + 0x3c], eax
mov rax, qword [0x14000a8b0]
mov eax, dword [rax]
cmp dword [rsp + 0x3c], eax
jae 0x140004b34
mov eax, dword [rsp + 0x3c]
mov rcx, qword [0x14000a8b0]
cmp qword [rcx + rax*8 + 8], 0
jne 0x140004b2f
mov rax, qword [0x14000a8b0]
mov eax, dword [rax]
dec eax
cmp dword [rsp + 0x3c], eax
jae 0x140004b19
mov eax, dword [rsp + 0x3c]
inc eax
mov eax, eax
mov ecx, dword [rsp + 0x3c]
mov rdx, qword [0x14000a8b0]
mov r8, qword [0x14000a8b0]
mov rax, qword [r8 + rax*8 + 8]
mov qword [rdx + rcx*8 + 8], rax
mov eax, dword [rsp + 0x3c]
inc eax
mov dword [rsp + 0x3c], eax
jmp 0x140004ad8
mov rax, qword [0x14000a8b0]
mov eax, dword [rax]
dec eax
mov rcx, qword [0x14000a8b0]
mov dword [rcx], eax
jmp 0x140004b34
jmp 0x140004aac
xor eax, eax
test eax, eax
jne 0x140004aa2
xor ecx, ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll__close
nop
cmp dword [0x14000a70c], 0
je 0x140004b5c
mov ecx, dword [0x14000a70c]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__sleep]
nop
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0
xor ecx, ecx
call qword [sym.imp.WS2_32.dll_WSASetLastError]
nop
mov eax, dword [rsp + 0xb0]
mov rdx, qword [0x14000a8b0]
mov ecx, eax
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x1400050d5
mov eax, 0x2008
mov word [rsp + 0x48], ax
movzx eax, word [rsp + 0x44]
test eax, eax
je 0x140004bae
xor eax, eax
mov word [rsp + 0x44], ax
jmp 0x140004f0e
mov rdi, qword [0x14000a8a8]
mov rsi, qword [0x14000a8b0]
mov ecx, 0x208
rep movsb byte [rdi], byte [rsi]
cmp qword [0x14000a730], 0
je 0x140004be8
mov r8d, 8
mov rdx, qword [0x14000a730]
mov rcx, qword [0x14000a6f8]
call qword [sym.imp.VCRUNTIME140.dll_memcpy]
nop
lea rax, [rsp + 0x70]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [0x14000a8a8]
mov ecx, reloc.WS2_32.dll_recv
call qword [sym.imp.WS2_32.dll_select]
mov dword [rsp + 0x30], eax
cmp dword [rsp + 0x30], 0
jge 0x140004c68
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2714
je 0x140004c68
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [rsp + 0x80], eax
lea rcx, str.select_fuxored
call fcn.140003198
mov eax, dword [rsp + 0xb0]
mov edx, 2
mov ecx, eax
call qword [sym.imp.WS2_32.dll_shutdown]
mov eax, dword [rsp + 0xb0]
mov ecx, eax
call qword [sym.imp.WS2_32.dll_closesocket]
mov eax, 1
jmp 0x1400050fa
cmp dword [rsp + 0x30], 0
jne 0x140004d03
lea rcx, [rsp + 0x88]
call fcn.140002b70
cmp dword [0x14000a854], 0
jbe 0x140004d03
mov rax, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x88]
sub rcx, rax
mov rax, rcx
mov rcx, qword [0x14000a730]
movsxd rcx, dword [rcx]
cmp rax, rcx
jle 0x140004d03
movzx eax, word [0x14000a6f4]
cmp eax, 1
jle 0x140004cc4
lea rcx, str.net_timeout
call fcn.140003198
nop
mov eax, dword [rsp + 0xb0]
mov edx, 2
mov ecx, eax
call qword [sym.imp.WS2_32.dll_shutdown]
mov eax, dword [rsp + 0xb0]
mov ecx, eax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [0x14000a8b0]
mov dword [rax], 0
xor ecx, ecx
call qword [sym.imp.WS2_32.dll_WSASetLastError]
xor eax, eax
jmp 0x1400050fa
mov eax, dword [rsp + 0xb0]
mov rdx, qword [0x14000a8a8]
mov ecx, eax
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x140004e33
lea rcx, [rsp + 0x78]
call fcn.140002b70
mov eax, dword [rsp + 0xb0]
xor r9d, r9d
mov r8d, 0x2000
mov rdx, qword [0x14000a8a0]
mov ecx, eax
call qword [sym.imp.WS2_32.dll_recv]
mov dword [rsp + 0x30], eax
cmp dword [rsp + 0x30], 0
jg 0x140004e05
mov dword [rsp + 0x40], 0
jmp 0x140004d6d
mov eax, dword [rsp + 0x40]
inc eax
mov dword [rsp + 0x40], eax
mov rax, qword [0x14000a8b0]
mov eax, dword [rax]
cmp dword [rsp + 0x40], eax
jae 0x140004df1
mov eax, dword [rsp + 0x40]
mov ecx, dword [rsp + 0xb0]
mov rdx, qword [0x14000a8b0]
cmp qword [rdx + rax*8 + 8], rcx
jne 0x140004dec
mov rax, qword [0x14000a8b0]
mov eax, dword [rax]
dec eax
cmp dword [rsp + 0x40], eax
jae 0x140004dd6
mov eax, dword [rsp + 0x40]
inc eax
mov eax, eax
mov ecx, dword [rsp + 0x40]
mov rdx, qword [0x14000a8b0]
mov rdi, qword [0x14000a8b0]
mov rax, qword [rdi + rax*8 + 8]
mov qword [rdx + rcx*8 + 8], rax
mov eax, dword [rsp + 0x40]
inc eax
mov dword [rsp + 0x40], eax
jmp 0x140004d95
mov rax, qword [0x14000a8b0]
mov eax, dword [rax]
dec eax
mov rcx, qword [0x14000a8b0]
mov dword [rcx], eax
jmp 0x140004df1
jmp 0x140004d63
xor eax, eax
test eax, eax
jne 0x140004d59
mov dword [rsp + 0x34], 0
jmp 0x140004e33
mov eax, dword [rsp + 0x30]
mov dword [rsp + 0x38], eax
mov rax, qword [0x14000a8a0]
mov qword [rsp + 0x60], rax
movzx eax, word [0x14000a72c]
test eax, eax
je 0x140004e33
mov edx, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x60]
call fcn.140004844
nop
cmp dword [rsp + 0x34], 0
je 0x140004e3f
jmp 0x140004f0e
cmp dword [rsp + 0x58], 0
je 0x140004eb4
call sub.api_ms_win_crt_stdio_l1_1_0.dll__kbhit
test eax, eax
je 0x140004eb2
mov rcx, qword [0x14000a890]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_gets]
lea rdx, [0x140007ad0]
mov rcx, qword [0x14000a890]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strcat]
mov rcx, qword [0x14000a890]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strlen]
mov dword [rsp + 0x30], eax
mov eax, dword [rsp + 0x30]
mov dword [rsp + 0x34], eax
mov rax, qword [0x14000a890]
mov qword [rsp + 0x50], rax
movzx eax, word [reloc.WS2_32.dll_accept]
test eax, eax
jne 0x140004eb2
mov eax, dword [rsp + 0x30]
mov dword [0x14000a728], eax
xor ecx, ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll__close
nop
jmp 0x140004f0e
mov r8d, 0x2000
mov rdx, qword [0x14000a890]
xor ecx, ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll__read
mov dword [rsp + 0x30], eax
cmp dword [rsp + 0x30], 0
jg 0x140004edd
xor ecx, ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll__close
nop
jmp 0x140004f0e
mov eax, dword [rsp + 0x30]
mov dword [rsp + 0x34], eax
mov rax, qword [0x14000a890]
mov qword [rsp + 0x50], rax
movzx eax, word [reloc.WS2_32.dll_accept]
test eax, eax
jne 0x140004f0e
mov eax, dword [rsp + 0x30]
mov dword [0x14000a728], eax
xor ecx, ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll__close
nop
cmp dword [rsp + 0x34], 0x2008
ja 0x140004f22
cmp dword [rsp + 0x38], 0x2008
jbe 0x140004f47
mov r8d, dword [rsp + 0x38]
mov edx, dword [rsp + 0x34]
lea rcx, str.Preposterous_Pointers:__d___d
call fcn.140003198
mov dword [rsp + 0x38], 0
mov eax, dword [rsp + 0x38]
mov dword [rsp + 0x34], eax
movzx eax, word [rsp + 0x48]
test eax, eax
jne 0x140004f66
lea rcx, str.too_many_output_retries
call fcn.140003198
mov eax, 1
jmp 0x1400050fa
cmp dword [rsp + 0x38], 0
je 0x140004ffa
mov r8d, dword [rsp + 0x38]
mov rdx, qword [rsp + 0x60]
mov ecx, 1
call sub.api_ms_win_crt_stdio_l1_1_0.dll__write
mov dword [rsp + 0x30], eax
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fflush]
cmp dword [rsp + 0x30], 0
jle 0x140004ffa
movzx eax, word [0x14000a748]
test eax, eax
je 0x140004fc1
mov r8d, dword [rsp + 0x30]
mov rdx, qword [rsp + 0x60]
mov ecx, 1
call fcn.140004524
nop
movsxd rax, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x60]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x60], rax
mov eax, dword [rsp + 0x30]
mov ecx, dword [rsp + 0x38]
sub ecx, eax
mov eax, ecx
mov dword [rsp + 0x38], eax
mov eax, dword [rsp + 0x30]
mov ecx, dword [0x14000a858]
add ecx, eax
mov eax, ecx
mov dword [0x14000a858], eax
cmp dword [rsp + 0x34], 0
je 0x14000508a
cmp dword [0x14000a70c], 0
je 0x140005022
mov edx, dword [rsp + 0x34]
mov rcx, qword [rsp + 0x50]
call fcn.1400033b0
mov dword [rsp + 0x30], eax
jmp 0x14000502a
mov eax, dword [rsp + 0x34]
mov dword [rsp + 0x30], eax
mov eax, dword [rsp + 0xb0]
xor r9d, r9d
mov r8d, dword [rsp + 0x30]
mov rdx, qword [rsp + 0x50]
mov ecx, eax
call qword [sym.imp.WS2_32.dll_send]
mov dword [rsp + 0x30], eax
cmp dword [rsp + 0x30], 0
jle 0x14000508a
movsxd rax, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x50]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x50], rax
mov eax, dword [rsp + 0x30]
mov ecx, dword [rsp + 0x34]
sub ecx, eax
mov eax, ecx
mov dword [rsp + 0x34], eax
mov eax, dword [rsp + 0x30]
mov ecx, dword [0x14000a724]
add ecx, eax
mov eax, ecx
mov dword [0x14000a724], eax
cmp dword [0x14000a70c], 0
je 0x1400050b0
mov ecx, dword [0x14000a70c]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__sleep]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0
jmp 0x140004b71
cmp dword [rsp + 0x34], 0
jne 0x1400050be
cmp dword [rsp + 0x38], 0
je 0x1400050d0
movzx eax, word [rsp + 0x48]
dec ax
mov word [rsp + 0x48], ax
jmp 0x140004f0e
jmp 0x140004b71
mov eax, dword [rsp + 0xb0]
mov edx, 2
mov ecx, eax
call qword [sym.imp.WS2_32.dll_shutdown]
mov eax, dword [rsp + 0xb0]
mov ecx, eax
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
add rsp, 0x98
pop rdi
pop rsi
ret