Function at 0x140031932
Capabilities:
Encode data using base64

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x148
test r8b, 3
je 0x140031967
mov byte [rcx + 8], 0
and qword [rcx], 0
add rsp, 0x148
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
cmp r8, 2
jb 0x1400319e8
movzx esi, byte [r8 + rdx - 1]
movzx r10d, byte [r8 + rdx - 2]
mov eax, 0x3c
mov edi, 0x3c
sub edi, r10d
mov r11d, 0x1c2
add r10d, r11d
and r10d, edi
sub eax, esi
add esi, r11d
and esi, eax
mov edi, esi
shr edi, 8
and edi, 1
bt r10d, 8
mov eax, edi
adc ax, 0
movzx r11d, ax
mov rax, r8
sub rax, r11
test r11w, r11w
je 0x1400319f0
cmp r11d, 1
je 0x140031d46
cmp r11d, 2
jne 0x14003194b
movzx r11d, si
movzx r10d, r10w
and r10d, r11d
xor esi, esi
bt r10d, 8
setae sil
jmp 0x1400319f2
xor eax, eax
test r8, r8
setne al
xor esi, esi
cmp rax, r8
ja 0x1400321b9
mov r10, rax
shr r10, 2
mov r11d, eax
and r11d, 3
lea r10, [r10 + r10*2]
lea edi, [r11 + r11*2]
shr edi, 2
add rdi, r10
cmp rdi, qword [rsp + 0x1b0]
jbe 0x140031a2a
mov byte [rcx + 8], 1
jmp 0x14003194f
mov qword [rsp + 0x68], r8
mov qword [rsp + 0x40], rcx
and rax, 0xfffffffffffffffc
lea rcx, [rdx + rax]
lea r8, [rsp + 0xd0]
mov qword [rsp + 0x58], rdx
mov qword [r8], rdx
mov qword [r8 + 8], rax
mov qword [r8 + 0x10], rcx
mov qword [r8 + 0x18], r11
mov qword [r8 + 0x20], 4
mov ecx, 3
mov rax, rdi
xor edx, edx
div rcx
mov qword [rsp + 0x48], rdi
sub rdi, rdx
lea rcx, [r9 + rdi]
lea r8, [rsp + 0xf8]
mov qword [rsp + 0x60], r9
mov qword [r8 + 0x10], r9
mov qword [r8 + 0x18], rdi
mov qword [r8], rcx
mov qword [r8 + 8], rdx
mov qword [r8 + 0x20], 3
lea rcx, [rsp + 0x98]
lea rdx, [rsp + 0xd0]
lea r8, [rsp + 0xf8]
call fcn.140031854
mov r12, qword [rsp + 0x98]
test r12, r12
je 0x140031b9d
mov r13, qword [rsp + 0xa0]
test r13, r13
je 0x1400321b9
mov r14, qword [rsp + 0xa8]
mov rbp, qword [rsp + 0xb0]
mov cl, byte [r12]
call fcn.1400318a9
cmp r13, 1
je 0x1400321b9
mov edi, eax
mov cl, byte [r12 + 1]
call fcn.1400318a9
cmp r13, 2
jbe 0x1400321b9
mov ebx, eax
mov cl, byte [r12 + 2]
call fcn.1400318a9
cmp r13, 3
je 0x1400321b9
mov r15d, eax
mov cl, byte [r12 + 3]
call fcn.1400318a9
test rbp, rbp
je 0x1400321b9
lea ecx, [rdi*4]
movzx edx, bx
shr edx, 4
or edx, ecx
mov byte [r14], dl
cmp rbp, 1
je 0x1400321b9
mov ecx, ebx
shl ecx, 4
movzx edx, r15w
shr edx, 2
or edx, ecx
mov byte [r14 + 1], dl
cmp rbp, 2
jbe 0x1400321b9
mov ecx, r15d
shl ecx, 6
or ecx, eax
mov byte [r14 + 2], cl
or ebx, edi
or r15d, eax
or r15d, ebx
shr r15d, 8
and r15d, 1
or esi, r15d
jmp 0x140031a9d
mov rdx, qword [rsp + 0xe0]
mov rbp, qword [rsp + 0xe8]
mov rax, qword [rsp + 0xf8]
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x100]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x54], 0x41414141
cmp rbp, 5
jae 0x1400321b9
lea r13, [rsp + 0x54]
mov rcx, r13
mov r8, rbp
call sub.msvcrt.dll_memcpy
mov cl, byte [r13]
call fcn.1400318a9
mov edi, eax
mov cl, byte [r13 + 1]
call fcn.1400318a9
mov ebx, eax
movzx r14d, ax
mov cl, byte [r13 + 2]
call fcn.1400318a9
mov r15d, eax
movzx r12d, ax
mov cl, byte [r13 + 3]
call fcn.1400318a9
lea ecx, [rdi*4]
shr r14d, 4
or r14d, ecx
mov byte [rsp + 0x31], r14b
mov ecx, ebx
shl ecx, 4
shr r12d, 2
or r12d, ecx
mov byte [rsp + 0x32], r12b
mov ecx, r15d
shl ecx, 6
or ecx, eax
mov byte [rsp + 0x33], cl
mov r8, qword [rsp + 0x38]
cmp r8, 4
jae 0x1400321b9
or ebx, edi
or eax, r15d
or eax, ebx
shr eax, 8
and eax, 1
xor edi, edi
cmp rbp, 1
sete dil
or edi, eax
lea rdx, [rsp + 0x31]
mov rcx, qword [rsp + 0x70]
call sub.msvcrt.dll_memcpy
or di, si
mov rcx, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x48]
je 0x140031ca4
mov rax, qword [rsp + 0x40]
mov byte [rax + 8], 0
and qword [rax], 0
jmp 0x140031953
mov rax, rsi
or rax, rcx
mov r11, qword [rsp + 0x40]
je 0x1400321ca
xor r9d, r9d
mov rax, rcx
sub rax, 1
mov r12d, 0
cmovae r12, rax
and r12, 0xfffffffffffffffc
cmp r12, rcx
ja 0x140031d39
xor r9d, r9d
mov r10, qword [rsp + 0x48]
mov rcx, r10
sub rcx, 1
cmovb rcx, r9
mov r8d, 3
mov rax, rcx
xor edx, edx
div r8
sub rcx, rdx
mov r8, r10
sub r8, rcx
jb 0x140031d39
and dword [rsp + 0x34], 0
mov rax, r8
shr rax, 0x3e
jne 0x140031d36
lea rax, [r8*4]
mov r10d, 3
xor edx, edx
div r10
add rax, 3
movabs r9, 0x7ffffffffffffffc
and r9, rax
cmp r9, 4
jbe 0x140031d51
mov r9b, 1
mov byte [r11 + 8], r9b
and qword [r11], 0
jmp 0x140031953
movzx esi, di
xor esi, 1
jmp 0x1400319f2
add r12, qword [rsp + 0x58]
add rcx, qword [rsp + 0x60]
mov rax, r8
xor edx, edx
div r10
sub r8, rdx
lea rbp, [rsp + 0x120]
mov qword [rbp], rcx
add rcx, r8
mov qword [rbp + 8], r8
mov qword [rbp + 0x10], rcx
mov qword [rbp + 0x18], rdx
lea rcx, [rsp + r9]
add rcx, 0x34
lea rax, [rsp + 0x34]
lea r13, [rsp + 0x98]
mov qword [r13 + 0x10], rax
mov qword [r13 + 0x18], r9
mov qword [rsp + 0x38], rcx
mov qword [r13], rcx
and qword [r13 + 8], 0
mov qword [rbp + 0x20], 3
mov qword [r13 + 0x20], 4
lea rsi, [0x14008bee0]
lea rcx, [rsp + 0x78]
mov rdx, rbp
mov r8, r13
call fcn.140031854
mov rdx, qword [rsp + 0x78]
test rdx, rdx
je 0x140031f9f
mov rax, qword [rsp + 0x80]
test rax, rax
je 0x1400321b9
cmp rax, 1
je 0x1400321b9
cmp rax, 2
jbe 0x1400321b9
mov rax, qword [rsp + 0x88]
mov rcx, qword [rsp + 0x90]
movzx r9d, byte [rdx]
movzx r8d, byte [rdx + 1]
movzx edx, byte [rdx + 2]
movzx r9d, r9w
mov r10d, r9d
shr r10d, 2
mov r11d, r10d
add r11d, 0x41
mov edi, 0x10
mov rbx, rsi
test rdi, rdi
je 0x140031e71
movzx r14d, byte [rbx + 1]
test byte [rbx], 1
mov r15d, r10d
cmove r15d, r11d
sub r14d, r15d
movsx r14d, r14w
shr r14d, 8
and r14w, word [rbx + 2]
add rbx, 4
add r14d, r11d
add rdi, 0xfffffffffffffffc
mov r11d, r14d
jmp 0x140031e3d
test rcx, rcx
je 0x1400321b9
mov byte [rax], r11b
shl r9d, 4
movzx r8d, r8w
mov r11d, r8d
shr r11d, 4
and r9d, 0x30
lea r10d, [r11 + r9]
add r10d, 0x41
or r11d, r9d
mov r9d, 0x10
mov rdi, rsi
test r9, r9
je 0x140031ed4
movzx ebx, byte [rdi + 1]
test byte [rdi], 1
mov r14d, r11d
cmove r14d, r10d
sub ebx, r14d
movsx ebx, bx
shr ebx, 8
and bx, word [rdi + 2]
add rdi, 4
add ebx, r10d
add r9, 0xfffffffffffffffc
mov r10d, ebx
jmp 0x140031ea4
cmp rcx, 1
je 0x1400321b9
mov byte [rax + 1], r10b
movzx edx, dx
mov r10d, edx
shr r10d, 6
and r8d, 0xf
lea r9d, [r10 + r8*4]
lea r8d, [r10 + r8*4]
add r8d, 0x41
mov r10d, 0x10
mov r11, rsi
test r10, r10
je 0x140031f37
movzx edi, byte [r11 + 1]
test byte [r11], 1
mov ebx, r9d
cmove ebx, r8d
sub edi, ebx
movsx edi, di
shr edi, 8
and di, word [r11 + 2]
add r11, 4
add edi, r8d
add r10, 0xfffffffffffffffc
mov r8d, edi
jmp 0x140031f05
cmp rcx, 2
jbe 0x1400321b9
mov byte [rax + 2], r8b
and edx, 0x3f
mov r8d, edx
add r8d, 0x41
mov r9d, 0x10
mov r10, rsi
test r9, r9
je 0x140031f8c
movzx r11d, byte [r10 + 1]
test byte [r10], 1
mov edi, edx
cmove edi, r8d
sub r11d, edi
movsx r11d, r11w
shr r11d, 8
and r11w, word [r10 + 2]
add r10, 4
add r11d, r8d
add r9, 0xfffffffffffffffc
mov r8d, r11d
jmp 0x140031f58
cmp rcx, 3
je 0x1400321b9
mov byte [rax + 3], r8b
jmp 0x140031dc3
mov rax, qword [rsp + 0xb0]
mov rbx, qword [rsp + 0xb8]
sub rax, rbx
jb 0x14003215c
mov rdx, qword [rsp + 0x130]
mov r13, qword [rsp + 0x138]
mov rsi, qword [rsp + 0xa8]
lea rcx, [rsi + rbx]
mov qword [rsp + 0xa8], rcx
mov qword [rsp + 0xb0], rax
test rsi, rsi
je 0x14003215c
mov byte [rsp + 0x7a], 0
and word [rsp + 0x78], 0
cmp r13, 4
jae 0x1400321b9
lea rdi, [rsp + 0x78]
mov rcx, rdi
mov r8, r13
call sub.msvcrt.dll_memcpy
movzx edx, byte [rdi]
movzx ecx, byte [rdi + 1]
movzx eax, byte [rdi + 2]
mov r8d, edx
shr r8d, 2
mov r9d, r8d
add r9d, 0x41
lea r11, [0x14008bee0]
mov r10d, 0x10
test r10, r10
je 0x14003206a
movzx edi, byte [r11 + 1]
test byte [r11], 1
mov ebp, r8d
cmove ebp, r9d
sub edi, ebp
movsx edi, di
shr edi, 8
and di, word [r11 + 2]
add r11, 4
add edi, r9d
add r10, 0xfffffffffffffffc
mov r9d, edi
jmp 0x140032038
test rbx, rbx
je 0x1400321b9
mov byte [rsi], r9b
movzx r9d, dx
shl r9d, 4
movzx ecx, cx
mov r8d, ecx
shr r8d, 4
and r9d, 0x30
lea edx, [r8 + r9]
add edx, 0x41
or r8d, r9d
lea r10, [0x14008bee0]
mov r9d, 0x10
test r9, r9
je 0x1400320d7
movzx r11d, byte [r10 + 1]
test byte [r10], 1
mov edi, r8d
cmove edi, edx
sub r11d, edi
movsx r11d, r11w
shr r11d, 8
and r11w, word [r10 + 2]
add r10, 4
add r11d, edx
add r9, 0xfffffffffffffffc
mov edx, r11d
jmp 0x1400320a3
cmp rbx, 1
je 0x1400321b9
mov byte [rsi + 1], dl
movzx eax, ax
shr eax, 6
and ecx, 0xf
lea edx, [rax + rcx*4]
lea eax, [rax + rcx*4]
add eax, 0x41
lea r8, [0x14008bee0]
mov ecx, 0x10
test rcx, rcx
je 0x140032137
movzx r9d, byte [r8 + 1]
test byte [r8], 1
mov r10d, edx
cmove r10d, eax
sub r9d, r10d
movsx r9d, r9w
shr r9d, 8
and r9w, word [r8 + 2]
add r8, 4
add r9d, eax
add rcx, 0xfffffffffffffffc
mov eax, r9d
jmp 0x140032102
cmp rbx, 2
jbe 0x1400321b9
mov byte [rsi + 2], al
cmp rbx, 3
je 0x1400321b9
cmp r13, 1
movzx eax, al
mov ecx, 0x3d
cmovne ecx, eax
mov byte [rsi + 2], cl
mov byte [rsi + 3], 0x3d
mov rax, qword [rsp + 0x58]
add rax, qword [rsp + 0x68]
mov qword [rsp + 0x20], rax
lea rdi, [rsp + 0x98]
lea rdx, [rsp + 0x34]
mov rcx, rdi
mov r8, qword [rsp + 0x38]
mov r9, r12
call fcn.1400317ff
mov rax, qword [rdi + 0x28]
mov rcx, qword [rdi + 0x20]
mov rdx, qword [rdi]
mov r9, qword [rdi + 0x10]
xor r8d, r8d
mov r11, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
cmp rax, rcx
je 0x1400321bd
mov r10b, byte [r9 + rcx]
xor r10b, byte [rdx + rcx]
or r8b, r10b
inc rcx
jmp 0x1400321a4
ud2
test r8b, r8b
je 0x1400321ca
xor r9d, r9d
jmp 0x140031d39
mov rax, qword [rsp + 0x60]
mov qword [r11], rax
mov qword [r11 + 8], rsi
jmp 0x140031953