Function at 0x508884
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd8
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.0040700c
xor eax, eax
push ebp
push 0x508ac6
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 8]
call fcn.0040688c
mov eax, dword [ebp - 4]
test eax, eax
je 0x5088de
mov edx, eax
sub edx, 0xa
cmp word [edx], 1
je 0x5088de
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
mov ecx, eax
test ecx, ecx
je 0x5088e9
sub ecx, 4
mov ecx, dword [ecx]
mov eax, ecx
mov ecx, 3
cdq
idiv ecx
mov dword [ebp - 0xc], edx
jmp 0x508a4c
mov esi, dword [ebp - 4]
test esi, esi
je 0x50891c
mov eax, esi
sub eax, 0xa
cmp word [eax], 1
je 0x50891c
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
mov esi, eax
mov edi, esi
test edi, edi
je 0x508927
sub edi, 4
mov edi, dword [edi]
cmp edi, 3
jl 0x50894c
mov eax, dword [ebp - 4]
movzx ebx, byte [eax]
shl ebx, 0x10
mov eax, dword [ebp - 4]
movzx eax, byte [eax + 1]
shl eax, 8
or ebx, eax
mov eax, dword [ebp - 4]
movzx eax, byte [eax + 2]
or ebx, eax
jmp 0x5089b1
mov eax, dword [ebp - 4]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x508974
mov eax, dword [ebp - 0x10]
sub eax, 0xa
cmp word [eax], 1
je 0x508974
lea eax, [ebp - 4]
xor ecx, ecx
mov edx, dword [ebp - 4]
call fcn.00406aa8
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x50898b
mov eax, dword [ebp - 0x14]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 2
jl 0x5089a8
mov eax, dword [ebp - 4]
movzx ebx, byte [eax]
shl ebx, 0x10
mov eax, dword [ebp - 4]
movzx eax, byte [eax + 1]
shl eax, 8
or ebx, eax
jmp 0x5089b1
mov eax, dword [ebp - 4]
movzx ebx, byte [eax]
shl ebx, 0x10
mov eax, dword [ebp - 8]
push dword [eax]
lea eax, [ebp - 0x18]
mov edx, ebx
shr edx, 0x12
and edx, 0x3f
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov ecx, 0
call fcn.00406b60
push dword [ebp - 0x18]
lea eax, [ebp - 0x1c]
mov edx, ebx
shr edx, 0xc
and edx, 0x3f
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov ecx, 0
call fcn.00406b60
push dword [ebp - 0x1c]
lea eax, [ebp - 0x20]
mov edx, ebx
shr edx, 6
and edx, 0x3f
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov ecx, 0
call fcn.00406b60
push dword [ebp - 0x20]
lea eax, [ebp - 0x24]
and ebx, 0x3f
movzx edx, byte [ebx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov ecx, 0
call fcn.00406b60
push dword [ebp - 0x24]
mov eax, dword [ebp - 8]
mov edx, 5
call fcn.00406e5c
lea eax, [ebp - 4]
mov ecx, 3
mov edx, 1
call fcn.00407100
lea eax, [ebp - 4]
xor edx, edx
call fcn.00406ab8
call fcn.00406c70
dec eax
jge 0x5088fb
cmp dword [ebp - 0xc], 0
jle 0x508aa3
mov edi, 3
sub edi, dword [ebp - 0xc]
test edi, edi
jle 0x508aa3
mov ebx, 1
mov eax, dword [ebp - 8]
mov eax, dword [eax]
mov dword [ebp - 0x28], eax
mov esi, dword [ebp - 0x28]
test esi, esi
je 0x508a8d
sub esi, 4
mov esi, dword [esi]
mov eax, dword [ebp - 8]
call fcn.00407094
mov edx, ebx
dec edx
sub esi, edx
mov byte [eax + esi - 1], 0x3d
inc ebx
dec edi
jne 0x508a79
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x508acd
lea eax, [ebp - 0x24]
mov edx, 4
call fcn.004068b0
lea eax, [ebp - 4]
call fcn.0040688c
ret