Function at 0x509d76
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
lea eax, [ebx + esi]
mov dword [ebp - 4], edi
mov dword [ebp - 0xc], eax
test esi, esi
je 0x509f59
mov eax, ebx
or eax, dword [ebp + 0x10]
je 0x509f59
push 0
push 3
push dword [ebp + 0x10]
push ebx
call fcn.0059f000
push 0
push 0x39
push dword [ebp + 0x10]
mov dword [ebp + 0x10], eax
push ebx
call fcn.0059f000
mov ecx, dword [ebp + 0x10]
lea eax, [eax + ecx*4 + 5]
push eax
call fcn.005a39eb
pop ecx
mov dword [ebp - 0x10], eax
mov dword [ebp + 0x10], eax
test eax, eax
je 0x509f59
mov eax, dword [ebp - 0xc]
sub eax, esi
cmp eax, 3
jl 0x509e94
mov dword [ebp - 8], eax
mov al, byte [esi]
mov cl, byte [esi + 2]
mov bl, byte [esi + 1]
movzx edi, al
mov eax, edi
shr eax, 2
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
push dword [ebp + 0x14]
lea eax, [ebp + 0x10]
mov byte [ebp + 0xb], cl
mov ecx, dword [ebp - 4]
push eax
call fcn.00509d4e
mov ecx, dword [ebp - 4]
movzx ebx, bl
mov eax, ebx
shr eax, 4
and edi, 3
shl edi, 4
or eax, edi
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
push dword [ebp + 0x14]
lea eax, [ebp + 0x10]
push eax
call fcn.00509d4e
movzx edi, byte [ebp + 0xb]
mov ecx, dword [ebp - 4]
mov eax, edi
shr eax, 6
and ebx, 0xf
shl ebx, 2
or eax, ebx
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
push dword [ebp + 0x14]
lea eax, [ebp + 0x10]
push eax
call fcn.00509d4e
mov ecx, dword [ebp - 4]
and edi, 0x3f
movzx eax, byte [edi + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
push dword [ebp + 0x14]
lea eax, [ebp + 0x10]
push eax
call fcn.00509d4e
sub dword [ebp - 8], 3
add esi, 3
cmp dword [ebp - 8], 3
jge 0x509ded
mov edi, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
sub eax, esi
cmp eax, 2
jne 0x509ef3
movzx eax, byte [esi]
mov ebx, dword [ebp + 0x14]
shr eax, 2
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
push ebx
lea eax, [ebp + 0x10]
push eax
mov ecx, edi
call fcn.00509d4e
movzx eax, byte [esi]
movzx ecx, byte [esi + 1]
and eax, 3
shl eax, 4
shr ecx, 4
or eax, ecx
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
push ebx
lea eax, [ebp + 0x10]
push eax
mov ecx, edi
call fcn.00509d4e
movzx eax, byte [esi + 1]
and eax, 0xf
movzx eax, byte [eax*4 + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
jmp 0x509f34
cmp eax, 1
jne 0x509f4e
movzx eax, byte [esi]
mov ebx, dword [ebp + 0x14]
shr eax, 2
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
push ebx
lea eax, [ebp + 0x10]
push eax
mov ecx, edi
call fcn.00509d4e
movzx eax, byte [esi]
and eax, 3
shl eax, 4
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
push eax
push ebx
lea eax, [ebp + 0x10]
push eax
mov ecx, edi
call fcn.00509d4e
push 0x3d
push ebx
lea eax, [ebp + 0x10]
push eax
mov ecx, edi
call fcn.00509d4e
push 0x3d
push ebx
lea eax, [ebp + 0x10]
push eax
mov ecx, edi
call fcn.00509d4e
mov eax, dword [ebp + 0x10]
mov byte [eax], 0
mov eax, dword [ebp - 0x10]
jmp 0x509f5b
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x10