Function at 0x18012b890
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x50
xor eax, eax
mov rsi, r9
mov rdi, r8
mov ebp, edx
mov r10, rcx
test rcx, rcx
je 0x18012be14
mov qword [rsp + 0x68], rbx
cmp edx, 2
jne 0x18012b91a
mov r11, qword [rsp + 0x80]
movzx ebx, ax
mov r8, r11
test r11, r11
je 0x18012bc2a
movzx edx, byte [r11]
movzx ebx, dx
imul bx, bx, 0x1e
test dl, dl
je 0x18012bc2a
nop
movzx eax, bx
movzx ecx, bx
inc r8
shl cx, 5
shr ax, 3
add cx, ax
movsx eax, dl
movzx edx, byte [r8]
add cx, ax
xor bx, cx
test dl, dl
jne 0x18012b8f0
jmp 0x18012bc2a
cmp edx, 5
jne 0x18012b9a8
mov r8d, dword [rsp + 0x88]
mov r9d, dword [rsp + 0x90]
cmp r8d, r9d
jne 0x18012b95b
cmp r8d, 1
je 0x18012bbd7
test r8d, r8d
jne 0x18012b95e
mov rdx, rdi
call sym.VBoxRT.dll_xmlExpFree
mov rax, qword [sym.VBoxRT.dll_emptyExp]
jmp 0x18012be0f
test r8d, r8d
jns 0x18012b974
mov rdx, rdi
call sym.VBoxRT.dll_xmlExpFree
mov rax, qword [sym.VBoxRT.dll_forbiddenExp]
jmp 0x18012be0f
cmp r9d, 0xffffffff
jne 0x18012b98f
mov r11, qword [rsp + 0x80]
lea ebx, [r8 + 0x4f]
add bx, word [rdi + 2]
jmp 0x18012bc3a
mov r11, qword [rsp + 0x80]
movzx ebx, r9w
sub bx, r8w
add bx, word [rdi + 2]
jmp 0x18012bc3a
cmp edx, 4
jne 0x18012bbbe
movzx ecx, byte [r8]
cmp cl, 1
je 0x18012bbe8
movzx eax, byte [r9]
cmp al, 1
jne 0x18012b9d9
mov rdx, r9
mov rcx, r10
call sym.VBoxRT.dll_xmlExpFree
mov rax, rdi
jmp 0x18012be0f
cmp r8, r9
jne 0x18012b9ea
dec dword [r8 + 4]
mov rax, r8
jmp 0x18012be0f
cmp cl, 4
jne 0x18012b9fc
cmp al, cl
je 0x18012ba03
mov rax, r8
mov rdi, r9
mov rsi, r8
movzx eax, byte [rsi]
cmp al, 4
jne 0x18012ba22
cmp rdi, qword [rsi + 0x10]
je 0x18012ba0f
cmp rdi, qword [rsi + 0x20]
jne 0x18012ba22
mov rdx, rdi
mov rcx, r10
call sym.VBoxRT.dll_xmlExpFree
mov rax, rsi
jmp 0x18012be0f
cmp byte [rdi], 4
jne 0x18012bab3
mov rcx, qword [rdi + 0x20]
cmp byte [rcx], 4
je 0x18012ba4a
mov rdx, qword [rdi + 0x10]
movzx eax, word [rdx + 2]
cmp word [rcx + 2], ax
jae 0x18012ba4a
mov qword [rdi + 0x20], rdx
mov qword [rdi + 0x10], rcx
mov rax, qword [rdi + 0x20]
xor ebx, ebx
mov r9, rsi
inc dword [rax + 4]
mov r8, qword [rdi + 0x20]
mov dword [rsp + 0x30], ebx
lea edx, [rbx + 4]
mov rcx, r10
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
call fcn.18012b890
mov rbp, qword [rsp + 0x60]
mov r9, rax
mov rax, qword [rdi + 0x10]
mov dword [rsp + 0x30], ebx
inc dword [rax + 4]
mov r8, qword [rdi + 0x10]
lea edx, [rbx + 4]
mov rcx, rbp
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
call fcn.18012b890
mov rdx, rdi
mov rcx, rbp
mov rbx, rax
call sym.VBoxRT.dll_xmlExpFree
mov rax, rbx
jmp 0x18012be0f
cmp al, 4
jne 0x18012bba1
mov rax, qword [rsi + 0x20]
movzx ecx, word [rdi + 2]
cmp cx, word [rax + 2]
jbe 0x18012bb2e
inc dword [rax + 4]
mov r8, qword [rsi + 0x20]
xor ebx, ebx
mov dword [rsp + 0x30], ebx
lea edx, [rbx + 4]
mov r9, rdi
mov rcx, r10
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
call fcn.18012b890
mov rbp, qword [rsp + 0x60]
mov dword [rsp + 0x30], ebx
mov r9, rax
mov rax, qword [rsi + 0x10]
lea edx, [rbx + 4]
inc dword [rax + 4]
mov r8, qword [rsi + 0x10]
mov rcx, rbp
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
call fcn.18012b890
mov rdx, rsi
mov rcx, rbp
mov rbx, rax
call sym.VBoxRT.dll_xmlExpFree
mov rax, rbx
jmp 0x18012be0f
mov rax, qword [rsi + 0x10]
cmp cx, word [rax + 2]
jbe 0x18012bbb4
mov rax, qword [rsi + 0x20]
xor ebx, ebx
mov r8, rdi
inc dword [rax + 4]
mov r9, qword [rsi + 0x20]
mov dword [rsp + 0x30], ebx
lea edx, [rbx + 4]
mov rcx, r10
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
call fcn.18012b890
mov rbp, qword [rsp + 0x60]
mov r9, rax
mov rax, qword [rsi + 0x10]
mov dword [rsp + 0x30], ebx
inc dword [rax + 4]
mov r8, qword [rsi + 0x10]
lea edx, [rbx + 4]
mov rcx, rbp
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
call fcn.18012b890
mov rdx, rsi
mov rcx, rbp
mov rbx, rax
call sym.VBoxRT.dll_xmlExpFree
mov rax, rbx
jmp 0x18012be0f
movzx eax, word [rsi + 2]
cmp word [rdi + 2], ax
jbe 0x18012bbb4
mov rax, rdi
mov rdi, rsi
mov rsi, rax
mov r8, rsi
mov ecx, 4
jmp 0x18012bc17
cmp edx, 3
jne 0x18012be0f
movzx eax, byte [r8]
cmp al, 1
jne 0x18012bbdf
mov rdx, r9
call sym.VBoxRT.dll_xmlExpFree
mov rax, rdi
jmp 0x18012be0f
movzx ecx, byte [r9]
cmp cl, 1
jne 0x18012bbfb
mov rdx, r8
mov rcx, r10
call sym.VBoxRT.dll_xmlExpFree
mov rax, rsi
jmp 0x18012be0f
test cl, cl
je 0x18012b9e2
test al, al
jne 0x18012bc0f
mov rax, r9
jmp 0x18012be0f
mov r8, r9
mov ecx, 3
mov rdx, rdi
call fcn.18012a7e0
mov r11, qword [rsp + 0x80]
movzx ebx, ax
mov r8d, dword [rsp + 0x88]
mov r9d, dword [rsp + 0x90]
mov rcx, qword [r10 + 8]
movzx eax, bx
cdq
idiv dword [r10 + 0x10]
movzx eax, dx
mov qword [rsp + 0x40], rax
cmp qword [rcx + rax*8], 0
je 0x18012bcbd
mov rcx, qword [rcx + rax*8]
test rcx, rcx
je 0x18012bcbd
nop
cmp word [rcx + 2], bx
jne 0x18012bcb4
movzx eax, byte [rcx]
cmp eax, ebp
jne 0x18012bcb4
cmp ebp, 2
jne 0x18012bc83
cmp r11, qword [rcx + 0x20]
jne 0x18012bcb4
inc dword [rcx + 4]
mov rax, rcx
jmp 0x18012be0f
cmp ebp, 5
jne 0x18012bca8
cmp dword [rcx + 0x20], r8d
jne 0x18012bcb4
cmp dword [rcx + 0x24], r9d
jne 0x18012bcb4
cmp qword [rcx + 0x10], rdi
jne 0x18012bcb4
inc dword [rcx + 4]
dec dword [rdi + 4]
mov rax, rcx
jmp 0x18012be0f
cmp qword [rcx + 0x10], rdi
jne 0x18012bcb4
cmp qword [rcx + 0x20], rsi
je 0x18012bd28
mov rcx, qword [rcx + 0x18]
test rcx, rcx
jne 0x18012bc60
cmp dword [r10 + 0x18], 0x2710
jge 0x18012be0d
mov ecx, 0x28
call qword [sym.VBoxRT.dll_xmlMalloc]
mov r11, rax
test rax, rax
je 0x18012be0d
mov rcx, qword [rsp + 0x60]
xor eax, eax
mov qword [r11], rax
mov qword [r11 + 8], rax
mov qword [r11 + 0x10], rax
mov qword [r11 + 0x20], rax
mov byte [r11], bpl
mov qword [r11 + 0x18], rax
inc dword [rcx + 0x18]
inc dword [rcx + 0x30]
mov word [r11 + 2], bx
cmp ebp, 2
jne 0x18012bd39
mov rax, qword [rsp + 0x80]
mov dword [r11 + 8], 1
mov qword [r11 + 0x20], rax
jmp 0x18012bddd
inc dword [rcx + 4]
dec dword [rdi + 4]
dec dword [rsi + 4]
mov rax, rcx
jmp 0x18012be0f
mov qword [r11 + 0x10], rdi
cmp ebp, 5
jne 0x18012bd77
mov eax, dword [rsp + 0x88]
mov edx, dword [rsp + 0x90]
mov dword [r11 + 0x20], eax
mov dword [r11 + 0x24], edx
test eax, eax
je 0x18012bd62
test byte [rdi + 1], 1
je 0x18012bd67
or byte [r11 + 1], 1
test edx, edx
js 0x18012bdd5
mov eax, dword [rdi + 8]
imul eax, edx
mov dword [r11 + 8], eax
jmp 0x18012bddd
mov qword [r11 + 0x20], rsi
cmp ebp, 4
jne 0x18012bdac
test byte [rdi + 1], 1
jne 0x18012bd8c
test byte [rsi + 1], 1
je 0x18012bd91
or byte [r11 + 1], 1
mov edx, dword [rdi + 8]
cmp edx, 0xffffffff
je 0x18012bdd5
mov eax, dword [rsi + 8]
cmp eax, 0xffffffff
je 0x18012bdd5
cmp edx, eax
cmovg eax, edx
mov dword [r11 + 8], eax
jmp 0x18012bddd
test byte [rdi + 1], 1
je 0x18012bdbd
test byte [rsi + 1], 1
je 0x18012bdbd
or byte [r11 + 1], 1
mov edx, dword [rdi + 8]
cmp edx, 0xffffffff
je 0x18012bdd5
mov eax, dword [rsi + 8]
cmp eax, 0xffffffff
je 0x18012bdd5
add eax, edx
mov dword [r11 + 8], eax
jmp 0x18012bddd
mov dword [r11 + 8], 0xffffffff
mov rdx, qword [rsp + 0x40]
mov dword [r11 + 4], 1
mov rax, qword [rcx + 8]
cmp qword [rax + rdx*8], 0
je 0x18012bdfd
mov rax, qword [rax + rdx*8]
mov qword [r11 + 0x18], rax
mov rax, qword [rcx + 8]
mov qword [rax + rdx*8], r11
inc dword [rcx + 0x14]
mov rax, r11
jmp 0x18012be0f
xor eax, eax
mov rbx, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
add rsp, 0x50
pop rdi
ret