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

Disassembly:
lea r12, [rsp - 0xf8]
cmp r12, qword [r14 + 0x10]
jbe 0x53a16c
sub rsp, 0x178
mov qword [rsp + 0x170], rbp
lea rbp, [rsp + 0x170]
mov qword [rsp + 0x188], rbx
mov qword [rsp + 0x1a0], rsi
nop dword [rax]
cmp r8, rcx
jg 0x53a158
test r8, r8
je 0x5395bf
cmp rsi, rbx
je 0x5395bf
nop
mov r10, rbx
lea r11, [r8 - 1]
lea r12, [rsi + r11]
nop
cmp r12, rbx
jb 0x5395bc
mov r12, rsi
add r11, r10
cmp r11, rsi
jae 0x53a145
mov rbx, r10
mov rsi, r12
jmp 0x5395bf
mov rbx, r10
mov r10, qword [rax + 0x70]
test r10, r10
je 0x539620
lea r11, [r10 - 0x40]
neg r11
cmp r11, 0x40
ja 0x53a134
mov r12, r10
neg r10
sar r10, 0x3f
and r10, r11
add r10, 0x30
add r10, rax
cmp r8, r12
jge 0x5395f7
mov rcx, r8
jmp 0x539600
mov rcx, r8
mov r8, r12
nop dword [rax]
cmp rdi, r8
jb 0x53a129
cmp r9, r8
jb 0x53a11e
xor edx, edx
jmp 0x53a0a1
test r8, r8
je 0x53988c
mov qword [rsp + 0x180], rax
mov qword [rsp + 0x158], r8
mov qword [rsp + 0x168], rsi
mov qword [rsp + 0x160], rbx
mov rdx, r8
and r8d, 0x3f
mov qword [rsp + 0xd0], r8
mov rcx, rdx
sub rdx, r8
mov qword [rsp + 0xf8], rdx
test r8, r8
je 0x5396f6
cmp rcx, rdx
jb 0x53a085
mov r10, rcx
sub rcx, rdx
cmp rcx, 0x40
mov r11d, 0x40
cmovl r11, rcx
lea r12, [rax + 0x30]
mov r13, rdx
sub rdx, r9
sar rdx, 0x3f
and rdx, r13
lea r9, [rsi + rdx]
cmp r12, r9
je 0x5396fc
mov qword [rsp + 0x150], rdi
mov rax, r12
mov rbx, r9
mov rcx, r11
call fcn.00466440
mov rax, qword [rsp + 0x180]
mov rbx, qword [rsp + 0x160]
mov rsi, qword [rsp + 0x168]
mov rdi, qword [rsp + 0x150]
mov r8, qword [rsp + 0xd0]
mov r10, qword [rsp + 0x158]
mov r13, qword [rsp + 0xf8]
jmp 0x5396fc
mov r10, rcx
mov r13, rdx
mov r9d, dword [rax + 4]
mov r11d, dword [rax + 0x14]
mov r12d, dword [rax + 8]
mov r15d, dword [rax + 0x18]
mov rcx, rsi
mov esi, dword [rax + 0xc]
mov rdx, r13
mov r13d, dword [rax + 0x1c]
lea r8d, [r9 + 0x3320646e]
mov dword [rsp + 0xac], r8d
xor r8d, dword [rax + 0x24]
rol r8d, 0x10
add r11d, r8d
mov dword [rsp + 0x84], r11d
xor r11d, r9d
rol r11d, 0xc
add r9d, r11d
mov dword [rsp + 0xcc], r9d
mov r9d, dword [rsp + 0xac]
add r9d, r11d
xor r9d, r8d
rol r9d, 8
mov dword [rsp + 0x68], r9d
mov r8d, dword [rsp + 0x84]
add r8d, r9d
mov dword [rsp + 0x84], r8d
xor r11d, r8d
lea r8d, [r12 + 0x79622d32]
mov dword [rsp + 0xa8], r8d
xor r8d, dword [rax + 0x28]
rol r8d, 0x10
add r15d, r8d
mov dword [rsp + 0x80], r15d
xor r15d, r12d
rol r15d, 0xc
add r12d, r15d
mov r9d, dword [rsp + 0xa8]
add r9d, r15d
xor r8d, r9d
rol r8d, 8
mov dword [rsp + 0x64], r8d
mov r9d, dword [rsp + 0x80]
add r9d, r8d
xor r15d, r9d
lea r8d, [rsi + 0x6b206574]
mov dword [rsp + 0xa4], r8d
xor r8d, dword [rax + 0x2c]
rol r8d, 0x10
add r13d, r8d
mov dword [rsp + 0x7c], r13d
xor r13d, esi
rol r13d, 0xc
add esi, r13d
mov dword [rsp + 0xc8], esi
mov esi, dword [rsp + 0xa4]
add esi, r13d
xor esi, r8d
rol esi, 8
mov r8d, dword [rsp + 0x7c]
add r8d, esi
xor r13d, r8d
nop word [rax + rax]
cmp rdi, r10
jb 0x53a078
mov dword [rsp + 0x80], r9d
mov dword [rsp + 0x60], esi
mov dword [rsp + 0x7c], r8d
mov dword [rsp + 0xc4], r12d
rol r11d, 7
mov dword [rsp + 0x98], r11d
rol r15d, 7
mov dword [rsp + 0x94], r15d
rol r13d, 7
mov dword [rsp + 0x90], r13d
mov edi, dword [rsp + 0xcc]
mov qword [rsp + 0x148], rax
xor eax, eax
mov qword [rsp + 0xf0], rax
mov rax, qword [rsp + 0x148]
jmp 0x5399cb
mov rbp, qword [rsp + 0x170]
add rsp, 0x178
ret
mov r13d, dword [rsp + 0x50]
add r13d, 0x61707865
nop
xor r13d, dword [r15]
mov dword [rdi], r13d
mov r13d, dword [rsp + 0x4c]
add r13d, 0x3320646e
nop
xor r13d, dword [r15 + 4]
mov dword [rdi + 4], r13d
mov r13d, dword [rsp + 0x30]
add r13d, 0x79622d32
nop
xor r13d, dword [r15 + 8]
mov dword [rdi + 8], r13d
mov r13d, dword [rsp + 0x2c]
add r13d, 0x6b206574
nop
xor r13d, dword [r15 + 0xc]
mov dword [rdi + 0xc], r13d
nop
xor r11d, dword [r15 + 0x10]
mov dword [rdi + 0x10], r11d
nop
xor r8d, dword [r15 + 0x14]
mov dword [rdi + 0x14], r8d
nop
xor r9d, dword [r15 + 0x18]
mov dword [rdi + 0x18], r9d
nop
xor r12d, dword [r15 + 0x1c]
mov dword [rdi + 0x1c], r12d
nop
xor r10d, dword [r15 + 0x20]
mov dword [rdi + 0x20], r10d
nop
xor esi, dword [r15 + 0x24]
mov dword [rdi + 0x24], esi
nop
mov esi, dword [rsp + 0x48]
xor esi, dword [r15 + 0x28]
mov dword [rdi + 0x28], esi
nop
mov esi, dword [rsp + 0x44]
xor esi, dword [r15 + 0x2c]
mov dword [rdi + 0x2c], esi
nop
mov esi, dword [rsp + 0x40]
xor esi, dword [r15 + 0x30]
mov dword [rdi + 0x30], esi
nop
mov esi, dword [rsp + 0x3c]
xor esi, dword [r15 + 0x34]
mov dword [rdi + 0x34], esi
nop
mov esi, dword [rsp + 0x38]
xor esi, dword [r15 + 0x38]
mov dword [rdi + 0x38], esi
mov esi, dword [rsp + 0x34]
xor esi, dword [r15 + 0x3c]
mov dword [rdi + 0x3c], esi
mov rsi, qword [rsp + 0xf0]
add rsi, 0x40
mov r12d, dword [rsp + 0xc4]
mov r11d, dword [rsp + 0x98]
mov r15d, dword [rsp + 0x94]
mov r10, qword [rsp + 0x158]
mov r13d, dword [rsp + 0x90]
mov edi, dword [rsp + 0xcc]
mov r8d, dword [rsp + 0x68]
mov r9d, dword [rsp + 0xc8]
mov r8d, dword [rsp + 0x7c]
mov r9d, dword [rsp + 0x80]
mov qword [rsp + 0xf0], rsi
mov esi, dword [rsp + 0x60]
mov r13, qword [rsp + 0xf0]
cmp r13, r10
jge 0x539e0b
mov r10d, dword [rax]
mov dword [rsp + 0x8c], r10d
mov r13d, dword [rax + 0x10]
mov dword [rsp + 0x78], r13d
mov r12d, dword [rax + 0x20]
mov dword [rsp + 0x5c], r12d
nop
nop
nop
nop
lea r8d, [r10 + 0x61707865]
xor r8d, r12d
rol r8d, 0x10
add r13d, r8d
mov dword [rsp + 0xc0], r13d
xor r13d, r10d
rol r13d, 0xc
lea r12d, [r10 + r13]
lea r15d, [r13 + 0x61707865]
add r15d, r10d
xor r15d, r8d
rol r15d, 8
mov r8d, dword [rsp + 0xc0]
add r8d, r15d
xor r13d, r8d
rol r13d, 7
lea r10d, [r12 + 0x61707865]
add r10d, r11d
add r12d, r11d
xor r10d, esi
rol r10d, 0x10
add r9d, r10d
mov dword [rsp + 0x74], r9d
xor r9d, r11d
rol r9d, 0xc
add r12d, 0x61707865
add r12d, r9d
xor r10d, r12d
rol r10d, 8
mov dword [rsp + 0x58], r10d
mov esi, dword [rsp + 0x74]
add esi, r10d
mov dword [rsp + 0x74], esi
xor r9d, esi
rol r9d, 7
mov dword [rsp + 0x88], r9d
lea r11d, [rdi + 0x3320646e]
mov esi, dword [rsp + 0x94]
add r11d, esi
add edi, esi
xor r11d, r15d
rol r11d, 0x10
mov r15d, dword [rsp + 0x7c]
add r15d, r11d
mov dword [rsp + 0x70], r15d
xor r15d, esi
rol r15d, 0xc
add edi, 0x3320646e
add edi, r15d
mov dword [rsp + 0xa0], edi
xor r11d, edi
rol r11d, 8
mov esi, dword [rsp + 0x70]
add esi, r11d
mov dword [rsp + 0x70], esi
xor r15d, esi
rol r15d, 7
mov esi, dword [rsp + 0xc4]
lea edi, [rsi + 0x79622d32]
mov r9d, dword [rsp + 0x90]
add edi, r9d
add esi, r9d
mov r10d, dword [rsp + 0x68]
xor edi, r10d
rol edi, 0x10
add r8d, edi
mov dword [rsp + 0x6c], r8d
xor r8d, r9d
rol r8d, 0xc
add esi, 0x79622d32
add esi, r8d
mov dword [rsp + 0x9c], esi
xor edi, esi
rol edi, 8
mov dword [rsp + 0x54], edi
mov r10d, dword [rsp + 0x6c]
add r10d, edi
xor r8d, r10d
rol r8d, 7
mov r9d, dword [rsp + 0xc8]
lea esi, [r9 + 0x6b206574]
add esi, r13d
add r9d, r13d
mov edi, dword [rsp + 0x64]
xor esi, edi
rol esi, 0x10
mov edi, dword [rsp + 0x84]
add edi, esi
xor r13d, edi
rol r13d, 0xc
add r9d, 0x6b206574
add r9d, r13d
xor esi, r9d
rol esi, 8
add edi, esi
xor r13d, edi
rol r13d, 7
mov qword [rsp + 0x140], rax
xor eax, eax
mov qword [rsp + 0xe8], rax
mov eax, dword [rsp + 0x88]
mov dword [rsp + 0x24], eax
mov qword [rsp + 0x138], rcx
mov ecx, dword [rsp + 0x74]
mov dword [rsp + 0x48], ecx
mov qword [rsp + 0x130], rdx
mov edx, dword [rsp + 0x58]
mov dword [rsp + 0x34], edx
mov qword [rsp + 0x128], rbx
mov ebx, dword [rsp + 0xa0]
mov dword [rsp + 0x4c], ebx
mov dword [rsp + 0x120], esi
mov esi, dword [rsp + 0x70]
mov dword [rsp + 0x44], esi
mov esi, dword [rsp + 0x120]
mov dword [rsp + 0x118], esi
mov esi, dword [rsp + 0x9c]
mov dword [rsp + 0x30], esi
mov dword [rsp + 0x110], edi
mov edi, dword [rsp + 0x54]
mov dword [rsp + 0x3c], edi
mov rax, qword [rsp + 0x140]
mov rcx, qword [rsp + 0x138]
mov rdx, qword [rsp + 0x130]
mov rbx, qword [rsp + 0x128]
mov esi, dword [rsp + 0x120]
mov edi, dword [rsp + 0x110]
jmp 0x53a01f
mov dword [rsp + 0x50], r12d
mov dword [rsp + 0x40], r11d
mov dword [rsp + 0x2c], r9d
mov dword [rsp + 0x38], esi
mov r8d, dword [rax + 4]
mov r9d, dword [rax + 8]
mov r12d, dword [rax + 0xc]
mov esi, dword [rax + 0x14]
mov r11d, dword [rax + 0x18]
mov dword [rsp + 0xc0], r11d
mov r11d, dword [rax + 0x1c]
mov dword [rsp + 0xbc], r11d
mov r11d, dword [rax + 0x24]
mov dword [rsp + 0xb8], r11d
mov r11d, dword [rax + 0x28]
mov dword [rsp + 0xb4], r11d
mov r11d, dword [rax + 0x2c]
mov dword [rsp + 0xb0], r11d
mov r11d, dword [rsp + 0x5c]
inc r11d
mov dword [rax + 0x20], r11d
mov r11d, dword [rsp + 0x8c]
add r11d, r13d
mov r13d, dword [rsp + 0x24]
add r8d, r13d
add r9d, r15d
mov r13d, dword [rsp + 0x20]
add r12d, r13d
mov r13d, dword [rsp + 0x78]
add r10d, r13d
add esi, edi
mov edi, dword [rsp + 0x48]
mov r13d, dword [rsp + 0xc0]
add edi, r13d
mov dword [rsp + 0x48], edi
mov r13d, dword [rsp + 0x44]
mov r15d, dword [rsp + 0xbc]
add r13d, r15d
mov dword [rsp + 0x44], r13d
mov r15d, dword [rsp + 0x40]
mov r13d, dword [rsp + 0x5c]
add r15d, r13d
mov dword [rsp + 0x40], r15d
mov r15d, dword [rsp + 0x3c]
mov edi, dword [rsp + 0xb8]
add edi, r15d
mov dword [rsp + 0x3c], edi
mov r15d, dword [rsp + 0x38]
mov edi, dword [rsp + 0xb4]
add edi, r15d
mov dword [rsp + 0x38], edi
mov r15d, dword [rsp + 0x34]
mov edi, dword [rsp + 0xb0]
add edi, r15d
cmp r13d, 0xffffffff
je 0x53a065
mov r13, qword [rsp + 0xf0]
mov r15, qword [rsp + 0x158]
cmp r13, r15
ja 0x53a055
mov dword [rsp + 0x34], edi
sub r15, r13
mov qword [rsp + 0xd8], r15
neg r15
sar r15, 0x3f
and r15, r13
lea rdi, [r15 + rcx]
add r15, rbx
cmp r13, rdx
jne 0x539daf
lea rdi, [rax + 0x30]
mov r15, rdi
mov edi, 0x40
mov qword [rsp + 0xe0], rdi
mov rdi, r15
jmp 0x539de8
mov qword [rsp + 0x108], rax
mov rax, qword [rsp + 0xd8]
mov qword [rsp + 0xe0], rax
mov rax, qword [rsp + 0x108]
mov qword [rsp + 0x100], rax
mov rax, rdi
mov rdi, r15
mov r15, rax
mov rax, qword [rsp + 0x108]
mov r13, qword [rsp + 0xe0]
cmp r13, 0x40
jb 0x53a048
nop word [rax + rax]
jae 0x53989c
jmp 0x53a03b
mov rsi, qword [rsp + 0xd0]
test rsi, rsi
je 0x539e59
add rsi, 0xffffffffffffffc0
neg rsi
mov qword [rax + 0x70], rsi
cmp r10, rdx
jb 0x539e69
sub r10, rdx
cmp r10, 0x40
mov esi, 0x40
mov rcx, r10
cmovg rcx, rsi
neg r10
sar r10, 0x3f
and rdx, r10
add rdx, rbx
lea rbx, [rax + 0x30]
cmp rbx, rdx
je 0x539e59
mov rax, rdx
call fcn.00466440
mov rbp, qword [rsp + 0x170]
add rsp, 0x178
ret
mov rax, rdx
mov rcx, r10
call fcn.00465b60
inc r8
mov qword [rsp + 0xe8], r8
nop
nop
nop
nop
nop
add r12d, r13d
xor r11d, r12d
rol r11d, 0x10
add r10d, r11d
xor r13d, r10d
rol r13d, 0xc
add r12d, r13d
xor r11d, r12d
rol r11d, 8
add r10d, r11d
xor r13d, r10d
rol r13d, 7
mov dword [rsp + 0x28], r13d
mov edx, dword [rsp + 0x24]
mov ebx, dword [rsp + 0x4c]
add ebx, edx
mov ecx, dword [rsp + 0x3c]
xor ecx, ebx
rol ecx, 0x10
add edi, ecx
xor edx, edi
rol edx, 0xc
add ebx, edx
xor ecx, ebx
rol ecx, 8
add edi, ecx
mov dword [rsp + 0x1c], edi
xor edx, edi
rol edx, 7
mov eax, dword [rsp + 0x30]
add eax, r15d
xor esi, eax
rol esi, 0x10
mov r8d, dword [rsp + 0x48]
add r8d, esi
xor r15d, r8d
rol r15d, 0xc
add eax, r15d
xor esi, eax
rol esi, 8
mov dword [rsp + 0x38], esi
add r8d, esi
xor r15d, r8d
rol r15d, 7
mov edi, dword [rsp + 0x20]
add r9d, edi
mov esi, dword [rsp + 0x34]
xor esi, r9d
rol esi, 0x10
mov r13d, dword [rsp + 0x44]
add r13d, esi
xor edi, r13d
rol edi, 0xc
add r9d, edi
xor esi, r9d
rol esi, 8
add r13d, esi
xor edi, r13d
rol edi, 7
add r12d, edx
xor esi, r12d
rol esi, 0x10
add r8d, esi
xor edx, r8d
rol edx, 0xc
add r12d, edx
xor esi, r12d
rol esi, 8
add r8d, esi
xor edx, r8d
rol edx, 7
mov dword [rsp + 0x24], edx
add ebx, r15d
xor r11d, ebx
rol r11d, 0x10
add r13d, r11d
xor r15d, r13d
rol r15d, 0xc
add ebx, r15d
xor r11d, ebx
rol r11d, 8
add r13d, r11d
xor r15d, r13d
rol r15d, 7
add eax, edi
xor ecx, eax
rol ecx, 0x10
add r10d, ecx
xor edi, r10d
rol edi, 0xc
add eax, edi
mov dword [rsp + 0x30], eax
xor ecx, eax
rol ecx, 8
mov dword [rsp + 0x3c], ecx
add r10d, ecx
xor edi, r10d
rol edi, 7
mov eax, dword [rsp + 0x28]
add r9d, eax
mov ecx, dword [rsp + 0x38]
xor ecx, r9d
rol ecx, 0x10
mov edx, dword [rsp + 0x1c]
add edx, ecx
xor eax, edx
rol eax, 0xc
add r9d, eax
xor ecx, r9d
rol ecx, 8
add edx, ecx
xor eax, edx
rol eax, 7
mov dword [rsp + 0x48], r8d
mov dword [rsp + 0x34], esi
mov dword [rsp + 0x4c], ebx
mov dword [rsp + 0x44], r13d
mov r13d, eax
mov esi, ecx
mov r8d, edi
mov rax, qword [rsp + 0x180]
mov rcx, qword [rsp + 0x168]
mov rbx, qword [rsp + 0x160]
mov edi, edx
mov rdx, qword [rsp + 0xf8]
mov dword [rsp + 0x20], r8d
mov r8, qword [rsp + 0xe8]
cmp r8, 9
jl 0x539e74
jmp 0x539c4d
mov ecx, 0x40
mov rdx, r13
call fcn.00465b20
mov ecx, 0x40
mov rdx, r13
call fcn.00465b20
mov rax, r13
mov rcx, r15
nop dword [rax + rax]
call fcn.00465b60
lea rax, [0x005e12a0]
lea rbx, [0x0067c080]
call fcn.00436440
mov rdx, r10
mov rbx, rdi
nop
call fcn.00465be0
mov rax, rdx
call fcn.00465b60
movzx r11d, byte [rdx + r10]
movzx r12d, byte [rdx + rsi]
xor r12d, r11d
mov byte [rbx + rdx], r12b
inc rdx
cmp rdx, r8
jl 0x53a08d
mov r10, qword [rax + 0x70]
sub r10, r8
mov qword [rax + 0x70], r10
test r10, r10
jne 0x53a106
movups xmmword [rax + 0x30], xmm15
movups xmmword [rax + 0x40], xmm15
movups xmmword [rax + 0x50], xmm15
movups xmmword [rax + 0x60], xmm15
cmp rcx, r8
jb 0x53a116
sub r9, r8
sub rcx, r8
mov r10, r9
neg r9
sar r9, 0x3f
and r9, r8
add rsi, r9
sub rdi, r8
mov r11, rdi
neg rdi
sar rdi, 0x3f
and r8, rdi
add rbx, r8
mov r8, rcx
mov rdi, r11
mov r9, r10
jmp 0x539620
mov rbp, qword [rsp + 0x170]
add rsp, 0x178
ret
mov rax, r8
call fcn.00465b60
mov rcx, r8
mov rdx, r9
call fcn.00465b20
mov rcx, r8
mov rdx, rdi
call fcn.00465b20
mov rax, r11
mov ecx, 0x40
nop dword [rax]
call fcn.00465b60
lea rax, [0x005e12a0]
lea rbx, [0x0067c070]
call fcn.00436440
lea rax, [0x005e12a0]
lea rbx, [0x0067c060]
call fcn.00436440
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.00463440
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.00539540