Function at 0x180016940
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 - 0x90]
sub rsp, 0x190
mov rax, qword [0x1800f3690]
xor rax, rsp
mov qword [rbp + 0x70], rax
mov rax, qword [rbp + 0xf0]
xor r15d, r15d
mov qword [rsp + 0x68], rax
lea rax, [rbp - 0x30]
mov qword [rsp + 0x40], rax
mov r13d, r15d
mov dword [rsp + 0x48], r9d
mov r14d, r9d
mov dword [rsp + 0x38], r8d
mov esi, r8d
mov qword [rsp + 0x60], rdx
mov rdi, rdx
mov qword [rsp + 0x50], rcx
mov r12, rcx
mov dword [rsp + 0x3c], r15d
mov byte [rsp + 0x30], r13b
test rcx, rcx
je 0x180017169
cmp dword [rcx], 0xbab1e
jne 0x180017169
cmp byte [rcx + 0x1b3], r13b
je 0x1800169d5
lea eax, [r15 + 8]
jmp 0x180016ac6
test r14d, r14d
jns 0x1800169e4
mov eax, 0xa
jmp 0x180016ac6
mov qword [rsp + 0x188], rbx
mov rbx, qword [rcx + 8]
test rbx, rbx
je 0x180016a6d
nop word [rax + rax]
lea rdx, [rbp - 0x60]
mov rcx, rbx
call fcn.180015290
mov r10d, eax
lea rdx, [rbp - 0x60]
mov eax, 1
mov r9d, r15d
nop dword [rax + rax]
mov r8, 0xffffffffffffffff
test r10d, eax
je 0x180016a3a
mov rcx, qword [rdx]
cmp rcx, r8
jae 0x180016a3a
inc r13d
mov r8, rcx
mov ecx, eax
rol ecx, 0x10
test r10d, ecx
je 0x180016a4f
cmp qword [rdx], 0xffffffffffffffff
jae 0x180016a4f
inc r13d
jmp 0x180016a55
cmp r8, 0xffffffffffffffff
je 0x180016a64
inc r9d
rol eax, 1
add rdx, 8
cmp r9d, 5
jb 0x180016a20
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x180016a00
lea rdx, [rsp + 0x34]
mov rcx, r12
call fcn.180016840
mov eax, dword [rsp + 0x34]
test eax, eax
js 0x180016a8e
cmp eax, r14d
cmovl r14d, eax
mov dword [rsp + 0x48], r14d
cmp byte [rbp + 0x100], r15b
lea eax, [rsi + r13]
lea ecx, [rax + 1]
cmove ecx, eax
cmp ecx, 0xa
jbe 0x180016aec
shl rcx, 4
call qword [section..data]
mov qword [rsp + 0x40], rax
mov rbx, rax
test rax, rax
jne 0x180016ae5
lea eax, [rbx + 3]
mov rbx, qword [rsp + 0x188]
mov rcx, qword [rbp + 0x70]
xor rcx, rsp
call fcn.18006a300
add rsp, 0x190
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov byte [rsp + 0x30], 1
jmp 0x180016af0
lea rbx, [rbp - 0x30]
xor r8d, r8d
mov dword [rsp + 0x34], r8d
test r13d, r13d
je 0x180016c59
mov rax, qword [r12 + 8]
mov qword [rsp + 0x58], rax
test rax, rax
je 0x180016c59
lea rdx, [rbp - 0x60]
mov rcx, rax
call fcn.180015290
xor r8d, r8d
lea r14, [rbp - 0x60]
mov esi, r8d
mov r12d, eax
jmp 0x180016b35
mov rbx, qword [rsp + 0x40]
bt r12d, esi
mov rdx, 0xffffffffffffffff
mov edi, r8d
jae 0x180016b6c
mov rcx, qword [r14]
cmp rcx, rdx
jae 0x180016b6c
mov eax, r15d
mov rdx, rcx
add rax, rax
mov edi, reloc.WLDAP32.dll_Ordinal_41
inc r15d
mov qword [rbx + rax*8], rcx
mov ecx, 0x300
mov word [rbx + rax*8 + 8], cx
lea ecx, [rsi + 0x10]
movzx eax, cl
bt r12d, eax
jae 0x180016bee
mov rbx, qword [r14]
cmp rbx, 0xffffffffffffffff
jae 0x180016bee
lea rax, [rsp + 0x34]
mov dword [rsp + 0x34], 4
lea r9, [rsp + 0x4c]
mov qword [rsp + 0x20], rax
mov edx, 0xffff
mov r8d, 0x1008
mov rcx, rbx
or edi, 0x32
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x180016bcb
cmp dword [rsp + 0x4c], 1
jne 0x180016bcb
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_send]
mov rcx, qword [rsp + 0x40]
mov edx, reloc.WS2_32.dll_recv
mov eax, r15d
add rax, rax
inc r15d
mov dword [rsp + 0x34], r15d
mov qword [rcx + rax*8], rbx
mov word [rcx + rax*8 + 8], dx
jmp 0x180016bfc
mov dword [rsp + 0x34], r15d
mov rbx, rdx
cmp rdx, 0xffffffffffffffff
je 0x180016c2e
mov rax, qword [rsp + 0x50]
mov r8d, edi
mov rcx, rbx
mov rdx, qword [rax + 0x1a8]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
jne 0x180016d8f
inc esi
add r14, 8
mov r8d, eax
cmp esi, 5
jb 0x180016b30
mov rax, qword [rsp + 0x58]
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x58], rax
test rax, rax
je 0x180016c4b
mov rbx, qword [rsp + 0x40]
jmp 0x180016b14
mov r12, qword [rsp + 0x50]
mov esi, dword [rsp + 0x38]
mov rdi, qword [rsp + 0x60]
mov r14d, r8d
test esi, esi
je 0x180016d71
lea rbx, [rdi + 8]
nop dword [rax + rax]
movzx edx, word [rbx]
movzx eax, dl
and al, 1
neg al
movzx eax, dl
sbb ecx, ecx
and ecx, 0x29
mov edi, ecx
or edi, 4
and al, 2
cmove edi, ecx
test dl, 4
je 0x180016ce3
mov rsi, qword [rbx - 8]
lea rax, [rsp + 0x4c]
mov rcx, rsi
mov dword [rsp + 0x4c], 4
lea r9, [rsp + 0x58]
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 0x180016cdf
cmp dword [rsp + 0x58], 1
jne 0x180016cdf
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_send]
mov esi, dword [rsp + 0x38]
mov rdx, qword [r12 + 0x1a8]
mov r8d, edi
mov rcx, qword [rbx - 8]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
jne 0x180016d8f
mov rax, qword [rbx - 8]
xor r8d, r8d
mov edx, r15d
shl rdx, 4
add rdx, qword [rsp + 0x40]
mov qword [rdx], rax
movzx eax, r8w
mov word [rdx + 8], r8w
movzx ecx, word [rbx]
test cl, 1
je 0x180016d38
mov r9d, 0x300
mov word [rdx + 8], r9w
mov eax, r9d
movzx ecx, word [rbx]
test cl, 2
je 0x180016d4c
mov ecx, 0x400
or ax, cx
mov word [rdx + 8], ax
movzx ecx, word [rbx]
test cl, 4
je 0x180016d59
or ax, 0x10
mov word [rdx + 8], ax
inc r15d
inc r14d
add rbx, 0x10
mov dword [rsp + 0x34], r15d
cmp r14d, esi
jb 0x180016c70
test r15d, r15d
jne 0x180016dab
movzx ebx, byte [rbp + 0x100]
test bl, bl
je 0x1800170e6
mov rbx, qword [rsp + 0x40]
mov r12d, r8d
jmp 0x180016dda
cmp byte [rsp + 0x30], 0
je 0x180016da1
mov rcx, qword [rsp + 0x40]
call qword [fcn.18009de5c]
mov eax, 4
jmp 0x180016abe
mov rbx, qword [rsp + 0x40]
xor r8d, r8d
mov rcx, rbx
mov edx, r15d
call fcn.180036350
mov r12d, eax
test eax, eax
jns 0x180016dcf
mov eax, listen
jmp 0x180016abe
jle 0x180016dd7
mov dword [rsp + 0x3c], eax
jmp 0x180016dfd
xor r8d, r8d
mov rdx, qword [rsp + 0x50]
mov r9d, dword [rsp + 0x48]
add rdx, 0x1a8
mov dword [rsp + 0x20], r8d
xor r8d, r8d
lea ecx, [r8 + 1]
call qword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
xor r10d, r10d
mov esi, r10d
cmp dword [rsp + 0x38], r10d
jbe 0x180016f33
mov r15, qword [rsp + 0x50]
mov edi, r10d
nop word [rax + rax]
mov r14, qword [rsp + 0x60]
lea ecx, [rsi + r13]
add rcx, rcx
lea r8, [rsp + 0x70]
xor edx, edx
mov r14, qword [rdi + r14]
movsx eax, word [rbx + rcx*8 + 0xa]
mov rcx, r14
mov dword [rsp + 0x58], eax
movzx ebx, r10w
mov dword [rsp + 0x70], r10d
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
jne 0x180016eb2
mov r8d, dword [rsp + 0x70]
mov ecx, eax
test r8b, 0x29
mov eax, r8d
setne cl
movzx edx, cx
or dx, 4
and al, 0x32
mov eax, r8d
cmove dx, cx
movzx ecx, dx
or cx, 2
and al, 4
cmove cx, dx
cmp qword [rsp + 0x68], 0
movzx ebx, cx
je 0x180016eb2
test r12d, r12d
jne 0x180016eb2
test r8d, r8d
je 0x180016eb2
inc dword [rsp + 0x3c]
xor r8d, r8d
mov rdx, qword [r15 + 0x1a8]
mov rcx, r14
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
jmp 0x180016f09
mov rdx, qword [r15 + 0x1a8]
xor r8d, r8d
mov rcx, r14
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test r12d, r12d
je 0x180016f09
mov r8d, dword [rsp + 0x58]
mov ecx, 0x300
mov eax, r8d
and eax, ecx
movzx ecx, bx
or cx, 1
test eax, eax
mov eax, r8d
cmove cx, bx
movzx edx, cx
or dx, 4
and al, 0x10
mov eax, 0x400
cmove dx, cx
movzx ebx, dx
or bx, 2
and r8d, eax
cmove bx, dx
mov rax, qword [rsp + 0x60]
inc esi
mov r10d, 0
mov word [rax + rdi + 0xa], bx
add rdi, 0x10
mov rbx, qword [rsp + 0x40]
cmp esi, dword [rsp + 0x38]
jb 0x180016e20
mov r15d, dword [rsp + 0x34]
test r13d, r13d
je 0x1800170cc
mov rax, qword [rsp + 0x50]
mov r13, qword [rax + 8]
mov qword [rsp + 0x60], r13
test r13, r13
je 0x1800170cc
mov r15d, dword [rsp + 0x3c]
lea r8, [0x180000000]
nop
mov rdx, qword [r13 + 0x20]
test rdx, rdx
je case.default.0x180016f8a
mov eax, dword [r13 + 0x58]
add eax, 0xfffffffd
cmp eax, 9
ja case.default.0x180016f8a
cdqe
mov ecx, dword [r8 + rax*4 + 0x17174]
add rcx, r8
jmp rcx
lea rdx, [rbp - 0x60]
mov rcx, r13
call fcn.18002e770
mov r14d, eax
xor r10d, r10d
jmp 0x180017030
mov rax, qword [rdx + 0x2e8]
lea r8, [rbp - 0x60]
mov rcx, r13
mov r9, qword [rax + 0x40]
test r9, r9
je 0x180016fc5
call r9
mov r14d, eax
xor r10d, r10d
jmp 0x180017030
xor edx, edx
call fcn.180025cf0
mov r14d, eax
xor r10d, r10d
jmp 0x180017030
mov rax, qword [rdx + 0x2e8]
mov r9, qword [rax + 0x48]
test r9, r9
je case.default.0x180016f8a
lea r8, [rbp - 0x60]
mov rcx, r13
call r9
mov r14d, eax
xor r10d, r10d
jmp 0x180017030
lea r8, [rbp - 0x60]
xor edx, edx
mov rcx, r13
call fcn.180025cf0
mov r14d, eax
xor r10d, r10d
jmp 0x180017030
mov rax, qword [rdx + 0x2e8]
mov r9, qword [rax + 0x50]
jmp 0x180016fdf
lea r8, [rbp - 0x60]
mov rcx, r13
call fcn.18002c180
mov r14d, eax
xor r10d, r10d
jmp 0x180017030
mov r14d, r10d
mov r13, qword [rsp + 0x50]
lea rsi, [rbp - 0x60]
mov edi, r10d
mov ebx, 1
lea eax, [rdi + 0x10]
mov ecx, ebx
bts ecx, eax
test r14d, ecx
je 0x1800170a4
mov rcx, qword [rsi]
lea r8, [rsp + 0x70]
xor edx, edx
mov dword [rsp + 0x70], r10d
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
jne 0x18001707e
cmp qword [rsp + 0x68], 0
je 0x18001707e
test r12d, r12d
jne 0x18001707e
cmp dword [rsp + 0x70], r12d
je 0x18001707e
inc r15d
mov rdx, qword [r13 + 0x1a8]
xor r8d, r8d
mov rcx, qword [rsi]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
inc edi
rol ebx, 1
add rsi, 8
mov r10d, 0
cmp edi, 5
jb 0x180017041
mov r13, qword [rsp + 0x60]
lea r8, [0x180000000]
mov dword [rsp + 0x3c], r15d
mov r13, qword [r13 + 0x10]
mov qword [rsp + 0x60], r13
test r13, r13
jne 0x180016f60
mov r15d, dword [rsp + 0x34]
mov r12, qword [rsp + 0x50]
mov rcx, qword [r12 + 0x1a8]
call qword [sym.imp.WS2_32.dll_WSAResetEvent]
movzx ebx, byte [rbp + 0x100]
cmp byte [rsp + 0x30], 0
je 0x1800170f8
mov rcx, qword [rsp + 0x40]
call qword [fcn.18009de5c]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x180017108
mov eax, dword [rsp + 0x3c]
mov dword [rcx], eax
cmp byte [rbp + 0xf8], 0
je 0x180017162
test r15d, r15d
jne 0x180017162
test bl, bl
jne 0x180017162
cmp dword [r12], 0xbab1e
mov dword [rsp + 0x34], r15d
jne 0x180017162
cmp byte [r12 + 0x1b3], bl
jne 0x180017162
lea rdx, [rsp + 0x34]
mov rcx, r12
call fcn.180016840
test eax, eax
jne 0x180017162
mov eax, dword [rsp + 0x34]
test eax, eax
je 0x180017162
mov ecx, dword [rsp + 0x48]
cmp eax, ecx
jg 0x180017158
test eax, eax
jns 0x18001715a
mov eax, ecx
movsxd rcx, eax
call fcn.1800368c0
xor eax, eax
jmp 0x180016abe
mov eax, 1
jmp 0x180016ac6