Function at 0x140171990
Capabilities:
Send data
Send data on socket

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0xa0]
sub rsp, 0x1a0
mov rax, qword [0x14026fad8]
xor rax, rsp
mov qword [rbp + 0x80], rax
mov rax, qword [rbp + 0x100]
lea r14, [rbp - 0x20]
mov qword [rsp + 0x68], rax
mov esi, r9d
xor eax, eax
mov dword [rsp + 0x40], r9d
mov r12d, r8d
mov r15, rdx
mov qword [rsp + 0x60], rdx
mov r13, rcx
mov qword [rsp + 0x58], rcx
mov edi, eax
mov dword [rsp + 0x3c], eax
mov dword [rsp + 0x38], eax
mov qword [rsp + 0x50], r14
mov byte [rsp + 0x30], al
test rcx, rcx
je 0x140172065
cmp dword [rcx], 0xbab1e
jne 0x140172065
cmp byte [rcx + 0x1ab], al
je 0x140171a23
mov eax, 8
jmp 0x140171d0e
test esi, esi
jns 0x140171a31
mov eax, 0xa
jmp 0x140171d0e
mov qword [rsp + 0x198], rbx
mov rbx, qword [rcx + 8]
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rax
mov qword [rbp - 0x80], rax
mov qword [rbp - 0x78], rax
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], rax
mov qword [rbp - 0x60], rax
test rbx, rbx
je 0x140171a7d
lea rdx, [rsp + 0x70]
mov rcx, rbx
call fcn.1401705c0
add edi, dword [rbp - 0x68]
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140171a60
mov dword [rsp + 0x3c], edi
lea rdx, [rsp + 0x34]
mov rcx, r13
call fcn.140171880
mov eax, dword [rsp + 0x34]
test eax, eax
js 0x140171a9b
cmp eax, esi
cmovl esi, eax
mov dword [rsp + 0x40], esi
cmp byte [rbp + 0x110], 0
lea eax, [r12 + rdi]
lea ecx, [rax + 1]
cmove ecx, eax
cmp ecx, 0xa
jbe 0x140171ad6
shl rcx, 4
call qword [sub.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x50], rax
mov r14, rax
test rax, rax
jne 0x140171ad1
lea eax, [r14 + 3]
jmp 0x140171d06
mov byte [rsp + 0x30], 1
xor ecx, ecx
mov dword [rsp + 0x34], ecx
mov esi, ecx
lea edx, [rcx + 0x29]
test edi, edi
je 0x140171bfd
mov r15, qword [r13 + 8]
test r15, r15
je 0x140171bf8
nop word [rax + rax]
lea rdx, [rsp + 0x70]
mov rcx, r15
call fcn.1401705c0
xor ecx, ecx
mov edi, ecx
cmp dword [rbp - 0x68], ecx
jbe 0x140171be7
nop word [rax + rax]
mov rax, qword [rsp + rdi*8 + 0x70]
mov ebx, esi
inc esi
shl rbx, 4
add rbx, r14
mov dword [rsp + 0x34], esi
mov esi, ecx
mov qword [rbx], rax
mov word [rbx + 8], cx
test byte [rbp + rdi - 0x64], 1
je 0x140171b52
mov eax, 0x300
mov esi, reloc.WLDAP32.dll_Ordinal_41
mov word [rbx + 8], ax
test byte [rbp + rdi - 0x64], 2
je 0x140171bb2
mov r14, qword [rsp + rdi*8 + 0x70]
lea rax, [rsp + 0x44]
mov rcx, r14
mov dword [rsp + 0x44], 4
lea r9, [rsp + 0x48]
mov qword [rsp + 0x20], rax
mov edx, 0xffff
mov r8d, 0x1008
or esi, 0x32
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x140171ba8
cmp dword [rsp + 0x48], 1
jne 0x140171ba8
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, r14
call qword [sym.imp.WS2_32.dll_send]
or word [rbx + 8], 0x10
mov r14, qword [rsp + 0x50]
mov rdx, qword [r13 + 0x198]
mov r8d, esi
mov rcx, qword [rsp + rdi*8 + 0x70]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
jne 0x140171cf1
mov eax, dword [rbp - 0x68]
inc rdi
mov esi, dword [rsp + 0x34]
mov ecx, 0
cmp rdi, rax
jb 0x140171b20
mov r15, qword [r15 + 0x10]
test r15, r15
jne 0x140171b00
lea edx, [r15 + 0x29]
mov r15, qword [rsp + 0x60]
mov r14, rcx
test r12, r12
je 0x140171d3c
lea rbx, [r15 + 8]
mov r15, qword [rsp + 0x50]
movzx eax, word [rbx]
mov edi, ecx
test al, 1
cmovne edi, edx
test al, 2
je 0x140171c23
or edi, 4
test al, 4
je 0x140171c75
mov rsi, qword [rbx - 8]
lea rax, [rsp + 0x48]
mov rcx, rsi
mov dword [rsp + 0x48], 4
lea r9, [rsp + 0x44]
mov qword [rsp + 0x20], rax
mov edx, 0xffff
mov r8d, 0x1008
or edi, 0x32
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x140171c75
cmp dword [rsp + 0x44], 1
jne 0x140171c75
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_send]
mov rdx, qword [r13 + 0x198]
mov r8d, edi
mov rcx, qword [rbx - 8]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
jne 0x140171d30
mov rax, qword [rbx - 8]
mov esi, dword [rsp + 0x34]
mov ecx, esi
shl rcx, 4
add rcx, r15
mov qword [rcx], rax
xor eax, eax
mov word [rcx + 8], ax
test byte [rbx], 1
je 0x140171cb9
mov eax, 0x300
mov word [rcx + 8], ax
test byte [rbx], 2
je 0x140171cc7
mov eax, 0x400
or word [rcx + 8], ax
test byte [rbx], 4
je 0x140171cd1
or word [rcx + 8], 0x10
inc esi
mov ecx, 0
inc r14
mov dword [rsp + 0x34], esi
add rbx, 0x10
lea edx, [rcx + 0x29]
cmp r14, r12
jb 0x140171c12
jmp 0x140171d41
cmp byte [rsp + 0x30], 0
je 0x140171d01
mov rcx, r14
call qword [fcn.1401c8df5]
mov eax, 4
mov rbx, qword [rsp + 0x198]
mov rcx, qword [rbp + 0x80]
xor rcx, rsp
call fcn.1401c74a0
add rsp, 0x1a0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
cmp byte [rsp + 0x30], 0
je 0x140171d01
mov rcx, r15
jmp 0x140171cfb
mov r15, qword [rsp + 0x50]
test esi, esi
jne 0x140171d58
movzx ebx, byte [rbp + 0x110]
test bl, bl
je 0x140171fe2
mov ebx, ecx
jmp 0x140171d7c
xor r8d, r8d
mov edx, esi
mov rcx, r15
call fcn.1401938b0
mov ebx, eax
test eax, eax
jns 0x140171d72
mov eax, listen
jmp 0x140171d06
jle 0x140171d7a
mov dword [rsp + 0x38], eax
jmp 0x140171d99
xor ecx, ecx
mov r9d, dword [rsp + 0x40]
lea rdx, [r13 + 0x198]
xor r8d, r8d
mov dword [rsp + 0x20], ecx
lea ecx, [r8 + 1]
call qword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
movsxd r15, ebx
test r12, r12
je 0x140171ea2
mov rcx, qword [rsp + 0x60]
mov r13d, dword [rsp + 0x3c]
shl r13, 4
sub r13, rcx
add r13, qword [rsp + 0x50]
lea rdi, [rcx + 0xa]
nop
mov rsi, qword [rdi - 0xa]
lea r8, [rbp - 0x58]
movsx r14d, word [rdi + r13]
xor eax, eax
mov rcx, rsi
mov dword [rbp - 0x58], eax
xor edx, edx
movzx ebx, ax
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
jne 0x140171e31
mov r9d, dword [rbp - 0x58]
mov ecx, 0
test r9b, 0x29
mov eax, r9d
setne cl
movzx edx, cx
or dx, 4
and al, 0x32
mov eax, r9d
cmove dx, cx
movzx r8d, dx
or r8w, 2
and al, 4
cmove r8w, dx
cmp qword [rsp + 0x68], 0
movzx ebx, r8w
je 0x140171e31
test r15, r15
jne 0x140171e31
test r9d, r9d
je 0x140171e31
inc dword [rsp + 0x38]
mov rax, qword [rsp + 0x58]
xor r8d, r8d
mov rcx, rsi
mov rdx, qword [rax + 0x198]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test r15, r15
jne 0x140171e53
mov word [rdi], bx
jmp 0x140171e8b
mov eax, r14d
movzx ecx, bx
or cx, 1
and eax, 0x300
mov eax, r14d
cmove cx, bx
movzx edx, cx
or dx, 4
and al, 0x10
cmove dx, cx
movzx eax, dx
or ax, 2
and r14d, 0x400
cmove ax, dx
mov word [rdi], ax
add rdi, 0x10
sub r12, 1
jne 0x140171dc0
mov r13, qword [rsp + 0x58]
mov esi, dword [rsp + 0x34]
cmp dword [rsp + 0x3c], 0
je 0x140171fce
mov rdi, qword [r13 + 8]
mov qword [rsp + 0x58], rdi
test rdi, rdi
je 0x140171fce
mov rsi, qword [rsp + 0x68]
lea r14, [0x140000000]
nop dword [rax + rax]
lea rdx, [rsp + 0x70]
mov rcx, rdi
call fcn.140181300
cmp qword [rdi + 0x20], 0
je case.0x140171efc.13
mov eax, dword [rdi + 0x58]
add eax, 0xfffffffd
cmp eax, 0xa
ja case.0x140171efc.4
cdqe
mov ecx, dword [r14 + rax*4 + 0x172070]
add rcx, r14
jmp rcx
lea r8, [0x14018b790]
mov rcx, rdi
lea rdx, [rsp + 0x70]
call fcn.1401811d0
jmp case.0x140171efc.13
lea r8, [0x140172140]
jmp 0x140171f36
lea r8, [0x140170130]
jmp 0x140171f36
lea r8, [0x140170150]
jmp 0x140171f36
lea r8, [0x140188020]
lea rdx, [rsp + 0x70]
mov rcx, rdi
call fcn.140181170
lea rdx, [rsp + 0x70]
mov rcx, rdi
call fcn.140180450
xor eax, eax
mov ebx, eax
cmp dword [rbp - 0x68], eax
jbe 0x140171fb8
mov edi, dword [rsp + 0x38]
nop dword [rax]
mov rcx, qword [rsp + rbx*8 + 0x70]
lea r8, [rbp - 0x58]
xor edx, edx
mov dword [rbp - 0x58], eax
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
jne 0x140171f8a
test rsi, rsi
je 0x140171f8a
test r15, r15
jne 0x140171f8a
cmp dword [rbp - 0x58], r15d
je 0x140171f8a
inc edi
mov rdx, qword [r13 + 0x198]
xor r8d, r8d
mov rcx, qword [rsp + rbx*8 + 0x70]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
mov eax, dword [rbp - 0x68]
inc rbx
cmp rbx, rax
mov eax, 0
jb 0x140171f60
mov dword [rsp + 0x38], edi
mov rdi, qword [rsp + 0x58]
mov rdi, qword [rdi + 0x10]
mov qword [rsp + 0x58], rdi
test rdi, rdi
jne 0x140171ed0
mov esi, dword [rsp + 0x34]
mov rcx, qword [r13 + 0x198]
call qword [sym.imp.WS2_32.dll_WSAResetEvent]
movzx ebx, byte [rbp + 0x110]
cmp byte [rsp + 0x30], 0
je 0x140171ff4
mov rcx, qword [rsp + 0x50]
call qword [fcn.1401c8df5]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x140172004
mov eax, dword [rsp + 0x38]
mov dword [rcx], eax
cmp byte [rbp + 0x108], 0
je 0x14017205e
test esi, esi
jne 0x14017205e
test bl, bl
jne 0x14017205e
xor eax, eax
cmp dword [r13], 0xbab1e
mov dword [rsp + 0x3c], eax
jne 0x14017205e
cmp byte [r13 + 0x1ab], al
jne 0x14017205e
lea rdx, [rsp + 0x3c]
mov rcx, r13
call fcn.140171880
test eax, eax
jne 0x14017205e
mov eax, dword [rsp + 0x3c]
test eax, eax
je 0x14017205e
mov ecx, dword [rsp + 0x40]
cmp eax, ecx
jg 0x140172056
test eax, eax
cmovs eax, ecx
mov ecx, eax
movsxd rcx, ecx
call fcn.140193df0
xor eax, eax
jmp 0x140171d06
mov eax, 1
jmp 0x140171d0e