Function at 0x180040940
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x20
mov ebp, r8d
mov r12, rdx
mov rbx, rcx
mov rcx, qword [rcx + 0x50]
mov rdx, qword [rbx + 0x58]
cmp rcx, 0x1238
je 0x18004098f
test rdx, rdx
je 0x180040982
mov rdi, rdx
xor eax, eax
rep stosb byte [rdi], al
mov rcx, rdx
call fcn.18002bc10
mov ecx, 0x1238
call fcn.1800416c0
mov rdx, rax
mov qword [rbx + 0x58], rdx
mov qword [rbx + 0x50], 0x1238
mov qword [rbx + 0x48], 0
mov r15d, ebp
shr r15d, 2
lea eax, [r15 + 6]
mov dword [rbx + 0x18], eax
lea r14d, [rax*4 + 4]
mov rcx, qword [rbx + 0x30]
mov rdx, qword [rbx + 0x38]
cmp rcx, r14
je 0x1800409ec
test rdx, rdx
je 0x1800409da
mov rdi, rdx
xor eax, eax
rep stosd dword [rdi], eax
mov rcx, rdx
call fcn.1800416b0
xor r8d, r8d
mov rdx, r14
lea rcx, [rbx + 0x20]
call fcn.180029130
mov rdx, rax
mov qword [rbx + 0x38], rdx
mov qword [rbx + 0x30], r14
movabs rax, 0x3fffffffffffffff
mov qword [rbx + 0x28], rax
mov rdi, rdx
movzx eax, byte [0x1800d6ebc]
test al, al
jne 0x180040a1c
call fcn.1800458b0
movzx eax, byte [0x1800d6ebc]
cmp byte [0x1800d6ec2], 0
je 0x180040a68
test al, al
jne 0x180040a2e
call fcn.1800458b0
cmp byte [0x1800d6ebf], 0
je 0x180040a68
mov rdx, rbp
mov r8, rdi
mov rcx, r12
call fcn.180047800
lea rcx, [rbx + 8]
mov rax, qword [rcx]
call qword [rax + 0x40]
test al, al
jne 0x180041402
mov edx, dword [rbx + 0x18]
mov rcx, qword [rbx + 0x38]
call fcn.180047790
jmp 0x180041402
mov r14, rbp
and r14, 0xfffffffffffffffc
test ebp, ebp
je 0x180040ad3
test rdi, rdi
jne 0x180040a85
call fcn.180064e20
mov dword [rax], 0x16
jmp 0x180040ace
test r12, r12
je 0x180040a9f
cmp r14, rbp
jb 0x180040a9f
mov r8, rbp
mov rdx, r12
mov rcx, rdi
call fcn.18007b360
jmp 0x180040ad3
mov r8, r14
xor edx, edx
mov rcx, rdi
call fcn.18007afa0
test r12, r12
jne 0x180040abe
call fcn.180064e20
mov dword [rax], 0x16
jmp 0x180040ace
cmp r14, rbp
jae 0x180040ad3
call fcn.180064e20
mov dword [rax], 0x22
call fcn.180057020
mov r8, r14
sub r8, rbp
lea rcx, [rdi + rbp]
xor edx, edx
call fcn.18007afa0
lea r9, [rbp + 3]
and r9, 0xfffffffffffffffc
mov r8, rdi
mov rdx, rdi
mov ecx, 1
call fcn.18003fd90
lea eax, [r15 - 1]
lea r11, [rax*4]
mov edx, dword [r11 + rdi]
mov eax, edx
shr eax, 0x10
movzx ecx, al
lea r9, [0x180000000]
movzx r8d, byte [rcx + r9 + 0x846d0]
shl r8d, 8
mov eax, edx
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r9 + 0x846d0]
xor r8d, eax
shl r8d, 8
movzx eax, dl
movzx eax, byte [rax + r9 + 0x846d0]
xor r8d, eax
shl r8d, 8
mov eax, edx
shr rax, 0x18
movzx eax, byte [rax + r9 + 0x846d0]
xor r8d, eax
xor r8d, dword [rdi]
xor r8d, dword [0x1800848d0]
lea r9, [r14 + rdi]
mov dword [r9], r8d
lea r10, [0x1800848d4]
xor r8d, dword [rdi + 4]
lea eax, [r15 + 1]
lea r12, [rax*4]
mov dword [r12 + rdi], r8d
xor r8d, dword [rdi + 8]
lea eax, [r15 + 2]
lea r13, [rax*4]
mov dword [rdi + r13], r8d
lea eax, [r15 + 3]
lea r15, [rax*4]
xor r8d, dword [rdi + 0xc]
mov dword [r15 + rdi], r8d
mov rsi, qword [rbx + 0x38]
mov rax, qword [rbx + 0x30]
lea rcx, [rsi + rax*4]
lea rax, [rdi + 0x10]
add rax, r14
cmp rax, rcx
je 0x180040c8e
cmp ebp, 0x18
jne 0x180040d67
mov eax, dword [rdi + 0x24]
xor eax, dword [rdi + 0x10]
mov dword [rdi + 0x28], eax
xor eax, dword [rdi + 0x14]
mov dword [rdi + 0x2c], eax
lea rsi, [0x180000000]
mov rdi, r9
mov edx, dword [r11 + r9]
mov eax, edx
shr eax, 0x10
movzx ecx, al
movzx r8d, byte [rcx + rsi + 0x846d0]
shl r8d, 8
mov eax, edx
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + rsi + 0x846d0]
xor r8d, eax
shl r8d, 8
movzx eax, dl
movzx eax, byte [rax + rsi + 0x846d0]
xor r8d, eax
shl r8d, 8
mov eax, edx
shr rax, 0x18
movzx eax, byte [rax + rsi + 0x846d0]
xor r8d, eax
xor r8d, dword [r10]
xor r8d, dword [r9]
add r9, r14
mov dword [r9], r8d
add r10, 4
xor r8d, dword [rdi + 4]
mov dword [r12 + rdi], r8d
xor r8d, dword [rdi + 8]
mov dword [rdi + r13], r8d
xor r8d, dword [rdi + 0xc]
mov dword [r15 + rdi], r8d
mov rsi, qword [rbx + 0x38]
mov rax, qword [rbx + 0x30]
lea rcx, [rsi + rax*4]
lea rax, [r14 + 0x10]
add rax, rdi
cmp rax, rcx
jne 0x180040bd5
lea rcx, [rbx + 8]
mov rax, qword [rcx]
call qword [rax + 0x40]
test al, al
je 0x180040dee
movzx eax, byte [0x1800d6eb0]
test al, al
jne 0x180040d31
xor ebp, ebp
mov r10d, ebp
lea r11, [0x180000000]
nop dword [rax + rax]
movzx edi, byte [r10 + r11 + 0x846d0]
lea r8d, [rdi + rdi]
mov edx, edi
shr edx, 7
imul r9d, edx, 0x1b000000
mov eax, r8d
shl eax, 0x18
xor r9, rax
mov eax, edi
shl eax, 8
or eax, edi
shl eax, 8
or r9, rax
imul ecx, edx, 0x11b
xor rcx, rdi
mov eax, r8d
xor rcx, rax
or rcx, r9
shl rcx, 0x20
or rcx, r9
mov qword [r11 + r10*8 + 0xd5ea0], rcx
inc r10
cmp r10, 0x100
jl 0x180040cc0
mov qword [0x1800d66a8], rbp
mov qword [0x1800d66a0], rbp
mov byte [0x1800d6eb0], 1
mov r9d, 0x10
mov r8, rsi
mov rdx, rsi
lea ecx, [r9 - 0xf]
call fcn.18003fd90
mov eax, dword [rbx + 0x18]
shl eax, 2
lea rdx, [rsi + rax*4]
mov r9d, 0x10
mov r8, rdx
lea ecx, [r9 - 0xf]
call fcn.18003fd90
jmp 0x1800413ce
cmp ebp, 0x20
jne 0x180040bed
mov edx, dword [rdi + 0x2c]
mov eax, edx
shr rax, 0x18
lea rsi, [0x180000000]
movzx r8d, byte [rax + rsi + 0x846d0]
shl r8d, 8
mov eax, edx
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + rsi + 0x846d0]
xor r8d, eax
shl r8d, 8
mov eax, edx
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + rsi + 0x846d0]
xor r8d, eax
shl r8d, 8
movzx eax, dl
movzx eax, byte [rax + rsi + 0x846d0]
xor r8d, eax
xor r8d, dword [rdi + 0x10]
mov dword [rdi + 0x30], r8d
xor r8d, dword [rdi + 0x14]
mov dword [rdi + 0x34], r8d
xor r8d, dword [rdi + 0x18]
mov dword [rdi + 0x38], r8d
xor r8d, dword [rdi + 0x1c]
mov dword [rdi + 0x3c], r8d
jmp 0x180040bf4
movzx eax, byte [0x1800d6eb1]
test al, al
jne 0x180040dfe
call fcn.1800401b0
mov ebp, 4
mov eax, dword [rbx + 0x18]
lea r11d, [rax*4 - 4]
lea r12, [0x180000000]
cmp r11d, ebp
jbe 0x18004119d
lea r14d, [r11 + 2]
lea r15d, [rbp + 2]
nop word [rax + rax]
mov eax, ebp
lea r10, [rsi + rax*4]
mov edi, dword [r10]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov r9d, dword [r12 + rdx*8 + 0xd66b4]
xor r9d, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor r9d, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor r9d, dword [r12 + rcx*8 + 0xd66b3]
lea r8, [rsi + r11*4]
mov edi, dword [r8]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov edx, dword [r12 + rdx*8 + 0xd66b4]
xor edx, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor edx, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor edx, dword [r12 + rcx*8 + 0xd66b3]
mov dword [r10], edx
mov dword [r8], r9d
lea eax, [r15 - 1]
lea r10, [rsi + rax*4]
mov edi, dword [r10]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov r9d, dword [r12 + rdx*8 + 0xd66b4]
xor r9d, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor r9d, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor r9d, dword [r12 + rcx*8 + 0xd66b3]
lea eax, [r14 - 1]
lea r8, [rsi + rax*4]
mov edi, dword [r8]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov edx, dword [r12 + rdx*8 + 0xd66b4]
xor edx, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor edx, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor edx, dword [r12 + rcx*8 + 0xd66b3]
mov dword [r10], edx
mov dword [r8], r9d
mov eax, r15d
lea r10, [rsi + rax*4]
mov edi, dword [r10]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov r9d, dword [r12 + rdx*8 + 0xd66b4]
xor r9d, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor r9d, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor r9d, dword [r12 + rcx*8 + 0xd66b3]
lea r8, [rsi + r14*4]
mov edi, dword [r8]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov edx, dword [r12 + rdx*8 + 0xd66b4]
xor edx, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor edx, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor edx, dword [r12 + rcx*8 + 0xd66b3]
mov dword [r10], edx
mov dword [r8], r9d
lea eax, [r15 + 1]
lea r10, [rsi + rax*4]
mov edi, dword [r10]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov r9d, dword [r12 + rdx*8 + 0xd66b4]
xor r9d, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor r9d, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor r9d, dword [r12 + rcx*8 + 0xd66b3]
lea eax, [r14 + 1]
lea r8, [rsi + rax*4]
mov edi, dword [r8]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov edx, dword [r12 + rdx*8 + 0xd66b4]
xor edx, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor edx, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor edx, dword [r12 + rcx*8 + 0xd66b3]
mov dword [r10], edx
mov dword [r8], r9d
add ebp, 4
add r15d, 4
add r11d, 0xfffffffc
lea r14d, [r14 - 4]
cmp ebp, r11d
jb 0x180040e30
mov eax, ebp
lea r8, [rsi + rax*4]
mov edi, dword [r8]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov edx, dword [r12 + rdx*8 + 0xd66b4]
xor edx, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor edx, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor edx, dword [r12 + rcx*8 + 0xd66b3]
mov dword [r8], edx
lea eax, [rbp + 1]
lea r8, [rsi + rax*4]
mov edi, dword [r8]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov edx, dword [r12 + rdx*8 + 0xd66b4]
xor edx, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor edx, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor edx, dword [r12 + rcx*8 + 0xd66b3]
mov dword [r8], edx
lea eax, [rbp + 2]
lea r8, [rsi + rax*4]
mov edi, dword [r8]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov edx, dword [r12 + rdx*8 + 0xd66b4]
xor edx, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor edx, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor edx, dword [r12 + rcx*8 + 0xd66b3]
mov dword [r8], edx
lea eax, [rbp + 3]
lea r8, [rsi + rax*4]
mov edi, dword [r8]
mov eax, edi
shr rax, 0x18
movzx edx, byte [rax + r12 + 0x846d0]
mov eax, edi
shr eax, 0x10
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
mov edx, dword [r12 + rdx*8 + 0xd66b4]
xor edx, dword [r12 + rax*8 + 0xd66b1]
mov eax, edi
shr eax, 8
movzx ecx, al
movzx eax, byte [rcx + r12 + 0x846d0]
xor edx, dword [r12 + rax*8 + 0xd66b2]
movzx eax, dil
movzx ecx, byte [rax + r12 + 0x846d0]
xor edx, dword [r12 + rcx*8 + 0xd66b3]
mov dword [r8], edx
mov edx, dword [rsi]
bswap edx
mov eax, dword [rbx + 0x18]
shl eax, 2
mov ecx, dword [rsi + rax*4]
bswap ecx
mov dword [rsi], ecx
mov eax, dword [rbx + 0x18]
shl eax, 2
mov dword [rsi + rax*4], edx
mov edx, dword [rsi + 4]
bswap edx
mov eax, dword [rbx + 0x18]
lea eax, [rax*4 + 1]
mov eax, dword [rsi + rax*4]
bswap eax
mov dword [rsi + 4], eax
mov eax, dword [rbx + 0x18]
lea eax, [rax*4 + 1]
mov dword [rsi + rax*4], edx
mov edx, dword [rsi + 8]
bswap edx
mov eax, dword [rbx + 0x18]
lea eax, [rax*4 + 2]
mov eax, dword [rsi + rax*4]
bswap eax
mov dword [rsi + 8], eax
mov eax, dword [rbx + 0x18]
lea eax, [rax*4 + 2]
mov dword [rsi + rax*4], edx
mov edx, dword [rsi + 0xc]
bswap edx
mov eax, dword [rbx + 0x18]
lea eax, [rax*4 + 3]
mov eax, dword [rsi + rax*4]
bswap eax
mov dword [rsi + 0xc], eax
mov eax, dword [rbx + 0x18]
lea eax, [rax*4 + 3]
mov dword [rsi + rax*4], edx
cmp byte [0x1800d6ebc], 0
jne 0x1800413dc
call fcn.1800458b0
cmp byte [0x1800d6ec2], 0
je 0x180041402
lea rdx, [rsi + 0x10]
mov r9d, dword [rbx + 0x18]
shl r9d, 4
sub r9d, 0x10
mov r8, rdx
mov ecx, 1
call fcn.18003fd90
mov rbx, qword [rsp + 0x78]
add rsp, 0x20
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret