Function at 0x1800065f0
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 0x180006b5c
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 0x1800066ef
cmp rcx, 4
jb 0x1800066c9
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 0x1800066c9
cmp eax, 1
jne 0x180006654
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 0x180006654
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 0x180006654
cmp eax, 9
jne 0x1800067a6
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x18]
cmp byte [rcx], 0
jne 0x180006709
xor edi, edi
jmp 0x180006719
mov rdi, 0xffffffffffffffff
inc rdi
cmp byte [rcx + rdi], 0
jne 0x180006710
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 0x18000673d
xor ecx, ecx
jmp 0x180006759
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 0x18000677d
cmp rsi, rax
ja 0x18000677d
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 0x18000677f
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 0x18000664f
cmp eax, 0xa
jne 0x18000684a
cmp rcx, 4
jae 0x1800067b9
xor eax, eax
jmp 0x1800067d3
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 0x1800067f3
cmp rsi, rcx
ja 0x1800067f3
sub rcx, rsi
lea rax, [rdx + rsi]
mov qword [rbx + 0x20], rcx
mov qword [rbx + 0x10], rax
test rdx, rdx
jne 0x1800067f5
xor edx, edx
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x28]
cmp byte [rcx], 0
jne 0x180006806
xor edi, edi
jmp 0x180006819
mov rdi, 0xffffffffffffffff
nop dword [rax]
inc rdi
cmp byte [rcx + rdi], 0
jne 0x180006810
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 0x18000664f
cmp eax, 1
jne 0x1800068a9
cmp rcx, 4
jae 0x180006859
xor eax, eax
jmp 0x180006873
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 0x180006893
cmp rdi, rcx
ja 0x180006893
sub rcx, rdi
lea rax, [rdx + rdi]
mov qword [rbx + 0x20], rcx
mov qword [rbx + 0x10], rax
test rdx, rdx
jne 0x180006895
xor edx, edx
lea rcx, [r14 + rbp]
mov r8, rdi
call sub.msvcrt.dll_memcpy
add r14, rdi
jmp 0x18000664f
cmp eax, 2
jne 0x180006935
cmp rcx, 4
jae 0x1800068bc
xor eax, eax
jmp 0x1800068d6
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 0x1800068f6
cmp rdi, rcx
ja 0x1800068f6
sub rcx, rdi
lea rax, [rdx + rdi]
mov qword [rbx + 0x20], rcx
mov qword [rbx + 0x10], rax
test rdx, rdx
jne 0x1800068f8
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 0x18000664f
cmp eax, 3
je 0x180006b83
cmp eax, 0xd
je 0x180006b83
cmp eax, 4
jne 0x180006964
mov rcx, qword [rbx + 0x28]
mov r8, r14
mov rdx, rbp
mov rcx, qword [rcx + 0x20]
call sub.msvcrt.dll_memcpy
jmp 0x180006654
cmp eax, 5
jne 0x180006a0c
mov rax, qword [rbx + 0x28]
mov rcx, qword [rax + 0x18]
cmp byte [rcx], 0
jne 0x18000697e
xor esi, esi
jmp 0x18000698e
mov rsi, 0xffffffffffffffff
inc rsi
cmp byte [rcx + rsi], 0
jne 0x180006985
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.180007000
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 0x18000664f
cmp eax, 6
jne 0x180006a97
lea rdx, [rsp + 0x98]
mov rcx, rbx
call fcn.180007000
mov rcx, qword [rbx + 0x28]
mov rdx, qword [rcx + 0x28]
cmp byte [rdx], 0
jne 0x180006a36
xor esi, esi
jmp 0x180006a49
mov rsi, 0xffffffffffffffff
nop dword [rax]
inc rsi
cmp byte [rdx + rsi], 0
jne 0x180006a40
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 0x180006b31
cmp eax, 0x10
jne 0x180006b54
mov rax, qword [0x1817797d0]
cmp dword [rax + 0x10], 0x36
jle 0x180006ac5
mov rax, qword [rax + 8]
add rax, 0x360
je 0x180006ac5
cmp word [rax], 3
jne 0x180006ac5
mov rax, qword [rax + 8]
jmp 0x180006ac7
xor eax, eax
mov rdi, 0xffffffffffffffff
nop
inc rdi
cmp byte [rax + rdi], 0
jne 0x180006ad0
mov qword [rsp + 0x80], rdi
test rdi, rdi
jne 0x180006afe
lea rdx, [rsp + 0x80]
mov rcx, rbx
call fcn.180007000
mov rdi, qword [rsp + 0x80]
mov rcx, qword [rbx + 0x28]
mov rdx, qword [rcx + 0x28]
cmp byte [rdx], 0
jne 0x180006b0f
xor esi, esi
jmp 0x180006b1f
mov rsi, 0xffffffffffffffff
inc rsi
cmp byte [rdx + rsi], 0
jne 0x180006b16
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 0x18000664f
test eax, eax
jne 0x180006654
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 0x180006c13
cmp eax, 0xd
jne 0x180006c3f
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 0x180006bcd
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x180006c3f
mov edx, dword [rsp + 0x90]
test edx, edx
je 0x180006c0a
mov rax, r15
mov r8d, edx
nop
movzx ecx, byte [rax]
cmp cl, 0x3d
jne 0x180006bef
mov byte [rax], 0
dec edx
jmp 0x180006c01
cmp cl, 0x2f
jne 0x180006bf9
mov byte [rax], 0x5f
jmp 0x180006c01
cmp cl, 0x2b
jne 0x180006c01
mov byte [rax], 0x2d
inc rax
sub r8, 1
jne 0x180006be0
mov dword [rsp + 0x90], edx
jmp 0x180006c3f
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 0x180006c3f
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 0x180006654