Function at 0x140059c40
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 [0x140217c00]
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 r13d, eax
mov edi, r8d
mov dword [rsp + 0x3c], r13d
mov r15, rcx
mov dword [rsp + 0x54], r8d
mov r12d, eax
mov qword [rsp + 0x60], rdx
mov dword [rsp + 0x38], eax
mov qword [rsp + 0x58], r14
mov byte [rsp + 0x30], al
test rcx, rcx
je 0x14005a2d6
cmp dword [rcx], 0xbab1e
jne 0x14005a2d6
cmp byte [rcx + 0x1cb], al
je 0x140059cd5
mov eax, 8
jmp 0x140059d86
test esi, esi
jns 0x140059ce3
mov eax, 0xa
jmp 0x140059d86
xorps xmm0, xmm0
mov qword [rsp + 0x198], rbx
mov rbx, qword [rcx + 8]
mov qword [rbp - 0x60], rax
movups xmmword [rsp + 0x70], xmm0
movups xmmword [rbp - 0x80], xmm0
movups xmmword [rbp - 0x70], xmm0
test rbx, rbx
je 0x140059d2f
nop dword [rax + rax]
lea rdx, [rsp + 0x70]
mov rcx, rbx
call fcn.140058750
add r13d, dword [rbp - 0x68]
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x140059d10
mov dword [rsp + 0x3c], r13d
lea rdx, [rsp + 0x34]
mov rcx, r15
call fcn.140059b50
mov eax, dword [rsp + 0x34]
test eax, eax
js 0x140059d4d
cmp eax, esi
cmovl esi, eax
mov dword [rsp + 0x40], esi
cmp byte [rbp + 0x110], r12b
lea eax, [rdi + r13]
lea ecx, [rax + 1]
cmove ecx, eax
cmp ecx, 0xa
jbe 0x140059dad
shl rcx, 4
call qword [fcn.1400cb740]
mov qword [rsp + 0x58], rax
mov r14, rax
test rax, rax
jne 0x140059da8
lea eax, [r14 + 3]
mov rbx, qword [rsp + 0x198]
mov rcx, qword [rbp + 0x80]
xor rcx, rsp
call fcn.1400b5940
add rsp, 0x1a0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov byte [rsp + 0x30], 1
xor edx, edx
mov dword [rsp + 0x34], edx
mov esi, edx
test r13d, r13d
je 0x140059ec8
mov r13, qword [r15 + 8]
test r13, r13
je 0x140059ec3
nop dword [rax + rax]
lea rdx, [rsp + 0x70]
mov rcx, r13
call fcn.140058750
xor edx, edx
mov edi, edx
cmp dword [rbp - 0x68], edx
jbe 0x140059eb2
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, edx
mov qword [rbx], rax
mov word [rbx + 8], dx
test byte [rbp + rdi - 0x64], 1
je 0x140059e1f
mov esi, 0x29
mov word [rbx + 8], 0x300
test byte [rbp + rdi - 0x64], 2
je 0x140059e7f
mov r14, qword [rsp + rdi*8 + 0x70]
lea rax, [rsp + 0x48]
mov rcx, r14
mov dword [rsp + 0x48], 4
lea r9, [rsp + 0x50]
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 0x140059e75
cmp dword [rsp + 0x50], 1
jne 0x140059e75
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 + 0x58]
mov rdx, qword [r15 + 0x1b8]
mov r8d, esi
mov rcx, qword [rsp + rdi*8 + 0x70]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
jne 0x140059fde
mov eax, dword [rbp - 0x68]
inc rdi
mov esi, dword [rsp + 0x34]
mov rdx, r12
cmp rdi, rax
jb 0x140059df0
mov r13, qword [r13 + 0x10]
test r13, r13
jne 0x140059dd0
mov edi, dword [rsp + 0x54]
mov r13d, dword [rsp + 0x3c]
mov esi, edi
mov r14, rdx
mov qword [rsp + 0x48], rsi
test edi, edi
je 0x14005a014
mov rbx, qword [rsp + 0x60]
add rbx, 8
movzx edx, word [rbx]
movzx eax, dl
and al, 1
neg al
sbb ecx, ecx
and ecx, 0x29
mov edi, ecx
or edi, 4
test dl, 2
cmove edi, ecx
test dl, 4
je 0x140059f55
mov rsi, qword [rbx - 8]
lea rax, [rsp + 0x54]
mov rcx, rsi
mov dword [rsp + 0x54], 4
lea r9, [rsp + 0x50]
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 0x140059f50
cmp dword [rsp + 0x50], 1
jne 0x140059f50
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_send]
mov rsi, qword [rsp + 0x48]
mov rdx, qword [r15 + 0x1b8]
mov r8d, edi
mov rcx, qword [rbx - 8]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
jne 0x140059ff8
mov rax, qword [rbx - 8]
xor edx, edx
mov edi, dword [rsp + 0x34]
mov r9, qword [rsp + 0x58]
mov ecx, edi
shl rcx, 4
add rcx, r9
mov qword [rcx], rax
movzx eax, dx
mov word [rcx + 8], dx
test byte [rbx], 1
je 0x140059fa6
mov r10d, 0x300
mov word [rcx + 8], r10w
mov eax, r10d
test byte [rbx], 2
je 0x140059fb9
mov r8d, 0x400
or ax, r8w
mov word [rcx + 8], ax
test byte [rbx], 4
je 0x140059fc6
or ax, 0x10
mov word [rcx + 8], ax
inc edi
inc r14
add rbx, 0x10
mov dword [rsp + 0x34], edi
cmp r14, rsi
jb 0x140059ee3
jmp 0x14005a01d
cmp byte [rsp + 0x30], r12b
je 0x14005a00a
mov rcx, r14
call qword [fcn.1400bc95c]
mov eax, 4
jmp 0x140059d7e
cmp byte [rsp + 0x30], r12b
je 0x14005a00a
mov rcx, qword [rsp + 0x58]
call qword [fcn.1400bc95c]
mov eax, 4
jmp 0x140059d7e
mov edi, dword [rsp + 0x34]
mov r9, qword [rsp + 0x58]
test edi, edi
jne 0x14005a103
movzx ebx, byte [rbp + 0x110]
test bl, bl
je 0x14005a258
mov edi, edx
mov r9d, dword [rsp + 0x40]
lea rdx, [r15 + 0x1b8]
xor ecx, ecx
xor r8d, r8d
mov dword [rsp + 0x20], ecx
lea ecx, [r8 + 1]
call qword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
test rsi, rsi
je 0x14005a192
mov rax, qword [rsp + 0x60]
shl r13, 4
sub r13, rax
add r13, qword [rsp + 0x58]
lea rsi, [rax + 0xa]
nop dword [rax]
nop word [rax + rax]
mov r14, qword [rsi - 0xa]
lea r8, [rbp - 0x58]
movsx r12d, word [rsi + r13]
xor eax, eax
mov rcx, r14
mov dword [rbp - 0x58], eax
xor edx, edx
movzx ebx, ax
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
jne 0x14005a132
mov r8d, dword [rbp - 0x58]
mov ecx, 0
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
cmp qword [rsp + 0x68], 0
movzx ebx, cx
je 0x14005a132
test edi, edi
jne 0x14005a132
test r8d, r8d
je 0x14005a132
inc dword [rsp + 0x38]
xor r8d, r8d
mov rdx, qword [r15 + 0x1b8]
mov rcx, r14
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
jmp 0x14005a17a
xor r8d, r8d
mov edx, edi
mov rcx, r9
call fcn.14007e880
mov edi, eax
test eax, eax
jns 0x14005a120
mov eax, ntohs
jmp 0x140059d7e
jle 0x14005a036
mov r12d, eax
mov dword [rsp + 0x38], eax
jmp 0x14005a055
mov rdx, qword [r15 + 0x1b8]
xor r8d, r8d
mov rcx, r14
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test edi, edi
je 0x14005a17a
movzx ecx, bx
or cx, 1
test r12d, 0x300
cmove cx, bx
movzx edx, cx
or dx, 4
test r12b, 0x10
cmove dx, cx
movzx ebx, dx
or bx, 2
bt r12d, 0xa
cmovae bx, dx
mov word [rsi], bx
add rsi, 0x10
sub qword [rsp + 0x48], 1
jne 0x14005a080
mov r12d, dword [rsp + 0x38]
cmp dword [rsp + 0x3c], 0
je 0x14005a240
mov rsi, qword [r15 + 8]
mov qword [rsp + 0x60], rsi
test rsi, rsi
je 0x14005a240
nop
lea rdx, [rsp + 0x70]
mov rcx, rsi
call fcn.140058750
xor eax, eax
mov ebx, eax
cmp dword [rbp - 0x68], eax
jbe 0x14005a229
mov esi, dword [rsp + 0x38]
nop word [rax + 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 0x14005a1fb
cmp qword [rsp + 0x68], 0
je 0x14005a1fb
test edi, edi
jne 0x14005a1fb
cmp dword [rbp - 0x58], edi
je 0x14005a1fb
inc esi
mov rdx, qword [r15 + 0x1b8]
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 0x14005a1d0
mov dword [rsp + 0x38], esi
mov rsi, qword [rsp + 0x60]
mov rsi, qword [rsi + 0x10]
mov qword [rsp + 0x60], rsi
test rsi, rsi
jne 0x14005a1b0
mov r12d, dword [rsp + 0x38]
mov rcx, qword [r15 + 0x1b8]
call qword [sym.imp.WS2_32.dll_WSAResetEvent]
mov edi, dword [rsp + 0x34]
movzx ebx, byte [rbp + 0x110]
cmp byte [rsp + 0x30], 0
je 0x14005a26a
mov rcx, qword [rsp + 0x58]
call qword [fcn.1400bc95c]
mov rax, qword [rsp + 0x68]
test rax, rax
je 0x14005a277
mov dword [rax], r12d
cmp byte [rbp + 0x108], 0
je 0x14005a2cf
test edi, edi
jne 0x14005a2cf
test bl, bl
jne 0x14005a2cf
xor eax, eax
cmp dword [r15], 0xbab1e
mov dword [rsp + 0x3c], eax
jne 0x14005a2cf
cmp byte [r15 + 0x1cb], al
jne 0x14005a2cf
lea rdx, [rsp + 0x3c]
mov rcx, r15
call fcn.140059b50
test eax, eax
jne 0x14005a2cf
mov eax, dword [rsp + 0x3c]
test eax, eax
je 0x14005a2cf
mov ecx, dword [rsp + 0x40]
cmp eax, ecx
jg 0x14005a2c5
test eax, eax
jns 0x14005a2c7
mov eax, ecx
movsxd rcx, eax
call fcn.14007edc0
xor eax, eax
jmp 0x140059d7e
mov eax, 1
jmp 0x140059d86