Function at 0x140301130
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov ebp, dword [rsp + 0xc0]
mov r13d, dword [rsp + 0xb0]
mov eax, dword [rcx]
mov esi, dword [rcx + 0x14]
mov edi, ebp
mov r12, rcx
mov qword [rsp + 0x98], rdx
sub edi, 1
mov dword [rsp + 0xa0], r8d
mov r14d, r13d
mov dword [rsp + 0xa8], r9d
mov dword [rsp + 0x2c], eax
mov dword [rsp + 0x3c], edi
js 0x140301710
mov rbx, qword [rsp + 0xb8]
movsxd rdx, edi
movsxd rax, ebp
add rdx, qword [rsp + 0xb8]
lea rcx, [rbx + rax - 2]
mov eax, edi
sub rcx, rax
mov eax, 0xd
nop word [rax + rax]
lea r8d, [rax*8]
sub rdx, 1
xor eax, r8d
movzx r8d, byte [rdx + 1]
xor eax, r8d
cmp rcx, rdx
jne 0x1403011b0
lea edx, [rax*8]
movzx edi, r13b
xor eax, edx
xor edx, edx
mov rbx, qword [r12 + 0x20]
xor eax, edi
mov dword [rsp + 0x38], edi
div esi
mov qword [rsp + 0x30], rbx
mov eax, edx
mov dword [rsp + 0x28], edx
mov rbx, qword [rbx + rax*8]
lea rdi, [rax*8]
test rbx, rbx
je 0x140301390
movsxd r15, ebp
jmp 0x14030121c
mov rbx, qword [rbx]
test rbx, rbx
je 0x140301390
cmp byte [rbx + 0x30], r14b
jne 0x140301210
cmp dword [rbx + 0x1c], ebp
jne 0x140301210
mov rdx, qword [rsp + 0xb8]
lea rcx, [rbx + 0x31]
mov r8, r15
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x140301210
mov esi, dword [rbx + 0x10]
mov r8d, eax
mov ebp, dword [rbx + 0x18]
mov eax, esi
sub eax, ebp
cmp eax, 0x15
jle 0x1403014e8
mov esi, ebp
mov rax, qword [rbx + 0x28]
neg esi
cmp rax, qword [rsp + 0x98]
je 0x1403014a2
mov rdi, qword [rsp + 0x98]
xor r8d, r8d
mov rcx, r12
mov rdx, rbx
sub rdi, rax
call fcn.14027c870
movsxd rax, dword [rbx + 0x18]
cmp rdi, 0x7f
lea rcx, [rbx + rax]
jbe 0x140301702
cmp rdi, 0x3fff
jbe 0x1403016b6
mov rdx, rdi
call fcn.1402b6e40
mov r8d, eax
add r8d, dword [rbx + 0x18]
mov rax, qword [rsp + 0x98]
movd xmm1, r8d
mov qword [rbx + 0x28], rax
pshufd xmm0, xmm1, 0xe0
movq qword [rbx + 0x14], xmm0
mov eax, dword [r12]
cmp eax, 1
je 0x1403016d8
mov r9d, dword [rsp + 0xa0]
mov edi, eax
add r8d, 1
mov dword [rbx + 0x24], 0
neg edi
mov dword [rbx + 0x18], r8d
sbb dx, dx
mov word [rbx + 0x22], dx
test r9d, r9d
js 0x14030154f
movsx edx, dx
cmp dword [rsp + 0xa0], edx
mov ebp, r8d
mov edi, 1
je 0x14030133b
test eax, eax
je 0x14030172d
movzx eax, word [rsp + 0xa0]
mov word [rbx + 0x22], ax
mov eax, dword [rsp + 0xa0]
mov dword [rsp + 0xa8], eax
mov eax, dword [rsp + 0xa8]
movsxd rbp, ebp
sub eax, dword [rbx + 0x24]
add rbp, rbx
add eax, 2
movsxd rdx, eax
cmp rdx, 0x7f
jbe 0x14030171f
cmp rdx, 0x3fff
jbe 0x14030176e
mov rcx, rbp
call fcn.1402b6e40
mov r8d, eax
add r8d, dword [rbx + 0x18]
mov eax, dword [rsp + 0xa8]
mov dword [rbx + 0x18], r8d
add r8d, esi
mov dword [rbx + 0x24], eax
jmp 0x140301556
mov eax, dword [r12 + 0x10]
add eax, eax
cmp esi, eax
jle 0x140301562
call fcn.14035b5c0
test eax, eax
mov esi, eax
jne 0x140301539
movsxd r15, ebp
mov eax, pe_nt_image_headers64
lea rdx, [r15 + 0x72]
cmp rdx, rax
cmovl rdx, rax
mov rcx, rdx
mov qword [rsp + 0x30], rdx
call fcn.140312ca0
test rax, rax
mov rbx, rax
je 0x140301539
mov rdx, qword [rsp + 0x30]
xor eax, eax
mov ecx, 6
mov rdi, rbx
rep stosq qword [rdi], rax
lea rcx, [rbx + 0x31]
mov byte [rbx + 0x30], r13b
mov r8, r15
mov dword [rbx + 0x10], edx
mov rdx, qword [rsp + 0xb8]
call sub.msvcrt.dll_memcpy
mov dword [rbx + 0x1c], ebp
mov r14d, dword [rsp + 0x28]
add ebp, 0x32
mov byte [rbx + r15 + 0x31], 0
mov rax, qword [r12 + 0x20]
mov dword [rbx + 0x18], ebp
movsxd rbp, ebp
lea rcx, [rbx + rbp]
lea rax, [rax + r14*8]
mov rdx, qword [rax]
mov qword [rbx], rdx
mov qword [rax], rbx
add dword [r12 + 0x10], 1
cmp qword [rsp + 0x98], 0x7f
jbe 0x14030178d
cmp qword [rsp + 0x98], 0x3fff
jbe 0x1403017a1
mov rdx, qword [rsp + 0x98]
call fcn.1402b6e40
mov ebp, eax
add ebp, dword [rbx + 0x18]
mov rax, qword [rsp + 0x98]
movd xmm2, ebp
mov qword [rbx + 0x28], rax
pshufd xmm0, xmm2, 0xe0
movq qword [rbx + 0x14], xmm0
mov eax, dword [r12]
cmp eax, 1
je 0x14030149f
add ebp, 1
neg eax
sbb ax, ax
mov dword [rbx + 0x18], ebp
mov word [rbx + 0x22], ax
mov r8d, ebp
mov ecx, dword [rsp + 0xa0]
test ecx, ecx
js 0x140301552
mov eax, dword [r12]
cmp eax, 1
je 0x1403016ea
mov edx, dword [rsp + 0x2c]
xor edi, edi
test edx, edx
movsx edx, word [rbx + 0x22]
sete dil
cmp edx, dword [rsp + 0xa0]
jne 0x140301319
lea r8d, [rsi + rbp]
test edi, edi
je 0x140301556
jmp 0x14030133b
mov dword [rsp + 0x28], r8d
call fcn.14035b5c0
test eax, eax
jne 0x140301539
add esi, esi
mov rcx, rbx
movsxd rdx, esi
call fcn.14031cee0
test rax, rax
je 0x140301539
add rdi, qword [r12 + 0x20]
mov dword [rax + 0x10], esi
mov r8d, dword [rsp + 0x28]
mov rdx, qword [rdi]
cmp rbx, rdx
je 0x14030152b
nop dword [rax]
mov rdi, rdx
mov rdx, qword [rdx]
cmp rdx, rbx
jne 0x140301520
mov ebp, dword [rax + 0x18]
mov qword [rdi], rax
mov rbx, rax
jmp 0x140301255
mov eax, 7
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
sub r8d, ebp
mov byte [rbx + 0x20], 1
mov rax, qword [r12 + 8]
add dword [rax], r8d
xor eax, eax
jmp 0x14030153e
call fcn.14035b5c0
test eax, eax
jne 0x140301539
add esi, esi
movsxd rax, esi
lea rdi, [rax*8]
mov rcx, rdi
call fcn.140312ca0
test rax, rax
mov rbx, rax
je 0x140301539
xor edx, edx
mov r8, rdi
mov rcx, rax
call sub.msvcrt.dll_memset
movsxd rax, dword [r12 + 0x14]
test eax, eax
jle 0x140301636
mov rdi, qword [rsp + 0x30]
lea r15, [rdi + rax*8]
mov r14, rdi
nop
mov rdi, qword [r14]
test rdi, rdi
je 0x140301629
nop dword [rax + rax]
mov rax, qword [rdi]
lea rcx, [rdi + 0x30]
mov qword [r14], rax
call sub.msvcrt.dll_strlen
mov edx, eax
sub edx, 1
js 0x1403016f8
cdqe
movsxd rcx, edx
mov edx, edx
lea r8, [rdi + rax - 2]
add rcx, rdi
mov eax, 0xd
sub r8, rdx
nop dword [rax]
lea edx, [rax*8]
sub rcx, 1
xor eax, edx
movzx edx, byte [rcx + 0x31]
xor eax, edx
cmp r8, rcx
jne 0x1403015f8
xor edx, edx
div esi
lea rax, [rbx + rdx*8]
mov rdx, qword [rax]
mov qword [rdi], rdx
mov qword [rax], rdi
mov rdi, qword [r14]
test rdi, rdi
jne 0x1403015c0
add r14, 8
cmp r14, r15
jne 0x1403015b0
mov rcx, qword [rsp + 0x30]
call fcn.14035ad80
mov edi, dword [rsp + 0x3c]
mov dword [r12 + 0x14], esi
mov qword [r12 + 0x20], rbx
test edi, edi
js 0x1403017cd
mov rbx, qword [rsp + 0xb8]
movsxd rcx, edi
movsxd rax, ebp
add rcx, qword [rsp + 0xb8]
lea r8, [rbx + rax - 2]
mov eax, edi
sub r8, rax
mov eax, 0xd
nop dword [rax + rax]
lea edx, [rax*8]
sub rcx, 1
xor eax, edx
movzx edx, byte [rcx + 1]
xor eax, edx
cmp rcx, r8
jne 0x140301680
lea edx, [rax*8]
mov edi, dword [rsp + 0x38]
xor eax, edx
xor edx, edx
xor edi, eax
mov eax, edi
div esi
mov dword [rsp + 0x28], edx
jmp 0x14030139f
mov rdx, rdi
xor eax, eax
mov r8d, 2
shr rdx, 7
mov al, dl
mov edx, edi
or al, 0x80
and edx, 0x7f
mov ah, dl
mov word [rcx], ax
jmp 0x1403012ae
mov eax, dword [rsp + 0xa0]
sub r8d, ebp
test eax, eax
js 0x140301552
mov byte [rbx + 0x21], 1
jmp 0x140301556
mov eax, 0xd
jmp 0x140301610
mov byte [rcx], dil
mov r8d, 1
jmp 0x1403012ae
mov edx, 0x68
mov eax, 0xd
jmp 0x1403011d3
mov byte [rbp], al
mov r8d, 1
jmp 0x140301373
lea eax, [rbp + 1]
movsxd rbp, ebp
movsxd rdx, dword [rsp + 0xa0]
mov dword [rbx + 0x18], eax
mov byte [rbx + rbp], 1
movsxd rcx, dword [rbx + 0x18]
add rcx, rbx
call fcn.14031ce50
add eax, dword [rbx + 0x18]
mov dword [rbx + 0x24], 0
mov ebp, eax
mov dword [rbx + 0x18], eax
movzx eax, word [rsp + 0xa0]
mov word [rbx + 0x22], ax
jmp 0x1403014db
xor ecx, ecx
shr rdx, 7
and eax, 0x7f
mov cl, dl
mov r8d, 2
or cl, 0x80
mov ch, al
mov word [rbp], cx
jmp 0x140301373
movzx eax, byte [rsp + 0x98]
mov ebp, 1
mov byte [rcx], al
jmp 0x14030146a
mov rdx, qword [rsp + 0x98]
xor eax, eax
mov ebp, 2
shr rdx, 7
mov al, dl
movzx edx, byte [rsp + 0x98]
or al, 0x80
and edx, 0x7f
mov ah, dl
mov word [rcx], ax
jmp 0x14030146a
mov edx, 0x68
mov eax, 0xd
jmp 0x14030169f