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

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x58
movsxd rax, r8d
mov rdi, rcx
mov qword [rcx + 0x18], rax
mov qword [rcx + 0x20], rax
mov eax, dword [rcx + 0x38]
cmp eax, dword [rcx + 0x48]
mov qword [rcx + 8], rdx
cmovbe eax, dword [rcx + 0x48]
mov qword [rcx + 0x10], rdx
lea ebx, [rax + rax*2]
mov eax, 0x2000
cmp ebx, eax
cmovl ebx, eax
movsxd r13, ebx
mov rcx, r13
mov dword [rbp + 0x58], ebx
call qword [sym.imp.msvcrt.dll_malloc]
xor esi, esi
mov rcx, r13
mov r15, rax
mov r14d, esi
call qword [sym.imp.msvcrt.dll_malloc]
mov r12, rax
cmp qword [rdi + 0x20], 4
jb 0x1800053aa
mov rax, qword [rdi + 0x10]
mov ecx, dword [rax]
call qword [sym.imp.WS2_32.dll_ntohl]
mov rcx, qword [rdi + 0x20]
add qword [rdi + 0x10], 4
add rcx, 0xfffffffffffffffc
mov rdx, qword [rdi + 0x10]
mov qword [rdi + 0x20], rcx
cmp eax, 7
jne 0x18000506f
cmp rcx, 4
jb 0x180005049
mov ecx, dword [rdx]
call qword [sym.imp.WS2_32.dll_ntohl]
add qword [rdi + 0x20], 0xfffffffffffffffc
add qword [rdi + 0x10], 4
test eax, eax
je 0x180005049
cmp eax, 1
jne 0x180004fd4
mov r8, r13
xor edx, edx
mov rcx, r15
call sub.msvcrt.dll_memset
mov r8d, dword [rdi + 0x48]
mov rcx, r15
mov rdx, qword [rdi + 0x40]
call sub.msvcrt.dll_memcpy
mov r14d, dword [rdi + 0x48]
jmp 0x180004fd4
mov r8, r13
xor edx, edx
mov rcx, r15
call sub.msvcrt.dll_memset
mov r8d, dword [rdi + 0x38]
mov rcx, r15
mov rdx, qword [rdi + 0x30]
call sub.msvcrt.dll_memcpy
mov r14d, dword [rdi + 0x38]
jmp 0x180004fd4
cmp eax, 9
jne 0x1800050df
mov rax, qword [rdi + 0x28]
mov rdx, qword [rax + 0x18]
cmp byte [rdx], sil
je 0x18000508e
or rsi, 0xffffffffffffffff
inc rsi
cmp byte [rdx + rsi], 0
jne 0x180005085
mov rax, rsi
neg rax
sbb cl, cl
and cl, 0xe7
add cl, 0x3f
mov byte [rdx + rsi], cl
lea rdx, [rbp - 0x18]
mov rcx, rdi
inc rsi
call fcn.180005874
mov rcx, qword [rdi + 0x28]
mov rdx, rax
mov r8, qword [rbp - 0x18]
mov rcx, qword [rcx + 0x18]
add rcx, rsi
call sub.msvcrt.dll_memcpy
mov rax, qword [rdi + 0x28]
mov ebx, dword [rbp + 0x58]
mov rax, qword [rax + 0x18]
add rax, qword [rbp - 0x18]
mov byte [rax + rsi], 0
xor esi, esi
jmp 0x180004fd4
cmp eax, 0xa
jne 0x180005128
lea rdx, [rbp + 0x60]
mov rcx, rdi
call fcn.180005874
mov rcx, qword [rdi + 0x28]
mov rdx, qword [rcx + 0x28]
cmp byte [rdx], sil
jne 0x180005102
mov rbx, rsi
jmp 0x18000510f
or rbx, 0xffffffffffffffff
inc rbx
cmp byte [rdx + rbx], sil
jne 0x180005106
mov r8, qword [rbp + 0x60]
lea rcx, [rdx + rbx]
mov rdx, rax
call sub.msvcrt.dll_memcpy
add rbx, qword [rbp + 0x60]
jmp 0x18000537c
cmp eax, 1
jne 0x180005156
lea rdx, [rbp + 0x50]
mov qword [rbp + 0x50], rsi
mov rcx, rdi
call fcn.180005874
mov r8, qword [rbp + 0x50]
lea rcx, [r14 + r15]
mov rdx, rax
call sub.msvcrt.dll_memcpy
add r14, qword [rbp + 0x50]
jmp 0x180004fd4
cmp eax, 2
jne 0x1800051af
lea rdx, [rbp + 0x50]
mov qword [rbp + 0x50], rsi
mov rcx, rdi
call fcn.180005874
mov rbx, qword [rbp + 0x50]
mov rdx, rax
mov r8, rbx
mov rcx, r12
call sub.msvcrt.dll_memcpy
lea rcx, [rbx + r12]
mov r8, r14
mov rdx, r15
call sub.msvcrt.dll_memcpy
mov r8, r13
xor edx, edx
mov rcx, r15
add r14, rbx
call sub.msvcrt.dll_memset
mov r8, r14
mov rdx, r12
mov rcx, r15
call sub.msvcrt.dll_memcpy
jmp 0x18000539a
mov ecx, 3
cmp eax, ecx
je 0x1800053d1
cmp eax, 0xd
je 0x1800053d1
cmp eax, 4
jne 0x1800051e2
mov rcx, qword [rdi + 0x28]
mov rdx, r15
mov rcx, qword [rcx + 0x20]
mov r8, r14
call sub.msvcrt.dll_memcpy
jmp 0x180004fd4
cmp eax, 5
jne 0x18000527e
mov rax, qword [rdi + 0x28]
mov rdx, qword [rax + 0x18]
cmp byte [rdx], sil
jne 0x1800051fd
mov rbx, rsi
jmp 0x18000520a
or rbx, 0xffffffffffffffff
inc rbx
cmp byte [rdx + rbx], sil
jne 0x180005201
mov rax, rbx
neg rax
sbb cl, cl
and cl, 0xe7
add cl, 0x3f
mov byte [rdx + rbx], cl
lea rdx, [rbp - 0x28]
mov rcx, rdi
inc rbx
call fcn.180005874
mov rcx, qword [rdi + 0x28]
mov rdx, rax
mov r8, qword [rbp - 0x28]
mov rcx, qword [rcx + 0x18]
add rcx, rbx
call sub.msvcrt.dll_memcpy
mov rax, qword [rdi + 0x28]
mov r8, r14
add rbx, qword [rbp - 0x28]
mov rdx, r15
mov rcx, qword [rax + 0x18]
mov byte [rbx + rcx], 0x3d
inc rbx
mov rax, qword [rdi + 0x28]
mov rcx, qword [rax + 0x18]
add rcx, rbx
call sub.msvcrt.dll_memcpy
mov rax, qword [rdi + 0x28]
mov rax, qword [rax + 0x18]
add rax, rbx
mov byte [rax + r14], sil
jmp 0x18000539a
cmp eax, 6
jne 0x1800052f4
lea rdx, [rbp - 0x20]
mov rcx, rdi
call fcn.180005874
mov rcx, qword [rdi + 0x28]
mov rdx, qword [rcx + 0x28]
cmp byte [rdx], sil
jne 0x1800052a1
mov rbx, rsi
jmp 0x1800052ae
or rbx, 0xffffffffffffffff
inc rbx
cmp byte [rdx + rbx], sil
jne 0x1800052a5
mov r8, qword [rbp - 0x20]
lea rcx, [rdx + rbx]
mov rdx, rax
call sub.msvcrt.dll_memcpy
mov rax, qword [rdi + 0x28]
mov r8, r14
add rbx, qword [rbp - 0x20]
mov rdx, r15
mov rcx, qword [rax + 0x28]
mov eax, 0x203a
mov word [rbx + rcx], ax
inc rbx
mov rax, qword [rdi + 0x28]
mov rcx, qword [rax + 0x28]
add rcx, rbx
call sub.msvcrt.dll_memcpy
add rbx, r14
jmp 0x18000537c
cmp eax, 0x10
jne 0x1800053a2
mov rax, qword [0x1817777d0]
cmp dword [rax + 0x10], 0x36
jle 0x180005321
mov rax, qword [rax + 8]
add rax, 0x360
je 0x180005321
cmp word [rax], cx
jne 0x180005321
mov rax, qword [rax + 8]
jmp 0x180005324
mov rax, rsi
or rsi, 0xffffffffffffffff
inc rsi
cmp byte [rax + rsi], 0
jne 0x180005328
mov qword [rbp + 0x50], rsi
test rsi, rsi
jne 0x18000534a
lea rdx, [rbp + 0x50]
mov rcx, rdi
call fcn.180005874
mov rsi, qword [rbp + 0x50]
mov rcx, qword [rdi + 0x28]
mov rdx, qword [rcx + 0x28]
cmp byte [rdx], 0
jne 0x18000535b
xor ebx, ebx
jmp 0x180005368
or rbx, 0xffffffffffffffff
inc rbx
cmp byte [rdx + rbx], 0
jne 0x18000535f
lea rcx, [rdx + rbx]
mov r8, rsi
mov rdx, rax
call sub.msvcrt.dll_memcpy
add rbx, rsi
xor esi, esi
mov rax, qword [rdi + 0x28]
mov rcx, qword [rax + 0x28]
mov eax, 0xa0d
mov word [rbx + rcx], ax
mov rax, qword [rdi + 0x28]
mov rcx, qword [rax + 0x28]
mov byte [rcx + rbx + 2], sil
mov ebx, dword [rbp + 0x58]
jmp 0x180004fd4
test eax, eax
jne 0x180004fd4
mov rcx, r15
call qword [sym.imp.msvcrt.dll_free]
mov rcx, r12
call qword [sym.imp.msvcrt.dll_free]
mov rax, qword [rdi + 0x28]
add rsp, 0x58
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
mov dword [rbp + 0x48], ebx
cmp eax, ecx
je 0x180005445
cmp eax, 0xd
jne 0x18000546d
lea rax, [rbp + 0x48]
mov r9, r12
mov r8d, 1
mov qword [rsp + 0x20], rax
mov edx, r14d
mov rcx, r15
call qword [sym.imp.CRYPT32.dll_CryptBinaryToStringA]
test eax, eax
jne 0x18000540d
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x18000546d
mov ecx, dword [rbp + 0x48]
test ecx, ecx
je 0x180005440
mov rax, r12
mov edx, ecx
cmp byte [rax], 0x3d
jne 0x180005425
mov byte [rax], sil
dec ecx
jmp 0x180005437
cmp byte [rax], 0x2f
jne 0x18000542f
mov byte [rax], 0x5f
jmp 0x180005437
cmp byte [rax], 0x2b
jne 0x180005437
mov byte [rax], 0x2d
inc rax
sub rdx, 1
jne 0x180005419
mov dword [rbp + 0x48], ecx
jmp 0x18000546d
lea rax, [rbp + 0x48]
mov r9, r12
mov r8d, 1
mov qword [rsp + 0x20], rax
mov edx, r14d
mov rcx, r15
call qword [sym.imp.CRYPT32.dll_CryptBinaryToStringA]
test eax, eax
jne 0x18000546d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r14d, dword [rbp + 0x48]
mov r8, r13
xor edx, edx
mov rcx, r15
call sub.msvcrt.dll_memset
mov rdx, r12
mov rcx, r15
jmp 0x1800051d5