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

Disassembly:
push rbp
push rsi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x88]
sub rsp, 0x188
mov rax, qword [0x140221bc0]
xor rax, rsp
mov qword [rbp + 0x70], rax
mov r13, qword [rbp + 0xe0]
xor r15d, r15d
mov dword [rsp + 0x38], r9d
mov r12, rcx
mov r14d, r8d
mov esi, r15d
mov qword [rsp + 0x50], rdx
mov qword [rsp + 0x48], rcx
mov qword [rsp + 0x78], r13
test rcx, rcx
je 0x140040a8d
cmp dword [rcx], 0xbab1e
jne 0x140040a8d
cmp byte [rcx + 0x25b], sil
je 0x140040577
mov eax, 8
jmp 0x140040a92
test r9d, r9d
jns 0x140040586
mov eax, 0xa
jmp 0x140040a92
mov qword [rsp + 0x1d0], rbx
lea rdx, [rbp - 0x30]
mov r8d, 0xa
mov qword [rsp + 0x180], rdi
lea rcx, [rsp + 0x58]
call fcn.140005646
lea rax, [r12 + 0x30]
mov rcx, rax
mov qword [rbp - 0x80], rax
call fcn.140004606
mov rdi, rax
test rax, rax
je 0x140040602
mov rcx, rdi
call fcn.1400021a8
mov rcx, rax
lea rbx, [rax + 0xa0]
mov rdx, rbx
call fcn.14003e3a0
mov rdx, rbx
lea rcx, [rsp + 0x58]
call fcn.140001dca
test eax, eax
jne 0x140040771
mov rcx, rdi
call fcn.140005100
mov rdi, rax
test rax, rax
jne 0x1400405c3
lea rcx, [r12 + 0x170]
lea rdx, [rsp + 0x58]
call fcn.140006e65
test eax, eax
jne 0x140040771
mov eax, dword [rsp + 0x60]
mov rbx, r15
mov dword [rsp + 0x30], eax
mov r8d, 0x400
mov qword [rsp + 0x40], r14
test r14, r14
je 0x14004069d
mov rdi, qword [rsp + 0x50]
nop dword [rax]
movzx r9d, word [rdi + 8]
movzx eax, r9b
and al, 1
neg al
sbb cx, cx
and cx, 0x300
movzx edx, cx
or dx, r8w
test r9b, 2
cmove dx, cx
lea rcx, [rsp + 0x58]
movzx r8d, dx
or r8w, 0x10
test r9b, 4
cmove r8w, dx
mov rdx, qword [rdi]
call fcn.1400051fa
test eax, eax
jne 0x140040771
inc rbx
add rdi, 0x10
mov r8d, 0x400
cmp rbx, r14
jb 0x140040640
mov r14, r15
mov ecx, 0x300
cmp dword [rsp + 0x60], esi
jbe 0x14004077c
mov rdi, r15
mov r12, qword [rsp + 0x58]
movzx edx, word [r12 + rdi + 8]
movzx eax, dx
and ax, cx
neg ax
sbb ecx, ecx
and ecx, 0x29
mov ebx, ecx
or ebx, 4
test r8w, dx
cmove ebx, ecx
test dl, 0x10
je 0x14004072a
mov r12, qword [r12 + rdi]
lea rax, [rsp + 0x70]
mov rcx, r12
mov dword [rsp + 0x70], 4
lea r9, [rsp + 0x34]
mov qword [rsp + 0x20], rax
mov edx, 0xffff
mov r8d, 0x1008
or ebx, 0x32
call qword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x14004072a
cmp dword [rsp + 0x34], 1
jne 0x14004072a
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, r12
call qword [sym.imp.WS2_32.dll_send]
mov r12, qword [rsp + 0x48]
test ebx, ebx
je 0x140040751
mov rcx, qword [rsp + 0x58]
mov r8d, ebx
mov rdx, qword [r12 + 0x248]
mov rcx, qword [rdi + rcx]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
jne 0x140040771
mov eax, dword [rsp + 0x60]
inc r14
add rdi, 0x10
cmp r14, rax
jae 0x14004077c
mov ecx, 0x300
mov r8d, 0x400
jmp 0x1400406b2
mov r15d, 3
jmp 0x140040a6e
lea r8, [rsp + 0x34]
mov rcx, r12
lea rdx, [rbp - 0x78]
call fcn.140040390
mov eax, dword [rsp + 0x34]
mov ebx, dword [rsp + 0x38]
test eax, eax
js 0x1400407a2
cmp eax, ebx
cmovl ebx, eax
mov dword [rsp + 0x38], ebx
mov eax, dword [rsp + 0x60]
movzx ecx, byte [rbp + 0xf0]
test eax, eax
jne 0x140040898
test cl, cl
je 0x140040a05
mov r12d, r15d
mov r13, qword [rsp + 0x48]
mov r9d, ebx
add r13, 0x248
mov dword [rsp + 0x20], r15d
mov rdx, r13
xor r8d, r8d
mov ecx, 1
call qword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
cmp qword [rsp + 0x40], r15
jbe 0x140040937
mov rdx, qword [rsp + 0x50]
mov edi, dword [rsp + 0x30]
shl rdi, 4
sub rdx, rdi
mov qword [rsp + 0x50], rdx
nop word [rax + rax]
mov r14, qword [rdx + rdi]
lea r8, [rbp - 0x68]
mov rax, qword [rsp + 0x58]
xor edx, edx
movzx ebx, r15w
movsx ecx, word [rdi + rax + 0xa]
mov dword [rsp + 0x34], ecx
mov rcx, r14
mov dword [rbp - 0x68], r15d
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
jne 0x1400408d2
mov r8d, dword [rbp - 0x68]
mov ecx, r15d
test r8b, 0x29
setne cl
movzx edx, cx
or dx, 4
test r8b, 0x32
cmove dx, cx
movzx ecx, dx
or cx, 2
test r8b, 4
cmove cx, dx
movzx ebx, cx
cmp qword [rsp + 0x78], r15
je 0x1400408d2
test r12d, r12d
jne 0x1400408d2
test r8d, r8d
je 0x1400408d2
mov rdx, qword [r13]
inc esi
xor r8d, r8d
mov rcx, r14
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
jmp 0x14004091d
mov rcx, qword [rsp + 0x58]
xor r8d, r8d
mov edx, eax
call fcn.1400061ef
mov r12d, eax
test eax, eax
jns 0x1400408b9
mov r15d, listen
jmp 0x140040a6e
jle 0x1400407c0
mov r13, qword [rsp + 0x48]
mov esi, eax
add r13, 0x248
jmp 0x1400407e5
mov rdx, qword [r13]
xor r8d, r8d
mov rcx, r14
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test r12d, r12d
je 0x14004091d
mov r8d, dword [rsp + 0x34]
movzx ecx, bx
or cx, 1
test r8d, 0x300
cmove cx, bx
movzx edx, cx
or dx, 4
test r8b, 0x10
cmove dx, cx
movzx ebx, dx
or bx, 2
bt r8d, 0xa
cmovae bx, dx
mov rdx, qword [rsp + 0x50]
mov word [rdx + rdi + 0xa], bx
add rdi, 0x10
sub qword [rsp + 0x40], 1
jne 0x140040810
cmp dword [rsp + 0x30], r15d
je 0x1400409e6
mov rcx, qword [rbp - 0x80]
call fcn.140004606
mov qword [rsp + 0x40], rax
test rax, rax
je 0x1400409e6
nop dword [rax]
mov rcx, rax
call fcn.1400021a8
mov rdi, r15
mov r14, rax
cmp dword [rax + 0xc8], edi
jbe 0x1400409ce
lea rbx, [rax + 0xa0]
nop dword [rax]
mov dword [rbp - 0x68], r15d
lea r8, [rbp - 0x68]
mov rcx, qword [rbx]
xor edx, edx
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
jne 0x1400409ab
cmp qword [rsp + 0x78], r15
je 0x1400409ab
test r12d, r12d
jne 0x1400409ab
cmp dword [rbp - 0x68], r15d
je 0x1400409ab
inc esi
mov rdx, qword [r13]
xor r8d, r8d
mov rcx, qword [rbx]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
mov eax, dword [r14 + 0xc8]
inc rdi
add rbx, 8
cmp rdi, rax
jb 0x140040980
mov rcx, qword [rsp + 0x40]
call fcn.140005100
mov qword [rsp + 0x40], rax
test rax, rax
jne 0x140040960
mov rcx, qword [r13]
call qword [sym.imp.WS2_32.dll_WSAResetEvent]
mov eax, dword [rsp + 0x60]
movzx ecx, byte [rbp + 0xf0]
mov r13, qword [rsp + 0x78]
mov r12, qword [rsp + 0x48]
test r13, r13
je 0x140040a0e
mov dword [r13], esi
cmp byte [rbp + 0xe8], r15b
je 0x140040a6e
test eax, eax
jne 0x140040a6e
test cl, cl
jne 0x140040a6e
cmp dword [r12], 0xbab1e
mov dword [rsp + 0x30], r15d
jne 0x140040a6e
cmp byte [r12 + 0x25b], r15b
jne 0x140040a6e
lea r8, [rsp + 0x30]
mov rcx, r12
lea rdx, [rbp - 0x78]
call fcn.140040390
test eax, eax
jne 0x140040a6e
mov ecx, dword [rsp + 0x30]
test ecx, ecx
je 0x140040a6e
mov r9d, dword [rsp + 0x38]
cmp ecx, r9d
jg 0x140040a63
test ecx, ecx
jns 0x140040a66
mov ecx, r9d
movsxd rcx, ecx
call fcn.140004f7f
lea rcx, [rsp + 0x58]
call fcn.140008b11
mov rdi, qword [rsp + 0x180]
mov eax, r15d
mov rbx, qword [rsp + 0x1d0]
jmp 0x140040a92
mov eax, 1
mov rcx, qword [rbp + 0x70]
xor rcx, rsp
call fcn.1400045b1
add rsp, 0x188
pop r15
pop r14
pop r13
pop r12
pop rsi
pop rbp
ret