Function at 0x590040
Capabilities:
Encrypt data using salsa20 or chacha
Resolve function by parsing pe exports

Disassembly:
cmp rsp, qword [r14 + 0x10]
jbe 0x590657
push rbp
mov rbp, rsp
sub rsp, 0x68
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x90], rdi
mov qword [rsp + 0xa8], r9
cmp rsi, 0x20
jne 0x590309
cmp r10, 0x10
jne 0x5902e5
mov qword [rsp + 0xb8], r11
mov qword [rsp + 0xa8], r9
mov qword [rsp + 0xa0], r8
mov qword [rsp + 0x90], rdi
mov qword [rsp + 0x88], rcx
mov qword [rsp + 0x80], rbx
mov qword [rsp + 0x78], rax
mov rax, rdi
mov ebx, 4
mov rcx, r8
nop dword [rax + rax]
call fcn.0053e5e0
mov dword [rsp + 0x34], eax
mov rcx, qword [rsp + 0xa0]
lea rdx, [rcx - 4]
mov rsi, qword [rsp + 0x90]
lea rdi, [rsi + 4]
mov ebx, 4
mov rax, rdi
mov rcx, rdx
call fcn.0053e5e0
mov dword [rsp + 0x30], eax
mov rcx, qword [rsp + 0xa0]
lea rdx, [rcx - 8]
mov rsi, qword [rsp + 0x90]
lea rdi, [rsi + 8]
mov ebx, 4
mov rax, rdi
mov rcx, rdx
call fcn.0053e5e0
mov dword [rsp + 0x2c], eax
mov rcx, qword [rsp + 0xa0]
lea rdx, [rcx - 0xc]
mov rsi, qword [rsp + 0x90]
lea rdi, [rsi + 0xc]
mov ebx, 4
mov rax, rdi
mov rcx, rdx
call fcn.0053e5e0
mov dword [rsp + 0x28], eax
mov rcx, qword [rsp + 0xa0]
lea rdx, [rcx - 0x10]
mov rsi, qword [rsp + 0x90]
lea rdi, [rsi + 0x10]
mov ebx, 4
mov rax, rdi
mov rcx, rdx
call fcn.0053e5e0
mov dword [rsp + 0x24], eax
mov rcx, qword [rsp + 0xa0]
lea rdx, [rcx - 0x14]
mov rsi, qword [rsp + 0x90]
lea rdi, [rsi + 0x14]
mov ebx, 4
mov rax, rdi
mov rcx, rdx
nop dword [rax]
call fcn.0053e5e0
mov dword [rsp + 0x20], eax
mov rcx, qword [rsp + 0xa0]
lea rdx, [rcx - 0x18]
mov rsi, qword [rsp + 0x90]
lea rdi, [rsi + 0x18]
mov ebx, 4
mov rax, rdi
mov rcx, rdx
call fcn.0053e5e0
mov dword [rsp + 0x54], eax
mov rcx, qword [rsp + 0xa0]
add rcx, 0xffffffffffffffe4
mov rdx, qword [rsp + 0x90]
add rdx, 0x1c
mov ebx, 4
mov rax, rdx
call fcn.0053e5e0
mov dword [rsp + 0x50], eax
mov ebx, 4
mov rcx, qword [rsp + 0xb8]
mov rax, qword [rsp + 0xa8]
call fcn.0053e5e0
mov dword [rsp + 0x4c], eax
mov rcx, qword [rsp + 0xb8]
lea rdx, [rcx - 4]
mov rsi, qword [rsp + 0xa8]
lea rdi, [rsi + 4]
mov ebx, 4
mov rax, rdi
mov rcx, rdx
nop
call fcn.0053e5e0
mov dword [rsp + 0x48], eax
mov rcx, qword [rsp + 0xb8]
lea rdx, [rcx - 8]
mov rsi, qword [rsp + 0xa8]
lea rdi, [rsi + 8]
mov ebx, 4
mov rax, rdi
mov rcx, rdx
call fcn.0053e5e0
mov dword [rsp + 0x44], eax
mov rcx, qword [rsp + 0xb8]
add rcx, 0xfffffffffffffff4
mov rdx, qword [rsp + 0xa8]
add rdx, 0xc
mov ebx, 4
mov rax, rdx
call fcn.0053e5e0
xor ecx, ecx
mov edx, dword [rsp + 0x24]
mov ebx, dword [rsp + 0x34]
mov esi, dword [rsp + 0x20]
mov edi, dword [rsp + 0x30]
mov r8d, dword [rsp + 0x54]
mov r9d, dword [rsp + 0x2c]
mov r10d, dword [rsp + 0x50]
mov r11d, dword [rsp + 0x28]
mov r12d, 0x61707865
mov r13d, 0x3320646e
mov r15d, 0x79622d32
mov edx, 0x6b206574
mov dword [rsp + 0x38], edx
mov edx, dword [rsp + 0x24]
nop
jmp 0x59049f
lea rax, [0x006e7a9f]
mov ebx, 0x24
call fcn.00480900
xor ecx, ecx
mov rdi, rax
mov rsi, rbx
xor eax, eax
mov rbx, rcx
add rsp, 0x68
pop rbp
ret
lea rax, [0x006e6c12]
mov ebx, 0x22
call fcn.00480900
xor ecx, ecx
mov rdi, rax
mov rsi, rbx
xor eax, eax
mov rbx, rcx
add rsp, 0x68
pop rbp
ret
mov qword [rsp + 0x60], rcx
mov dword [rsp + 0x50], r10d
mov dword [rsp + 0x28], r11d
mov dword [rsp + 0x54], r8d
mov dword [rsp + 0x2c], r9d
mov dword [rsp + 0x20], esi
mov dword [rsp + 0x30], edi
mov eax, r12d
mov ecx, edx
mov edi, dword [rsp + 0x4c]
call fcn.0058ee80
mov dword [rsp + 0x5c], eax
mov dword [rsp + 0x34], ebx
mov dword [rsp + 0x24], ecx
mov dword [rsp + 0x4c], edi
mov eax, dword [rsp + 0x58]
mov ebx, dword [rsp + 0x30]
mov ecx, dword [rsp + 0x20]
mov edi, dword [rsp + 0x48]
nop dword [rax]
call fcn.0058ee80
mov dword [rsp + 0x58], eax
mov dword [rsp + 0x30], ebx
mov dword [rsp + 0x20], ecx
mov dword [rsp + 0x48], edi
mov eax, dword [rsp + 0x3c]
mov ebx, dword [rsp + 0x2c]
mov ecx, dword [rsp + 0x54]
mov edi, dword [rsp + 0x44]
call fcn.0058ee80
mov dword [rsp + 0x3c], eax
mov dword [rsp + 0x2c], ebx
mov dword [rsp + 0x54], ecx
mov dword [rsp + 0x44], edi
mov eax, dword [rsp + 0x38]
mov ebx, dword [rsp + 0x28]
mov ecx, dword [rsp + 0x50]
mov edi, dword [rsp + 0x40]
call fcn.0058ee80
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x50], ecx
mov eax, dword [rsp + 0x5c]
mov ebx, dword [rsp + 0x30]
mov ecx, dword [rsp + 0x54]
call fcn.0058ee80
mov dword [rsp + 0x5c], eax
mov dword [rsp + 0x30], ebx
mov dword [rsp + 0x54], ecx
mov dword [rsp + 0x40], edi
mov eax, dword [rsp + 0x58]
mov ebx, dword [rsp + 0x2c]
mov ecx, dword [rsp + 0x50]
mov edi, dword [rsp + 0x4c]
call fcn.0058ee80
mov dword [rsp + 0x58], eax
mov dword [rsp + 0x2c], ebx
mov dword [rsp + 0x50], ecx
mov dword [rsp + 0x4c], edi
mov eax, dword [rsp + 0x3c]
mov ebx, dword [rsp + 0x28]
mov ecx, dword [rsp + 0x24]
mov edi, dword [rsp + 0x48]
call fcn.0058ee80
mov dword [rsp + 0x3c], eax
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x24], ecx
mov dword [rsp + 0x48], edi
mov eax, dword [rsp + 0x38]
mov ebx, dword [rsp + 0x34]
mov ecx, dword [rsp + 0x20]
mov edi, dword [rsp + 0x44]
call fcn.0058ee80
mov rdx, qword [rsp + 0x60]
inc rdx
mov esi, ecx
mov r8d, dword [rsp + 0x54]
mov r9d, dword [rsp + 0x2c]
mov r10d, dword [rsp + 0x50]
mov r11d, dword [rsp + 0x28]
mov r12d, dword [rsp + 0x5c]
mov r13d, dword [rsp + 0x58]
mov r15d, dword [rsp + 0x3c]
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x44], edi
mov eax, dword [rsp + 0x40]
mov rcx, rdx
mov edx, dword [rsp + 0x24]
mov edi, dword [rsp + 0x30]
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x3c], r15d
mov dword [rsp + 0x58], r13d
cmp rcx, 0xa
jl 0x59032d
mov rax, qword [rsp + 0x78]
mov ebx, 4
mov rcx, qword [rsp + 0x88]
mov edi, r12d
call fcn.0053e600
mov rcx, qword [rsp + 0x88]
lea rdx, [rcx - 4]
mov rsi, rdx
neg rdx
sar rdx, 0x3f
and edx, 4
mov r8, qword [rsp + 0x78]
lea rax, [r8 + rdx]
mov ebx, 4
mov edi, dword [rsp + 0x58]
mov rcx, rsi
nop
call fcn.0053e600
mov rcx, qword [rsp + 0x88]
lea rdx, [rcx - 8]
mov rsi, rdx
neg rdx
sar rdx, 0x3f
and edx, 8
mov r8, qword [rsp + 0x78]
lea rax, [r8 + rdx]
mov ebx, 4
mov edi, dword [rsp + 0x3c]
mov rcx, rsi
call fcn.0053e600
mov rcx, qword [rsp + 0x88]
lea rdx, [rcx - 0xc]
mov rsi, rdx
neg rdx
sar rdx, 0x3f
and edx, 0xc
mov r8, qword [rsp + 0x78]
lea rax, [r8 + rdx]
mov ebx, 4
mov edi, dword [rsp + 0x38]
mov rcx, rsi
call fcn.0053e600
mov rcx, qword [rsp + 0x88]
lea rdx, [rcx - 0x10]
mov rsi, rdx
neg rdx
sar rdx, 0x3f
and edx, 0x10
mov r8, qword [rsp + 0x78]
lea rax, [r8 + rdx]
mov ebx, 4
mov edi, dword [rsp + 0x4c]
mov rcx, rsi
call fcn.0053e600
mov rcx, qword [rsp + 0x88]
lea rdx, [rcx - 0x14]
mov rsi, rdx
neg rdx
sar rdx, 0x3f
and edx, 0x14
mov r8, qword [rsp + 0x78]
lea rax, [r8 + rdx]
mov ebx, 4
mov edi, dword [rsp + 0x48]
mov rcx, rsi
call fcn.0053e600
mov rcx, qword [rsp + 0x88]
lea rdx, [rcx - 0x18]
mov rsi, rdx
neg rdx
sar rdx, 0x3f
and edx, 0x18
mov r8, qword [rsp + 0x78]
lea rax, [rdx + r8]
mov ebx, 4
mov edi, dword [rsp + 0x44]
mov rcx, rsi
nop
call fcn.0053e600
mov rcx, qword [rsp + 0x88]
lea rdx, [rcx - 0x1c]
mov rsi, rdx
neg rdx
sar rdx, 0x3f
and edx, 0x1c
mov r8, qword [rsp + 0x78]
lea rax, [rdx + r8]
mov ebx, 4
mov edi, dword [rsp + 0x40]
mov rcx, rsi
call fcn.0053e600
mov rax, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x80]
mov rcx, qword [rsp + 0x88]
xor edi, edi
xor esi, esi
add rsp, 0x68
pop rbp
ret
mov qword [rsp + 8], rax
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rcx
mov qword [rsp + 0x20], rdi
mov qword [rsp + 0x28], rsi
mov qword [rsp + 0x30], r8
mov qword [rsp + 0x38], r9
mov qword [rsp + 0x40], r10
mov qword [rsp + 0x48], r11
call fcn.00474300
mov rax, qword [rsp + 8]
mov rbx, qword [rsp + 0x10]
mov rcx, qword [rsp + 0x18]
mov rdi, qword [rsp + 0x20]
mov rsi, qword [rsp + 0x28]
mov r8, qword [rsp + 0x30]
mov r9, qword [rsp + 0x38]
mov r10, qword [rsp + 0x40]
mov r11, qword [rsp + 0x48]
jmp fcn.00590040