Function at 0x180056740
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x2f8
mov qword [rsp + 0x60], rcx
cmp rdx, 2
jb 0x180056e59
mov rsi, rdx
movabs rax, 0x3fffffffffffffff
add rax, rdx
mov rcx, rax
or rcx, rdx
shr rcx, 0x20
je 0x180056785
xor edx, edx
div rsi
jmp 0x180056789
xor edx, edx
div esi
mov qword [rsp + 0x68], rax
cmp rsi, 0x1001
mov qword [rsp + 0x48], r9
mov qword [rsp + 0x40], r8
jae 0x1800567bc
mov rax, rsi
shr rax, 1
mov rcx, rsi
sub rcx, rax
cmp rcx, 0x40
mov eax, 0x40
cmovb rax, rcx
jmp 0x1800567ce
mov rcx, rsi
call fcn.18010d8e0
mov r8, qword [rsp + 0x40]
mov r9, qword [rsp + 0x48]
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0x60]
lea rcx, [rax + 3]
mov qword [rsp + 0x78], rcx
add rax, 0xfffffffffffffffe
mov qword [rsp + 0x80], rax
mov r13d, 1
xor r12d, r12d
xor r14d, r14d
mov qword [rsp + 0x90], rsi
nop word cs:[rax + rax]
mov rax, qword [rsp + 0x60]
lea rax, [rax + r12*2]
mov qword [rsp + 0x50], rax
sub rsi, r12
jbe 0x180056890
cmp rsi, qword [rsp + 0x58]
jae 0x1800568b0
cmp byte [rsp + 0x360], 0
je 0x1800568c1
cmp rsi, 0x20
mov eax, 0x20
cmovae rsi, rax
mov rax, qword [rsp + 0x368]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
mov rcx, qword [rsp + 0x50]
mov rdx, rsi
call fcn.180011ce0
mov r8, qword [rsp + 0x40]
mov r9, qword [rsp + 0x48]
mov eax, esi
lea rsi, [rax*2 + 1]
jmp 0x180056aeb
xor esi, esi
mov eax, 1
mov qword [rsp + 0x70], rax
cmp r14, 2
jae 0x180056b40
jmp 0x180056de6
mov r10, r8
cmp rsi, 2
jae 0x1800568d5
mov r15, rsi
jmp 0x180056ae0
mov rax, qword [rsp + 0x58]
cmp rax, rsi
cmovb rsi, rax
add rsi, rsi
jmp 0x180056aeb
mov r11, qword [rsp + 0x50]
movzx edx, byte [r11 + 2]
movzx r8d, byte [r11 + 3]
xor ecx, ecx
cmp r8b, byte [r11 + 1]
setb cl
xor eax, eax
cmp dl, byte [r11]
setb al
cmove eax, ecx
test al, al
je 0x180056935
cmp rsi, 2
jne 0x18005698d
mov rax, qword [rsp + 0x50]
add rax, 2
mov r15d, 2
mov edx, 1
movabs r9, 0x7ffffffffffffffe
cmp rdx, 1
jne 0x180056a3f
xor ecx, ecx
jmp 0x180056aa0
mov r15d, 2
cmp rsi, 2
je 0x180056ae0
mov ecx, 2
nop word [rax + rax]
mov r9d, edx
mov r10d, r8d
mov r8, qword [rsp + 0x50]
movzx edx, byte [r8 + rcx*2]
movzx r8d, byte [r8 + rcx*2 + 1]
xor r11d, r11d
cmp r8b, r10b
setb r11b
xor r10d, r10d
cmp dl, r9b
setb r10b
cmove r10d, r11d
test r10b, r10b
jne 0x1800569df
inc rcx
cmp rsi, rcx
jne 0x180056950
jmp 0x1800569dc
mov ecx, 2
nop word cs:[rax + rax]
mov r9d, edx
mov r10d, r8d
mov r8, qword [rsp + 0x50]
movzx edx, byte [r8 + rcx*2]
movzx r8d, byte [r8 + rcx*2 + 1]
xor r11d, r11d
cmp r8b, r10b
setb r11b
xor r10d, r10d
cmp dl, r9b
setb r10b
cmove r10d, r11d
cmp r10b, 1
jne 0x1800569df
inc rcx
cmp rsi, rcx
jne 0x1800569a0
mov rcx, rsi
cmp rcx, qword [rsp + 0x58]
mov r9, qword [rsp + 0x48]
mov r8, qword [rsp + 0x40]
jb 0x18005682e
mov r10, r8
test al, al
je 0x180056ad3
mov r15d, 1
cmp rcx, 2
jb 0x180056ae0
mov rdx, rcx
shr rdx, 1
mov rax, qword [rsp + 0x50]
lea rax, [rax + rcx*2]
mov r8, rcx
and r8, 0xfffffffffffffffe
sub rax, r8
mov r15, rcx
movabs r9, 0x7ffffffffffffffe
cmp rdx, 1
je 0x18005692e
mov r8, rdx
and r8, 0xfffffffffffffffe
mov rcx, qword [rsp + 0x78]
lea r10, [rcx + r12*2]
lea r11, [rax + rdx*2]
dec r11
xor ecx, ecx
nop dword [rax + rax]
movzx esi, word [r10 + rcx*2 - 3]
movzx edi, word [r11 - 1]
mov word [r10 + rcx*2 - 3], di
mov word [r11 - 1], si
mov rsi, rcx
xor rsi, r9
add rsi, rdx
movzx edi, word [r10 + rcx*2 - 1]
movzx ebx, word [rax + rsi*2]
mov word [r10 + rcx*2 - 1], bx
mov word [rax + rsi*2], di
add rcx, 2
add r11, 0xfffffffffffffffc
cmp r8, rcx
jne 0x180056a60
test dl, 1
je 0x180056ac7
mov r8, rcx
not r8
add rdx, r8
mov r9, qword [rsp + 0x50]
movzx r8d, word [r9 + rcx*2]
movzx r10d, word [rax + rdx*2]
mov word [r9 + rcx*2], r10w
mov word [rax + rdx*2], r8w
mov r9, qword [rsp + 0x48]
mov r10, qword [rsp + 0x40]
jmp 0x180056ae0
mov r15, rcx
nop word cs:[rax + rax]
lea rsi, [r15*2 + 1]
mov r8, r10
mov rax, r13
shr rax, 1
mov qword [rsp + 0x70], rsi
shr rsi, 1
lea rdx, [r12 + r12]
sub rdx, rax
lea rax, [rsi + r12*2]
mov rcx, qword [rsp + 0x68]
imul rdx, rcx
imul rax, rcx
xor rax, rdx
je 0x180056b29
bsr rsi, rax
xor rsi, 0x3f
cmp r14, 2
jae 0x180056b40
jmp 0x180056de6
mov esi, 0x40
cmp r14, 2
jb 0x180056de6
nop dword [rax + rax]
mov rax, qword [rsp + 0x80]
lea rax, [rax + r12*2]
mov qword [rsp + 0x88], rax
mov qword [rsp + 0x98], r12
jmp 0x180056b93
mov r12, r13
mov rdx, r10
sub r8, rdx
mov rcx, r12
call sub.VCRUNTIME140.dll_memcpy
mov r9, qword [rsp + 0x48]
mov r8, qword [rsp + 0x40]
lea r13, [rbp*2 + 1]
mov r12, qword [rsp + 0x98]
cmp r14, 1
jbe 0x180056de0
cmp byte [rsp + r14 + 0xa5], sil
jb 0x180056de6
dec r14
mov rdi, qword [rsp + r14*8 + 0xe8]
mov r15, rdi
shr r15, 1
mov rbx, r13
shr rbx, 1
lea rbp, [r15 + rbx]
cmp rbp, r9
ja 0x180056be0
mov eax, edi
or eax, r13d
and eax, 1
jne 0x180056be0
add rbp, rbp
mov r13, rbp
cmp r14, 1
ja 0x180056b93
jmp 0x180056de0
mov rax, r12
sub rax, rbp
mov rcx, qword [rsp + 0x60]
lea r12, [rcx + rax*2]
test dil, 1
je 0x180056c10
test r13b, 1
je 0x180056c58
cmp r13, 2
jae 0x180056ca5
jmp 0x180056b79
mov rax, r15
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov rcx, qword [rsp + 0x368]
mov qword [rsp + 0x30], rcx
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rcx, r12
mov rdx, r15
call fcn.180011ce0
mov r8, qword [rsp + 0x40]
mov r9, qword [rsp + 0x48]
test r13b, 1
jne 0x180056bfb
lea rcx, [r12 + r15*2]
mov rax, rbx
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov rdx, qword [rsp + 0x368]
mov qword [rsp + 0x30], rdx
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rdx, rbx
call fcn.180011ce0
mov r8, qword [rsp + 0x40]
mov r9, qword [rsp + 0x48]
cmp r13, 2
jb 0x180056b79
cmp rdi, 2
jb 0x180056b79
cmp r15, rbx
mov rdi, rbx
cmovb rdi, r15
cmp rdi, r9
ja 0x180056b79
lea r13, [r12 + r15*2]
cmp rbx, r15
mov rdx, r12
cmovb rdx, r13
mov rcx, r8
lea r8, [rdi + rdi]
call sub.VCRUNTIME140.dll_memcpy
mov r10, qword [rsp + 0x40]
lea r8, [r10 + rdi*2]
cmp rbx, r15
jae 0x180056d60
mov rax, qword [rsp + 0x88]
nop word cs:[rax + rax]
movzx edx, byte [r8 - 2]
movzx ecx, byte [r8 - 1]
xor r9d, r9d
cmp cl, byte [r13 - 1]
setb r9b
xor ecx, ecx
cmp dl, byte [r13 - 2]
setb cl
cmove ecx, r9d
mov rdx, r13
test cl, cl
jne 0x180056d2c
mov rdx, r8
movzx edx, word [rdx - 2]
mov word [rax], dx
movzx edx, cl
xor cl, 1
movzx ecx, cl
lea r13, [r13 + rcx*2 - 2]
lea r8, [r8 + rdx*2]
add r8, 0xfffffffffffffffe
cmp r13, r12
je 0x180056b5e
add rax, 0xfffffffffffffffe
cmp r8, r10
jne 0x180056d00
jmp 0x180056b5e
mov rdx, r10
test rdi, rdi
je 0x180056b64
nop dword [rax]
movzx ecx, byte [r13]
movzx eax, byte [r13 + 1]
xor r9d, r9d
cmp al, byte [rdx + 1]
setb r9b
xor eax, eax
cmp cl, byte [rdx]
setb al
cmove eax, r9d
mov rcx, r13
test al, al
jne 0x180056d99
mov rcx, rdx
mov r9d, eax
xor r9b, 1
movzx ecx, word [rcx]
mov word [r12], cx
movzx ecx, r9b
lea rdx, [rdx + rcx*2]
add r12, 2
cmp rdx, r8
je 0x180056b64
movzx eax, al
lea r13, [r13 + rax*2]
cmp r13, qword [rsp + 0x50]
jne 0x180056d70
jmp 0x180056b64
mov r14d, 1
mov qword [rsp + r14*8 + 0xe8], r13
mov byte [rsp + r14 + 0xa6], sil
mov rsi, qword [rsp + 0x90]
cmp rsi, r12
jbe 0x180056e19
inc r14
mov r13, qword [rsp + 0x70]
mov rax, r13
shr rax, 1
add r12, rax
jmp 0x180056810
test r13b, 1
jne 0x180056e59
mov rax, rsi
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov rcx, qword [rsp + 0x368]
mov qword [rsp + 0x30], rcx
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rcx, qword [rsp + 0x60]
mov rdx, rsi
call fcn.180011ce0
nop
add rsp, 0x2f8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret