Function at 0x140005b00
Capabilities:
Encode data using base64

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov rsi, rcx
mov rcx, qword [r8]
mov ebp, edx
mov rdi, r8
call sym.sqlite3_value_bytes
mov rcx, rsi
mov ebx, eax
call sym.sqlite3_context_db_handle
mov r8d, 0xffffffff
xor edx, edx
mov rcx, rax
call sym.sqlite3_limit
mov r12d, eax
cmp ebp, 1
je 0x140005b58
mov r8d, 0x1291
lea rdx, str.shell.c
lea rcx, str.na1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__assert]
mov rcx, qword [rdi]
call sym.sqlite3_value_type
cmp eax, 3
je 0x140005cb0
cmp eax, 4
jne 0x140005c88
lea ecx, [rbx*4]
mov r8d, 0xffffffff
lea edx, [rcx + 0x47]
movsxd rax, edx
sar edx, 0x1f
imul rax, rax, 0x38e38e39
sar rax, 0x24
sub eax, edx
lea rdx, str.blob_expanded_to_base64_too_big
lea ebp, [rcx + rax + 1]
cmp r12d, ebp
jl 0x140005c95
mov rcx, qword [rdi]
call sym.sqlite3_value_blob
mov rdi, rax
test rax, rax
je 0x140005e48
mov ecx, ebp
call sym.sqlite3_malloc
mov rdx, rax
test rax, rax
je 0x140005e78
mov r8, rax
cmp ebx, 2
jle 0x140005ed0
xor r9d, r9d
lea rcx, str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_
jmp 0x140005c01
test ebx, ebx
je 0x140005c70
add r8, 4
cmp ebx, 2
jle 0x140005ed0
movzx eax, byte [rdi]
add r9d, 4
sub ebx, 3
add rdi, 3
shr al, 2
and eax, 0x3f
movzx eax, byte [rcx + rax]
mov byte [r8], al
movzx eax, byte [rdi - 2]
movzx r10d, byte [rdi - 3]
shr al, 4
shl r10d, 4
or eax, r10d
and eax, 0x3f
movzx eax, byte [rcx + rax]
mov byte [r8 + 1], al
movzx eax, byte [rdi - 2]
movzx r10d, byte [rdi - 1]
shl eax, 2
and eax, 0x3c
shr r10b, 6
or eax, r10d
and eax, 0x3f
movzx eax, byte [rcx + rax]
mov byte [r8 + 2], al
movzx eax, byte [rdi - 1]
and eax, 0x3f
movzx eax, byte [rcx + rax]
mov byte [r8 + 3], al
cmp r9d, 0x47
jle 0x140005bf0
mov byte [r8 + 4], 0xa
xor r9d, r9d
add r8, 5
jmp 0x140005bf8
mov r8d, 0xffffffff
lea rdx, str.base64_accepts_only_blob_or_text
mov rcx, rsi
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp sym.sqlite3_result_error
mov edx, ebx
lea eax, [rbx + 6]
mov r8d, 0xffffffff
add edx, 3
cmovns eax, edx
lea rdx, str.blob_from_base64_may_be_too_big
sar eax, 2
lea ebp, [rax + rax*2]
cmp r12d, ebp
jl 0x140005c95
mov rcx, qword [rdi]
call sym.sqlite3_value_text
mov rdi, rax
test rax, rax
je 0x140005e1d
test ebp, ebp
mov eax, 1
cmovg eax, ebp
mov ecx, eax
call sym.sqlite3_malloc
mov r10, rax
test rax, rax
je 0x140005e78
test ebx, ebx
jle 0x140005f80
movsxd rax, ebx
cmp byte [rdi + rax - 1], 0xa
je 0x140005f69
mov r9, r10
lea r11, [0x14015a74e]
lea r8, [0x14015ebe0]
nop dword [rax + rax]
cmp byte [rdi], 0x3d
je 0x140005df6
mov ecx, ebx
mov rax, rdi
add rcx, rdi
jmp 0x140005d5a
js 0x140005d51
cmp byte [r8 + rdx], 0
jns 0x140005d62
add rax, 1
cmp rax, rcx
je 0x140005d62
movsx rdx, byte [rax]
test dl, dl
jne 0x140005d48
mov edx, eax
mov r12d, 4
sub edx, edi
mov rdi, rax
sub ebx, edx
cmp ebx, r12d
cmovle r12d, ebx
movsxd rax, r12d
sub ebx, r12d
movsx ebp, byte [r11 + rax]
test ebp, ebp
je 0x140005df6
xor edx, edx
xor ecx, ecx
xor eax, eax
cmp ecx, r12d
jge 0x140005dc0
movsx rax, byte [rdi]
lea r13, [rdi + 1]
test al, al
js 0x140005db8
movzx eax, byte [r8 + rax]
cmp al, 0x81
je 0x140005ea0
cmp al, 0x82
jne 0x140005e90
mov r12d, ecx
xor ebx, ebx
sub ebp, 1
mov rdi, r13
xor eax, eax
shl edx, 6
add ecx, 1
or edx, eax
cmp ecx, 4
jne 0x140005d8b
cmp ebp, 2
je 0x140005eb4
cmp ebp, 3
je 0x140005eb0
cmp ebp, 1
je 0x140005ebb
movsxd rax, ebp
add r9, rax
test ebx, ebx
jg 0x140005d30
mov ebx, r9d
sub ebx, r10d
lea r9, [sym.sqlite3_free]
mov r8d, ebx
mov rdx, r10
mov rcx, rsi
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp sym.sqlite3_result_blob
mov rcx, rsi
call sym.sqlite3_context_db_handle
mov rcx, rax
call sym.sqlite3_errcode
cmp eax, 7
je 0x140005e78
xor edx, edx
mov rcx, rsi
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp sym.sqlite3_result_zeroblob
mov rcx, rsi
call sym.sqlite3_context_db_handle
mov rcx, rax
call sym.sqlite3_errcode
cmp eax, 7
je 0x140005e78
xor r9d, r9d
mov r8d, 0xffffffff
lea rdx, [0x140150568]
jmp 0x140005f43
mov r8d, 0xffffffff
lea rdx, str.base64_OOM
jmp 0x140005c95
mov rdi, r13
cmp al, 0x80
je 0x140005db8
jmp 0x140005dc0
mov r12d, ecx
jmp 0x140005db8
mov byte [r9 + 2], dl
movzx eax, dh
mov byte [r9 + 1], al
shr edx, 0x10
mov byte [r9], dl
jmp 0x140005de8
test ebx, ebx
jle 0x140005f35
lea r10d, [rbx + 1]
cmp ebx, 2
je 0x140005f57
movzx r9d, byte [rdi]
shl r9d, 8
shl r9d, 8
movzx r10d, r10b
mov eax, 3
lea rcx, str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_
cmp r10d, eax
jg 0x140005f10
mov byte [r8 + rax], 0x3d
sub rax, 1
shr r9d, 6
cmp r10d, eax
jle 0x140005efe
mov r11d, r9d
and r11d, 0x3f
movzx r11d, byte [rcx + r11]
mov byte [r8 + rax], r11b
sub rax, 1
jb 0x140005f2c
shr r9d, 6
jmp 0x140005ef9
mov byte [r8 + 4], 0xa
add r8, 5
mov byte [r8], 0
lea r9, [sym.sqlite3_free]
sub r8d, edx
mov rcx, rsi
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp sym.sqlite3_result_text
movzx r9d, word [rdi]
rol r9w, 8
movzx r9d, r9w
jmp 0x140005ee5
sub ebx, 1
jne 0x140005d1a
jmp 0x140005dfc
xor ebx, ebx
jmp 0x140005dfc