Function at 0x180058d90
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push rbp
push r15
push r14
push rsi
push rdi
push rbx
sub rsp, 0x58
lea rbp, [rsp + 0x50]
mov qword [rbp], 0xfffffffffffffffe
mov rsi, rdx
mov rdi, rcx
mov rbx, qword [rcx]
mov r14, qword [rcx + 8]
cmp rbx, r14
jne 0x180058dfc
mov rax, qword [rsi + 0x20]
mov bl, 1
cmp rax, qword [rsi + 0x18]
jne 0x180058e44
jmp 0x180058ff7
add rax, 0x28
mov rdx, rax
mov rcx, r8
call fcn.1800aa400
mov qword [rbx + 0x18], 0
mov qword [rbx + 0x20], recvfrom
mov byte [rbx + 8], 0
add rbx, 0x28
cmp rbx, r14
je 0x180058e2d
mov rax, qword [rbx + 0x20]
cmp rax, 0x10
jb 0x180058ddf
mov rcx, qword [rbx + 8]
lea rdx, [rax + 1]
cmp rdx, 0x1000
jb 0x180058dda
mov r8, qword [rcx - 8]
add rcx, 0xfffffffffffffff8
sub rcx, r8
cmp rcx, 0x20
jb 0x180058dd0
call fcn.1800b3cac
mov rax, qword [rdi]
mov qword [rdi + 8], rax
mov rax, qword [rsi + 0x20]
mov bl, 1
cmp rax, qword [rsi + 0x18]
je 0x180058ff7
movzx r14d, byte [rsi + 8]
mov rax, qword [rsi]
lea rdx, [rbp - 2]
mov r8d, 2
mov rcx, rsi
call qword [rax + ioctlsocket]
test r14b, r14b
jne 0x180058e73
test al, al
je 0x180058e73
movzx eax, word [rbp - 2]
rol ax, 8
mov word [rbp - 2], ax
jmp 0x180058e88
test r14b, r14b
sete cl
xor al, 1
or al, cl
je 0x180058e84
jmp 0x180058ff5
movzx eax, word [rbp - 2]
cmp ax, 4
jb 0x180058ff7
xorps xmm0, xmm0
movups xmmword [rbp - 0x28], xmm0
mov qword [rbp - 0x18], 0
mov qword [rbp - 0x10], recvfrom
mov rax, qword [rsi]
lea rdx, [rbp - 0x30]
mov r8d, 2
mov rcx, rsi
call qword [rax + ioctlsocket]
test al, al
je 0x180058fba
rol word [rbp - 0x30], 8
lea r14, [rbp - 0x28]
movzx r15d, byte [rsi + 8]
mov rax, qword [rsi]
lea rdx, [rbp - 4]
mov r8d, 2
mov rcx, rsi
call qword [rax + ioctlsocket]
test r15b, r15b
jne 0x180058efc
test al, al
je 0x180058efc
movzx eax, word [rbp - 4]
rol ax, 8
mov word [rbp - 4], ax
jmp 0x180058f0e
test r15b, r15b
setne cl
test cl, al
je 0x180058fba
movzx eax, word [rbp - 4]
movzx edx, ax
mov rcx, rsi
mov r8, r14
call fcn.18001d410
test al, al
je 0x180058fba
movzx eax, word [rbp - 2]
sub ax, word [rbp - 0x18]
add eax, 0xfffffffc
mov word [rbp - 2], ax
mov rdx, qword [rdi + 8]
cmp rdx, qword [rdi + 0x10]
je 0x180058f6a
movzx eax, word [rbp - 0x30]
mov word [rdx], ax
xorps xmm0, xmm0
movups xmmword [rdx + 0x18], xmm0
movups xmmword [rdx + 8], xmm0
movups xmm0, xmmword [r14]
movups xmm1, xmmword [r14 + 0x10]
movups xmmword [rdx + 8], xmm0
movups xmmword [rdx + 0x18], xmm1
add qword [rdi + 8], 0x28
jmp 0x180058e84
lea r8, [rbp - 0x30]
mov rcx, rdi
call fcn.1800583d0
mov rax, qword [rbp - 0x10]
cmp rax, 0x10
jb 0x180058e84
mov rcx, qword [rbp - 0x28]
lea rdx, [rax + 1]
cmp rdx, 0x1000
jb 0x180058fb0
mov r8, qword [rcx - 8]
add rcx, 0xfffffffffffffff8
sub rcx, r8
cmp rcx, 0x20
jae 0x180059006
add rax, 0x28
mov rdx, rax
mov rcx, r8
call fcn.1800aa400
jmp 0x180058e84
mov rax, qword [rbp - 0x10]
cmp rax, 0x10
jb 0x180058ff5
mov rcx, qword [rbp - 0x28]
lea rdx, [rax + 1]
cmp rdx, 0x1000
jb 0x180058ff0
mov r8, qword [rcx - 8]
add rcx, 0xfffffffffffffff8
sub rcx, r8
cmp rcx, 0x20
jae 0x18005900b
add rax, 0x28
mov rdx, rax
mov rcx, r8
call fcn.1800aa400
xor ebx, ebx
mov eax, ebx
add rsp, 0x58
pop rbx
pop rdi
pop rsi
pop r14
pop r15
pop rbp
ret
call fcn.1800b3cac
call fcn.1800b3cac
int3