Function at 0x515510
Capabilities:
Encode data using base64

Disassembly:
sub esp, 8
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x1c]
xor ebp, ebp
xor esi, esi
test edi, edi
je 0x5156f2
mov ebx, dword [esp + 0x20]
test ebx, ebx
je 0x5156f2
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov eax, 0x55555556
imul ecx
mov eax, edx
mov dword [esp + 0x14], ecx
shr eax, 0x1f
add edx, eax
test edx, edx
jle 0x5155ef
mov dword [esp + 0x20], edx
mov ecx, dword [esp + 0x1c]
xor eax, eax
xor edx, edx
mov al, byte [ecx + ebp]
mov dl, byte [ecx + ebp + 1]
inc ebp
mov edi, edx
inc ebp
xor edx, edx
mov dl, byte [ecx + ebp]
mov ecx, eax
sar ecx, 2
mov dword [esp + 0x10], edx
mov edx, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
and ecx, 0x3f
and eax, 3
shl eax, 4
mov cl, byte [ecx + edx]
mov edx, edi
sar edx, 4
and edx, 0xf
mov byte [esi + ebx], cl
or edx, eax
mov eax, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
inc ebp
inc esi
mov cl, byte [edx + eax]
mov eax, dword [esp + 0x10]
mov edx, eax
and edi, 0xf
sar edx, 6
and edx, 3
mov byte [esi + ebx], cl
mov ecx, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
inc esi
shl edi, 2
or edx, edi
and eax, 0x3f
inc esi
mov dl, byte [edx + ecx]
mov byte [esi + ebx - 1], dl
mov ecx, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
inc esi
mov dl, byte [eax + ecx]
mov eax, dword [esp + 0x20]
mov byte [esi + ebx - 1], dl
dec eax
mov dword [esp + 0x20], eax
jne 0x51555b
mov ecx, dword [esp + 0x14]
mov eax, ecx
mov ecx, 3
cdq
idiv ecx
sub edx, 0
je 0x5156c8
dec edx
je 0x515661
dec edx
jne 0x5156df
mov edi, dword [esp + 0x1c]
xor eax, eax
xor edx, edx
mov al, byte [edi + ebp]
mov dl, byte [edi + ebp + 1]
mov ecx, eax
mov edi, edx
mov edx, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
and eax, 3
sar ecx, 2
and ecx, 0x3f
inc esi
shl eax, 4
mov cl, byte [ecx + edx]
mov edx, edi
sar edx, 4
and edx, 0xf
mov byte [esi + ebx - 1], cl
or edx, eax
mov eax, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
inc esi
and edi, 0xf
mov cl, byte [edx + eax]
mov byte [esi + ebx - 1], cl
mov edx, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov al, byte [edx + edi*4]
mov byte [esi + ebx], al
jmp 0x515698
mov edx, dword [esp + 0x1c]
xor eax, eax
mov al, byte [edx + ebp]
mov edx, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov ecx, eax
and eax, 3
sar ecx, 2
and ecx, 0x3f
inc esi
shl eax, 4
mov cl, byte [ecx + edx]
mov byte [esi + ebx - 1], cl
mov edx, dword [str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
inc esi
mov al, byte [eax + edx]
mov byte [esi + ebx - 1], al
mov byte [esi + ebx], 0x3d
inc esi
mov byte [esi + ebx], 0x3d
mov cl, byte [0x58368c]
inc esi
mov byte [esi + ebx], cl
mov al, byte [0x58368d]
inc esi
test al, al
je 0x5156df
mov byte [esi + ebx], al
inc esi
pop edi
mov eax, 1
mov byte [esi + ebx], 0
pop esi
pop ebp
pop ebx
add esp, 8
ret 8
mov dl, byte [0x58368c]
mov byte [esi + ebx], dl
mov al, byte [0x58368d]
inc esi
test al, al
je 0x5156df
mov byte [esi + ebx], al
inc esi
mov byte [esi + ebx], 0
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret 8