Function at 0x406037
Capabilities:
Encode data using base64

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x78
xor r12d, r12d
mov qword [rsp + 0x38], r8
mov rbx, rcx
mov rbp, rdx
mov sil, byte [rbp]
test sil, sil
je 0x406642
movsx r14d, sil
lea rcx, str.:___r_n_t___
mov edx, r14d
call sym.strchr
mov r13, rax
test rax, rax
je 0x406090
mov r8d, 1
mov rdx, rbp
mov rcx, rbx
call qword [rbx]
jmp 0x406637
cmp sil, 0x25
jne 0x4065b2
mov al, byte [rbp + 1]
mov r15, qword [rsp + 0x38]
cmp al, 0x6c
jne 0x406118
cmp byte [rbp + 2], 0x6c
jne 0x406434
mov al, byte [rbp + 3]
cmp al, 0x64
je 0x4060bf
cmp al, 0x75
jne 0x406434
cmp al, 0x75
lea r8, str._I64u
mov r9, qword [r15]
lea rdx, [r15 + 8]
lea r13, [rsp + 0x5b]
mov qword [rsp + 0x38], rdx
mov edx, 0x15
lea rax, str._I64d
cmovne r8, rax
mov rcx, r13
mov rdi, r13
mov esi, 4
call sym.cs_win_snprintf
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdx, r13
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rcx, rbx
call qword [rbx]
add r12d, eax
jmp 0x4065aa
cmp al, 0x7a
jne 0x406172
cmp byte [rbp + 2], 0x75
jne 0x406434
lea r13, [rsp + 0x5b]
mov r9d, dword [r15]
lea rax, [r15 + 8]
mov edx, 0x15
mov rcx, r13
mov qword [rsp + 0x38], rax
mov rdi, r13
mov esi, 3
lea r8, [0x0041b50c]
call sym.cs_win_snprintf
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdx, r13
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rcx, rbx
call qword [rbx]
add r12d, eax
jmp 0x4065aa
cmp al, 0x4d
jne 0x40618c
lea rax, [r15 + 8]
lea rdx, [rsp + 0x38]
mov rcx, rbx
mov qword [rsp + 0x38], rax
call qword [r15]
jmp 0x4061c6
cmp al, 0x42
jne 0x4061d3
lea rax, [r15 + 8]
cmp dword [r15], 0
lea rdx, str.false
mov qword [rsp + 0x38], rax
lea rax, str.true
cmovne rdx, rax
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rcx, rbx
call qword [rbx]
add r12d, eax
mov esi, 2
jmp 0x4065aa
cmp al, 0x48
jne 0x406261
lea rax, [r15 + 0x10]
mov esi, dword [r15]
mov rdi, qword [r15 + 8]
mov rcx, rbx
mov qword [rsp + 0x38], rax
mov r8d, 1
lea rdx, [0x0041b404]
xor r13d, r13d
call qword [rbx]
add r12d, eax
mov rax, qword [rbx]
cmp esi, r13d
jle 0x40624a
mov dl, byte [rdi + r13]
lea r14, str.0123456789abcdef
mov r8d, 1
mov rcx, rbx
shr dl, 4
movzx edx, dl
add rdx, r14
call rax
mov dl, byte [rdi + r13]
mov r8d, 1
mov rcx, rbx
add r12d, eax
inc r13
and edx, 0xf
add rdx, r14
call qword [rbx]
add r12d, eax
jmp 0x406203
mov r8d, 1
lea rdx, [0x0041b404]
mov rcx, rbx
call rax
jmp 0x4061c6
cmp al, 0x56
jne 0x406375
lea rax, [r15 + 0x10]
mov rdi, qword [r15]
mov esi, dword [r15 + 8]
mov rcx, rbx
mov qword [rsp + 0x38], rax
mov r8d, 1
xor r13d, r13d
lea r15, [rsp + 0x5b]
lea rdx, [0x0041b404]
call qword [rbx]
add eax, r12d
xor r12d, r12d
mov dword [rsp + 0x20], eax
cmp esi, r13d
mov r9, qword [rbx]
jle 0x406358
lea r11d, [r13 + 1]
movzx r8d, byte [rdi + r13]
mov r14d, r13d
xor edx, edx
cmp r11d, esi
jge 0x4062c2
movzx edx, byte [rdi + r13 + 1]
add r14d, 2
xor r10d, r10d
cmp r14d, esi
jge 0x4062d4
movzx r10d, byte [rdi + r13 + 2]
mov ecx, r8d
sar ecx, 2
call sym.b64idx
mov ecx, r8d
mov r8d, edx
mov byte [rsp + 0x5b], al
shl ecx, 4
sar r8d, 4
and ecx, 0x30
or ecx, r8d
call sym.b64idx
lea ecx, [rdx*4]
mov edx, r10d
mov byte [rsp + 0x5c], al
sar edx, 6
and ecx, 0x3c
or ecx, edx
call sym.b64idx
mov ecx, r10d
mov byte [rsp + 0x5d], al
and ecx, 0x3f
call sym.b64idx
mov byte [rsp + 0x5e], al
cmp r11d, esi
jl 0x406333
mov byte [rsp + 0x5d], 0x3d
cmp r14d, esi
jl 0x40633d
mov byte [rsp + 0x5e], 0x3d
mov r8d, 4
mov rdx, r15
mov rcx, rbx
add r13, 3
call r9
add r12d, eax
jmp 0x40629d
add r12d, dword [rsp + 0x20]
mov r8d, 1
lea rdx, [0x0041b404]
mov rcx, rbx
call r9
jmp 0x4061c6
cmp al, 0x51
je 0x4063a8
cmp al, 0x2e
jne 0x406434
cmp byte [rbp + 2], 0x2a
jne 0x406434
cmp byte [rbp + 3], 0x51
jne 0x406434
lea rdx, [r15 + 8]
movsxd rdi, dword [r15]
mov esi, 4
mov qword [rsp + 0x38], rdx
jmp 0x4063af
xor edi, edi
mov esi, 2
mov rdx, qword [rsp + 0x38]
mov r9, qword [rbx]
lea rcx, [rdx + 8]
mov qword [rsp + 0x38], rcx
mov r13, qword [rdx]
test r13, r13
jne 0x4063dd
mov r8d, 4
lea rdx, str.null
mov rcx, rbx
call r9
jmp 0x40642c
cmp al, 0x51
jne 0x4063f3
mov rdi, r13
or rcx, 0xffffffffffffffff
xor eax, eax
repne scasb al, byte [rdi]
not rcx
lea rdi, [rcx - 1]
mov r8d, 1
lea rdx, [0x0041b404]
mov rcx, rbx
call r9
mov r8, rdi
mov rdx, r13
mov rcx, rbx
add r12d, eax
call sym.json_escape
mov r8d, 1
lea rdx, [0x0041b404]
mov rcx, rbx
add r12d, eax
call qword [rbx]
add r12d, eax
jmp 0x4065aa
lea rcx, [rbp + 1]
lea rdx, str.sdfFeEgGlhuIcx._0123456789
call sym.strspn
mov r8d, 0x14
mov rdi, rax
cmp eax, 0x13
jg 0x406458
movsxd r8, eax
inc r8
lea r14, [rsp + 0x47]
mov rdx, rbp
lea esi, [rdi + 1]
mov rcx, r14
movsxd rsi, esi
call sym.strncpy
lea rax, [rsp + 0x5b]
mov r9, r15
mov r8, r14
mov edx, 0x15
mov rcx, rax
mov byte [rsp + rsi + 0x47], 0
mov qword [rsp + 0x20], rax
call sym.cs_win_vsnprintf
test eax, eax
jns 0x4064d8
mov r15d, 0x15
mov rcx, r13
add r15d, r15d
call sym.free
movsxd rdx, r15d
mov rcx, rdx
mov qword [rsp + 0x28], rdx
call sym.malloc
mov r9, qword [rsp + 0x38]
mov r13, rax
test rax, rax
je 0x406516
mov rdx, qword [rsp + 0x28]
mov r8, r14
mov rcx, rax
call sym.cs_win_vsnprintf
test eax, eax
js 0x40649a
jmp 0x406520
mov r13, qword [rsp + 0x20]
cmp eax, 0x14
jle 0x406520
inc eax
mov r9, qword [rsp + 0x38]
movsxd r15, eax
mov rcx, r15
mov qword [rsp + 0x28], r9
call sym.malloc
mov r13, rax
test rax, rax
je 0x406516
mov r9, qword [rsp + 0x28]
mov r8, r14
mov rdx, r15
mov rcx, rax
call sym.cs_win_vsnprintf
jmp 0x406520
mov byte [rsp + 0x5b], 0
mov r13, qword [rsp + 0x20]
cmp edi, 4
jne 0x406553
lea rdx, str._I64d
mov rcx, r14
call sym.strcmp
test eax, eax
je 0x40654b
lea rdx, str._I64u
mov rcx, r14
call sym.strcmp
test eax, eax
jne 0x406553
add qword [rsp + 0x38], 8
jmp 0x40657e
lea rdx, str._.s
mov rcx, r14
call sym.strcmp
mov r8d, eax
mov rax, qword [rsp + 0x38]
lea rdx, [rax + 8]
add rax, 0x10
test r8d, r8d
cmovne rax, rdx
mov qword [rsp + 0x38], rax
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, r13
mov rdx, r13
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rcx, rbx
call qword [rbx]
add r12d, eax
cmp r13, qword [rsp + 0x20]
je 0x4065aa
mov rcx, r13
call sym.free
add rbp, rsi
jmp 0x406055
mov r9, qword [rbx]
mov r8d, 1
cmp sil, 0x5f
je 0x4065cd
mov ecx, r14d
call sym.json_isalpha
test eax, eax
je 0x40662e
lea rdx, [0x0041b404]
mov rcx, rbx
call r9
add r12d, eax
movsx edx, byte [rbp]
mov r9, qword [rbx]
cmp dl, 0x5f
jne 0x406600
mov rdx, rbp
mov r8d, 1
mov rcx, rbx
inc rbp
call r9
add r12d, eax
jmp 0x4065dd
mov ecx, edx
call sym.json_isalpha
test eax, eax
jne 0x4065e9
sub edx, 0x30
cmp edx, 9
jbe 0x4065e9
mov r8d, 1
lea rdx, [0x0041b404]
mov rcx, rbx
call r9
add r12d, eax
jmp 0x406055
mov rdx, rbp
mov rcx, rbx
call r9
add r12d, eax
inc rbp
jmp 0x406055
mov eax, r12d
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret