Function at 0x140004188
Capabilities:
Encode data using xor

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x20], r9
mov qword [rax + 0x18], r8
mov qword [rax + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
movzx eax, word [0x1402c7638]
mov r13, rdx
mov rbp, qword [0x1402c75f8]
mov ecx, 1
sub qword [0x1402c75d8], rcx
mov edx, 0xffff
mov r9d, dword [rsp + 0x98]
add ax, dx
mov rbx, qword [rsp + 0xa0]
xor edx, edx
mov word [0x1402c7638], ax
mov rdi, r8
movzx eax, ax
sub r9d, ecx
movsxd r12, r9d
mov r11, rbp
mov dword [rsp + 0x98], r9d
movzx r15d, byte [rax + r8]
mov r8, qword [0x1402c7620]
mov rax, qword [0x1402c7648]
sub r8, rcx
movzx ecx, word [0x1402c75cc]
xor rax, rbp
mov qword [rsp + 0x10], rax
imul eax, dword [0x1402c765c], 0x16bf
mov qword [0x1402c7620], r8
movzx r9d, byte [r12 + rbx]
mov qword [rsp + 8], r8
cdqe
mov qword [rsp + 0x18], rax
mov rax, r8
div qword [0x1402c7608]
mov eax, 0x88baaad9
mov rsi, rdx
imul dword [0x1402c75c4]
add edx, dword [0x1402c75c4]
sar edx, 0xc
mov eax, edx
shr eax, 0x1f
add eax, edx
cdqe
mov qword [rsp + 0x20], rax
mov eax, 0x43491159
mul ecx
shr edx, 0xa
cmp r9, qword [0x1402c7648]
mov r14d, edx
mov qword [rsp], r14
jbe 0x140004356
mov r13, qword [rsp]
lea rbp, [r9 + r15]
mov rdi, qword [rsp + 0x88]
lea r14, [rsi + r9*2]
movsxd r10, r9d
mov r8d, 1
add word [r11], r8w
xor edx, edx
movzx eax, word [r11]
xor r10, r12
add r9d, r8d
movzx ecx, word [rdi + rax*2 + 0xc]
movzx eax, byte [rbp]
add rbp, r8
or eax, 0x1bde
mov qword [0x1402c75d0], r10
div ecx
xor edx, edx
movsxd r10, r9d
add eax, 0x2ff
cdqe
add qword [0x1402c7600], rax
mov eax, 0x9e7
movzx ecx, word [rsi]
shl rcx, 4
div qword [rcx + 0x831]
movzx eax, word [r11]
lea rcx, [rax + rax*2]
mov qword [r13 + rcx*8], rdx
movzx eax, word [r11]
movzx edx, byte [rbx + rax*2]
movzx eax, word [r14]
lea r14, [r14 + 2]
and rax, r12
or rdx, rax
cmp r10, qword [0x1402c7648]
mov qword [0x1402c7600], rdx
ja 0x1400042b0
mov rbp, qword [0x1402c75f8]
mov r8, qword [rsp + 8]
mov rdi, qword [rsp + 0x80]
mov r13, qword [rsp + 0x78]
mov r14, qword [rsp]
jmp 0x14000435d
mov rdx, qword [0x1402c7600]
movzx eax, r8w
mov ecx, dword [r13 + rax*4 + 4]
cmp dword [0x1402c763c], ecx
jl 0x14000437c
movzx eax, byte [r12 + rdi]
cmp qword [0x1402c75e8], rax
je 0x140004395
mov eax, 0xffff
add r8w, ax
movzx eax, r8w
movzx ecx, byte [rax + rdi]
cmp ecx, 0x1b5e
jae 0x1400043d9
movzx eax, byte [r15 + 0xf82]
add rdx, rax
mov qword [0x1402c7600], rdx
mov eax, 1
add word [r11], ax
movzx ecx, word [r11]
add rcx, rax
lea rax, [rbx + rcx*2]
mov rbx, qword [rsp + 0x70]
movzx eax, byte [rcx + rax]
xor eax, 0x78d
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
movzx eax, word [r11]
mov rdi, qword [rsp + 0xb0]
movzx r8d, r8w
movzx ecx, byte [rax + rdi]
mov eax, 0x16b4
sub cx, ax
lea r9d, [r8 + r8*2]
mov rax, qword [rsp + 0x10]
mov word [rax + rbp*2], cx
movzx r10d, word [rsi]
mov eax, dword [rsp + 0x98]
lea eax, [rax*2 + 4]
movsxd rcx, eax
mov rax, qword [rsp + 0x18]
movzx edx, word [r11 + rcx*2]
lea ecx, [r8 + 4]
movzx eax, byte [rax + r10*2]
sub edx, eax
mov rax, qword [rsp + 0x20]
movzx r8d, byte [rcx + rax]
mov eax, edx
cdq
idiv r8d
sub al, byte [rsi + r10*2]
or byte [r9 + rdi], al
mov eax, dword [r13 + 0x1138]
mov ecx, dword [0x1402c75e0]
or ecx, 0xe1
xor eax, ecx
add dword [0x1402c7660], eax
cmp qword [0x1402c75f8], 0x2b
jne 0x1400043a7
cmp qword [0x1402c75d0], 0
ja 0x1400043a7
movzx ecx, word [0x1402c7638]
xor edx, edx
movsxd rax, dword [0x1402c7614]
xor rax, 0x18b9
div qword [rcx*8 + 0x7f9]
xor edx, edx
mov qword [rcx*8 + 0x7f9], rax
movzx eax, word [r11]
movzx ecx, byte [rdi + 0x1b29]
mov rax, qword [r14 + rax*8]
div qword [0x1402c75e0]
mov edx, 1
xor ax, cx
mov word [0x1402c7610], ax
mov rax, qword [0x1402c75e8]
add rax, rdx
mov qword [0x1402c75e8], rax
or eax, 0x1553
sub eax, dword [0x1402c7664]
mov dword [0x1402c7664], eax
add word [r11], dx
movzx ecx, word [r11]
add rcx, rdx
jmp 0x1400043b7