Function at 0x40e670
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov esi, dword [ebp + 0xc]
lea ecx, [ebp - 0x38]
call fcn.00406d60
lea ecx, [ebp - 0x38]
call fcn.00407140
mov ecx, dword [esi + 0xc]
mov edx, 0x55555556
mov eax, ecx
imul edx
mov eax, ecx
sar eax, 0x1f
sub edx, eax
lea eax, [edx + edx*2]
mov edx, ecx
sub edx, eax
test edx, edx
jle 0x40e6af
add ecx, 3
sub ecx, edx
shl ecx, 3
mov ebx, 0x2aaaaaab
mov eax, ecx
imul ebx
sar ecx, 0x1f
mov dword [esp + 4], 0
mov ebx, edx
sub ebx, ecx
mov dword [esp], ebx
lea ecx, [ebp - 0x38]
call fcn.00407360
mov eax, dword [ebp - 0x34]
sub esp, 8
mov ecx, dword [esi + 0xc]
mov dword [ebp - 0x40], eax
mov eax, dword [esi + 4]
mov esi, 0x55555556
mov edi, ecx
mov dword [ebp - 0x44], eax
mov eax, ecx
imul esi
mov eax, ecx
sar eax, 0x1f
mov esi, edx
sub esi, eax
lea eax, [esi + esi*2]
mov esi, ecx
sub esi, eax
test esi, esi
jle 0x40e70b
lea edi, [ecx + 3]
sub edi, esi
shl edi, 3
mov edx, 0x2aaaaaab
mov eax, edi
imul edx
sar edi, 0x1f
sub edx, edi
mov edi, dword [ebp - 0x40]
test edi, edi
je 0x40e8c0
cmp ebx, edx
jl 0x40e8d0
sub ecx, esi
test ecx, ecx
mov dword [ebp - 0x3c], ecx
jle 0x40e8c7
mov eax, dword [ebp - 0x44]
mov ecx, edi
xor ebx, ebx
xor edi, edi
mov dword [ebp - 0x48], esi
movzx edx, byte [eax]
add ebx, 4
add edi, 3
add eax, 3
add ecx, 4
shr dl, 2
movzx edx, dl
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [ecx - 4], dl
movzx esi, byte [eax - 3]
movzx edx, byte [eax - 2]
shl esi, 4
sar edx, 4
add edx, esi
and edx, 0x3f
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [ecx - 3], dl
movzx edx, byte [eax - 1]
movzx esi, byte [eax - 2]
sar edx, 6
lea edx, [edx + esi*4]
and edx, 0x3f
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [ecx - 2], dl
movzx edx, byte [eax - 1]
and edx, 0x3f
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [ecx - 1], dl
cmp dword [ebp - 0x3c], edi
jg 0x40e748
mov esi, dword [ebp - 0x48]
cmp esi, 1
je 0x40e880
cmp esi, 2
mov eax, ebx
je 0x40e820
mov dword [esp + 4], 0
lea ecx, [ebp - 0x38]
mov dword [esp], eax
call fcn.00407360
sub esp, 8
lea ebx, [ebp - 0x28]
lea eax, [ebp - 0x38]
mov ecx, ebx
mov dword [esp], eax
call fcn.00408370
mov ecx, dword [ebp + 8]
sub esp, 4
mov dword [esp], ebx
call fcn.00403760
sub esp, 4
mov ecx, ebx
call fcn.00403630
lea ecx, [ebp - 0x38]
call fcn.00406c60
mov eax, dword [ebp + 8]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [ebp - 0x44]
mov esi, dword [ebp - 0x40]
lea ecx, [ebx + edi]
mov ebx, dword [ebp - 0x44]
movzx edx, byte [ecx]
lea ebx, [ebx + edi + 1]
shr dl, 2
movzx edx, dl
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + eax], dl
movzx ecx, byte [ecx]
movzx edx, byte [ebx]
shl ecx, 4
sar edx, 4
add edx, ecx
and edx, 0x3f
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + eax + 1], dl
movzx edx, byte [ebx]
mov byte [esi + eax + 3], 0x3d
shl edx, 2
and edx, 0x3f
movzx edx, byte [edx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + eax + 2], dl
add eax, 4
jmp 0x40e7c8
add edi, dword [ebp - 0x44]
mov esi, dword [ebp - 0x40]
movzx eax, byte [edi]
shr al, 2
movzx eax, al
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + ebx], al
movzx eax, byte [edi]
mov byte [esi + ebx + 2], 0x3d
mov byte [esi + ebx + 3], 0x3d
shl eax, 4
and eax, 0x3f
movzx eax, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + ebx + 1], al
lea eax, [ebx + 4]
jmp 0x40e7c8
xor eax, eax
jmp 0x40e7c8
xor edi, edi
xor ebx, ebx
jmp 0x40e7b8
lea ecx, [ebp - 0x38]
call fcn.00407140
jmp 0x40e7de