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

Disassembly:
lea r12, [rsp - 0xb8]
cmp r12, qword [r14 + 0x10]
jbe 0x598966
push rbp
mov rbp, rsp
sub rsp, 0x130
mov qword [rsp + 0x148], rbx
mov qword [rsp + 0x160], rsi
cmp rcx, r8
jne 0x59894f
nop word [rax + rax]
nop
test rcx, 0x3f
jne 0x59894f
mov qword [rsp + 0x140], rax
mov edx, dword [rax]
mov dword [rsp + 0x44], edx
mov r10d, dword [rax + 4]
mov dword [rsp + 0x90], r10d
mov r11d, dword [rax + 8]
mov dword [rsp + 0x7c], r11d
mov r12d, dword [rax + 0xc]
mov dword [rsp + 0x8c], r12d
mov r13d, dword [rax + 0x10]
mov dword [rsp + 0x4c], r13d
mov r15d, dword [rax + 0x14]
mov dword [rsp + 0x78], r15d
mov r12d, dword [rax + 0x18]
mov dword [rsp + 0x54], r12d
mov r11d, dword [rax + 0x1c]
mov dword [rsp + 0x68], r11d
mov r11d, dword [rax + 0x24]
mov dword [rsp + 0x94], r11d
mov r12d, dword [rax + 0x28]
mov dword [rsp + 0x64], r12d
mov r12d, dword [rax + 0x2c]
mov dword [rsp + 0x3c], r12d
cmp byte [rax + 0x79], 0
jne 0x5985d5
mov qword [rsp + 0x170], r9
mov qword [rsp + 0x168], r8
mov qword [rsp + 0x160], rsi
mov qword [rsp + 0x158], rdi
mov qword [rsp + 0x150], rcx
mov qword [rsp + 0x148], rbx
mov eax, 0x3320646e
mov ebx, r10d
mov ecx, r15d
mov edi, r11d
call fcn.005977a0
mov rdx, qword [rsp + 0x140]
mov dword [rdx + 0x7c], eax
mov dword [rdx + 0x80], ebx
mov dword [rdx + 0x84], ecx
mov dword [rdx + 0x88], edi
mov eax, 0x79622d32
mov ebx, dword [rsp + 0x7c]
mov ecx, dword [rsp + 0x54]
mov edi, dword [rsp + 0x64]
call fcn.005977a0
mov rdx, qword [rsp + 0x140]
mov dword [rdx + 0x8c], eax
mov dword [rdx + 0x90], ebx
mov dword [rdx + 0x94], ecx
mov dword [rdx + 0x98], edi
mov eax, 0x6b206574
mov ebx, dword [rsp + 0x8c]
mov ecx, dword [rsp + 0x68]
mov edi, dword [rsp + 0x3c]
call fcn.005977a0
mov rdx, qword [rsp + 0x140]
mov dword [rdx + 0x9c], eax
mov dword [rdx + 0xa0], ebx
mov dword [rdx + 0xa4], ecx
mov dword [rdx + 0xa8], edi
mov byte [rdx + 0x79], 1
mov rax, rdx
mov rcx, qword [rsp + 0x150]
mov edx, dword [rsp + 0x44]
mov rbx, qword [rsp + 0x148]
mov rsi, qword [rsp + 0x160]
mov rdi, qword [rsp + 0x158]
mov r8, qword [rsp + 0x168]
mov r9, qword [rsp + 0x170]
mov r10d, dword [rsp + 0x90]
mov r11d, dword [rsp + 0x94]
mov r12d, dword [rsp + 0x3c]
mov r13d, dword [rsp + 0x4c]
mov r15d, dword [rsp + 0x78]
jmp 0x5985d5
mov dword [rsp + 0x38], r15d
mov dword [rsp + 0xa4], ebx
mov rax, qword [rsp + 0x120]
mov ebx, 4
mov rcx, qword [rsp + 0x108]
mov rdi, qword [rsp + 0x128]
mov rsi, rbx
mov r9d, r8d
mov r10d, 0x61707865
mov r8, qword [rsp + 0xf0]
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x3c]
mov qword [rsp + 0x118], rdx
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x3c]
mov qword [rsp + 0xe8], r11
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x3c]
mov qword [rsp + 0xe0], r12
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x3c]
mov qword [rsp + 0x110], r13
lea r15, [r8 - 0x40]
mov qword [rsp + 0xd8], r15
neg r15
sar r15, 0x3f
and r15d, 0x40
mov qword [rsp + 0xd0], r15
lea rsi, [rcx - 0x40]
mov qword [rsp + 0xc8], rsi
neg rsi
sar rsi, 0x3f
and esi, 0x40
mov qword [rsp + 0xc0], rsi
lea r10, [rax + 4]
lea rbx, [rcx - 4]
mov qword [rsp + 0xb8], rbx
lea r9, [r8 - 4]
lea rsi, [rdi + 4]
mov rax, r10
mov ebx, 4
mov rcx, qword [rsp + 0xb8]
mov rdi, rsi
mov rsi, rbx
mov r8, r9
mov r9d, dword [rsp + 0xa8]
mov r10d, 0x3320646e
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 8]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 8]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 8]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 8]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x88]
mov r10d, 0x79622d32
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
nop dword [rax + rax]
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0xc]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0xc]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0xc]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0xc]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x40]
mov r10d, 0x6b206574
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x10]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x10]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x10]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x10]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0xa4]
mov r10d, dword [rsp + 0x44]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x14]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x14]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x14]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x14]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x74]
mov r10d, dword [rsp + 0x90]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x18]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x18]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x18]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x18]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0xac]
mov r10d, dword [rsp + 0x7c]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x1c]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x1c]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x1c]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x1c]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x70]
mov r10d, dword [rsp + 0x8c]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x20]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x20]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x20]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x20]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x38]
mov r10d, dword [rsp + 0x4c]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
nop
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x24]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x24]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x24]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x24]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0xa0]
mov r10d, dword [rsp + 0x78]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x28]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x28]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x28]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x28]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x48]
mov r10d, dword [rsp + 0x54]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x2c]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x2c]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x2c]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x2c]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x84]
mov r10d, dword [rsp + 0x68]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
nop
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x30]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x30]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x30]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x30]
mov r15, qword [rsp + 0x140]
mov r10d, dword [r15 + 0x20]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x6c]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x34]
mov rcx, qword [rsp + 0x108]
lea r11, [rcx - 0x34]
mov r8, qword [rsp + 0xf0]
lea r12, [r8 - 0x34]
mov rdi, qword [rsp + 0x128]
lea r13, [rdi + 0x34]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x50]
mov r10d, dword [rsp + 0x94]
mov rax, rdx
mov rcx, r11
mov rdi, r13
mov r8, r12
call fcn.00599160
mov rax, qword [rsp + 0x120]
lea rdx, [rax + 0x38]
mov rcx, qword [rsp + 0x108]
add rcx, 0xffffffffffffffc8
mov r8, qword [rsp + 0xf0]
add r8, 0xffffffffffffffc8
mov rdi, qword [rsp + 0x128]
lea r11, [rdi + 0x38]
mov ebx, 4
mov rsi, rbx
mov r9d, dword [rsp + 0x5c]
mov r10d, dword [rsp + 0x64]
mov rax, rdx
mov rdi, r11
nop dword [rax]
call fcn.00599160
mov rax, qword [rsp + 0x118]
mov ebx, 4
mov rcx, qword [rsp + 0xe8]
mov rdi, qword [rsp + 0x110]
mov rsi, rbx
mov r8, qword [rsp + 0xe0]
mov r9d, dword [rsp + 0x80]
mov r10d, dword [rsp + 0x3c]
call fcn.00599160
mov rax, qword [rsp + 0x140]
inc dword [rax + 0x20]
mov rdx, qword [rsp + 0xd0]
mov r11, qword [rsp + 0x128]
lea rsi, [r11 + rdx]
mov r8, qword [rsp + 0xf8]
add r8, 0xffffffffffffffc0
mov rdx, qword [rsp + 0xc0]
mov r11, qword [rsp + 0x120]
lea rbx, [r11 + rdx]
mov rcx, qword [rsp + 0x100]
add rcx, 0xffffffffffffffc0
mov edx, dword [rsp + 0x4c]
mov r11d, dword [rsp + 0x44]
mov r12, qword [rsp + 0xc8]
mov r13, qword [rsp + 0xd8]
mov edx, r11d
mov r10d, dword [rsp + 0x90]
mov r11d, dword [rsp + 0x94]
mov r12d, dword [rsp + 0x3c]
mov r13d, dword [rsp + 0x4c]
mov r15d, dword [rsp + 0x78]
mov r9, qword [rsp + 0xd8]
mov rdi, qword [rsp + 0xc8]
cmp r8, 0x40
jl 0x59876a
nop
cmp rcx, 0x40
jl 0x59876a
mov qword [rsp + 0x108], rdi
mov qword [rsp + 0x100], rcx
mov qword [rsp + 0xf8], r8
mov qword [rsp + 0x128], rsi
mov qword [rsp + 0x120], rbx
mov qword [rsp + 0xf0], r9
mov edi, dword [rax + 0x20]
mov ebx, edx
mov ecx, r13d
mov eax, 0x61707865
call fcn.005977a0
mov dword [rsp + 0x60], ebx
mov dword [rsp + 0x9c], ecx
mov dword [rsp + 0x98], edi
mov rdx, qword [rsp + 0x140]
mov esi, dword [rdx + 0x80]
mov r8d, dword [rdx + 0x94]
mov r9d, dword [rdx + 0xa8]
mov ebx, esi
mov ecx, r8d
mov edi, r9d
call fcn.005977a0
mov dword [rsp + 0x58], eax
mov dword [rsp + 0x74], ebx
mov dword [rsp + 0x48], ecx
mov dword [rsp + 0x80], edi
mov rdx, qword [rsp + 0x140]
mov esi, dword [rdx + 0x7c]
mov r8d, dword [rdx + 0x90]
mov r9d, dword [rdx + 0xa4]
mov eax, esi
mov ebx, r8d
mov ecx, r9d
mov edi, dword [rsp + 0x98]
call fcn.005977a0
mov dword [rsp + 0xa8], eax
mov dword [rsp + 0xac], ebx
mov dword [rsp + 0x84], ecx
mov dword [rsp + 0x6c], edi
mov rdx, qword [rsp + 0x140]
mov esi, dword [rdx + 0x8c]
mov r8d, dword [rdx + 0xa0]
mov r9d, dword [rdx + 0x88]
mov eax, esi
mov ebx, r8d
mov ecx, dword [rsp + 0x9c]
mov edi, r9d
call fcn.005977a0
mov dword [rsp + 0x88], eax
mov dword [rsp + 0x70], ebx
mov dword [rsp + 0x38], ecx
mov dword [rsp + 0x50], edi
mov rdx, qword [rsp + 0x140]
mov esi, dword [rdx + 0x9c]
mov r8d, dword [rdx + 0x84]
mov r9d, dword [rdx + 0x98]
mov eax, esi
mov ebx, dword [rsp + 0x60]
mov ecx, r8d
mov edi, r9d
call fcn.005977a0
xor edx, edx
mov esi, dword [rsp + 0x80]
mov r8d, dword [rsp + 0x58]
mov r9d, dword [rsp + 0xa8]
mov r10d, dword [rsp + 0x88]
mov r11d, dword [rsp + 0x74]
mov r12d, dword [rsp + 0xac]
mov r13d, dword [rsp + 0x70]
mov r15d, dword [rsp + 0x38]
jmp 0x598908
add rsp, 0x130
pop rbp
ret
mov qword [rsp + 0xb0], rdx
mov eax, r8d
mov ecx, r15d
mov edi, dword [rsp + 0x6c]
call fcn.005977a0
mov dword [rsp + 0x58], eax
mov dword [rsp + 0xa4], ebx
mov dword [rsp + 0x38], ecx
mov dword [rsp + 0x6c], edi
mov eax, dword [rsp + 0xa8]
mov ebx, dword [rsp + 0x74]
mov ecx, dword [rsp + 0xa0]
mov edi, dword [rsp + 0x50]
call fcn.005977a0
mov dword [rsp + 0xa8], eax
mov dword [rsp + 0x74], ebx
mov dword [rsp + 0xa0], ecx
mov dword [rsp + 0x50], edi
mov eax, dword [rsp + 0x88]
mov ebx, dword [rsp + 0xac]
mov ecx, dword [rsp + 0x48]
mov edi, dword [rsp + 0x5c]
call fcn.005977a0
mov dword [rsp + 0x88], eax
mov dword [rsp + 0xac], ebx
mov dword [rsp + 0x48], ecx
mov dword [rsp + 0x5c], edi
mov eax, dword [rsp + 0x40]
mov ebx, dword [rsp + 0x70]
mov ecx, dword [rsp + 0x84]
mov edi, dword [rsp + 0x80]
call fcn.005977a0
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x70], ebx
mov dword [rsp + 0x84], ecx
mov eax, dword [rsp + 0x58]
mov ebx, dword [rsp + 0x74]
mov ecx, dword [rsp + 0x48]
call fcn.005977a0
mov dword [rsp + 0x58], eax
mov dword [rsp + 0x74], ebx
mov dword [rsp + 0x48], ecx
mov dword [rsp + 0x80], edi
mov eax, dword [rsp + 0xa8]
mov ebx, dword [rsp + 0xac]
mov ecx, dword [rsp + 0x84]
mov edi, dword [rsp + 0x6c]
call fcn.005977a0
mov dword [rsp + 0xa8], eax
mov dword [rsp + 0xac], ebx
mov dword [rsp + 0x84], ecx
mov dword [rsp + 0x6c], edi
mov eax, dword [rsp + 0x88]
mov ebx, dword [rsp + 0x70]
mov ecx, dword [rsp + 0x38]
mov edi, dword [rsp + 0x50]
call fcn.005977a0
mov dword [rsp + 0x88], eax
mov dword [rsp + 0x70], ebx
mov dword [rsp + 0x38], ecx
mov dword [rsp + 0x50], edi
mov eax, dword [rsp + 0x40]
mov ebx, dword [rsp + 0xa4]
mov ecx, dword [rsp + 0xa0]
mov edi, dword [rsp + 0x5c]
call fcn.005977a0
mov rdx, qword [rsp + 0xb0]
inc rdx
mov esi, dword [rsp + 0x80]
mov r8d, dword [rsp + 0x58]
mov r9d, dword [rsp + 0xa8]
mov r10d, dword [rsp + 0x88]
mov r11d, dword [rsp + 0x74]
mov r12d, dword [rsp + 0xac]
mov r13d, dword [rsp + 0x70]
mov r15d, dword [rsp + 0x38]
mov dword [rsp + 0x80], esi
mov dword [rsp + 0x5c], edi
mov dword [rsp + 0xa0], ecx
mov dword [rsp + 0x70], r13d
mov dword [rsp + 0xac], r12d
mov dword [rsp + 0x74], r11d
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x88], r10d
mov dword [rsp + 0xa8], r9d
cmp rdx, 9
jl 0x598773
jmp 0x597f96
lea rax, [0x00669740]
lea rbx, [0x0070f4f0]
nop dword [rax]
call fcn.00471b20
nop
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
call fcn.00477e00
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]
jmp fcn.00597da0