Function at 0x180006220
Capabilities:
Encode data using base64 via winapi

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x38
mov rbx, rcx
movsxd rax, r8d
mov qword [rcx + 0x18], rax
mov qword [rcx + 0x20], rax
mov eax, 0x2000
mov qword [rcx + 8], rdx
mov qword [rcx + 0x10], rdx
mov ecx, dword [rcx + 0x38]
cmp ecx, dword [rbx + 0x48]
cmovbe ecx, dword [rbx + 0x48]
lea r13d, [rcx + rcx*2]
cmp r13d, eax
cmovl r13d, eax
movsxd r12, r13d
mov rcx, r12
call qword [sym.imp.msvcrt.dll_malloc]
mov rcx, r12
xor r14d, r14d
mov rbp, rax
call qword [sym.imp.msvcrt.dll_malloc]
mov r15, rax
mov edi, 0x3f
cmp qword [rbx + 0x20], 4
jb 0x18000678c
mov rax, qword [rbx + 0x10]
mov ecx, dword [rax]
call qword [sym.imp.WS2_32.dll_ntohl]
mov rcx, qword [rbx + 0x20]
add qword [rbx + 0x10], 4
add rcx, 0xfffffffffffffffc
mov rdx, qword [rbx + 0x10]
mov qword [rbx + 0x20], rcx
cmp eax, 7
jne 0x18000631f
cmp rcx, 4
jb 0x1800062f9
mov ecx, dword [rdx]
call qword [sym.imp.WS2_32.dll_ntohl]
add qword [rbx + 0x20], 0xfffffffffffffffc
add qword [rbx + 0x10], 4
test eax, eax
je 0x1800062f9
cmp eax, 1
jne 0x180006284
mov r8, r12
xor edx, edx
mov rcx, rbp
call sub.msvcrt.dll_memset
mov r8d, dword [rbx + 0x48]
mov rcx, rbp
mov rdx, qword [rbx + 0x40]
call sub.msvcrt.dll_memcpy
mov r14d, dword [rbx + 0x48]
jmp 0x180006284
mov r8, r12
xor edx, edx
mov rcx, rbp
call sub.msvcrt.dll_memset
mov r8d, dword [rbx + 0x38]
mov rcx, rbp
mov rdx, qword [rbx + 0x30]
call sub.msvcrt.dll_memcpy
mov r14d, dword [rbx + 0x38]
jmp 0x180006284
cmp eax, 9
jne 0x1800063d6
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x18]
cmp byte [rcx], 0
jne 0x180006339
xor edi, edi
jmp 0x180006349
mov rdi, 0xffffffffffffffff
inc rdi
cmp byte [rcx + rdi], 0
jne 0x180006340
test rdi, rdi
mov eax, 0x26
mov edx, 0x3f
cmove eax, edx
mov byte [rcx + rdi], al
inc rdi
mov rax, qword [rbx + 0x20]
cmp rax, 4
jae 0x18000636d
xor ecx, ecx
jmp 0x180006389
mov rax, qword [rbx + 0x10]
mov ecx, dword [rax]
call qword [sym.imp.WS2_32.dll_ntohl]
add qword [rbx + 0x20], 0xfffffffffffffffc
mov ecx, eax
mov rax, qword [rbx + 0x20]
add qword [rbx + 0x10], 4
movsxd rsi, ecx
test ecx, ecx
je 0x1800063ad
cmp rsi, rax
ja 0x1800063ad
mov rdx, qword [rbx + 0x10]
sub rax, rsi
mov qword [rbx + 0x20], rax
lea rax, [rdx + rsi]
mov qword [rbx + 0x10], rax
test rdx, rdx
jne 0x1800063af
xor edx, edx
mov rax, qword [rbx + 0x28]
mov r8, rsi
mov rcx, qword [rax + 0x18]
add rcx, rdi
call sub.msvcrt.dll_memcpy
mov rax, qword [rbx + 0x28]
mov rax, qword [rax + 0x18]
add rax, rsi
mov byte [rax + rdi], 0
jmp 0x18000627f
cmp eax, 0xa
jne 0x18000647a
cmp rcx, 4
jae 0x1800063e9
xor eax, eax
jmp 0x180006403
mov ecx, dword [rdx]
call qword [sym.imp.WS2_32.dll_ntohl]
add qword [rbx + 0x20], 0xfffffffffffffffc
add qword [rbx + 0x10], 4
mov rdx, qword [rbx + 0x10]
mov rcx, qword [rbx + 0x20]
movsxd rsi, eax
test eax, eax
je 0x180006423
cmp rsi, rcx
ja 0x180006423
sub rcx, rsi
lea rax, [rdx + rsi]
mov qword [rbx + 0x20], rcx
mov qword [rbx + 0x10], rax
test rdx, rdx
jne 0x180006425
xor edx, edx
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x28]
cmp byte [rcx], 0
jne 0x180006436
xor edi, edi
jmp 0x180006449
mov rdi, 0xffffffffffffffff
nop dword [rax]
inc rdi
cmp byte [rcx + rdi], 0
jne 0x180006440
add rcx, rdi
mov r8, rsi
call sub.msvcrt.dll_memcpy
mov rax, qword [rbx + 0x28]
add rdi, rsi
mov rcx, qword [rax + 0x28]
mov eax, 0xa0d
mov word [rdi + rcx], ax
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x28]
mov byte [rcx + rdi + 2], 0
jmp 0x18000627f
cmp eax, 1
jne 0x1800064d9
cmp rcx, 4
jae 0x180006489
xor eax, eax
jmp 0x1800064a3
mov ecx, dword [rdx]
call qword [sym.imp.WS2_32.dll_ntohl]
add qword [rbx + 0x20], 0xfffffffffffffffc
add qword [rbx + 0x10], 4
mov rdx, qword [rbx + 0x10]
mov rcx, qword [rbx + 0x20]
movsxd rdi, eax
test eax, eax
je 0x1800064c3
cmp rdi, rcx
ja 0x1800064c3
sub rcx, rdi
lea rax, [rdx + rdi]
mov qword [rbx + 0x20], rcx
mov qword [rbx + 0x10], rax
test rdx, rdx
jne 0x1800064c5
xor edx, edx
lea rcx, [r14 + rbp]
mov r8, rdi
call sub.msvcrt.dll_memcpy
add r14, rdi
jmp 0x18000627f
cmp eax, 2
jne 0x180006565
cmp rcx, 4
jae 0x1800064ec
xor eax, eax
jmp 0x180006506
mov ecx, dword [rdx]
call qword [sym.imp.WS2_32.dll_ntohl]
add qword [rbx + 0x20], 0xfffffffffffffffc
add qword [rbx + 0x10], 4
mov rdx, qword [rbx + 0x10]
mov rcx, qword [rbx + 0x20]
movsxd rdi, eax
test eax, eax
je 0x180006526
cmp rdi, rcx
ja 0x180006526
sub rcx, rdi
lea rax, [rdx + rdi]
mov qword [rbx + 0x20], rcx
mov qword [rbx + 0x10], rax
test rdx, rdx
jne 0x180006528
xor edx, edx
mov r8, rdi
mov rcx, r15
call sub.msvcrt.dll_memcpy
lea rcx, [rdi + r15]
mov r8, r14
mov rdx, rbp
call sub.msvcrt.dll_memcpy
mov r8, r12
xor edx, edx
mov rcx, rbp
add r14, rdi
call sub.msvcrt.dll_memset
mov r8, r14
mov rdx, r15
mov rcx, rbp
call sub.msvcrt.dll_memcpy
jmp 0x18000627f
cmp eax, 3
je 0x1800067b3
cmp eax, 0xd
je 0x1800067b3
cmp eax, 4
jne 0x180006594
mov rcx, qword [rbx + 0x28]
mov r8, r14
mov rdx, rbp
mov rcx, qword [rcx + 0x20]
call sub.msvcrt.dll_memcpy
jmp 0x180006284
cmp eax, 5
jne 0x18000663c
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x18]
cmp byte [rcx], 0
jne 0x1800065ae
xor esi, esi
jmp 0x1800065be
mov rsi, 0xffffffffffffffff
inc rsi
cmp byte [rcx + rsi], 0
jne 0x1800065b5
test rsi, rsi
lea rdx, [rsp + 0x88]
mov eax, 0x26
cmove eax, edi
mov byte [rcx + rsi], al
mov rcx, rbx
inc rsi
call fcn.180006c30
mov rcx, qword [rbx + 0x28]
mov rdx, rax
mov r8, qword [rsp + 0x88]
mov rcx, qword [rcx + 0x18]
add rcx, rsi
call sub.msvcrt.dll_memcpy
mov rax, qword [rbx + 0x28]
mov r8, r14
add rsi, qword [rsp + 0x88]
mov rdx, rbp
mov rcx, qword [rax + 0x18]
mov byte [rsi + rcx], 0x3d
inc rsi
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x18]
add rcx, rsi
call sub.msvcrt.dll_memcpy
mov rax, qword [rbx + 0x28]
mov rax, qword [rax + 0x18]
add rax, rsi
mov byte [rax + r14], 0
jmp 0x18000627f
cmp eax, 6
jne 0x1800066c7
lea rdx, [rsp + 0x98]
mov rcx, rbx
call fcn.180006c30
mov rcx, qword [rbx + 0x28]
mov rdx, qword [rcx + 0x28]
cmp byte [rdx], 0
jne 0x180006666
xor esi, esi
jmp 0x180006679
mov rsi, 0xffffffffffffffff
nop dword [rax]
inc rsi
cmp byte [rdx + rsi], 0
jne 0x180006670
mov r8, qword [rsp + 0x98]
lea rcx, [rdx + rsi]
mov rdx, rax
call sub.msvcrt.dll_memcpy
mov rax, qword [rbx + 0x28]
mov r8, r14
add rsi, qword [rsp + 0x98]
mov rdx, rbp
mov rcx, qword [rax + 0x28]
mov eax, 0x203a
mov word [rsi + rcx], ax
inc rsi
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x28]
add rcx, rsi
call sub.msvcrt.dll_memcpy
add rsi, r14
jmp 0x180006761
cmp eax, 0x10
jne 0x180006784
mov rax, qword [0x181777730]
cmp dword [rax + 0x10], 0x36
jle 0x1800066f5
mov rax, qword [rax + 8]
add rax, 0x360
je 0x1800066f5
cmp word [rax], 3
jne 0x1800066f5
mov rax, qword [rax + 8]
jmp 0x1800066f7
xor eax, eax
mov rdi, 0xffffffffffffffff
nop
inc rdi
cmp byte [rax + rdi], 0
jne 0x180006700
mov qword [rsp + 0x80], rdi
test rdi, rdi
jne 0x18000672e
lea rdx, [rsp + 0x80]
mov rcx, rbx
call fcn.180006c30
mov rdi, qword [rsp + 0x80]
mov rcx, qword [rbx + 0x28]
mov rdx, qword [rcx + 0x28]
cmp byte [rdx], 0
jne 0x18000673f
xor esi, esi
jmp 0x18000674f
mov rsi, 0xffffffffffffffff
inc rsi
cmp byte [rdx + rsi], 0
jne 0x180006746
lea rcx, [rdx + rsi]
mov r8, rdi
mov rdx, rax
call sub.msvcrt.dll_memcpy
add rsi, rdi
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x28]
mov eax, 0xa0d
mov word [rsi + rcx], ax
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x28]
mov byte [rcx + rsi + 2], 0
jmp 0x18000627f
test eax, eax
jne 0x180006284
mov rcx, rbp
call qword [sym.imp.msvcrt.dll_free]
mov rcx, r15
call qword [sym.imp.msvcrt.dll_free]
mov rax, qword [rbx + 0x28]
add rsp, 0x38
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
mov dword [rsp + 0x90], r13d
cmp eax, 3
je 0x180006843
cmp eax, 0xd
jne 0x18000686f
lea rax, [rsp + 0x90]
mov r9, r15
mov r8d, 1
mov qword [rsp + 0x20], rax
mov edx, r14d
mov rcx, rbp
call qword [sym.imp.CRYPT32.dll_CryptBinaryToStringA]
test eax, eax
jne 0x1800067fd
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x18000686f
mov edx, dword [rsp + 0x90]
test edx, edx
je 0x18000683a
mov rax, r15
mov r8d, edx
nop
movzx ecx, byte [rax]
cmp cl, 0x3d
jne 0x18000681f
mov byte [rax], 0
dec edx
jmp 0x180006831
cmp cl, 0x2f
jne 0x180006829
mov byte [rax], 0x5f
jmp 0x180006831
cmp cl, 0x2b
jne 0x180006831
mov byte [rax], 0x2d
inc rax
sub r8, 1
jne 0x180006810
mov dword [rsp + 0x90], edx
jmp 0x18000686f
lea rax, [rsp + 0x90]
mov r9, r15
mov r8d, 1
mov qword [rsp + 0x20], rax
mov edx, r14d
mov rcx, rbp
call qword [sym.imp.CRYPT32.dll_CryptBinaryToStringA]
test eax, eax
jne 0x18000686f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r14d, dword [rsp + 0x90]
mov r8, r12
xor edx, edx
mov rcx, rbp
call sub.msvcrt.dll_memset
mov r8d, r14d
mov rdx, r15
mov rcx, rbp
call sub.msvcrt.dll_memcpy
jmp 0x180006284